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

Error while compiling elpa (Useful for ELPA compiling) #3461

Closed ignisfatuus28 closed 4 months ago

ignisfatuus28 commented 9 months ago

Details

Dear developers and users,

I faced some problems when compiling elpa with toolchain on a cluster. The error information is as bellow:

make[1]: [src/elpa2/kernels/libelpa_openmp_private_la-real_simple_block4.lo] Error 1 manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(160): error #6683: A kind type parameter must be a compile-time constant. [IK] integer(kind=ik) :: thread_cpu_id -----------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(161): error #6683: A kind type parameter must be a compile-time constant. [IK] integer(kind=ik) :: i, actuall_num -----------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(184): error #6683: A kind type parameter must be a compile-time constant. [IK] integer(kind=ik) :: i -----------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(185): error #6683: A kind type parameter must be a compile-time constant. [IK] integer(kind=ik), intent(in) :: mype -----------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(186): error #6683: A kind type parameter must be a compile-time constant. [IK] integer(kind=ik) :: pid, ppid -----------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(104): error #6683: A kind type parameter must be a compile-time constant. [IK] cpu_id = int(cpu_id_c, kind=ik) --------------------------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(104): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [INT] cpu_id = int(cpu_id_c, kind=ik) --------------------------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(104): error #6404: This name does not have a type, and must have an explicit type. [INT] cpu_id = int(cpu_id_c, kind=ik) -------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(112): error #6683: A kind type parameter must be a compile-time constant. [IK] cpu_id = int(cpu_id_c, kind=ik) --------------------------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(112): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [INT] cpu_id = int(cpu_id_c, kind=ik) --------------------------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(112): error #6404: This name does not have a type, and must have an explicit type. [INT] cpu_id = int(cpu_id_c, kind=ik) -------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(120): error #6683: A kind type parameter must be a compile-time constant. [IK] process_id = int(process_id_c, kind=ik) ------------------------------------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(120): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [INT] process_id = int(process_id_c, kind=ik) ------------------------------------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(120): error #6404: This name does not have a type, and must have an explicit type. [INT] process_id = int(process_id_c, kind=ik) ------------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(121): error #6632: Keyword arguments are invalid without an explicit interface. [KIND] pprocess_id = int(pprocess_id_c, kind=ik) -------------------------------------^ manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90(121): error #6404: This name does not have a type, and must have an explicit type. [IK] pprocess_id = int(pprocess_id_c, kind=ik) ------------------------------------------^ make[1]: [src/elpa2/kernels/libelpa_openmp_private_la-real_simple_block6.lo] Error 1 compilation aborted for manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90 (code 1) Traceback (most recent call last): File "/scratch/guest/gst23-23/test/abacus-develop/toolchain/build/elpa-2023.05.001/build_cpu/../manual_cpp", line 64, in check_call(args + [tmp_filename]) File "/scratch/guest/gst23-23/test/abacus-develop/toolchain/build/elpa-2023.05.001/build_cpu/../manual_cpp", line 18, in check_call return subprocess.check_call(args, kwargs) File "/opt/intel-2022/oneapi/intelpython/latest/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/scratch/opt/intel-2022/oneapi/mpi/2021.5.0/bin/mpiifort', '-DHAVE_CONFIG_H', '-I.', '-I..', '-module', 'private_modules', '-Imodules', '-Iprivate_modules', '-O2', '-fPIC', '-fp-model=precise', '-funroll-loops', '-g', '-qopenmp', '-qopenmp-simd', '-traceback', '-xHost', '-m64', '-I/scratch/opt/intel-2022/oneapi/mkl/2022.0.1/include', '-I/scratch/opt/intel-2022/oneapi/mkl/2022.0.1/include/fftw', '-ffree-line-length-none', '-mavx2', '-mfma', '-msse4', '-fno-lto', '-c', '-fPIC', '-o', 'src/helpers/.libs/libelpa_openmp_private_la-mod_thread_affinity.o', 'manuallypreprocessed..src_helpers_mod_thread_affinity.F90-src_helpers.libs_libelpa_openmp_private_la-mod_thread_affinity.o.F90']' returned non-zero exit status 1. make[1]: ** [src/helpers/libelpa_openmp_private_la-mod_thread_affinity.lo] Error 1 mv: cannot move '.Tpo' to '.Plo': No such file or directory make[1]: [src/elpa2/kernels/real_avx_2hv_double_precision.lo] Error 1

The cpu is Intel(R) Xeon(R) CPU E5-2680 v3 with intel oneapi 2022.1 and gcc-9.4.0. Does anyone know how to fix it?

Sincerely

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)

yizeyi18 commented 9 months ago

Try compiling with mpifort or gfortran? GCC compiler should work with ELPA, the developers did tested it. The toolchain contains nothing about Fortran compiler, maybe you should specify it manually, i. e. export FC=/path/to/mpifort -march=native -mtune=native -O3 before installation.

Further investigation may take some time, since ELPA developers recommand using "Intel compiler" in their document; maybe it's new problem encounterd to ifort while swiching to llvm.

QuantumMisaka commented 9 months ago

@ignisfatuus28 default compiler for intel-toolchain is icx and icpx, which may cause problem. You can change it to traditional icc and icpc by specify --with-intel-classic=yes in toolchain_intel.sh. Also you can try the method above by @yizeyi18 .

caic99 commented 9 months ago

@ignisfatuus28 default compiler for intel-toolchain is icx and icpx, which may cause problem. You can change it to traditional icc and icpc by specify --with-intel-classic=yes in toolchain_intel.sh. Also you can try the method above by @yizeyi18 .

@QuantumMisaka Have you tried ifx?

pplab commented 6 months ago

I just compiled elpa 2023.05.001 with intel oneapi 2022.2.1 and gcc 9.3.0 on an intel xeon e5-2620v4 server. Although the compiler gave a lot of warnings like "The Intel(R) C++ Compiler Classic (ICC) is deprecated..." or "Global name too long, shortened from:...", it finally compiled the code successfully.

Here is my config script, FYI:

CXX=mpiicpc CC=mpiicc FC=mpiifort \
./configure --prefix=$HOME/program/elpa/2023.05.001/oneapi_gcc9 \
               CFLAGS="-Ofast -xHost -qmkl=parallel" \
               CXXFLAGS="-Ofast -xHost -qmkl=parallel" \
               FCFLAGS="-Ofast -xHost -qmkl=parallel " \
               LIBS=" -qmkl=parallel  -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64"