Skip to content
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

Supported Stages/2024 and added a basic CI test #27

Merged
merged 85 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
d765ae3
Env script for Stages/2024
kvrigor Aug 23, 2024
a0f7242
TSMP2 CI build test
kvrigor Aug 23, 2024
1ef6b2b
MPI Fortran fix for Ubuntu
kvrigor Aug 23, 2024
62827a5
Added Hypre installation in CI
kvrigor Aug 23, 2024
5bf4bb9
Merged commits from #23 and #24
kvrigor Oct 9, 2024
e4935d5
Switched to IntelMPI; Loaded 2024 env by default
kvrigor Oct 9, 2024
94d0474
MPI Fortran Finder fixes for ParaStationMPI
kvrigor Oct 9, 2024
e2936d9
Only source env file when using JSC supercomputers
kvrigor Oct 9, 2024
e2b2e8a
Fixed FindMPIFortran for Ubuntu
kvrigor Oct 9, 2024
cf063bf
Added -DeCLM=ON and -DParFlow=ON
kvrigor Oct 9, 2024
7965923
CI.yml: Set SYSTEMNAME and eCLM_TAG
kvrigor Oct 9, 2024
5980881
CI.yml: Used matrix.os instead of runner.os
kvrigor Oct 9, 2024
1b7a558
CI.yml: YAML trick to wrap multiline command into a single line
kvrigor Oct 9, 2024
7efb515
CI.yml: YAML is sensitive to whitespace...
kvrigor Oct 9, 2024
de3577c
include `CMAKE_CXX_COMPILER_ID` in `BuildPDAF.cmake`
jjokella Oct 18, 2024
029a8d2
Fixed hardcoded compiler-specific OpenMP flag
kvrigor Oct 29, 2024
1d14c8f
BuildParFlow: Disabled CUDA linker flags when on GCC-OpenMPI system
kvrigor Oct 29, 2024
6ac4c48
Various fixes for building ParFlow in Ubuntu
kvrigor Oct 29, 2024
3640f41
CI.yml: Update cache location
kvrigor Oct 29, 2024
baf1c31
README: Set default stage to 2024; added tag when cloning eCLM
kvrigor Oct 29, 2024
3080777
Merge remote-tracking branch 'refs/remotes/origin/stages-2024' into s…
kvrigor Oct 29, 2024
2ae0b48
Set absolute path to Hypre install dir
kvrigor Oct 29, 2024
e4bf447
Check model and dependency directories
kvrigor Oct 30, 2024
f9dc2e2
FindNetCDF.cmake and CI.yml fixes
kvrigor Oct 30, 2024
816c0e4
More NetCDF fixes
kvrigor Oct 30, 2024
134c789
Reenabled free/fixed flags and disabled free-form flag
kvrigor Oct 30, 2024
03c8c8b
Disabled parallel build
kvrigor Oct 30, 2024
a983f30
BuildParFlow: NETCDF_LIBRARY actually requires a library file, not a …
kvrigor Oct 30, 2024
5dbfa7f
AMPS_CPU_TICKS_PER_SEC fix in kvrigor/parflow
kvrigor Oct 30, 2024
4389d6c
Reinstall all Ubuntu apt packages
kvrigor Oct 30, 2024
dce8160
NetCDF fixes on ParFlow
kvrigor Oct 30, 2024
90e015d
Re-enabled Ubuntu apt caching
kvrigor Oct 30, 2024
5c47ed3
FindNetCDF.cmake: Inject logging statements
kvrigor Oct 30, 2024
64801d3
Reinstalled MPI fortran compilers
kvrigor Oct 30, 2024
387ebfe
Manually verify netcdf-mpi prefix path
kvrigor Oct 30, 2024
e324132
Add more NetCDF debugging logs
kvrigor Oct 30, 2024
41e1508
netCDF_HAS_PARALLEL seems to be incorrectly parsed
kvrigor Oct 30, 2024
80680d1
Check value of netCDF_HAS_PARALLEL
kvrigor Oct 30, 2024
7233837
Be more verbose how NetCDF is being searched
kvrigor Oct 30, 2024
06d8e68
BuildPDAF: fix syntax error `OR`
jjokella Oct 30, 2024
fc9c5fd
Merge remote-tracking branch 'origin/stages-2024' into stages-2024
jjokella Oct 30, 2024
48172cd
Merge branch 'master' into stages-2024
jjokella Oct 30, 2024
1f225b6
BuildPDAF: yet another `CMAKE_CXX_COMPILER_ID`-related fix
jjokella Oct 31, 2024
21be0b3
Open SSH port to debug CI runner
kvrigor Oct 31, 2024
0f65fbb
Appended path to parallel-aware NetCDF to CMAKE_PREFIX_PATH; increase…
kvrigor Oct 31, 2024
7baec04
Yet another attempt at taming the ill-behaved FindNetCDF
kvrigor Oct 31, 2024
0d95e23
Append to CMAKE_PREFIX_PATH only after Hypre installation
kvrigor Oct 31, 2024
24df63f
Merge branch 'master' into stages-2024
jjokella Nov 5, 2024
63dff48
Merge branch 'master' into stages-2024
jjokella Nov 6, 2024
62a9968
CI: Installed NetCDF C and Fortran
kvrigor Nov 8, 2024
a39f889
CI: Changed version naming convention; fixed NetCDF F90 configure error
kvrigor Nov 8, 2024
10eed1b
BuildParFlow: Reverted NETCDF_DIR setting
kvrigor Nov 8, 2024
f08cd23
CI: Removed debugging statements
kvrigor Nov 8, 2024
463f61c
CI: Removed --log-level=DEBUG
kvrigor Nov 8, 2024
4667d42
BuildParFlow: Fixed mis-parsed linker flags
kvrigor Nov 11, 2024
9532894
Merge remote-tracking branch 'refs/remotes/origin/stages-2024' into s…
kvrigor Nov 11, 2024
c038820
BuildPDAF: Separate Fortran/C compiler options
jjokella Nov 13, 2024
5c40aa5
Merge branch 'dev-pdaf-fopt-copt' into stages-2024
jjokella Nov 13, 2024
b140a08
BuildPDAF: Add Fortran debug compiler options like for eCLM
jjokella Nov 13, 2024
f1336d8
eCLM: Update to stages-2024 branch
jjokella Nov 13, 2024
86d1ae3
pdaf: update to stages 2024 branch
jjokella Nov 13, 2024
f6422f1
pdaf: fix for adding IntelLLVM for Stages/2024
jjokella Nov 14, 2024
fdacc35
update eCLM to head of `master`
jjokella Nov 14, 2024
c97a9a4
CI: Changed ParFlow source to upstream
kvrigor Nov 14, 2024
6536361
CI: Clone from ParFlow master and then checkout specific commit
kvrigor Nov 14, 2024
ae99465
CI: cd parflow then git checkout
kvrigor Nov 14, 2024
4dfdfd4
BuildParFlow: Fixed misparsed LDFLAGS and ignore unused variable warn…
kvrigor Nov 14, 2024
3613599
Merge branch 'master' into stages-2024
jjokella Nov 15, 2024
a40d52e
Align y/n input to the same line as question
kvrigor Nov 15, 2024
3285e16
PDAF commit to head of `tsmp-pdaf-patched`
jjokella Nov 19, 2024
f729f83
Merge branch 'master' into stages-2024
jjokella Nov 20, 2024
da38a7c
CI: Update apt before downloading packages
kvrigor Nov 21, 2024
8e6539e
Merge branch 'master' into stages-2024
jjokella Nov 22, 2024
d9f33dd
CI: Point to ParFlow commit with LLVM fixes
kvrigor Nov 26, 2024
85e5d7e
Merge branch 'master' into stages-2024
jjokella Nov 27, 2024
4052bf7
Point to ParFlow commit with LLVM fix (ed39749)
kvrigor Nov 27, 2024
a799767
Use Intel-built Hypre
kvrigor Nov 27, 2024
4688d47
Merge branch 'master' into stages-2024
jjokella Nov 28, 2024
157ebdc
Add EOL to FindNetCDF.cmake
kvrigor Nov 28, 2024
2f285d6
Stages/2024: PDAF-related updates and fixes (#43)
jjokella Dec 2, 2024
df0c938
Only source env file if on JSC or --tsmp2_env is supplied
kvrigor Dec 3, 2024
c82093a
Fixed typo: {tsmp2_env} -> ${tsmp2_env}
kvrigor Dec 3, 2024
0925143
Removed debugging statement
kvrigor Dec 3, 2024
95addcd
Merge branch 'master' into stages-2024
jjokella Dec 4, 2024
1a7d5ed
README: Stages/2024 requires cloning ParFlow master instead of v3.12.
kvrigor Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 235 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
name: TSMP2 Build

# Controls when the action will run.
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
eclm_build_job:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04 ]
config:
- {
name: "eCLM-ParFlow",
}

