generated from ACCESS-NRI/model-deployment-template
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile UM7 with Intel oneAPI compiler #41
Comments
I successfully compiled the
diff --git a/ummodel_hg3/cfg/bld-hadgem3-mct.cfg b/ummodel_hg3/cfg/bld-hadgem3-mct.cfg
index 140e540..5bc5939 100644
--- a/ummodel_hg3/cfg/bld-hadgem3-mct.cfg
+++ b/ummodel_hg3/cfg/bld-hadgem3-mct.cfg
@@ -37,7 +37,7 @@ tool::ar ar
tool::cc mpicc
tool::cflags -O2 -xHost -g -fp-model precise
tool::cpp cpp
-tool::cppflags -I ${NETCDF_ROOT}/include
+tool::cppflags -I ${NETCDF_BASE}/include/Intel
tool::cppkeys C_LONG_LONG_INT=c_long_long_int MPP=mpp C_LOW_U=c_low_u FRL8=frl8 LINUX=linux BUFRD_IO=bufrd_io LITTLE_END=little_end LINUX_INTEL_COMPILER=linux_intel_compiler ACCESS=access OASIS3=oasis3 CONTROL=control REPROD=reprod MPP=mpp ATMOS=atmos GLOBAL=global A04_ALL=a04_all A01_3A=a01_3a A02_3A=a02_3a A03_8C=a03_8c A04_3D=a04_3d A05_4A=a05_4a A06_4A=a06_4a A08_7A=a08_7a A09_2A=a09_2a A10_2A=a10_2a A11_2A=a11_2a A12_2A=a12_2a A13_2A=a13_2a A14_1B=a14_1b A15_1A=a15_1a A16_1A=a16_1a A17_2B=a17_2b A18_0A=a18_0a A19_1A=a19_1a A25_0A=a25_0a A26_1A=a26_1a A30_1A=a30_1a A31_0A=a31_0a A32_1A=a32_1a A33_0A=a33_0a A34_0A=a34_0a A35_0A=a35_0a A38_0A=a38_0a A70_1B=a70_1b A71_1A=a71_1a C70_1A=c70_1a C72_0A=c72_0a C80_1A=c80_1a C82_1A=c82_1a C84_1A=c84_1a C92_2A=c92_2a C94_1A=c94_1a C95_2A=c95_2a C96_1C=c96_1c C97_3A=c97_3a CABLE_17TILES=cable_17tiles CABLE_SOIL_LAYERS=cable_soil_layers TIMER=timer
tool::fc mpif90
tool::fflags -O2 -g -traceback -V -i8 -r8 -fp-model precise -ftz -what -fno-alias -stack-temps -safe-cray-ptr
@@ -48,10 +48,10 @@ tool::fflags::control::top_level::atm_step -O0 -g -V -i8 -r8
tool::fflags::control::top_level::set_atm_pointers -O0 -g -traceback -i8 -r8 -fp-model strict -ftz -std95
tool::fflags::control::top_level::u_model -O0 -g -V -i8 -r8 -mp1 -fp-model strict -ftz -what -fno-alias -stack-temps -safe-cray-ptr
tool::fpp cpp
-tool::fppflags -P -traditional -I ${NETCDF_ROOT}/include
+tool::fppflags -P -traditional -I ${NETCDF_BASE}/include/Intel
tool::fppkeys C_LONG_LONG_INT=c_long_long_int MPP=mpp C_LOW_U=c_low_u FRL8=frl8 LINUX=linux BUFRD_IO=bufrd_io LITTLE_END=little_end LINUX_INTEL_COMPILER=linux_intel_compiler ACCESS=access OASIS3=oasis3 CONTROL=control REPROD=reprod MPP=mpp ATMOS=atmos GLOBAL=global A04_ALL=a04_all A01_3A=a01_3a A02_3A=a02_3a A03_8C=a03_8c A04_3D=a04_3d A05_4A=a05_4a A06_4A=a06_4a A08_7A=a08_7a A09_2A=a09_2a A10_2A=a10_2a A11_2A=a11_2a A12_2A=a12_2a A13_2A=a13_2a A14_1B=a14_1b A15_1A=a15_1a A16_1A=a16_1a A17_2B=a17_2b A18_0A=a18_0a A19_1A=a19_1a A25_0A=a25_0a A26_1A=a26_1a A30_1A=a30_1a A31_0A=a31_0a A32_1A=a32_1a A33_0A=a33_0a A34_0A=a34_0a A35_0A=a35_0a A38_0A=a38_0a A70_1B=a70_1b A71_1A=a71_1a C70_1A=c70_1a C72_0A=c72_0a C80_1A=c80_1a C82_1A=c82_1a C84_1A=c84_1a C92_2A=c92_2a C94_1A=c94_1a C95_2A=c95_2a C96_1C=c96_1c C97_3A=c97_3a CABLE_17TILES=cable_17tiles CABLE_SOIL_LAYERS=cable_soil_layers TIMER=timer
tool::geninterface none
tool::ld mpif90
-tool::ldflags -g -traceback -lgcom -static-intel -ldummygrib -lpsmile.MPI1 -lmct -lmpeu -lscrip -lnetcdf -lnetcdff
+tool::ldflags -g -traceback -lgcom -static-intel -lpsmile.MPI1 -lmct -lmpeu -lscrip -lnetcdf -lnetcdff #-ldummygrib
diff --git a/umbase_hg3/src/control/c_code/pio_data_conv.c b/umbase_hg3/src/control/c_code/pio_data_conv.c
index b39c7ca..ad3bf0f 100644
--- a/umbase_hg3/src/control/c_code/pio_data_conv.c
+++ b/umbase_hg3/src/control/c_code/pio_data_conv.c
@@ -77,7 +77,7 @@
/* Include file for Fortran-to-C Interface */
#include "c_fort2c.h"
-integer *the_unit;
+extern integer *the_unit;
static char message[256];
/* Include file for Portable data conversion constants */
diff --git a/umbase_hg3/src/control/c_code/pio_io_timer.c b/umbase_hg3/src/control/c_code/pio_io_timer.c
index 24c5f52..eac2890 100644
--- a/umbase_hg3/src/control/c_code/pio_io_timer.c
+++ b/umbase_hg3/src/control/c_code/pio_io_timer.c
@@ -60,7 +60,7 @@
/* Header files for Fortran to C interface */
#include "c_fort2c.h"
-integer *the_unit;
+extern integer *the_unit;
static char message[256];
#!/bin/bash
# this script builds UM in HadGEM3 configuration
# depending on argument It also builds debug executatbles
MY_PATH=$(dirname $(readlink -f $0))
PBS_O_WORKDIR=${PBS_O_WORKDIR:-$MY_PATH}
UM_SOURCE_DIRNAME=access-nri-um7
module purge
#from AMIP umui
module use ~access/modules
module load intel-compiler-llvm/2024.2.1
module load netcdf/4.9.2
module load openmpi/4.0.2
module load fcm/2019.09.0
# module load gcom/7.7_ompi.4.0.2 # MS (12th Feb, 2025): This version compiled.
module load gcom/8.2_ompi.4.0.2 ## Also compiles the um_hg3 exe successfully
module load oasis3-mct-local/ompi.4.0.2-opt
module load um
module list
SYSTEMDIR=$MY_PATH/../..
HG=3 # build HadGEM3 ONLY here
# Whether to build debug --jhan: adjust path to configs
BLD_CONFIG=bld-hadgem${HG}-mct.cfg
EXEC=um_hg${HG}.exe
if [ "$2" == "debug" ]
then
echo "Building debug mode"
sleep 1
BLD_CONFIG=bld-dbg-hadgem${HG}.cfg
EXEC=um_hg${HG}_dbg.exe-$2
fi
# Model build only ## Base build # rm'd superfluous
# ~~~~~~~~~~~~~~~~
echo "Model build... Start"
# force full build with -f
fcm build -v 3 -f -j 4 $SYSTEMDIR/${UM_SOURCE_DIRNAME}/ummodel_hg${HG}/cfg/$BLD_CONFIG || exit 2
# incremental build
#fcm build -v 3 -j 4 $SYSTEMDIR/UM/ummodel_hg${HG}/cfg/$BLD_CONFIG || exit 2
echo "Model build... OK"
#copy UM executable to bin directory to avoid deleting it on a rebuild
### MS (12th Feb 2025): Need to figure out the exact directory layout and intent before fixing the following
### two commented-out lines
#cp -f $SYSTEMDIR/${UM_SOURCE_DIRNAME}/ummodel_hg${HG}/bin/$EXEC $SYSTEMDIR/../bin/$EXEC
#cp -f $SYSTEMDIR/${UM_SOURCE_DIRNAME}/ummodel_hg${HG}/bin/$EXEC $SYSTEMDIR/../bin/$EXEC-`date +%Y%m%d`_`date +%k` |
Paul's script used these modules - some of which are no longer available module use ~access/modules
module load intel-fc/12.1.9.293
module load intel-cc/12.1.9.293
module load netcdf/4.2.1.1
module load openmpi/1.6.5
module load fcm/2.3.1
module load gcom/4.4
module load oasis3-mct
module load um
module load dummygrib My compile script used above used the following modules (as captured by Currently Loaded Modulefiles:
1) intel-compiler-llvm/2024.2.1 2) netcdf/4.9.2 3) openmpi/4.0.2 4) fcm/2019.09.0 5) gcom/8.2_ompi.4.0.2 6) oasis3-mct-local/ompi.4.0.2-opt 7) um/default I have successfully compiled with both |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Follow Paul's existing script and compile the package with the latest possible versions of the dependencies.
The text was updated successfully, but these errors were encountered: