deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
http://abacus.ustc.edu.cn
GNU Lesser General Public License v3.0
170 stars 129 forks source link

failed to build abacus #1471

Closed kianpu34593 closed 1 year ago

kianpu34593 commented 1 year ago

Details

Hi,

I'm having trouble building abacus. It seems like it's a problem from intel-mkl. Can someone help me? Thank you very much.

Dependencies spec:

Here are the log and err files from the build. log.log err.log

kianpu34593 commented 1 year ago

As a follow-up, I tried to go around the intel-mkl issue with building blas, lapack, scalapack and fftw separately. Now the dependencies look like the following:

From the err file listed below, the thing that made it stops was that openblas was not linked correctly. I was able to fix that But I'm a bit confused by the warning that are produced. It seems like its because of the GCC C std? But I saw in the CMakeList.txt, the standard is set to be 11: set(CMAKE_CXX_STANDARD 11) I need some help here.

Thank you very much!

Here are the log and err files from the build. log.log err.log

kianpu34593 commented 1 year ago

As another follow-up, interestingly I disabled the build testing. -DBUILD_TESTING=0. Then it works until the very last step. 😢

The dependencies spec is the same as the above. And the cmake configure command is the following:

cmake -B build -DCMAKE_INSTALL_PREFIX=~/softwares/bin -DENABLE_LIBXC=1 -DLibxc_DIR=/home/jiankunp/softwares/bin/libxc5.1.7/share/cmake/Libxc -DBUILD_TESTING=0 -DELPA_LIBRARY=/home/jiankunp/spack-env/abacusDevelop/.spack-env/view/lib -DELPA_INCLUDE_DIR=/home/jiankunp/spack-env/abacusDevelop/.spack-env/view/include/elpa_openmp-2021.11.001 -DMKLROOT=OFF -DLAPACK_LIBRARY=/home/jiankunp/spack-env/abacusDevelop/.spack-env/view/lib64

Here are the log and err files from the build: err.log log.log

hellozhaoming commented 1 year ago

-Dxxxx_DIR in cmake is the installation path of xxxx. It usually contain subdir as bin, lib, include, share, and so on. -Dxxxx_INCLUDE_DIR is "installation path"/include. -Dxxxx_LIBRARY is "installation path"/lib or "installation path"/lib64. Check your CMAKE parameters.

caic99 commented 1 year ago

Hi @kianpu34593 , Thank you for trying ABACUS! Would you check installation docs for more details on setting flags?

kianpu34593 commented 1 year ago

Thank y'all for all your suggestions. I finally figure it out how to build it after more than 10 tries!!! All the dependencies are built using spack. Currently, I manaully configure the library in cmake. But I believe this can also work with spack environment. (Which should make my $PATH variable not so clumsy). I will continue this path. Will update here in the future.....

But here is the cmake command:

cmake -B build -DCMAKE_INSTALL_PREFIX=/home/jiankunp/softwares/bin/abacus -DENABLE_LIBXC=1 -DLibxc_DIR=/home/jiankunp/softwares/bin/libxc5.1.7 -DBUILD_TESTING=0 -DUSE_OPENMP=0 -DELPA_LIBRARY=/home/jiankunp/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/elpa-2021.11.001-4pfka33melg26ins3cfriooienr26fbn/lib/libelpa_openmp.so -DELPA_INCLUDE_DIR=/home/jiankunp/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/elpa-2021.11.001-4pfka33melg26ins3cfriooienr26fbn/include/elpa_openmp-2021.11.001 -DLAPACK_LIBRARY=/home/spack/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/openblas-0.3.20-x35mffjuc4kofnzrujaxfqjfvt3tzwql/lib/libopenblas.so -DCEREAL_INCLUDE_DIR=/home/jiankunp/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/cereal-1.3.2-pfkj32rigwsgwogap4skvkw2x5ipmi7l/include/

Here is the config output after cmake -B build:

-- The CXX compiler identification is GNU 11.2.0
-- Check for working CXX compiler: /home/jiankunp/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/gcc-11.2.0-zbujwd4dptmqplxmi6winbyr6tpgaypn/bin/g++
-- Check for working CXX compiler: /home/jiankunp/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/gcc-11.2.0-zbujwd4dptmqplxmi6winbyr6tpgaypn/bin/g++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Cereal: /home/jiankunp/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/cereal-1.3.2-pfkj32rigwsgwogap4skvkw2x5ipmi7l/include
-- Found ELPA: /home/jiankunp/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/elpa-2021.11.001-4pfka33melg26ins3cfriooienr26fbn/lib/libelpa_openmp.so
-- Performing Test ELPA_VERSION_SATISFIES
-- Performing Test ELPA_VERSION_SATISFIES - Success
-- Found MPI_CXX: /home/spack/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/openmpi-4.1.3-6brg3rzbtqvcbfunyhhewnlcxblvgzph/lib/libmpi.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - NOTFOUND
-- Found FFTW3: /home/jiankunp/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/fftw-3.3.10-ryqrghhzlwpgx7o5fsibe7wg6bgvgqt3/lib/libfftw3.so
-- Found LAPACK: /home/spack/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/openblas-0.3.20-x35mffjuc4kofnzrujaxfqjfvt3tzwql/lib/libopenblas.so
-- Found ScaLAPACK: /home/jiankunp/.spack/opt/spack/linux-centos7-broadwell/gcc-11.2.0/netlib-scalapack-2.2.0-qiw2i4q74uwtfxtxytmpnlfbrlwfqwar/lib/libscalapack.so
-- Found Libxc: version 5.1.7
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jiankunp/softwares/abacus-develop-10/abacus-develop-develop/build

I'm still getting these warnings [int to double narrowning](warning: narrowing conversion of 'z' from 'int' to 'double' [-Wnarrowing]) in the building process. But I'm able to use abacus even with these warnings. Here is the err file: err.log

Lastly, to prove this work, I will upload the successful scf and cell relax log after running two quick examples: running_cell-relax-pw.log running_scf-pw.log running_cell-relax-lcao.log running_scf-lcao.log