FreeFem / FreeFem-sources

FreeFEM source code
https://freefem.org/
Other
746 stars 187 forks source link

configure fails to find scotch because of: error: unknown type name 'int64_t' #296

Open yurivict opened 8 months ago

yurivict commented 8 months ago

Failure log:

configure:20468: checking check scotch
configure:20491: c++ -o conftest  -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -DNDEBUG -O3 -std=gnu++14 -DBAMG_LONG_LONG  -DNCHECKPTR -fPIC -I/usr/local/include/superlu -isystem /usr/local/include  -s -L/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc12  -L/usr/local/lib/gcc12 -fstack-protector-strong  -rdynamic conftest.cpp -ldl -lm -lrt -lz  -L/usr/local/lib -L/usr/local/lib/gcc12 -L/usr/local/lib/gcc12/gcc/x86_64-portbld-freebsd13.2/12.2.0 -L/usr/local/lib/gcc12/gcc/x86_64-portbld-freebsd13.2/12.2.0/../../../../../x86_64-portbld-freebsd13.2/lib -L/usr/local/lib/gcc12/gcc/x86_64-portbld-freebsd13.2/12.2.0/../../.. -lz -lgfortran -lm -lssp_nonshared -lquadmath -lscotch -lscotcherr  >&5
In file included from conftest.cpp:60:
/usr/local/include/scotch.h:76:9: error: unknown type name 'int64_t'
typedef int64_t SCOTCH_Idx;
        ^
/usr/local/include/scotch.h:78:9: error: unknown type name 'int64_t'
typedef int64_t SCOTCH_Num;
        ^

Did you forget to #include <sys/types.h> ?

Version: 4.14 FreeBSD 13.2

prj- commented 8 months ago

If you use PETSc with SCOTCH, you will not have this issue.

yurivict commented 8 months ago

This is a bug in scotch: https://gitlab.inria.fr/scotch/scotch/-/issues/35

yurivict commented 8 months ago

Additionally, you also need to use -pthread to link the test executable during configure:

configure:20468: checking check scotch
configure:20491: c++ -o conftest  -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -DNDEBUG -O3 -std=gnu++14 -DBAMG_LONG_LONG  -DNCHECKPTR -fPIC -I/usr/local/include/superlu -isystem /usr/local/include  -s -L/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc12  -L/usr/local/lib/gcc12 -fstack-protector-strong  -rdynamic conftest.cpp -ldl -lm -lrt -lz  -L/usr/local/lib -L/usr/local/lib/gcc12 -L/usr/local/lib/gcc12/gcc/x86_64-portbld-freebsd13.2/12.2.0 -L/usr/local/lib/gcc12/gcc/x86_64-portbld-freebsd13.2/12.2.0/../../../../../x86_64-portbld-freebsd13.2/lib -L/usr/local/lib/gcc12/gcc/x86_64-portbld-freebsd13.2/12.2.0/../../.. -lz -lgfortran -lm -lssp_nonshared -lquadmath -lscotch -lscotcherr  >&5
ld: error: undefined reference due to --no-allow-shlib-undefined: pthread_barrier_wait
>>> referenced by /usr/local/lib/libscotch.so 

ld: error: undefined reference due to --no-allow-shlib-undefined: pthread_barrier_init
>>> referenced by /usr/local/lib/libscotch.so

ld: error: undefined reference due to --no-allow-shlib-undefined: pthread_barrier_destroy
>>> referenced by /usr/local/lib/libscotch.so
c++: error: linker command failed with exit code 1 (use -v to see invocation)
prj- commented 8 months ago

My point still stands, if you use PETSc with SCOTCH, you will not have any of these issues.