A base setup for a fortran environment with compiler, testing etc
The Fortran code is built using the Waf_ build tool. This requires Python 2.5 or newer (including 3.x) to be available. If any errors with waf check if update needed (See troubleshooting at bottom).
You will need docker in order to create a virtual environment to run the fortran model
https://docs.docker.com/docker-for-windows/
https://docs.docker.com/install/linux/docker-ce/ubuntu/
Replace 'fortran_environment' with the name of your model
docker build . -t fortran_environment
Note can add args like 'abc' in example below
docker run -it fortran_environment ./build/run_model abc
This is the instructions for running without docker on windows
- MinGW - http://www.mingw.org/wiki/Getting_Started
- Needs specific compilers?
- assuming your directory for MinGW is the default "C:\MinGW", setup your PATH environment variable to include "C:\MinGW\bin" && "C:\MinGW\msys\1.0\bin"
- Check this is working by opening cmd or powershell and typing "make -h". This should give you some options for the make command
- Git For windows - https://git-scm.com/download/win
- This provides access to git bash
- Python 2.7 - https://www.python.org/downloads/release/python-2717/
- Add python to your environment variables "C:/Python27". Make sure to rename python.exe to python2.exe
- Add pip to your environment variables "C:/Python27/Scripts"
- Python Virtual Env - Install python2 virtual env
python2 -m pip install --user virtualenv
Note: Ensure you reopen command panels after editing PATH Vars
- From
git bash
Create the python virtual environmentpython2 -m virtualenv venv
and activate. ./venv/scripts/activate
. When Activated you should now have(venv)
at the start of the current path in the command line
- With the environment activated run
python waf configure
followed bypython waf build
- You should now have a run_model.exe file in the build folder. Run this in bash/cmd and you should see
hello world
as a response