diff --git a/CMakeLists.txt b/CMakeLists.txt index db25d7a..590213e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,13 @@ cmake_minimum_required (VERSION 2.6) project (qcint C) -set(qcint_VERSION "3.1.0") -set(qcint_SOVERSION "3") - +set(qcint_VERSION_MAJOR "3") +set(qcint_VERSION_MINOR "1") +set(qcint_VERSION_PATCH "1") +set(qcint_VERSION_TWEAK "0") +set(qcint_VERSION "${qcint_VERSION_MAJOR}.${qcint_VERSION_MINOR}.${qcint_VERSION_PATCH}") +set(qcint_SOVERSION "${qcint_VERSION_MAJOR}") + +#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 -DNDEBUG") if ("${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE RELWITHDEBINFO) endif() @@ -15,6 +20,7 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -funroll-loops -ftree-vectorize -ffast-math") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-math-errno -fno-strict-overflow -fomit-frame-pointer") endif() +message("${CMAKE_C_FLAGS}") if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.3) @@ -97,9 +103,27 @@ endif(WITH_GTG) if(PYPZPX) add_definitions(-DPYPZPX) - message("P orbitals are sorted to (py, pz, px)") + message("P orbitals convention (py, pz, px)") +else() + message("P orbitals convention (px, py, pz)") endif(PYPZPX) +option(WITH_FORTRAN "Fortran interface" on) +if(WITH_FORTRAN) + add_definitions(-DWITH_FORTRAN) + message("Enable Fortran interface") +else() + message("Exclude Fortran interface") +endif(WITH_FORTRAN) + +option(WITH_CINT2_INTERFACE "Old libcint (version 2) interface" on) +if(WITH_CINT2_INTERFACE) + add_definitions(-DWITH_CINT2_INTERFACE) + message("Enable old cint (version 2) interface") +else() + message("Exclude old cint (version 2) interface") +endif(WITH_CINT2_INTERFACE) + option(BUILD_SHARED_LIBS "build shared libraries" 1) option(ENABLE_STATIC "Enforce static library build" 0) if(ENABLE_STATIC) diff --git a/ChangeLog b/ChangeLog index 76e5c0e..1bb14e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +Version 3.1.1 (2020-08-25): + * Fix bug in (py, pz, px) order Version 3.1.0 (2020-08-25): * Add convention py, pz, px Version 3.0.19 (2019-11-30): diff --git a/README.md b/README.md index 2443565..fd9e619 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ qcint (quick libcint) An optimized libcint branch for X86 platform -version 3.1.0 +version 3.1.1 2020-08-25 diff --git a/src/c2f.c b/src/c2f.c index 6ff6065..b8ab293 100644 --- a/src/c2f.c +++ b/src/c2f.c @@ -22,6 +22,7 @@ * c to fortran interface */ +#ifdef WITH_FORTRAN #include #include #include "cint_bas.h" @@ -178,3 +179,4 @@ void cintdel_optimizer_(CINTOptPtrAsInteger8 *optptr) cintdel_2e_optimizer_(optptr); } */ +#endif diff --git a/src/c2f.h b/src/c2f.h index 32193df..6780d1b 100644 --- a/src/c2f.h +++ b/src/c2f.h @@ -18,6 +18,7 @@ * along with this program. If not, see . */ +#ifdef WITH_FORTRAN #define ALL_CINT_FORTRAN_(NAME) \ int c##NAME##_sph_(double *out, int *shls, int *atm, int *natm, \ int *bas, int *nbas, double *env, size_t optptr_as_integer8) { \ @@ -67,3 +68,10 @@ int c##NAME##_(double *out, int *shls, int *atm, int *natm, \ return NAME##_spinor((double complex *)out, NULL, shls, \ atm, *natm, bas, *nbas, env, NULL, NULL); \ } + +#else + +#define ALL_CINT_FORTRAN_(NAME) +#define ALL_CINT1E_FORTRAN_(NAME) + +#endif diff --git a/src/cart2sph.c b/src/cart2sph.c index c21b39f..d106d35 100644 --- a/src/cart2sph.c +++ b/src/cart2sph.c @@ -2933,9 +2933,9 @@ static double *p_bra_cart2spheric(double *gsph, int nket, double *gcart, int l) #ifdef PYPZPX int i; for (i = 0; i < nket; i++) { - gsph[i*nket+0] = gcart[i*nket+1]; // py - gsph[i*nket+1] = gcart[i*nket+2]; // pz - gsph[i*nket+2] = gcart[i*nket+0]; // px + gsph[i*3+0] = gcart[i*3+1]; // py + gsph[i*3+1] = gcart[i*3+2]; // pz + gsph[i*3+2] = gcart[i*3+0]; // px } return gsph; #else @@ -8255,8 +8255,18 @@ static double *sph2e_inner(double *gsph, double *gcart, { int n; switch (l) { +#ifdef PYPZPX + case 0: + return gcart; + case 1: + for (n = 0; n < ncall; n++) { + p_ket_cart2spheric(gsph+n*sizsph, gcart+n*sizcart, nbra, nbra, l); + } + break; +#else case 0: case 1: return gcart; +#endif case 2: for (n = 0; n < ncall; n++) { d_ket_cart2spheric(gsph+n*sizsph, gcart+n*sizcart, nbra, nbra, l); diff --git a/src/misc.h b/src/misc.h index ffd1006..7142859 100644 --- a/src/misc.h +++ b/src/misc.h @@ -37,6 +37,7 @@ double CINTsquare_dist(const double *r1, const double *r2); double CINTgto_norm(int n, double a); +#ifdef WITH_CINT2_INTERFACE #define ALL_CINT(NAME) \ int c##NAME##_cart(double *out, int *shls, int *atm, int natm, \ int *bas, int nbas, double *env, CINTOpt *opt) { \ @@ -79,3 +80,10 @@ int c##NAME(double *out, int *shls, int *atm, int natm, \ return NAME##_spinor((double complex *)out, NULL, shls, \ atm, natm, bas, nbas, env, NULL, NULL); \ } + +#else + +#define ALL_CINT(NAME) +#define ALL_CINT1E(NAME) + +#endif // WITH_CINT2_INTERFACE