env:
CC: mpicc
CXX: mpicxx
FC: mpifort
F77: mpif77
BUILD_DIR: bld
INSTALL_DIR: install
MODEL_DIR: ${{ github.workspace }}/component-models
VER_OASIS: tsmp-patches-v0.1
VER_eCLM: beta-0.1
VER_PARFLOW: ed3974987902ef24c1f7519eb0ba5f8f66380c8c # points to commit "Supported Ubuntu 24.04 and added LLVM to CI"
VER_HYPRE: 2.26.0
VER_NETCDF_C: 4.9.2
VER_NETCDF_F90: 4.6.1
CMAKE_PREFIX_PATH: ${{ github.workspace }}/dependencies
SYSTEMNAME: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Install TSMP2 dependencies on Ubuntu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libxml++2.6-dev pylint wget cmake libpnetcdf-dev tcl-dev tk-dev
version: 1.0
execute_install_scripts: true

- name: Download HDF5 headers and MPI Fortran compiler
run: |
sudo apt-get update
sudo apt-get install gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev libhdf5-openmpi-103 hdf5-helpers

- name: Create directories for component model and dependencies
run: |
mkdir -p ${CMAKE_PREFIX_PATH} ${MODEL_DIR}

#
# NetCDF C
#
- name: Restore cached NetCDF C ${{ env.VER_NETCDF_C }}
uses: actions/cache/restore@v4
id: cache-netcdf-restore
with:
path: ${{ env.CMAKE_PREFIX_PATH }}
key: cache-${{ matrix.config.name }}-${{ env.VER_NETCDF_C }}

