Skip to content

Commit

Permalink
fix ed
Browse files Browse the repository at this point in the history
  • Loading branch information
robkooper committed Sep 2, 2024
1 parent a903d43 commit f5f4442
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 31 deletions.
58 changes: 27 additions & 31 deletions models/ed/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
38 changes: 38 additions & 0 deletions models/ed/data-raw/include.mk.opt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f5f4442

Please sign in to comment.