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
174 stars 136 forks source link

Error when using MKL as the math kernel lib. #3984

Closed grysgreat closed 7 months ago

grysgreat commented 7 months ago

Details

When I compiled the unit tests using mkl as a math library, the compiled program failed to execute successfully. The error is as follows:

./Perf_Hsolver_Kernels: error while loading shared libraries: libifcore.so.5: cannot open shared object file: No such file or directory

My compilation process is as follows:

  1. Use an intel environment mirror in a bohrium cluster
  2. source/opt/Intel/oneapi setvars. Sh, activate the Intel environment
  3. Run the ./toolchain_intel.sh dependent installation script
  4. Add the unit test compilation option in ./build_abacus_intel.sh
  5. Run the ./build_abacus_intel.sh to compile abacus and unittest
  6. Execute the compilation options I need.

Then the above error occurred.

View the dynamic library of compiled program links through ldd

root@bohrium-19267-1122804# ldd Perf_Hsolver_Kernels 
        linux-vdso.so.1 (0x00007fff171a1000)
        libiomp5.so => /lib/x86_64-linux-gnu/libiomp5.so (0x00007f656597b000)
        libifcore.so.5 => not found
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6565894000)
        libmpicxx.so.12 => /opt/intel/oneapi/mpi/2021.10.0/lib/libmpicxx.so.12 (0x00007f6565600000)
        libmpifort.so.12 => /opt/intel/oneapi/mpi/2021.10.0/lib/libmpifort.so.12 (0x00007f6565200000)
        libmpi.so.12 => /opt/intel/oneapi/mpi/2021.10.0/lib/release/libmpi.so.12 (0x00007f6563600000)
        libmkl_intel_lp64.so.2 => not found
        libmkl_intel_thread.so.2 => not found
        libmkl_core.so.2 => not found
        libmkl_scalapack_lp64.so.2 => not found
        libmkl_blacs_intelmpi_lp64.so.2 => not found
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f65633d6000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6565870000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f65631ae000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6565aa3000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f656586b000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6565864000)

Found that there are indeed many libraries not found, including a part of the mkl library.

Have you read FAQ on the online manual http://abacus.deepmodeling.com/en/latest/community/faq.html

Task list for Issue attackers (only for developers)

WHUweiqingzhou commented 7 months ago

@caic99, could you have a look?

grysgreat commented 7 months ago

Fix that. Make sure to load the MKL environment wherever MKL-codes is compiled and run.