Euler Fortran Implementation
All problems are solved in Fortran95, and should be compliant with later standards.
Organization
All Fortran files share a common prefix with their problem number. All shared functions are moved to header files in the include subfolder
Makefile
There are three main recipes in this Makefile
test
This recipe runs tests in a single thread and performs benchmarks on each.
test_*
This recipe currently redirects to test
, but in future versions may
spawn a number of threads equal to the suffix given, with auto
equalling
the number of CPUs on the system.
clean
This removes any build files, as well as the test runner executable
Build
This is the most complicated build process of my implementations. It has a six step build process, as outlined below
flowchart TB subgraph include["src/include/"] direction TB constants["constants.f90"] primes["primes.f90"] misc["*.f90"] end subgraph src["src/"] direction TB p0001["p0001.f90"] p0002["p0002.f90"] p0003["p0003.f90"] pxxxx["p____.f90"] p9999["p9999.f90"] end constants --> primes constants --> misc constants --> problems constants --> test constants --> p0001 constants --> p0002 constants --> p0003 constants --> pxxxx constants --> p9999 primes --> p0003 p0001 --> problems p0002 --> problems p0003 --> problems pxxxx --> problems p9999 --> problems problems["problems.f90"] --> test["test.f90"]
Compile
src/include/constants.f90
Then
src/include/*.f90
, giving a reference to the aboveThen
src/*.f90
, giving a reference to the aboveA file,
problems.f90
, is generated which links the above with a pair of helper functionsThen
problems.f90
is compiled, giving a reference to the aboveFinally,
test.f90
is compiled and ran
Tests
Generic Problems
For each problem it will check the answer against a known dictionary. If the problem is not in the "known slow" category (meaning that I generate the correct answer with a poor solution), it will run it as many times as the benchmark plugin wants. Otherwise it is run exactly once.
A test fails if it gets the wrong answer or if it takes more than 1 minute.
Dependencies
I try to keep the dependencies of this project as small as possible, except for test plugins. At the moment there are no dependencies for this section.
Library Code
Problems Solved
- Fortran Implementation of Problem 1
- Fortran Implementation of Problem 2
- Fortran Implementation of Problem 3
- Fortran Implementation of Problem 4
- Fortran Implementation of Problem 5
- Fortran Implementation of Problem 6
- Fortran Implementation of Problem 7
- Fortran Implementation of Problem 8
- Fortran Implementation of Problem 9
- Fortran Implementation of Problem 10
- Fortran Implementation of Problem 11
- Fortran Implementation of Problem 13
- Fortran Implementation of Problem 14
- Fortran Implementation of Problem 15
- Fortran Implementation of Problem 16
- Fortran Implementation of Problem 17
- Fortran Implementation of Problem 19
- Fortran Implementation of Problem 20
- Fortran Implementation of Problem 22
- Fortran Implementation of Problem 28
- Fortran Implementation of Problem 34
- Fortran Implementation of Problem 76
- Fortran Implementation of Problem 836