Skip to content

Instantly share code, notes, and snippets.

@Synkevych
Created January 18, 2023 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Synkevych/e69437e4e78b4e7bfe66e0964137b60a to your computer and use it in GitHub Desktop.
Save Synkevych/e69437e4e78b4e7bfe66e0964137b60a to your computer and use it in GitHub Desktop.
FROM --platform=linux/amd64 ubuntu:18.04
LABEL maintainer Synkevych Roman "synkevych.roman@gmail.com"
RUN apt-get update && apt-get install -y \
language-pack-en openssh-server vim software-properties-common \
build-essential make gcc g++ zlib1g-dev git python3 python3-dev python3-pip \
gfortran autoconf libtool automake flex bison cmake git-core \
libeccodes0 libeccodes-data libeccodes-dev libeccodes-tools \
libnetcdff-dev unzip curl wget
# did't work on ARM64 arch
RUN add-apt-repository 'deb http://security.ubuntu.com/ubuntu xenial-security main'\
&& apt-get update \
&& apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com \
&& apt-get install -y libjasper1 libjasper-dev
# Eneble MPI
RUN apt-get -y install openmpi-bin libopenmpi-dev
# Download, modify and compile flexpart 10
RUN mkdir flex_src && cd flex_src \
&& wget https://www.flexpart.eu/downloads/66 \
&& tar -xvf 66 \
&& rm 66 \
&& cd flexpart_v10.4_3d7eebf/src \
&& cp makefile makefile_local \
&& sed -i '74 a INCPATH1 = /usr/include\nINCPATH2 = /usr/include\nLIBPATH1 = /usr/lib\n F90 = gfortran' makefile_local \
&& sed -i 's/LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper $(NCOPT)/LIBS = -leccodes_f90 -leccodes -lm -ljasper $(NCOPT)/' makefile_local \
&& make mpi ncf=yes -f makefile_local
ENV PATH /flex_src/flexpart_v10.4_3d7eebf/src/:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment