evaleev / libint

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

`make install` failed #173

Closed CHN-beta closed 2 years ago

CHN-beta commented 4 years ago

(I'm sorry, I made a mistake and sent it before I complete edit.)

make install failed on my machine. The error message is here:

make DESTDIR=/home/chn/Desktop/libint2/root install
/usr/bin/install -c -d -m 0755 /home/chn/Desktop/libint2/root/usr/include/libint2
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./include/libint2.h /home/chn/Desktop/libint2/root/usr/include
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./include/libint2.hpp /home/chn/Desktop/libint2/root/usr/include
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./include/libint2/*.h /home/chn/Desktop/libint2/root/usr/include/libint2
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./include/libint2_*.h /home/chn/Desktop/libint2/root/usr/include/libint2
/usr/bin/install -c -m 0644 ./include/libint2/config.h /home/chn/Desktop/libint2/root/usr/include/libint2
/usr/bin/install -c -d -m 0755 /home/chn/Desktop/libint2/root/usr/include/libint2/chemistry
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./include/libint2/chemistry/*.h /home/chn/Desktop/libint2/root/usr/include/libint2/chemistry
/usr/bin/install -c -d -m 0755 /home/chn/Desktop/libint2/root/usr/include/libint2/lcao
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./include/libint2/lcao/*.h /home/chn/Desktop/libint2/root/usr/include/libint2/lcao
/usr/bin/install -c -d -m 0755 /home/chn/Desktop/libint2/root/usr/include/libint2/util
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./include/libint2/util/*.h /home/chn/Desktop/libint2/root/usr/include/libint2/util
/usr/bin/install -c -d -m 0755 /home/chn/Desktop/libint2/root/usr/include/libint2/util/generated
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./include/libint2/util/generated/*.h /home/chn/Desktop/libint2/root/usr/include/libint2/util/generated
if test "X1" = "X0"; then `gunzip -c /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./external/boost.tar.gz | tar -xf - -C /home/chn/Desktop/libint2/root/usr/include/libint2`; fi
/usr/bin/install -c -d -m 0755 /home/chn/Desktop/libint2/root/usr/lib
/bin/sh   ./libtool --quiet --mode=install --tag=CXX /usr/bin/install -c -m 0644 lib/libint2.la /home/chn/Desktop/libint2/root/usr/lib
libtool: warning: remember to run 'libtool --finish /usr/lib'
/usr/bin/install -c -d -m 0755 /home/chn/Desktop/libint2/root/usr/lib/pkgconfig
/usr/bin/install -c -m 0644 ./libint2.pc /home/chn/Desktop/libint2/root/usr/lib/pkgconfig
/usr/bin/install -c -d -m 0755 /home/chn/Desktop/libint2/root/usr/lib/cmake/libint2
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./FindLibint2.cmake /home/chn/Desktop/libint2/root/usr/lib/cmake/libint2
/usr/bin/install -c -d -m 0755 /home/chn/Desktop/libint2/root/usr/share/libint/2.6.0/basis
/usr/bin/install -c -m 0644 /home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/./lib/basis/* /home/chn/Desktop/libint2/root/usr/share/libint/2.6.0/basis
(cd fortran && make) || exit 1
make[1]: 进入目录“/home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/fortran”
FC libint_f.o
../include/libint2/util/generated/libint2_params.h:29:0:

   29 | #    if __has_include (<libint2_params.h>)
      | 
错误: missing '(' before "__has_include" operand
../include/libint2/util/generated/libint2_params.h:29:0: 错误: operator "__has_include" requires a header-name
make[1]: *** [../MakeSuffixRules:12:libint_f.o] 错误 1
make[1]: 离开目录“/home/chn/Desktop/libint2/libint-2.6.0/build/libint-2.6.0/fortran”
make: *** [Makefile:38:fortran] 错误 1

("进入目录" in Chinese means "entering directory", and "错误" means error.)

I use Archlinux, with gcc 10.1.0.

dvdesolve commented 4 years ago

Seems like gfortran in GCC 10 package leads to this behavior so it could be considered as a regression. I can't find any changelogs which document this, however, I've found similar issue but the solution found there couldn't be implemented here

e-kwsm commented 4 years ago

@CHN-beta Is compilation of the following code successful?

#if !__has_include(<iostream>)
#error
#endif

#if __has_include("non-existing.h")
#error
#endif

int main() {}

If not, this is due to GCC rather than libint.

BTW, messages will be printed in English by setting LANG=C.

CHN-beta commented 4 years ago

@CHN-beta Is compilation of the following code successful?

#if !__has_include(<iostream>)
#error
#endif

#if __has_include("non-existing.h")
#error
#endif

int main() {}

If not, this is due to GCC rather than libint.

BTW, messages will be printed in English by setting LANG=C.

g++ compiles pass.

g++ main.cpp -o main

But gfortran does not.

LANG=C gfortran main.F

It complains:

main.F:1:0:

    1 | #if !__has_include(<iostream>)
      | 
Error: missing '(' before "__has_include" operand
main.F:1:0: Error: operator "__has_include" requires a header-name
main.F:1:0: Error: missing binary operator before token "("
main.F:5:0:

    5 | #if __has_include("non-existing.h")
      | 
Error: missing '(' before "__has_include" operand
main.F:5:0: Error: operator "__has_include" requires a header-name
<built-in>:0: confused by earlier errors, bailing out
dev-zero commented 4 years ago

While libint is using __has_include in a non-portable way: every call to __has_include should be enclosed (not in the same line) in a #if defined(__has_include), according to https://gcc.gnu.org/onlinedocs/gcc-10.1.0/cpp/_005f_005fhas_005finclude.html it seems there is something else going on in the traditional-mode preprocessor of gcc 10.1, I've opened a bug for it, let's see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95889

dev-zero commented 4 years ago

Ok, I came up with a bugfix for gcc-10: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/550832.html

Nevertheless, to be portable, calls to __has_include should be guarded with a

#if defined(__has_include)

But as of now, the real bug is in gcc-10, not in libint.