evaleev / libint

Libint: high-performance library for computing Gaussian integrals in quantum mechanics
Other
226 stars 95 forks source link

Fortran interface errors in out-of-tree builds #136

Closed mbanck closed 5 years ago

mbanck commented 5 years ago

It seems the Fortran interface assumes that the CMAKE_BINARY_DIR is the same as the source tree, at least I am getting this error when I do something like mkdir obj-x86_64-linux-gnu; cmake ..; make:

[100%] Generating libint2.h.i
/usr/bin/cc -E -D__COMPILING_LIBINT2 -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/include -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/include/libint2 /<<PKGBUILDDIR>>/include/libint2.h -o /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/fortran/libint2.h.i
cc1: fatal error: opening output file /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/fortran/libint2.h.i: No such file or directory
compilation terminated.

And indeed, there is no fortran directory in obj-x86_64-linux-gnu, it does not seem to get created so I guess it is assumed to be the source one? If I create it, I get a bit further but then hit include errors where the build is looking for headers in <src>/include

[100%] Building Fortran object CMakeFiles/libint_f.dir/fortran/libint_f.F90.o
/usr/bin/gfortran -D__COMPILING_LIBINT2 -I"/build/libint2-PjDXPU/libint2-2.6.0~beta6/include" -I"/build/libint2-PjDXPU/libint2-2.6.0~beta6/fortran"   -c "/build/libint2-PjDXPU/libint2-2.6.0~beta6/fortran/libint_f.F90" -o CMakeFiles/libint_f.dir/fortran/libint_f.F90.o
/build/libint2-PjDXPU/libint2-2.6.0~beta6/fortran/libint_f.F90:5:2:

 #include <libint2/util/generated/libint2_params.h>
  1~~~~~~~~~~~~~~~~~
Fatal Error: libint2/config.h: No such file or directory
compilation terminated.

The generated libint2/config.h header is only in the CMAKE_BINARY_DIR but the -Is are for the source dir.

cc @pseewald

mbanck commented 5 years ago

Thanks, WFM!