diff --git a/arch/Linux-gnu-x86_64-static.ssmp b/arch/Linux-gnu-x86_64-static.ssmp index ab7983a921..3c876000e2 100644 --- a/arch/Linux-gnu-x86_64-static.ssmp +++ b/arch/Linux-gnu-x86_64-static.ssmp @@ -6,7 +6,7 @@ # # Usage: Source this arch file and then run make as instructed. # -# Last update: 16.05.2025 +# Last update: 12.06.2025 # # \ if [[ "${0}" == "${BASH_SOURCE}" ]]; then \ @@ -19,7 +19,8 @@ rm -rf build; \ [[ -z "${target_cpu}" ]] && target_cpu="native"; \ echo "Found GCC $(gcc -dumpfullversion) compiler"; \ - ./install_cp2k_toolchain.sh -j${maxtasks} --mpi-mode=no --no-arch-files --target-cpu=${target_cpu} --with-gcc --with-ace --with-dftd4 --with-hdf5 --with-trexio; \ + ./install_cp2k_toolchain.sh -j${maxtasks} --mpi-mode=no --no-arch-files --target-cpu=${target_cpu} --with-gcc \ + --with-ace --with-dftd4 --with-hdf5 --with-tblite --with-trexio; \ source ./install/setup; \ cd ../..; \ echo; \ @@ -234,7 +235,7 @@ endif CFLAGS += $(DFLAGS) $(CFLAGS_DEBUG) -CXXFLAGS := $(CFLAGS) --std=c++14 +CXXFLAGS := $(CFLAGS) FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS) ifeq ($(shell [ $(shell gcc -dumpversion | cut -d. -f1) -gt 9 ] && echo yes), yes) @@ -246,6 +247,9 @@ FCFLAGS += -ffree-line-length-none FCFLAGS += -fno-omit-frame-pointer FCFLAGS += -std=f2008 +CFLAGS += -std=c17 +CXXFLAGS += -std=c++17 + # The LeakSanitizer does not work with static linking ifeq ($(DO_CHECKS), yes) LDFLAGS += $(FCFLAGS) diff --git a/arch/Linux-gnu-x86_64.psmp b/arch/Linux-gnu-x86_64.psmp index a1dd7e973b..325057e641 100644 --- a/arch/Linux-gnu-x86_64.psmp +++ b/arch/Linux-gnu-x86_64.psmp @@ -9,7 +9,7 @@ # Optionally, GNU compiler and MPI implementation can be specified as arguments. # Replace or adapt the "module add" commands below if needed. # -# Last update: 16.05.2025 +# Last update: 12.06.2025 # # \ if [[ "${0}" == "${BASH_SOURCE}" ]]; then \ @@ -478,7 +478,7 @@ endif CFLAGS += $(DFLAGS) $(CFLAGS_DEBUG) -CXXFLAGS := $(CFLAGS) --std=c++14 +CXXFLAGS := $(CFLAGS) FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS) ifeq ($(shell [ $(shell gcc -dumpversion | cut -d. -f1) -gt 9 ] && echo yes), yes) @@ -490,6 +490,9 @@ FCFLAGS += -ffree-line-length-none FCFLAGS += -fno-omit-frame-pointer FCFLAGS += -std=f2008 +CFLAGS += -std=c17 +CXXFLAGS += -std=c++17 + LDFLAGS += $(FCFLAGS) LIBS += -lz -ldl -lstdc++ diff --git a/tools/toolchain/scripts/generate_arch_files.sh b/tools/toolchain/scripts/generate_arch_files.sh index fbb91c57c3..2fea918043 100755 --- a/tools/toolchain/scripts/generate_arch_files.sh +++ b/tools/toolchain/scripts/generate_arch_files.sh @@ -143,16 +143,16 @@ if [ "${with_intel}" != "__DONTUSE__" ]; then FC_arch+=" IF_MPI(-fc=${I_MPI_FC}|)" LD_arch+=" IF_MPI(-fc=${I_MPI_FC}|)" fi - CFLAGS="${G_CFLAGS} -std=c11 -Wall \$(DFLAGS)" - CXXFLAGS="${G_CFLAGS} -std=c++14 -Wall \$(DFLAGS)" + CFLAGS="${G_CFLAGS} -std=c17 -Wall \$(DFLAGS)" + CXXFLAGS="${G_CFLAGS} -std=c++17 -Wall \$(DFLAGS)" FCFLAGS="${FCFLAGS} -diag-disable=8291 -diag-disable=8293 -fpp -fpscomp logicals -free" # Suppress warnings and add include path to omp_lib.mod explicitly. # No clue why the Intel oneAPI setup script does not include that path (bug?) FCFLAGS="${FCFLAGS} -diag-disable=10448 -I/opt/intel/oneapi/2024.1/opt/compiler/include/intel64" elif [ "${with_amd}" != "__DONTUSE__" ]; then - CFLAGS="$G_CFLAGS -std=c11 -Wall \$(DFLAGS)" + CFLAGS="$G_CFLAGS -std=c17 -Wall \$(DFLAGS)" else - CFLAGS="$G_CFLAGS -std=c11 -Wall -Wextra -Werror -Wno-vla-parameter -Wno-deprecated-declarations \$(DFLAGS)" + CFLAGS="${G_CFLAGS} -std=c17 -Wall -Wextra -Werror -Wno-vla-parameter -Wno-deprecated-declarations \$(DFLAGS)" fi # Linker flags @@ -166,9 +166,9 @@ LDFLAGS="IF_STATIC(${STATIC_FLAGS}|) \$(FCFLAGS) ${CP_LDFLAGS}" LIBS="${CP_LIBS} -lstdc++" if [ "${with_intel}" == "__DONTUSE__" ] && [ "${with_amd}" == "__DONTUSE__" ]; then - CXXFLAGS+=" --std=c++14 \$(DFLAGS) -Wno-deprecated-declarations" + CXXFLAGS+=" -std=c++17 \$(DFLAGS) -Wno-deprecated-declarations" else - CXXFLAGS+=" --std=c++14 \$(DFLAGS)" + CXXFLAGS+=" -std=c++17 \$(DFLAGS)" fi # CUDA handling if [ "${ENABLE_CUDA}" = __TRUE__ ] && [ "${GPUVER}" != no ]; then diff --git a/tools/toolchain/scripts/stage0/install_gcc.sh b/tools/toolchain/scripts/stage0/install_gcc.sh index 1cdaf5e75d..b916acdf4e 100755 --- a/tools/toolchain/scripts/stage0/install_gcc.sh +++ b/tools/toolchain/scripts/stage0/install_gcc.sh @@ -8,6 +8,8 @@ SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)" gcc_ver="14.2.0" gcc_sha256="7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293" +#gcc_ver="15.1.0" +#gcc_sha256="51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1" source "${SCRIPT_DIR}"/common_vars.sh source "${SCRIPT_DIR}"/tool_kit.sh diff --git a/tools/toolchain/scripts/stage2/install_gmp.sh b/tools/toolchain/scripts/stage2/install_gmp.sh index efa39d66db..024aa15fc8 100755 --- a/tools/toolchain/scripts/stage2/install_gmp.sh +++ b/tools/toolchain/scripts/stage2/install_gmp.sh @@ -44,7 +44,8 @@ case "$with_gmp" in mkdir build cd build # autotools setup, out-of-source build - ../configure --prefix="${pkg_install_dir}" \ + ../configure CFLAGS="${CFLAGS} -std=c17" \ + --prefix="${pkg_install_dir}" \ --libdir="${pkg_install_dir}/lib" \ --enable-cxx=yes \ --includedir="${pkg_install_dir}/include" \ diff --git a/tools/toolchain/scripts/stage3/install_fftw.sh b/tools/toolchain/scripts/stage3/install_fftw.sh index e1a7cb7e4c..fdf2ce176e 100755 --- a/tools/toolchain/scripts/stage3/install_fftw.sh +++ b/tools/toolchain/scripts/stage3/install_fftw.sh @@ -54,7 +54,10 @@ case "$with_fftw" in grep '\bavx512f\b' /proc/cpuinfo 1> /dev/null && FFTW_FLAGS="${FFTW_FLAGS} --enable-avx512" fi fi - ./configure --prefix=${pkg_install_dir} --libdir="${pkg_install_dir}/lib" ${FFTW_FLAGS} \ + ./configure CFLAGS="${CFLAGS} -std=c17" \ + --prefix=${pkg_install_dir} \ + --libdir="${pkg_install_dir}/lib" \ + ${FFTW_FLAGS} \ > configure.log 2>&1 || tail -n ${LOG_LINES} configure.log make -j $(get_nprocs) > make.log 2>&1 || tail -n ${LOG_LINES} make.log make install > install.log 2>&1 || tail -n ${LOG_LINES} install.log diff --git a/tools/toolchain/scripts/stage4/install_scalapack.sh b/tools/toolchain/scripts/stage4/install_scalapack.sh index ef05c27ed1..829140d5b6 100755 --- a/tools/toolchain/scripts/stage4/install_scalapack.sh +++ b/tools/toolchain/scripts/stage4/install_scalapack.sh @@ -48,16 +48,19 @@ case "$with_scalapack" in cflags="" fflags="" if ("${FC}" --version | grep -q 'GNU'); then - cflags="-fpermissive" + cflags="-fpermissive -std=c17" fflags=$(allowed_gfortran_flags "-fallow-argument-mismatch") fi - CFLAGS=${cflags} FFLAGS=${fflags} cmake -DCMAKE_FIND_ROOT_PATH="$ROOTDIR" \ + cmake \ + -DCMAKE_BUILD_TYPE=Release .. \ + -DCMAKE_C_FLAGS="${cflags}" \ + -DCMAKE_Fortran_FLAGS="${fflags}" \ + -DCMAKE_FIND_ROOT_PATH="${ROOTDIR}" \ -DCMAKE_INSTALL_PREFIX="${pkg_install_dir}" \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DBUILD_SHARED_LIBS=NO \ - -DCMAKE_BUILD_TYPE=Release .. \ -DBUILD_TESTING=NO \ -DSCALAPACK_BUILD_TESTS=NO \ > configure.log 2>&1 || tail -n ${LOG_LINES} configure.log diff --git a/tools/toolchain/scripts/stage6/install_ace.sh b/tools/toolchain/scripts/stage6/install_ace.sh index 184920d7c4..2f4360506c 100755 --- a/tools/toolchain/scripts/stage6/install_ace.sh +++ b/tools/toolchain/scripts/stage6/install_ace.sh @@ -45,10 +45,14 @@ case "$with_ace" in tar -xzf ${ace_pkg} cd ${ace_dir} + # Fix for GCC 15 + sed -i '1i #include ' yaml-cpp/src/emitterutils.cpp + mkdir build cd build + cmake \ - -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_CXX_STANDARD=17 \ .. > cmake.log 2>&1 || tail -n ${LOG_LINES} cmake.log make -j > make.log 2>&1 || tail -n ${LOG_LINES} make.log # no make install. diff --git a/tools/toolchain/scripts/stage6/install_deepmd.sh b/tools/toolchain/scripts/stage6/install_deepmd.sh index fd522b9976..bd4cc891d1 100755 --- a/tools/toolchain/scripts/stage6/install_deepmd.sh +++ b/tools/toolchain/scripts/stage6/install_deepmd.sh @@ -47,10 +47,10 @@ case "$with_deepmd" in mkdir build cd build cmake \ - -DENABLE_PYTORCH=TRUE \ -DCMAKE_INSTALL_PREFIX="${pkg_install_dir}" \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=11 \ -DCMAKE_CXX_STANDARD_REQUIRED=TRUE \ + -DENABLE_PYTORCH=TRUE \ .. > cmake.log 2>&1 || tail -n ${LOG_LINES} cmake.log make -j deepmd_c > make.log 2>&1 || tail -n ${LOG_LINES} make.log make install > install.log 2>&1 || tail -n ${LOG_LINES} install.log diff --git a/tools/toolchain/scripts/stage8/install_sirius.sh b/tools/toolchain/scripts/stage8/install_sirius.sh index 224622754a..8eeeb0b3ca 100755 --- a/tools/toolchain/scripts/stage8/install_sirius.sh +++ b/tools/toolchain/scripts/stage8/install_sirius.sh @@ -118,6 +118,9 @@ case "$with_sirius" in # Workaround for https://github.com/electronic-structure/SIRIUS/issues/1073 patch -p1 < ${SCRIPT_DIR}/stage8/sirius_memory.patch + # Fix for GCC 15 + sed -i '1i #include ' src/core/memory.hpp + rm -Rf build mkdir build cd build