Skip to content

Commit d1b34c4

Browse files
committed
Fix --with-intelmpi-classic=yes problem
1 parent 0fc6591 commit d1b34c4

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

toolchain/install_abacus_toolchain.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ The --with-PKG options follow the rules:
154154
Default = system
155155
--with-intel-classic Use the classic Intel compiler (icc, icpc, ifort) to compile ABACUS.
156156
Default = no
157-
--with-intelmpi-classic Use the classic Intelmpi compiler (mpiicc, mpiicpc and mpiifort)
158-
Default = no
159157
--with-ifx Use the new Intel Fortran compiler ifx instead of ifort to compile dependence of ABACUS, along with mpiifx (if --with-intel-classic=no)
160158
Default = yes
161159
--with-cmake Cmake utilities
@@ -170,6 +168,8 @@ The --with-PKG options follow the rules:
170168
--with-intelmpi Intel MPI, MPI library like OpenMPI. one should
171169
use only one of OpenMPI, MPICH or Intel MPI.
172170
Default = system
171+
--with-intelmpi-classic Use the classic Intelmpi compiler (mpiicc, mpiicpc and mpiifort)
172+
Default = no
173173
--with-libxc libxc, exchange-correlation library. Needed for
174174
QuickStep DFT and hybrid calculations.
175175
Default = install

toolchain/scripts/stage1/install_intelmpi.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ case "${with_intelmpi}" in
3232
__SYSTEM__)
3333
echo "==================== Finding Intel MPI from system paths ===================="
3434
check_command mpiexec "intelmpi" && MPIRUN="$(realpath $(command -v mpiexec))"
35+
if [ "${intel_classic}" = "yes" ]; then
36+
# if intel compiler used as classic, so as intelmpi
37+
export intelmpi_classic="yes"
38+
fi
3539
if [ "${with_intel}" != "__DONTUSE__" ]; then
36-
if [ "${intel_classic}" = "yes" ]; then
37-
# if intel compiler used as classic, so as intelmpi
38-
export ${intel_classic}="yes"
39-
fi
4040
if [ "${intelmpi_classic}" = "yes" ]; then
4141
check_command mpiicc "intelmpi" && MPICC="$(realpath $(command -v mpiicc))" || exit 1
4242
check_command mpiicpc "intelmpi" && MPICXX="$(realpath $(command -v mpiicpc))" || exit 1
4343
check_command mpiifort "intelmpi" && MPIFC="$(realpath $(command -v mpiifort))" || exit 1
4444
else
4545
check_command mpiicx "intelmpi" && MPICC="$(realpath $(command -v mpiicc))" || exit 1
4646
check_command mpiicpx "intelmpi" && MPICXX="$(realpath $(command -v mpiicpc))" || exit 1
47-
if [ "${with_ifx}" = "yes" ]; then
47+
if [ "${with_ifx}" == "yes" ]; then
4848
check_command mpiifx "intelmpi" && MPIFC="$(realpath $(command -v mpiifx))" || exit 1
4949
else
5050
check_command mpiifort "intelmpi" && MPIFC="$(realpath $(command -v mpiifort))" || exit 1
@@ -93,7 +93,7 @@ case "${with_intelmpi}" in
9393
MPIFORT="${MPIFC}"
9494
MPIF77="${MPIFC}"
9595
# include path is already handled by compiler wrapper scripts (can cause wrong mpi.mod with GNU Fortran)
96-
#INTELMPI_CFLAGS="-I'${pkg_install_dir}/include'"
96+
INTELMPI_CFLAGS="-I'${pkg_install_dir}/include'"
9797
INTELMPI_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
9898
;;
9999
esac
@@ -105,7 +105,11 @@ if [ "${with_intelmpi}" != "__DONTUSE__" ]; then
105105
else
106106
I_MPI_CXX="icpx"
107107
I_MPI_CC="icx"
108-
I_MPI_FC="ifort"
108+
if [ "${with_ifx}" = "yes" ]; then
109+
I_MPI_FC="ifx"
110+
else
111+
I_MPI_FC="ifort"
112+
fi
109113
fi
110114
INTELMPI_LIBS="-lmpi -lmpicxx"
111115
echo "I_MPI_CXX is ${I_MPI_CXX}"

0 commit comments

Comments
 (0)