Migrating to the new application programmers’ interface¶
This is a short guide to migrating to the new application programmers’ interface
(API) and build system for XCFun. We assume that you have successfully built and
tested XCFun and installed it to <install-prefix>.
The layout of the install tree will be as follows:
<install-prefix>/
├── include
│ └── XCFun
│ ├── config.hpp
│ ├── densvars.hpp
│ ├── functional.hpp
│ ├── functionals
│ ├── specmath.hpp
│ ├── XCFunctional.hpp
│ ├── XCFunExport.h
│ ├── xcfun.f90
│ ├── xcfun.h
│ └── xcint.hpp
├── lib
│ └── python
│ └── xcfun
├── lib64
│ ├── libxcfun.a
│ ├── libxcfun.so -> libxcfun.so.2
│ └── libxcfun.so.2
└── share
└── cmake
└── XCFun
C/C++ host programs¶
Types and function signatures are in the header file xcfun.h.
In your source code, apply the following changes:
Remove any of the calls to the functions that have been removed from the API. Open an issue if these functions are essential to your workflow and you would like them to be reinstated.
Replace
xc_functionalwithxcfun_t *.Replace
xc_new_functionalwithxcfun_new.Replace
xc_enumerate_parameterswithxcfun_enumerate_parameters.Replace
xc_enumerate_aliaseswithxcfun_enumerate_aliases.Replace
xc_setwithxcfun_set.Replace
xc_getwithxcfun_get.Replace
xc_describe_shortwithxcfun_describe_short.Replace
xc_describe_longwithxcfun_describe_long.Replace
xc_is_ggawithxcfun_is_gga.Replace
xc_is_metaggawithxcfun_is_metagga.Replace
xc_eval_setupwithxcfun_eval_setup.Replace
xc_user_eval_setupwithxcfun_user_eval_setup.Replace
xc_input_lengthwithxcfun_input_length.Replace
xc_output_lengthwithxcfun_output_length.Replace
xc_evalwithxcfun_eval.Replace
xc_eval_vecwithxcfun_eval_vec.
Fortran host programs¶
The Fortran/C interoperability layer for types and function signatures is in the source file xcfun.f90.
In your source code, apply the following changes:
Use the intrinsic
iso_c_bindingmodule:use, intrinsic :: iso_c_binding.Remove any of the calls to the functions that have been removed from the API. Open an issue if these functions are essential to your workflow and you would like them to be reinstated.
You should call the intrinsic
trimon functions returning strings:xcfun_version,xcfun_splash,xcfun_authors,xcfun_enumerate_paramters,xcfun_enumerate_aliases,xcfun_describe_short,xcfun_describe_long.Replace the type for the
xc_functionalobject (nowxcfun_t *) fromintegertotype(c_ptr).Replace
xc_new_functionalwithxcfun_new.Replace
xc_enumerate_parameterswithxcfun_enumerate_parameters.Replace
xc_enumerate_aliaseswithxcfun_enumerate_aliases.Replace
xc_setwithxcfun_set.Replace
xc_getwithxcfun_get.Replace
xc_describe_shortwithxcfun_describe_short.Replace
xc_describe_longwithxcfun_describe_long.Replace
xc_is_ggawithxcfun_is_gga.Replace
xc_is_metaggawithxcfun_is_metagga.Replace
xc_eval_setupwithxcfun_eval_setup.Replace
xc_user_eval_setupwithxcfun_user_eval_setup.Replace
xc_input_lengthwithxcfun_input_length.Replace
xc_output_lengthwithxcfun_output_length.Replace
xc_evalwithxcfun_eval.Replace
xc_eval_vecwithxcfun_eval_vec.