From 38be65b9a1aec679bbc679232d878f334be641f9 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 5 Aug 2021 09:04:38 +0200 Subject: [PATCH] Fix DIRAC build with high compiler optimiztations --- ...AC-19.0-intel-2020a-Python-2.7.18-int64.eb | 10 +-- ...9.0-intel-2020a-Python-2.7.18-mpi-int64.eb | 10 +-- .../DIRAC/DIRAC-19.0_use_easybuild_opts.patch | 70 +++++++++++++++++++ .../DIRAC-19.0_use_easybuild_opts_intel.patch | 33 --------- 4 files changed, 76 insertions(+), 47 deletions(-) create mode 100644 easybuild/easyconfigs/d/DIRAC/DIRAC-19.0_use_easybuild_opts.patch delete mode 100644 easybuild/easyconfigs/d/DIRAC/DIRAC-19.0_use_easybuild_opts_intel.patch diff --git a/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0-intel-2020a-Python-2.7.18-int64.eb b/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0-intel-2020a-Python-2.7.18-int64.eb index c938fbf458e..82a95e63297 100644 --- a/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0-intel-2020a-Python-2.7.18-int64.eb +++ b/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0-intel-2020a-Python-2.7.18-int64.eb @@ -15,14 +15,14 @@ sources = ['DIRAC-%(version)s-Source.tar.gz'] patches = [ '%(name)s-%(version)s_remove-broken-tests-intel.patch', '%(name)s-%(version)s_fix-bss_energy_test.patch', - '%(name)s-%(version)s_use_easybuild_opts_intel.patch', + '%(name)s-%(version)s_use_easybuild_opts.patch', '%(name)s-%(version)s_fix_test_path.patch', ] checksums = [ 'f0e3610bdd1fbcff90cdfb4cf3fd7582a4762f533af7d635c4bc4d114f402c32', # DIRAC-19.0-Source.tar.gz 'cb0e07097499fe59180d79a5db9ee883b9c83e16dcc6210fd945072c3a54c8a4', # DIRAC-19.0_remove-broken-tests-intel.patch 'e66be847d87ccfda23687de31a3a7c8d71c97b0accd290cf7ade4b4184f1fb93', # DIRAC-19.0_fix-bss_energy_test.patch - '666a9053d6c1287ee7aa471d18436133931959b3eacb7619d5197dbfb4e0c1fe', # DIRAC-19.0_use_easybuild_opts_intel.patch + '150b293250f1ca476a1d268534a236e06dbf5960d25c2a09f6d3f5e82c043316', # DIRAC-19.0_use_easybuild_opts.patch '527680cab911a8c7a52347d7ace516a497b725043537a6274670a1aaa97bfb0f', # DIRAC-19.0_fix_test_path.patch ] @@ -30,10 +30,7 @@ builddependencies = [('CMake', '3.16.4')] dependencies = [('Python', '2.7.18')] -separate_build_dir = True - -configopts = '-DCMAKE_BUILD_TYPE=RELEASE ' -configopts += '-DENABLE_BLAS=off ' +configopts = '-DENABLE_BLAS=off ' configopts += '-DENABLE_LAPACK=off ' configopts += '-DMKL_FLAG=off ' configopts += '-DBLAS_LANG=Fortran ' @@ -47,7 +44,6 @@ configopts += '-DENABLE_RUNTIMECHECK=False ' configopts += '-DENABLE_64BIT_INTEGERS=True ' configopts += '-DEXPLICIT_LIBS="${LIBLAPACK_MT}" ' configopts += '-DENABLE_PCMSOLVER=OFF ' -configopts += '-G"Unix Makefiles" ' parallel = 1 diff --git a/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0-intel-2020a-Python-2.7.18-mpi-int64.eb b/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0-intel-2020a-Python-2.7.18-mpi-int64.eb index bdb2729a3aa..f8abf1845ff 100644 --- a/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0-intel-2020a-Python-2.7.18-mpi-int64.eb +++ b/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0-intel-2020a-Python-2.7.18-mpi-int64.eb @@ -15,7 +15,7 @@ sources = ['DIRAC-%(version)s-Source.tar.gz'] patches = [ '%(name)s-%(version)s_remove-broken-tests-intel.patch', '%(name)s-%(version)s_fix-bss_energy_test.patch', - '%(name)s-%(version)s_use_easybuild_opts_intel.patch', + '%(name)s-%(version)s_use_easybuild_opts.patch', '%(name)s-%(version)s_fix_test_path.patch', '%(name)s-%(version)s_fix_mpi_tests.patch', ] @@ -23,7 +23,7 @@ checksums = [ 'f0e3610bdd1fbcff90cdfb4cf3fd7582a4762f533af7d635c4bc4d114f402c32', # DIRAC-19.0-Source.tar.gz 'cb0e07097499fe59180d79a5db9ee883b9c83e16dcc6210fd945072c3a54c8a4', # DIRAC-19.0_remove-broken-tests-intel.patch 'e66be847d87ccfda23687de31a3a7c8d71c97b0accd290cf7ade4b4184f1fb93', # DIRAC-19.0_fix-bss_energy_test.patch - '666a9053d6c1287ee7aa471d18436133931959b3eacb7619d5197dbfb4e0c1fe', # DIRAC-19.0_use_easybuild_opts_intel.patch + '150b293250f1ca476a1d268534a236e06dbf5960d25c2a09f6d3f5e82c043316', # DIRAC-19.0_use_easybuild_opts.patch '527680cab911a8c7a52347d7ace516a497b725043537a6274670a1aaa97bfb0f', # DIRAC-19.0_fix_test_path.patch 'ccc26fc320f0967211b6390244b1fa359ba5d0294071d5d2cb9e36b4652a52b2', # DIRAC-19.0_fix_mpi_tests.patch ] @@ -32,10 +32,7 @@ builddependencies = [('CMake', '3.16.4')] dependencies = [('Python', '2.7.18')] -separate_build_dir = True - -configopts = '-DCMAKE_BUILD_TYPE=RELEASE ' -configopts += '-DENABLE_BLAS=off ' +configopts = '-DENABLE_BLAS=off ' configopts += '-DENABLE_LAPACK=off ' configopts += '-DMKL_FLAG=off ' configopts += '-DBLAS_LANG=Fortran ' @@ -49,7 +46,6 @@ configopts += '-DENABLE_RUNTIMECHECK=False ' configopts += '-DENABLE_64BIT_INTEGERS=True ' configopts += '-DEXPLICIT_LIBS="${LIBSCALAPACK_MT}" ' configopts += '-DENABLE_PCMSOLVER=OFF ' -configopts += '-G"Unix Makefiles" ' parallel = 1 diff --git a/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0_use_easybuild_opts.patch b/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0_use_easybuild_opts.patch new file mode 100644 index 00000000000..e7e16b65880 --- /dev/null +++ b/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0_use_easybuild_opts.patch @@ -0,0 +1,70 @@ +# Take EasyBuild compiler flags for C, C++, and Fortran +# OCT 5th, 2020 by B. Hajgato (UGent) +# Updated by Alexander Grund (TU Dresden) +diff -ur DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/GNU.C.cmake DIRAC-19.0-Source/cmake/custom/compiler_flags/GNU.C.cmake +--- DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/GNU.C.cmake 2021-08-04 17:42:21.340186361 +0200 ++++ DIRAC-19.0-Source/cmake/custom/compiler_flags/GNU.C.cmake 2021-08-04 17:53:53.657008099 +0200 +@@ -3,7 +3,5 @@ + message(STATUS "Added gcc -maix64 flag due to IBM AIX XL Fortran and integer*8") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maix64 ") + endif() +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") +- set(CMAKE_C_FLAGS_RELEASE "-O2 -Wno-unused") +- set(CMAKE_C_FLAGS_DEBUG "-O0") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused") + endif() +diff -ur DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/GNU.CXX.cmake DIRAC-19.0-Source/cmake/custom/compiler_flags/GNU.CXX.cmake +--- DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/GNU.CXX.cmake 2021-08-04 17:42:21.340186361 +0200 ++++ DIRAC-19.0-Source/cmake/custom/compiler_flags/GNU.CXX.cmake 2021-08-04 17:53:53.657008099 +0200 +@@ -1,5 +1,4 @@ + if(CMAKE_CXX_COMPILER_ID MATCHES GNU) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wno-unknown-pragmas -Wno-sign-compare -Woverloaded-virtual -Wwrite-strings -Wno-unused") +- set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -march=native -DNDEBUG -Wno-unused") +- set(CMAKE_CXX_FLAGS_DEBUG "-O0 -DDEBUG") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wno-sign-compare -Woverloaded-virtual -Wwrite-strings -Wno-unused") ++ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") + endif() +diff -ur DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/GNU.Fortran.cmake DIRAC-19.0-Source/cmake/custom/compiler_flags/GNU.Fortran.cmake +--- DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/GNU.Fortran.cmake 2021-08-04 17:42:21.340186361 +0200 ++++ DIRAC-19.0-Source/cmake/custom/compiler_flags/GNU.Fortran.cmake 2021-08-04 17:53:53.657008099 +0200 +@@ -4,7 +4,6 @@ + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -maix64") + message(STATUS "Added gfortran -maix64 flag due to IBM AIX and integer*8") + endif() +- set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -funroll-all-loops -w") +- set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS} -O0 -fbounds-check -finit-real=nan -finit-integer=-9999 -Wall") +- #set(CMAKE_Fortran_FLAGS_DEBUG "-O0") ++ set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -funroll-all-loops -w") ++ set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS} -fbounds-check -finit-real=nan -finit-integer=-9999 -Wall") + endif() +diff -ur DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.C.cmake DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.C.cmake +--- DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.C.cmake 2021-08-04 17:42:21.340186361 +0200 ++++ DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.C.cmake 2021-08-04 17:53:53.657008099 +0200 +@@ -1,5 +1,3 @@ + if(CMAKE_C_COMPILER_ID MATCHES Intel) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -wd981 -wd279 -wd383 -wd1572 -wd177") +- set(CMAKE_C_FLAGS_RELEASE "-O2") +- set(CMAKE_C_FLAGS_DEBUG "-O0") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd981 -wd279 -wd383 -wd1572 -wd177") + endif() +diff -ur DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.CXX.cmake DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.CXX.cmake +--- DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.CXX.cmake 2021-08-04 17:42:21.340186361 +0200 ++++ DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.CXX.cmake 2021-08-04 17:53:53.657008099 +0200 +@@ -1,5 +1,4 @@ + if(CMAKE_CXX_COMPILER_ID MATCHES Intel) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") +- set(CMAKE_CXX_FLAGS_RELEASE "-debug -O3 -DNDEBUG") +- set(CMAKE_CXX_FLAGS_DEBUG "-O0 -debug -DDEBUG") ++ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") + endif() +diff -ur DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.Fortran.cmake DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.Fortran.cmake +--- DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.Fortran.cmake 2021-08-04 17:42:21.340186361 +0200 ++++ DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.Fortran.cmake 2021-08-04 17:53:53.657008099 +0200 +@@ -1,5 +1,4 @@ + if(CMAKE_Fortran_COMPILER_ID MATCHES Intel) +- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w -assume byterecl -g -traceback -DVAR_IFORT") +- set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -ip") +- set(CMAKE_Fortran_FLAGS_DEBUG "-O0") ++ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w -assume byterecl -DVAR_IFORT") ++ set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -ip") + endif() diff --git a/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0_use_easybuild_opts_intel.patch b/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0_use_easybuild_opts_intel.patch deleted file mode 100644 index d0cd900f24c..00000000000 --- a/easybuild/easyconfigs/d/DIRAC/DIRAC-19.0_use_easybuild_opts_intel.patch +++ /dev/null @@ -1,33 +0,0 @@ -# Take EasyBuild compiler flags for C, C++, and Fortran -# OCT 5th, 2020 by B. Hajgato (UGent) -diff -ru DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.C.cmake DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.C.cmake ---- DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.C.cmake 2019-12-12 17:26:15.000000000 +0100 -+++ DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.C.cmake 2020-10-07 19:53:57.517988580 +0200 -@@ -1,5 +1,5 @@ - if(CMAKE_C_COMPILER_ID MATCHES Intel) -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -wd981 -wd279 -wd383 -wd1572 -wd177") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd981 -wd279 -wd383 -wd1572 -wd177") - set(CMAKE_C_FLAGS_RELEASE "-O2") - set(CMAKE_C_FLAGS_DEBUG "-O0") - endif() -diff -ru DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.CXX.cmake DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.CXX.cmake ---- DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.CXX.cmake 2019-12-12 17:26:15.000000000 +0100 -+++ DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.CXX.cmake 2020-10-07 19:54:10.338306645 +0200 -@@ -1,5 +1,5 @@ - if(CMAKE_CXX_COMPILER_ID MATCHES Intel) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") -- set(CMAKE_CXX_FLAGS_RELEASE "-debug -O3 -DNDEBUG") -+ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") - set(CMAKE_CXX_FLAGS_DEBUG "-O0 -debug -DDEBUG") - endif() -diff -ru DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.Fortran.cmake DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.Fortran.cmake ---- DIRAC-19.0-Source.orig/cmake/custom/compiler_flags/Intel.Fortran.cmake 2019-12-12 17:26:15.000000000 +0100 -+++ DIRAC-19.0-Source/cmake/custom/compiler_flags/Intel.Fortran.cmake 2020-10-07 19:55:34.670398011 +0200 -@@ -1,5 +1,5 @@ - if(CMAKE_Fortran_COMPILER_ID MATCHES Intel) -- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w -assume byterecl -g -traceback -DVAR_IFORT") -- set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -ip") -+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w -assume byterecl -DVAR_IFORT") -+ set(CMAKE_Fortran_FLAGS_RELEASE " ") - set(CMAKE_Fortran_FLAGS_DEBUG "-O0") - endif()