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

Conversation

Rajdeep1311
Copy link

No description provided.

@nakib
Copy link
Owner

nakib commented Sep 16, 2023

Dear Rajdeep,

Thanks a lot for your PR. There might be a slight confusion here. By fpm, I meant the fortran package manager. By the way, I am also fine with the cmake option, though fpm is preferred.

Best regards,
Nakib

@Rajdeep1311
Copy link
Author

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

ENV TZ=Europe/Madrid
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

Update software repo

RUN apt-get update

Upgrade OS

RUN apt-get upgrade -yq && apt-get dist-upgrade -yq

Install sudo

RUN apt-get install -yq sudo

Create, give sudo powers, and switch to user "elf"

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

Set user name and work directory

USER $USERNAME
WORKDIR /home/$USERNAME

Install some other packages from Debian repo

RUN sudo apt-get install -yq git nano make cmake gfortran mpich
liblapack-dev libsymspg-dev &&
sudo apt-get clean -q

Install FPM

RUN sudo apt-get install -yq ruby &&
sudo gem install fpm

Create a directory for your Fortran project

RUN mkdir my_fortran_project

Copy your Fortran project files (FPM.toml, source code, etc.) into the container

COPY . /home/$USERNAME/my_fortran_project

Set the working directory to your Fortran project directory

WORKDIR /home/$USERNAME/my_fortran_project

Use FPM to build and install your Fortran project

RUN fpm build &&
fpm install

Optionally, you can run your Fortran application here

CMD ["./your_fortran_executable"]

Sir Is this alright?

@nakib
Copy link
Owner

nakib commented Sep 17, 2023

Hi Rajdeep,

Thanks a lot for the update. Unfortunately, I still don't think this will work. By the way, have you tried building this image on your machine?

To be specific about the issue, with the following command, you are installing a different fpm than the one needed here:

RUN sudo apt-get install -yq ruby &&
sudo gem install fpm

You can try the cmake route, which would be simpler as you can simply apt get it. Following this, building OpenCoarrays, and cloning elphbolt, you can simply mkdir build; cd build; cmake ..; make; ctest.

Best regards,
Nakib

@Rajdeep1311
Copy link
Author

I will try my best to help you sir

@nakib
Copy link
Owner

nakib commented Sep 25, 2023

Hi Rajdeep,

I have updated the Dockerfile to use cmake and have closed the issue.

Best regards,
Nakib

@nakib nakib closed this Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants