[CP2K-user] [CP2K:20344] Re: Build failure of CP2K v2024.1 with GCC 10.2 due to unexpected inability to handle default initialization of derived types with allocatable components
Frederick Stein
f.stein at hzdr.de
Mon Jun 17 13:32:29 UTC 2024
Dear Arno,
Could you add an exception for the older GCC compilers of version (append " ||
(__GNUC__ == 10 && __GNUC_MINOR__ < 5)" to the condition of the
preprocessor)? Does this issue vanish? If the same error occurs at other
spots but in the same context, try to add this fix as well.
Best,
Frederick
Arno schrieb am Montag, 17. Juni 2024 um 14:42:03 UTC+2:
> Hello,
>
> I am running into the following compilation error when trying to build
> CP2K v2024.1 with GCC 10.2.0:
>
>
> /mnt/lustre/e1000/home/z04/shared/cp2k/cp2k-2024.1/src/cp_eri_mme_interface.F:25:7:
>
> 25 | USE eri_mme_test, ONLY:
> eri_mme_2c_perf_acc_test,&
> | 1
> Error: The rank of the element in the structure constructor at (1) does
> not match that of the component (0/1)
>
> I believe this relates to the following in cp_eri_mme_interface.F:
>
> TYPE cp_eri_mme_param
> TYPE(cp_logger_type), POINTER :: logger => NULL()
> ! There is a bug with some older compilers preventing a default
> initialization of derived types with allocatable components
> #if __GNUC__ < 9 || (__GNUC__ == 9 && __GNUC_MINOR__ < 5)
> TYPE(eri_mme_param) :: par
> #else
> TYPE(eri_mme_param) :: par = eri_mme_param()
> #endif
>
> Based on this and your successful builds of CP2K v2024.1 with GCC 9.5 and
> 10.5 in the dashboard I would not expect this to fail.
>
> Would you be able to advise on how to resolve this, short of using another
> version of GCC? Is GCC 10.2.0 perhaps an edge case of a version that has
> the same bug that is not caught by the above workaround?
>
> The full compilation command is as follows (I have checked that the
> mpifort command is indeed using GCC 10.2.0):
>
> /work/y07/shared/cirrus-software/openmpi/4.1.6/bin/mpifort -c
> -fno-omit-frame-pointer -fopenmp -g -mtune=native -O3 -funroll-loops
> -I/work/y07/shared/cirrus-software/openmpi/4.1.6/include -pthread -m64
> -I/mnt/lustre/e1000/home/y07/shared/cirrus-software/oneapi/mkl/2024.0/include
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/fftw-3.3.10/include'
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/libint-v2.6.0-cp2k-lmax-5/include'
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/libxc-6.2.2/include'
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/libgrpp-main-20231215/include'
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/libxsmm-1.17/include'
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/COSMA-2.6.6/include'
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/elpa-2023.05.001/cpu/include/elpa_openmp-2023.05.001/modules'
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/elpa-2023.05.001/cpu/include/elpa_openmp-2023.05.001/elpa'
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/gsl-2.7/include'
> -I/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/hdf5-1.14.2/include
> -I/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/libvdwxc-0.4.0/include
> -I/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/spglib-1.16.2/include
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/SpFFT-1.0.6/include'
> -I'/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/SpLA-1.5.5/include/spla'
> -I/work/z04/shared/cp2k/cp2k-2024.1/tools/toolchain/install/sirius-7.4.3/include
> -fbacktrace -ffree-form -fimplicit-none -std=f2008 -Werror=aliasing
> -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow
> -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs
> -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-variable
> -Werror=unused-variable -Werror=unused-dummy-argument
> -Werror=unused-parameter -Werror=unused-label -Werror=conversion
> -Werror=zerotrip -Wno-maybe-uninitialized -Wuninitialized
> -Wuse-without-only -D__LIBXSMM -D__parallel -D__MPI_F08 -D__MKL -D__FFTW3
> -D__SCALAPACK -D__FFTW3 -D__LIBINT -D__LIBXC -D__LIBGRPP -D__COSMA
> -D__ELPA -D__GSL -D__PLUMED2 -D__HDF5 -D__LIBVDWXC -D__SPGLIB -D__LIBVORI
> -D__SPFFT -D__SPLA -D__SIRIUS -fallow-argument-mismatch
> -D__COMPILE_ARCH="\"local\"" -D__COMPILE_DATE="\"Thu May 9 17:32:33 BST
> 2024\"" -D__COMPILE_HOST="\"cirrus-login1\""
> -D__COMPILE_REVISION="\"git:b4a17a5\""
> -D__DATA_DIR="\"/mnt/lustre/e1000/home/z04/shared/cp2k/cp2k-2024.1/data\""
> -D__SHORT_FILE__="\"cp_eri_mme_interface.F\""
> -I'/mnt/lustre/e1000/home/z04/shared/cp2k/cp2k-2024.1/src/'
> -I'/mnt/lustre/e1000/home/z04/shared/cp2k/cp2k-2024.1/obj/local/psmp/exts/dbcsr'
> cp_eri_mme_interface.F90
>
> This follows a toolchain build of the dependencies using the following
> command:
>
> ./install_cp2k_toolchain.sh -j 18 --with-gcc=system --mpi-mode=openmpi
> --with-openmpi=system --math-mode=mkl --with-mkl=system --with-openblas=no
> --with-plumed
>
> For completeness I have attached attached the ARCH file and
> toolchain-installed setup file that I am sourcing prior to the CP2K build.
>
> Many thanks in advance,
>
> Arno
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/b002319f-9e27-4b2d-bc29-3b304c7b0604n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20240617/ab1e6049/attachment.htm>
More information about the CP2K-user
mailing list