- if: steps.cache-netcdf-restore.outputs.cache-hit != 'true'
name: Install NetCDF C ${{ env.VER_NETCDF_C }}
run: |
wget https://github.com/Unidata/netcdf-c/archive/v${VER_NETCDF_C}.tar.gz
tar xf v${VER_NETCDF_C}.tar.gz
cd netcdf-c-${VER_NETCDF_C}
export CPPFLAGS=-I/usr/include/hdf5/openmpi
export LDFLAGS=-L/usr/lib/x86_64-linux-gnu/hdf5/openmpi
./configure --prefix=$(realpath $CMAKE_PREFIX_PATH)
make -j4 install

- if: steps.cache-netcdf-restore.outputs.cache-hit != 'true'
name: Cache NetCDF ${{ env.VER_NETCDF_C }}
uses: actions/cache/save@v4
with:
path: ${{ env.CMAKE_PREFIX_PATH }}
key: cache-${{ matrix.config.name }}-${{ env.VER_NETCDF_C }}

#
# NetCDF Fortran
#
- name: Restore cached NetCDF Fortran ${{ env.VER_NETCDF_F90 }}
uses: actions/cache/restore@v4
id: cache-netcdff90-restore
with:
path: ${{ env.CMAKE_PREFIX_PATH }}
key: cache-${{ matrix.config.name }}-${{ env.VER_NETCDF_F90 }}

- if: steps.cache-netcdff90-restore.outputs.cache-hit != 'true'
name: Install NetCDF Fortran ${{ env.VER_NETCDF_F90 }}
run: |
wget https://github.com/Unidata/netcdf-fortran/archive/v${VER_NETCDF_F90}.tar.gz
tar xf v${VER_NETCDF_F90}.tar.gz
cd netcdf-fortran-${VER_NETCDF_F90}
export CPPFLAGS=-I${CMAKE_PREFIX_PATH}/include
export LDFLAGS=-L${CMAKE_PREFIX_PATH}/lib
./configure --prefix=$(realpath $CMAKE_PREFIX_PATH)
make -j4 install

- if: steps.cache-netcdff90-restore.outputs.cache-hit != 'true'
name: Cache NetCDF Fortran ${{ env.VER_NETCDF_F90 }}
uses: actions/cache/save@v4
with:
path: ${{ env.CMAKE_PREFIX_PATH }}
key: cache-${{ matrix.config.name }}-${{ env.VER_NETCDF_F90 }}

#
# OASIS3-MCT
#
- name: Restore cached OASIS3-MCT ${{ env.VER_OASIS }}
uses: actions/cache/restore@v4
id: cache-oasis-restore
with:
path: ${{ env.MODEL_DIR }}/oasis3-mct
key: cache-${{ matrix.config.name }}-${{ env.VER_OASIS }}

- if: steps.cache-oasis-restore.outputs.cache-hit != 'true'
name: Download OASIS3-MCT ${{ env.VER_OASIS }}
working-directory: ${{ env.MODEL_DIR }}
run: |
git clone -b $VER_OASIS https://icg4geo.icg.kfa-juelich.de/ExternalReposPublic/oasis3-mct.git
echo "OASIS3-MCT version: $(cd oasis3-mct && git describe --tags --always)"

- if: steps.cache-oasis-restore.outputs.cache-hit != 'true'
name: Cache OASIS3-MCT ${{ env.VER_OASIS }}
uses: actions/cache/save@v4
with:
path: ${{ env.MODEL_DIR }}/oasis3-mct
key: cache-${{ matrix.config.name }}-${{ env.VER_OASIS }}

#
# eCLM
#
- name: Restore cached eCLM ${{ env.VER_eCLM }}
uses: actions/cache/restore@v4
id: cache-eclm-restore
with:
path: ${{ env.MODEL_DIR }}/eCLM
key: cache-${{ matrix.config.name }}-${{ env.VER_eCLM }}

- if: steps.cache-eclm-restore.outputs.cache-hit != 'true'
name: Download eCLM ${{ env.VER_eCLM }}
working-directory: ${{ env.MODEL_DIR }}
run: |
git clone -b $VER_eCLM https://github.com/HPSCTerrSys/eCLM.git
echo "eCLM version: $(cd eCLM && git describe --tags --always)"

- if: steps.cache-eclm-restore.outputs.cache-hit != 'true'
name: Cache eCLM ${{ env.VER_eCLM }}
uses: actions/cache/save@v4
with:
path: ${{ env.MODEL_DIR }}/eCLM
key: cache-${{ matrix.config.name }}-${{ env.VER_eCLM }}

#
# ParFlow
#
- name: Restore cached ParFlow ${{ env.VER_PARFLOW }}
uses: actions/cache/restore@v4
id: cache-parflow-restore
with:
path: ${{ env.MODEL_DIR }}/parflow
key: cache-${{ matrix.config.name }}-${{ env.VER_PARFLOW }}

# TODO: Must use upstream repo https://github.com/parflow/parflow.git
- if: steps.cache-parflow-restore.outputs.cache-hit != 'true'
name: Download ParFlow ${{ env.VER_PARFLOW }}
working-directory: ${{ env.MODEL_DIR }}
run: |
git clone https://github.com/parflow/parflow.git
cd parflow
git checkout $VER_PARFLOW
echo "ParFlow version: $(git describe --tags --always)"

- if: steps.cache-parflow-restore.outputs.cache-hit != 'true'
name: Cache ParFlow ${{ env.VER_PARFLOW }}
uses: actions/cache/save@v4
with:
path: ${{ env.MODEL_DIR }}/parflow
key: cache-${{ matrix.config.name }}-${{ env.VER_PARFLOW }}

#
# Hypre
#
- name: Restore cached Hypre ${{ env.VER_HYPRE }}
uses: actions/cache/restore@v4
id: cache-hypre-restore
with:
path: ${{ env.CMAKE_PREFIX_PATH }}
key: cache-${{ matrix.config.name }}-${{ env.VER_HYPRE }}

- if: steps.cache-hypre-restore.outputs.cache-hit != 'true'
name: Install Hypre ${{ env.VER_HYPRE }}
run: |
wget https://github.com/hypre-space/hypre/archive/v${VER_HYPRE}.tar.gz
tar xf v${VER_HYPRE}.tar.gz
cd hypre-${VER_HYPRE}/src
./configure --prefix=$(realpath $CMAKE_PREFIX_PATH)
make -j4 install

- if: steps.cache-hypre-restore.outputs.cache-hit != 'true'
name: Cache Hypre ${{ env.VER_HYPRE }}
uses: actions/cache/save@v4
with:
path: ${{ env.CMAKE_PREFIX_PATH }}
key: cache-${{ matrix.config.name }}-${{ env.VER_HYPRE }}

#
# TSMP2
#
- name: Configure TSMP2
run: >-
cmake -S . -B ${BUILD_DIR}
-DCMAKE_BUILD_TYPE="RELEASE"
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
-DOASIS_SRC=${MODEL_DIR}/oasis3-mct
-DeCLM="ON"
-DeCLM_SRC=${MODEL_DIR}/eCLM
-DParFlow="ON"
-DPARFLOW_SRC=${MODEL_DIR}/parflow

- name: Build TSMP2
run: |
cmake --build ${BUILD_DIR}

- name: Install TSMP2
run: |
cmake --install ${BUILD_DIR}
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[submodule "models/parflow_pdaf"]
path = models/parflow_pdaf
url = https://github.com/HPSCTerrSys/parflow
branch = tsmp-pdaf
branch = tsmp-pdaf-patched
[submodule "models/pdaf"]
path = models/pdaf
url = https://github.com/HPSCTerrSys/pdaf.git
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ cd $TSMP2_DIR
2. Load the environment variables required for the build.

```bash
source env/jsc.2023_Intel.sh
source env/jsc.2024_Intel.sh
```

3. Specify build and install directories.
Expand All @@ -82,19 +82,19 @@ mkdir -p ${BUILD_DIR} ${INSTALL_DIR}
## NOTE: Download only the component models that you need! ##

# eCLM
git clone https://github.com/HPSCTerrSys/eCLM.git models/eCLM
git clone -b beta-0.1 https://github.com/HPSCTerrSys/eCLM.git models/eCLM
eCLM_SRC=`realpath models/eCLM`

# ICON
git clone https://icg4geo.icg.kfa-juelich.de/spoll/icon2.6.4_oascoup.git models/icon
ICON_SRC=`realpath models/icon`

# ParFlow
git clone -b v3.12.0 https://github.com/parflow/parflow.git models/parflow
git clone https://github.com/parflow/parflow.git models/parflow
PARFLOW_SRC=`realpath models/parflow`

# ParFlow (PDAF-patched)
git clone -b v3.12.0-tsmp https://github.com/HPSCTerrSys/parflow models/parflow_pdaf
git clone -b v3.13.0-pdaf https://github.com/HPSCTerrSys/parflow models/parflow_pdaf
PARFLOW_SRC=`realpath models/parflow_pdaf`

# CLM3.5
Expand Down
17 changes: 9 additions & 8 deletions build_tsmp2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ if [ -n "${comp_namey}" ] && [ -z "${comp_srcname}" ];then
submodule_name=$(echo "models/"${sub_srcname})
fi
if [ "$( ls -A ${cmake_tsmp2_dir}/${submodule_name} | wc -l)" -ne 0 ];then
echo "submodule ${submodule_name} aleady exist. Do you want overwrite it? (y/n)"
read yn
read -p "submodule ${submodule_name} aleady exists. Do you want overwrite it? (y/n) " yn
if [ "${yn,}" = "y" ];then
message "Overwrite submodule ${submodule_name}"
git submodule update --init --force -- ${submodule_name}
Expand Down Expand Up @@ -188,7 +187,7 @@ else
fi

# set INSTALL and BUILD DIR (neccesary for building)
if [ -z "${SYSTEMNAME}" ]; then SYSTEMNAME="UNKN"; fi
if [ -z "${SYSTEMNAME}" ]; then export SYSTEMNAME=$(hostname); fi

if [ -z "${build_dir}" ]; then
cmake_build_dir="${cmake_tsmp2_dir}/bld/${SYSTEMNAME^^}_${model_id}"
Expand All @@ -210,14 +209,16 @@ fi # Makefile verbosity

build_log="$(dirname ${cmake_build_dir})/${model_id}_$(date +%Y-%m-%d_%H-%M).log"

## source environment
message "source environment"
if [ -z "${tsmp2_env}" ]; then
tsmp2_env="${cmake_tsmp2_dir}/env/jsc.2023_Intel.sh"
## source environment if on JSC or env file is provided
if [[ -z "${tsmp2_env}" && ($SYSTEMNAME = "jurecadc" || $SYSTEMNAME = "juwels" || $SYSTEMNAME = "jusuf") ]]; then
tsmp2_env="${cmake_tsmp2_dir}/env/jsc.2024_Intel.sh"
else
tsmp2_env="$(realpath ${tsmp2_env})"
fi # tsmp2_env
source $tsmp2_env
if [ ! -z "${tsmp2_env}" ]; then
message "source environment"
mvhulten marked this conversation as resolved.
Show resolved Hide resolved
source $tsmp2_env
fi

## CMAKE config
# rm -rf ${cmake_build_dir}
Expand Down
3 changes: 2 additions & 1 deletion cmake/BuildCOSMO.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
find_package(ecCodes REQUIRED)
find_package(NetCDF REQUIRED)
find_package(OpenMP REQUIRED)

set(COSMO_BLD_DIR ${CMAKE_BINARY_DIR}/COSMO5_1/bld)
set(COSMO_Fopts ${COSMO_BLD_DIR}/Fopts)
Expand All @@ -15,7 +16,7 @@ file(APPEND ${COSMO_Fopts} "COMFLG4 = $(COMFLG1)\n")
file(APPEND ${COSMO_Fopts} "COMFLG = $(COMFLG1)\n")
file(APPEND ${COSMO_Fopts} "COMFLG5 = $(COMFLG1)\n")
file(APPEND ${COSMO_Fopts} "LDPAR = ${CMAKE_Fortran_COMPILER}\n")
file(APPEND ${COSMO_Fopts} "LDFLG = -qopenmp\n")
file(APPEND ${COSMO_Fopts} "LDFLG = ${OpenMP_Fortran_FLAGS}\n")
file(APPEND ${COSMO_Fopts} "PROGRAM = lmparbin\n")
file(APPEND ${COSMO_Fopts} "LIBPATH = ${ecCodes_LIBRARIES} ${NetCDF_LIBRARIES} ${OASIS_LIBRARIES}\n")

Expand Down
13 changes: 10 additions & 3 deletions cmake/BuildOASIS3MCT.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
find_package(NetCDF REQUIRED)
find_package(OpenMP REQUIRED)

if (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set(OPTIM "-g")
Expand All @@ -20,7 +21,7 @@ file(WRITE ${OASIS_MAKE_INC} "CHAN = MPI1\n")
file(APPEND ${OASIS_MAKE_INC} "COUPLE = ${OASIS_SRC}\n")
file(APPEND ${OASIS_MAKE_INC} "BUILD_DIR = ${OASIS_BLD_DIR}\n")
file(APPEND ${OASIS_MAKE_INC} "ARCHDIR = ${OASIS_INSTALL_PREFIX}\n")
file(APPEND ${OASIS_MAKE_INC} "NETCDF_INCLUDE = ${NetCDF_ROOT}/include\n")
file(APPEND ${OASIS_MAKE_INC} "NETCDF_INCLUDE = ${NetCDF_F90_ROOT}/include\n")
file(APPEND ${OASIS_MAKE_INC} "NETCDF_LIBRARY = ${NetCDF_LIBRARIES}\n")
file(APPEND ${OASIS_MAKE_INC} "MPI_INCLUDE = ${MPI_Fortran_INCLUDE_DIRS}\n")
file(APPEND ${OASIS_MAKE_INC} "MAKE = make\n")
Expand All @@ -39,8 +40,14 @@ if(${PDAF})
else()
file(APPEND ${OASIS_MAKE_INC} "CPPDEF = -Duse_netCDF -Duse_comm_$(CHAN) -D__VERBOSE -DTREAT_OVERLAY\n")
endif()
file(APPEND ${OASIS_MAKE_INC} "FCBASEFLAGS = ${OPTIM} -xCORE-AVX2 -I. -assume byterecl -mt_mpi -qopenmp\n")
file(APPEND ${OASIS_MAKE_INC} "CCBASEFLAGS = ${OPTIM} -qopenmp\n")
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
file(APPEND ${OASIS_MAKE_INC} "FCBASEFLAGS = ${OPTIM} -I. -ffree-line-length-none -fallow-argument-mismatch ${OpenMP_Fortran_FLAGS}\n")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
file(APPEND ${OASIS_MAKE_INC} "FCBASEFLAGS = ${OPTIM} -I. -xCORE-AVX2 -assume byterecl -mt_mpi ${OpenMP_Fortran_FLAGS}\n")
else()
message(FATAL_ERROR "Fortran compiler '${CMAKE_Fortran_COMPILER_ID}' is not supported.")
endif()
file(APPEND ${OASIS_MAKE_INC} "CCBASEFLAGS = ${OPTIM} ${OpenMP_Fortran_FLAGS}\n")
file(APPEND ${OASIS_MAKE_INC} "MCT_DEBUGFLAG = ${MCT_DEBUGFLAG}\n")
file(APPEND ${OASIS_MAKE_INC} "FLIBS = ${NetCDF_LIBRARIES}\n")
file(APPEND ${OASIS_MAKE_INC} "INC_DIRS = -I$(ARCHDIR)/include -I$(NETCDF_INCLUDE)\n")
Expand Down
Loading