Skip to content

Commit

Permalink
Merge pull request NOAA-GFDL#37 from thomas-robinson/main
Browse files Browse the repository at this point in the history
Fixes for building singularity container with intel
  • Loading branch information
thomas-robinson authored Aug 5, 2021
2 parents 35a6474 + 35547b9 commit bbd44eb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions container/Singularity.intel_am4
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Stage: build
## Singularity def file used to create AM4

%post
LD_LIBRARY_PATH=/opt/netcdf-c/lib:/opt/netcdf-fortran/lib:/opt/hdf5/lib:/opt/intel/oneapi/lib:/opt/intel/oneapi/lib/intel64/:/opt/intel/oneapi/lib/intel64/lib:/opt/intel/oneapi/lib/intel64/libfabric:${LD_LIBRARY_PATH}
export PATH=${PATH}:/opt/netcdf-c/bin:/opt/netcdf-fortran/bin
cd /opt
## Build the AM4 from github
git clone --recursive https://github.com/NOAA-GFDL/AM4.git -b main
Expand Down
10 changes: 8 additions & 2 deletions container/Singularity.intel_netcdf
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
Bootstrap: docker
From: intel/oneapi-hpckit:devel-ubuntu18.04
From: intel/oneapi-hpckit:2021.2-devel-ubuntu18.04
Stage: build

%post
## Set up oneAPI
apt-get -yqq update
apt-get -yqq upgrade
apt-get -yqq install git make
apt-get -yqq install git
apt-get -yqq install make
apt-get -yqq install wget
apt-get -yqq install m4
apt-get -yqq install autoconf
apt-get -yqq install automake
apt-get -yqq install libtool
apt-get -yqq install autogen
apt-get -yqq install intltool
# use wget to fetch the Intel repository public key
# cd /tmp
# wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Expand Down
4 changes: 2 additions & 2 deletions container/singularity_build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

singularity build -f intel_netcdf_ubuntu.sif Singularity.intel_netcdf
singularity build -f am4_2021.02_ubuntu_intel.sif Singularity.intel_am4
singularity build -f intel_netcdf_ubuntu.sif Singularity.intel2021.2_netcdfc4.7.4
singularity build -f am4_2021.03_ubuntu_intel.sif Singularity.intel_am4
2 changes: 1 addition & 1 deletion exec/fms/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ libFMS.a: folder configure build
folder:
mkdir -p build && cd build && autoreconf -i ${SRCROOT}/FMS
configure: folder
cd build && ${SRCROOT}/FMS/configure FC="$(FC)" CC="$(CC)" FCFLAGS="$(FFLAGS)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) $(CPPDEFS)" FPPFLAGS="$(FPPFLAGS)"
cd build && ${SRCROOT}/FMS/configure FC="$(FC)" CC="$(CC)" FCFLAGS="$(FFLAGS)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) $(CPPDEFS) $(FPPFLAGS)" FPPFLAGS="$(FPPFLAGS)" LIBS="$(LIBS)"
build: configure
cd build && make -j 20
clean:
Expand Down
1 change: 1 addition & 0 deletions exec/templates/intel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ FPPFLAGS = -fpp -Wp,-w $(INCLUDES)
# Fortran Compiler flags for the NetCDF library
ifndef NETCDF_FLAGS
FPPFLAGS += $(shell nf-config --fflags)
FFLAGS += $(shell nf-config --fflags)
else
FPPFLAGS += $(NETCDF_FLAGS)
endif
Expand Down

0 comments on commit bbd44eb

Please sign in to comment.