Building libefp.so fails when setting LINALG to Internal and EPFLIB to ON
Hi,
I am trying to build OpenMolcas on our university cluster.
When setting the CMake option LINALG to Internal and EPFLIB to ON, then the build fails, as libepf required liblapack, but libepf is built before lapack.
/cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin/gfortran -fPIC -fno-aggressive-loop-optimizations -cpp -fdefault-integer-8 -fopenmp -O2 -ftree-vectorize -march=core-avx2 -mavx2 -shared -Wl,-soname,libfruit_molcas.so -o ../../../lib/libfruit_molcas.so CMakeFiles/fruit_molcas.dir/fruit.f90.o -L/cluster/scratch/sfux/OpenMolcas/build/External/Libxc_install/lib -L/cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build
-- Generating done
-- Build files have been written to: /cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build
cd /cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build && /cluster/apps/gcc-8.2.0/cmake-3.25.0-45vsyctxfmoqynitpwn6qiaqrlfn5mvr/bin/cmake -E touch /cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-stamp/efplib-configure
[ 2%] Performing build step for 'efplib'
cd /cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build && make
make[2]: Leaving directory '/cluster/scratch/sfux/OpenMolcas/build'
make[3]: Entering directory '/cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build'
[ 2%] Built target fruit_molcas
make[4]: Entering directory '/cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build'
make[5]: Entering directory '/cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build'
make[5]: Leaving directory '/cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build'
make[5]: Entering directory '/cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build'
[ 17%] Building C object CMakeFiles/efp.dir/src/ai_disp.c.o
[ 29%] Building C object CMakeFiles/efp.dir/src/balance.c.o
[ 29%] Building C object CMakeFiles/efp.dir/src/clapack.c.o
[ 29%] Building C object CMakeFiles/efp.dir/src/efp.c.o
[ 29%] Building C object CMakeFiles/efp.dir/src/disp.c.o
[ 35%] Building C object CMakeFiles/efp.dir/src/elec.c.o
[ 41%] Building C object CMakeFiles/efp.dir/src/elec_terms.c.o
[ 47%] Building C object CMakeFiles/efp.dir/src/int.c.o
[ 52%] Building C object CMakeFiles/efp.dir/src/log.c.o
[ 58%] Building C object CMakeFiles/efp.dir/src/parse.c.o
[ 64%] Building C object CMakeFiles/efp.dir/src/pol.c.o
[ 70%] Building C object CMakeFiles/efp.dir/src/pol_direct.c.o
[ 76%] Building C object CMakeFiles/efp.dir/src/stream.c.o
[ 82%] Building C object CMakeFiles/efp.dir/src/swf.c.o
[ 94%] Building C object CMakeFiles/efp.dir/src/xr.c.o
[ 94%] Building C object CMakeFiles/efp.dir/src/util.c.o
[100%] Linking C shared library libefp.so
/cluster/apps/sfos/bin/ld: cannot find -llapack
collect2: error: ld returned 1 exit status
make[5]: *** [CMakeFiles/efp.dir/build.make:337: libefp.so] Error 1
make[5]: Leaving directory '/cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build'
make[4]: *** [CMakeFiles/Makefile2:83: CMakeFiles/efp.dir/all] Error 2
make[4]: Leaving directory '/cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build'
make[3]: *** [Makefile:136: all] Error 2
make[3]: Leaving directory '/cluster/scratch/sfux/OpenMolcas/build/External/src/efplib-build'
make[2]: *** [CMakeFiles/efplib.dir/build.make:89: External/src/efplib-stamp/efplib-build] Error 2
make[2]: Leaving directory '/cluster/scratch/sfux/OpenMolcas/build'
make[1]: *** [CMakeFiles/Makefile2:2622: CMakeFiles/efplib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 2%] Linking Fortran shared library lib/libblas.so
/cluster/apps/gcc-8.2.0/cmake-3.25.0-45vsyctxfmoqynitpwn6qiaqrlfn5mvr/bin/cmake -E cmake_link_script CMakeFiles/blas.dir/link.txt --verbose=1
/cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin/gfortran -fPIC -fno-aggressive-loop-optimizations -cpp -fdefault-integer-8 -fopenmp -O2 -ftree-vectorize -march=core-avx2 -mavx2 -shared -Wl,-soname,libblas.so -o lib/libblas.so CMakeFiles/blas.dir/src/LinAlg_internal/blas.f.o CMakeFiles/blas.dir/src/LinAlg_internal/blas_f90.F90.o CMakeFiles/blas.dir/src/LinAlg_internal/la_constants_.F90.o CMakeFiles/blas.dir/src/LinAlg_internal/la_xisnan_.F90.o
make[2]: Leaving directory '/cluster/scratch/sfux/OpenMolcas/build'
[ 2%] Built target blas
[ 2%] Linking Fortran shared library lib/liblapack.so
/cluster/apps/gcc-8.2.0/cmake-3.25.0-45vsyctxfmoqynitpwn6qiaqrlfn5mvr/bin/cmake -E cmake_link_script CMakeFiles/lapack.dir/link.txt --verbose=1
/cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin/gfortran -fPIC -fno-aggressive-loop-optimizations -cpp -fdefault-integer-8 -fopenmp -O2 -ftree-vectorize -march=core-avx2 -mavx2 -shared -Wl,-soname,liblapack.so -o lib/liblapack.so CMakeFiles/lapack.dir/src/LinAlg_internal/lapack.f.o CMakeFiles/lapack.dir/src/LinAlg_internal/lapack_f90.F90.o CMakeFiles/lapack.dir/src/LinAlg_internal/la_constants_.F90.o CMakeFiles/lapack.dir/src/LinAlg_internal/la_xisnan_.F90.o
make[2]: Leaving directory '/cluster/scratch/sfux/OpenMolcas/build'
[ 2%] Built target lapack
Is there a way to make sure that lapack in External is built before libepf from External is built?
Best regards
Sam