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

Update Dockerfile #106 #107

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
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
51 changes: 21 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
# Use an appropriate base image with a Fortran compiler (e.g., gfortran) and FPM installed.
FROM debian:buster

# User name
ENV USERNAME=elf

# Select and set time zone
# Need to do this, or else docker build prompts for TZ and then stalls.
ENV TZ=Europe/Madrid
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# This section is needed only if OpenMPI is used in the OpenCoarrays install.
# For an MPICH build (which I am going to do), this is not necessary.
#
# Below is a fix for the OpenMPI bug where a bunch of weird stuff is outputted
# for number of processes (or, coarray images) > 1. The numerical results
# are unaffected.
#
# I am not sure if this fix affects performance.
#ENV OMPI_MCA_btl_vader_single_copy_mechanism=none

# Update software repo
RUN apt-get update

Expand All @@ -28,7 +18,6 @@ RUN apt-get upgrade -yq && apt-get dist-upgrade -yq
RUN apt-get install -yq sudo

# Create, give sudo powers, and switch to user "elf"
# This section is from Milan Curcic (https://github.com/modern-fortran/modern-fortran-docker)
RUN echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
useradd --no-log-init --home-dir /home/$USERNAME --create-home --shell /bin/bash $USERNAME && \
adduser $USERNAME sudo
Expand All @@ -42,21 +31,23 @@ RUN sudo apt-get install -yq git nano make cmake gfortran mpich \
liblapack-dev libsymspg-dev && \
sudo apt-get clean -q

# Install OpenCoarrays 2.8.0
RUN rm -rf OpenCoarrays # Remove previous build, if it exists.
RUN git clone https://github.com/sourceryinstitute/OpenCoarrays && \
mkdir OpenCoarrays/opencoarrays-install && \
cd OpenCoarrays/opencoarrays-install && \
git checkout tags/2.8.0 && \
FC="$(command -v gfortran)" CC="$(command -v gcc)" cmake .. && \
sudo make install && \
caf --version && \
cafrun --version

# Install elphbolt (develop-latest)
RUN rm -rf elphbolt # Remove previous builds if it exists.
RUN git clone https://github.com/nakib/elphbolt; cd elphbolt && \
cp Makefiles/thinkpad_gcc.make src/ && \
cp Makefiles/Makefile src/ &&\
cd src/ && \
make clean; make
# Install FPM
RUN sudo apt-get install -yq ruby && \
sudo gem install fpm

# Install elphbolt using FPM
RUN git clone https://github.com/nakib/elphbolt && \
cd elphbolt && \
fpm install && \
cd .. && rm -rf elphbolt

# Optionally, install other Fortran dependencies using FPM
# RUN fpm install <dependency-name>

# Copy your Fortran project files (FPM.toml, source code, etc.) into the container
# COPY . /home/$USERNAME/my_fortran_project

# Build and install your Fortran project using FPM
# RUN cd /home/$USERNAME/my_fortran_project && \
# fpm build && \
# fpm install
Loading