Skip to content

Commit

Permalink
Update Autotools to correctly configure oneAPI (#3751)
Browse files Browse the repository at this point in the history
* Update Autotools to correctly configure oneAPI

Splits the Intel config files under the Autotools into 'classic'
Intel and oneAPI versions, fixing 'unsupported option' messages.

Also turns off `-check uninit` (new in 2023) in Fortran, which kills
the H5_buildiface program due to false positives.

* Enable Fortran in oneAPI CI workflow

* Turn on Fortran in CMake, update LD_LIBRARY_PATH

* Go back to disabling Fortran w/ Intel

For some reason there's a linking problem w/ Fortran

error while loading shared libraries: libifport.so.5: cannot open shared object file: No such file or directory
  • Loading branch information
derobins authored Oct 23, 2023
1 parent 744a20f commit a6d1bda
Show file tree
Hide file tree
Showing 8 changed files with 539 additions and 24 deletions.
42 changes: 26 additions & 16 deletions config/apple
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,19 @@ fi
# Figure out C compiler flags
. $srcdir/config/gnu-flags
. $srcdir/config/clang-flags
. $srcdir/config/oneapi-flags
. $srcdir/config/intel-flags

# temp patch: if GCC 4.2.1 is used in Lion or Mountain Lion systems, do not
# use -O option as it causes failures in test/dt_arith.
case "$host_os" in
darwin1[12].*) # lion & mountain lion
#echo cc_vendor=$cc_vendor'-'cc_version=$cc_version
case "$cc_vendor-$cc_version" in
gcc-4.2.1)
# Remove any -O flags
#echo PROD_CFLAGS=$PROD_CFLAGS
PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O[0-3]*//'`"
#echo new PROD_CFLAGS=$PROD_CFLAGS
;;
esac
;;
esac

if test "X-" = "X-$FC"; then
case $CC_BASENAME in
gcc*)
FC=gfortran
FC_BASENAME=gfortran
;;
icx*)
FC=ifx
FC_BASENAME=ifx
;;
icc*)
FC=ifort
FC_BASENAME=ifort
Expand All @@ -97,6 +86,7 @@ fi

# Figure out FORTRAN compiler flags
. $srcdir/config/gnu-fflags
. $srcdir/config/oneapi-fflags
. $srcdir/config/intel-fflags


Expand All @@ -107,6 +97,10 @@ if test "X-" = "X-$CXX"; then
CXX=g++
CXX_BASENAME=g++
;;
icx)
CXX=icpx
CXX_BASENAME=icpx
;;
icc)
CXX=icpc
CXX_BASENAME=icpc
Expand All @@ -123,6 +117,7 @@ if test "X-" = "X-$CXX"; then
fi

# Figure out C++ compiler flags
. $srcdir/config/oneapi-cxxflags
. $srcdir/config/intel-cxxflags # Do this ahead of GNU to avoid icpc being detected as g++
. $srcdir/config/gnu-cxxflags
. $srcdir/config/clang-cxxflags
Expand All @@ -139,6 +134,11 @@ case $CC in
grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'`
;;

*icx*)
cc_version_info=`$CC $CCFLAGS $H5_CCFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;

*icc*)
cc_version_info=`$CC $CCFLAGS $H5_CCFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
Expand All @@ -156,6 +156,11 @@ case $FC in
grep 'GCC' | sed 's/\(.*(GCC) [-a-z0-9\. ]*\).*/\1/'`
;;

*ifx*)
fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;

*ifc*|*ifort*)
fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
Expand All @@ -179,6 +184,11 @@ case $CXX in
grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'`
;;

*icpx*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;

*icpc*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
Expand Down
16 changes: 13 additions & 3 deletions config/freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ fi
# Figure out GNU C compiler flags
. $srcdir/config/gnu-flags

# Figure out Intel C compiler flags
# Figure out Intel oneAPI C compiler flags
. $srcdir/config/oneapi-flags

# Figure out Intel classic C compiler flags
. $srcdir/config/intel-flags

# The default Fortran 90 compiler
Expand All @@ -43,6 +46,10 @@ if test "X-" = "X-$FC"; then
FC=gfortran
FC_BASENAME=gfortran
;;
icx*)
FC=ifx
FC_BASENAME=ifx
;;
icc*)
FC=ifort
FC_BASENAME=ifort
Expand All @@ -57,8 +64,11 @@ fi
# Figure out FORTRAN compiler flags
. $srcdir/config/gnu-fflags

# Figure out Intel F90 compiler flags
. $srcdir/config/intel-fflags
# Figure out Intel oneAPI FC compiler flags
. $srcdir/config/oneapi-fflags

# Figure out Intel classic FC compiler flags
. $srcdir/config/classic-fflags

# The default C++ compiler

Expand Down
33 changes: 30 additions & 3 deletions config/linux-gnulibc1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ fi
# Figure out CCE C compiler flags
. $srcdir/config/cce-flags

# Figure out Intel C compiler flags
# Figure out Intel oneAPI C compiler flags
. $srcdir/config/oneapi-flags

# Figure out Intel classic C compiler flags
. $srcdir/config/intel-flags

# Figure out Clang C compiler flags
Expand All @@ -55,6 +58,10 @@ if test "X-" = "X-$FC"; then
FC=pgf90
FC_BASENAME=pgf90
;;
icx*)
FC=ifx
FC_BASENAME=ifx
;;
icc*)
FC=ifort
FC_BASENAME=ifort
Expand Down Expand Up @@ -119,7 +126,10 @@ fi
# Figure out CCE FC compiler flags
. $srcdir/config/cce-fflags

# Figure out Intel FC compiler flags
# Figure out Intel oneAPI FC compiler flags
. $srcdir/config/oneapi-fflags

# Figure out Intel classic FC compiler flags
. $srcdir/config/intel-fflags

# Figure out Clang FC compiler flags
Expand Down Expand Up @@ -200,7 +210,10 @@ if test -z "$CXX"; then
CXX_BASENAME=g++
fi

# Figure out Intel CXX compiler flags
# Figure out Intel oneAPI CXX compiler flags
. $srcdir/config/oneapi-cxxflags

# Figure out Intel classic CXX compiler flags
# Do this ahead of GNU to avoid icpc being detected as g++
. $srcdir/config/intel-cxxflags

Expand Down Expand Up @@ -237,6 +250,11 @@ case $CC in
cc_version_info=`echo $cc_version_info`
;;

*icx*)
cc_version_info=`$CC $CCFLAGS $H5_CCFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;

*icc*)
cc_version_info=`$CC $CCFLAGS $H5_CCFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
Expand Down Expand Up @@ -271,6 +289,11 @@ case $FC in
fc_version_info=`echo $fc_version_info`
;;

*ifx*)
fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;

*ifc*|*ifort*)
fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
Expand Down Expand Up @@ -333,6 +356,10 @@ case $CXX in
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\
grep 'GCC' | sed 's/\(.*(GCC) [-a-z0-9\. ]*\).*/\1/'`
;;
*icpx*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;
*icpc*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
Expand Down
13 changes: 11 additions & 2 deletions config/netbsd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ fi
# Figure out C compiler flags
. $srcdir/config/gnu-flags

# Figure out Intel C compiler flags
# Figure out Intel oneAPI C compiler flags
. $srcdir/config/oneapi-flags

# Figure out Intel classic C compiler flags
. $srcdir/config/intel-flags

# The default Fortran 90 compiler
Expand All @@ -36,6 +39,10 @@ if test "X-" = "X-$FC"; then
FC=gfortran
FC_BASENAME=gfortran
;;
icx*)
FC=ifx
FC_BASENAME=ifx
;;
icc*)
FC=ifort
FC_BASENAME=ifort
Expand All @@ -50,6 +57,8 @@ fi
# Figure out FORTRAN compiler flags
. $srcdir/config/gnu-fflags

# Figure out Intel F90 compiler flags
# Figure out Intel oneAPI FC compiler flags
. $srcdir/config/intel-fflags

# Figure out Intel classic FC compiler flags
. $srcdir/config/oneapi-fflags
Loading

0 comments on commit a6d1bda

Please sign in to comment.