diff --git a/arch/CRAY-XC40-cce.psmp b/arch/CRAY-XC40-cce.psmp index f565bd8d34..74be7db82e 100644 --- a/arch/CRAY-XC40-cce.psmp +++ b/arch/CRAY-XC40-cce.psmp @@ -10,8 +10,6 @@ FC = ftn LD = ftn AR = ar -r DFLAGS = -D__FFTW3 -D__parallel -D__SCALAPACK -D__FORCE_USE_FAST_MATH -# CRAY does not provide the mpi_f08 module -DFLAGS += -D__NO_MPI_F08 # DFLAGS += -D__LIBXSMM DFLAGS += -D__LIBINT -D__MAX_CONTR=4 DFLAGS += -D__LIBXC diff --git a/arch/CRAY-XC40-gnu.psmp b/arch/CRAY-XC40-gnu.psmp index 9635c87b07..a306c728b6 100644 --- a/arch/CRAY-XC40-gnu.psmp +++ b/arch/CRAY-XC40-gnu.psmp @@ -94,8 +94,6 @@ CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g DFLAGS := -D__parallel DFLAGS += -D__SCALAPACK -# CRAY does not provide the mpi_f08 module -DFLAGS += -D__NO_MPI_F08 DFLAGS += -D__FFTW3 DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR)) diff --git a/arch/CRAY-XC40-intel-minimal.psmp b/arch/CRAY-XC40-intel-minimal.psmp index 9f6ace38b8..d118422d72 100644 --- a/arch/CRAY-XC40-intel-minimal.psmp +++ b/arch/CRAY-XC40-intel-minimal.psmp @@ -35,8 +35,6 @@ DFLAGS += -D__MAX_CONTR=4 DFLAGS += -D__MKL DFLAGS += -D__parallel DFLAGS += -D__SCALAPACK -# CRAY does not provide the mpi_f08 module -DFLAGS += -D__NO_MPI_F08 FCFLAGS = $(CFLAGS) $(DFLAGS) FCFLAGS += -diag-disable=8291 diff --git a/arch/CRAY-XC50-gnu.psmp b/arch/CRAY-XC50-gnu.psmp index 93defb89f2..50f950b0a5 100644 --- a/arch/CRAY-XC50-gnu.psmp +++ b/arch/CRAY-XC50-gnu.psmp @@ -102,8 +102,6 @@ CFLAGS := -O2 -fopenmp -fopenmp-simd -ftree-vectorize -funroll-loops -g DFLAGS := -D__parallel DFLAGS += -D__SCALAPACK -# CRAY does not provide the mpi_f08 module -DFLAGS += -D__NO_MPI_F08 DFLAGS += -D__FFTW3 DFLAGS += -D__MAX_CONTR=$(strip $(MAX_CONTR)) diff --git a/tools/toolchain/scripts/stage1/install_intelmpi.sh b/tools/toolchain/scripts/stage1/install_intelmpi.sh index 26ee4dc26a..2ec2b5ff81 100755 --- a/tools/toolchain/scripts/stage1/install_intelmpi.sh +++ b/tools/toolchain/scripts/stage1/install_intelmpi.sh @@ -89,7 +89,7 @@ export INTELMPI_LIBS="${INTELMPI_LIBS}" export MPI_CFLAGS="${INTELMPI_CFLAGS}" export MPI_LDFLAGS="${INTELMPI_LDFLAGS}" export MPI_LIBS="${INTELMPI_LIBS}" -export CP_DFLAGS="\${CP_DFLAGS} IF_MPI(-D__parallel|)" +export CP_DFLAGS="\${CP_DFLAGS} IF_MPI(-D__parallel -D__MPI_F08|)" export CP_CFLAGS="\${CP_CFLAGS} IF_MPI(${INTELMPI_CFLAGS}|)" export CP_LDFLAGS="\${CP_LDFLAGS} IF_MPI(${INTELMPI_LDFLAGS}|)" export CP_LIBS="\${CP_LIBS} IF_MPI(${INTELMPI_LIBS}|)" diff --git a/tools/toolchain/scripts/stage1/install_openmpi.sh b/tools/toolchain/scripts/stage1/install_openmpi.sh index 4bb7ee12ef..a995fdfdcc 100755 --- a/tools/toolchain/scripts/stage1/install_openmpi.sh +++ b/tools/toolchain/scripts/stage1/install_openmpi.sh @@ -152,6 +152,11 @@ export MPI_CFLAGS="${OPENMPI_CFLAGS}" export MPI_LDFLAGS="${OPENMPI_LDFLAGS}" export MPI_LIBS="${OPENMPI_LIBS}" export CP_DFLAGS="\${CP_DFLAGS} IF_MPI(-D__parallel|)" +# For proper mpi_f08 support, we need at least GCC version 9 (asynchronous keyword) +# Other compilers should work + if ! [ "$(gfortran -dumpversion | cut -d. -f1)" -lt 9 ]; then + export CP_DFLAGS="\${CP_DFLAGS} IF_MPI(-D__MPI_F08|)" + fi export CP_CFLAGS="\${CP_CFLAGS} IF_MPI(${OPENMPI_CFLAGS}|)" export CP_LDFLAGS="\${CP_LDFLAGS} IF_MPI(${OPENMPI_LDFLAGS}|)" export CP_LIBS="\${CP_LIBS} IF_MPI(${OPENMPI_LIBS}|)"