-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is the "ALL_CINT_FORTRAN_" macro commented out for the autogenerated code? #14
Comments
Update: It does however work to write short wrapper function manually in C that is doing essentially what the macro should be doing. Here I tested with some gradient 2-electron integrals that were not directly callable from fortran, and they work nicely with optimizer. #include "cint.h"
int int2e_ip1_sph(double *buf, int *dims, int *shls, int *atm, int natm, int *bas,
int nbas, double *env, CINTOpt *opt, double *cache);
void int2e_ip1_optimizer(CINTOpt **opt, int *atm, int natm, int *bas, int nbas,
double *env);
int int_wrapper_(double *buf, int *shls, int *atm, int *natm, int *bas,
int *nbas, double *env, void **opt) {
return int2e_ip1_sph(buf, NULL, shls, atm, *natm, bas, *nbas, env,
*(CINTOpt **)(opt), NULL);
}
void opt_wrapper_(void **opt, int *atm, int *natm, int *bas, int *nbas,
double *env) {
int2e_ip1_optimizer((CINTOpt **)opt, atm, *natm, bas, *nbas, env);
}
void del_opt_wrapper_(void **opt) { CINTdel_optimizer((CINTOpt **)opt); } So there is seemingly no inherent problem to call from Fortran, just the macro not working. Would it take a lot of work to fix the macro? |
Update 2: So after comparing the gen-code.cl scripts from libcint and qcint, I noticed that in libcint the call of the macro looks like "ALL_CINT_FORTRAN_(~a)~%" while in qcint it looks like "ALL_CINT_FORTRAN_(c~a)~%" This prepending of a c to the name seems like an error as it then tries to generate functions with names "ccint2e_...". Removing this seemes to have fixed the problem. |
Created a pull request (#15) with a possible fix. |
I see they are not commented out in libcint. Is it safe to just uncomment them in the gen-code.cl script? If not, what is the reason for the reduced compatibility between qcint vs libcint?
The text was updated successfully, but these errors were encountered: