diff --git a/models/ed/Dockerfile b/models/ed/Dockerfile index f8edf578f4e..395c6fb664c 100644 --- a/models/ed/Dockerfile +++ b/models/ed/Dockerfile @@ -1,44 +1,40 @@ # # this needs to be at the top, what version are we building -# ARG IMAGE_VERSION="latest" +ARG IMAGE_VERSION="latest" -# # ---------------------------------------------------------------------- -# # BUILD MODEL BINARY -# # ---------------------------------------------------------------------- -# FROM pecan/models:${IMAGE_VERSION} as model-binary - -# # Some variables that can be used to set control the docker build -# ARG MODEL_VERSION="2.2.0" -# ARG BINARY_VERSION="2.2" +# ---------------------------------------------------------------------- +# BUILD MODEL BINARY +# ---------------------------------------------------------------------- +FROM pecan/models:${IMAGE_VERSION} as model-binary -# # specify fortran compiler -# ENV FC_TYPE=GNU +# Some variables that can be used to set control the docker build +ARG MODEL_VERSION="2.2.0" +ARG BINARY_VERSION="2.2" -# # install dependencies -# RUN apt-get update \ -# && apt-get install -y --no-install-recommends \ -# build-essential \ -# curl \ -# gfortran \ -# git \ -# libhdf5-dev \ -# libopenmpi-dev \ -# && rm -rf /var/lib/apt/lists/* +# install dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + build-essential \ + curl \ + gfortran \ + git \ + libhdf5-openmpi-dev \ + && rm -rf /var/lib/apt/lists/* -# # download, unzip and build ed2 -# WORKDIR /src -# RUN git -c http.sslVerify=false clone https://github.com/EDmodel/ED2.git \ -# && cd ED2/ED/build \ -# && curl -o make/include.mk.VM http://isda.ncsa.illinois.edu/~kooper/EBI/include.mk.opt.`uname -s` \ -# && if [ "${MODEL_VERSION}" != "git" ]; then git checkout "v.${MODEL_VERSION}"; fi \ -# && ./install.sh -g -p VM \ -# && mv /src/ED2/ED/build/ed_${BINARY_VERSION}-opt /src/ED2/ED/build/ed +# download, unzip and build ed2 +WORKDIR /src +RUN git -c http.sslVerify=false clone https://github.com/EDmodel/ED2.git +COPY data-raw/include.mk.opt /src/ED2/ED/build/make/include.mk.pecan +RUN cd ED2/ED/build \ + && if [ "${MODEL_VERSION}" != "git" ]; then git checkout "v.${MODEL_VERSION}"; fi \ + && ./install.sh -g -p pecan \ + && mv /src/ED2/ED/build/ed_${BINARY_VERSION}-opt /src/ED2/ED/build/ed ######################################################################## # ---------------------------------------------------------------------- # ED MODEL # ---------------------------------------------------------------------- -FROM edmodel/ed2:gnu AS model-binary +#FROM edmodel/ed2:gnu AS model-binary # ---------------------------------------------------------------------- # BUILD PECAN FOR MODEL @@ -51,7 +47,7 @@ FROM pecan/models:${IMAGE_VERSION} RUN apt-get update \ && apt-get install -y --no-install-recommends \ - libopenmpi3 \ + libhdf5-openmpi \ && rm -rf /var/lib/apt/lists/* # INSTALL PEcAn.ED2 diff --git a/models/ed/data-raw/include.mk.opt b/models/ed/data-raw/include.mk.opt new file mode 100644 index 00000000000..14c2a7032a2 --- /dev/null +++ b/models/ed/data-raw/include.mk.opt @@ -0,0 +1,38 @@ +#Makefile include include.mk.opt.ubuntu +############################################################################ + +# Define make (gnu make works best). +MAKE=/usr/bin/make + +# libraries. +BASE=$(ED_ROOT)/build/ + +# HDF 5 Libraries +HDF5_INCS=-I/usr/include/hdf5/openmpi +HDF5_LIBS= -L/usr/lib/$(shell uname -m)-linux-gnu/hdf5/openmpi -lhdf5_fortran -lhdf5_hl -lhdf5 -lz -lm +USE_COLLECTIVE_MPIO=0 + +# interface +USE_INTERF=1 + +# gfortran +CMACH=PC_LINUX1 +FC_TYPE=GNU +F_COMP=mpif90.openmpi +F_OPTS=-O3 -ffree-line-length-none -frecursive -fopenmp -static +C_COMP=mpicc.openmpi +C_OPTS=-O0 -DLITTLE -g -static +LOADER=mpif90.openmpi +LOADER_OPTS=-O3 -ffree-line-length-none -frecursive -fopenmp +C_LOADER==mpicc.openmpi +LIBS= +MOD_EXT=mod + +# using MPI libraries: +MPI_PATH= +PAR_INCS= +PAR_LIBS= +PAR_DEFS=-DRAMS_MPI + +# For IBM,HP,SGI,ALPHA,LINUX use these: +ARCHIVE=ar rs