-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# syntax=docker/dockerfile:1.4 | ||
# use latest debian | ||
FROM debian:sid-slim | ||
|
||
ENV RUNLEVEL 1 | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LC_ALL C.UTF-8 | ||
|
||
RUN <<EOF | ||
#!/usr/bin/env bash | ||
set -exo pipefail | ||
|
||
# update OS | ||
apt-get -y update | ||
apt-get -y upgrade | ||
|
||
# install cctbx | ||
declare -ar pkgs=( | ||
# seems to be needed | ||
#10 70.95 Setting up dbus-system-bus-common (1.16.0-1) ... | ||
#10 70.96 Can't locate Encode.pm in @INC (you may need to install the Encode module) | ||
'libencode-perl' | ||
# this is huge, qt, hdf... | ||
'python3-cctbx' | ||
# fable wants to compile c++ | ||
'g++' | ||
) | ||
apt-get -y --no-install-recommends install "${pkgs[@]}" | ||
|
||
# run fable to check works | ||
fable.cout --example | ||
|
||
# docker cleanup | ||
apt-get -y autoremove --purge | ||
rm -rf /var/lib/apt/lists/* | ||
EOF | ||
|
||
# /usr/bin | ||
ENTRYPOINT ["fable.cout"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
docker to run fable FORTRAN converter | ||
|
||
# remember name of docker to build | ||
``` | ||
export DOCK_NAME='fable-dock' | ||
``` | ||
|
||
# build fable docker | ||
``` | ||
docker buildx build -t ${DOCK_NAME} . | ||
``` | ||
|
||
# run bash in fable docker | ||
# overriding entrypoint | ||
``` | ||
docker run -i --entrypoint /usr/bin/env -t ${DOCK_NAME} bash | ||
``` | ||
|
||
# run fable, see help | ||
``` | ||
docker run -it ${DOCK_NAME} | ||
``` | ||
|
||
# run fable --example to current dir | ||
# fable.cout and fable_cout.cpp are created | ||
``` | ||
docker run -i -w $(pwd) --volume=$(pwd):$(pwd):rw -t ${DOCK_NAME} --example | ||
``` | ||
|
||
# run fable on local files | ||
# send cout to cpp file | ||
``` | ||
declare -ar cmda=( | ||
docker run -i -w $(pwd) | ||
--volume=$(pwd):$(pwd):rw | ||
-t ${DOCK_NAME} | ||
<user fortran file> | ||
<user fortran file> | ||
--namespace <user namespace> | ||
) | ||
${cmda[@]} > <user cpp file> | ||
``` |