-
Notifications
You must be signed in to change notification settings - Fork 34
Compile
FLAP has been developed on GNU/Linux architecture. Other OS are not supported (and in general there is no best alternative to GNU/Linux :-).
FLAP relies on the following sources structure:
src/
├── lib
│ ├── flap_command_line_arguments_group_t.f90
│ ├── flap_command_line_argument_t.F90
│ ├── flap_command_line_interface_t.F90
│ ├── flap.f90
│ ├── flap_object_t.f90
│ └── flap_utils_m.f90
├── tests
│ ├── test_basic.f90
│ ├── test_choices_logical.f90
│ ├── test_nested.f90
│ └── test_string.f90
└── third_party
└── PENF
The most easy way to compile FLAP is to use FoBiS.py within the provided fobos file.
Consequently, it is strongly encouraged to install FoBiS.py.
| Build by means of FoBiS | Build by means of GNU Make | Build by means of CMake |
FoBiS.py is a KISS tool for automatic building of modern Fortran projects. Providing very few options, FoBiS.py is able to build almost automatically complex Fortran projects with cumbersome inter-modules dependency. This removes the necessity to write complex makefile. Moreover, providing a very simple options file (in the FoBiS.py nomenclature indicated as fobos
file) FoBiS.py can substitute the (ab)use of makefile for other project stuffs (build documentations, make project archive, etc...). FLAP is shipped with a fobos file that can build the library in both static and shared forms and also build the Test_Driver
program. The provided fobos file has several building modes.
Typing:
FoBiS.py build -lmodes
the following message should be printed:
The fobos file defines the following modes:
- "shared-gnu"
- "static-gnu"
- "test-driver-gnu"
- "shared-gnu-debug"
- "static-gnu-debug"
- "test-driver-gnu-debug"
- "shared-intel"
- "static-intel"
- "test-driver-intel"
- "shared-intel-debug"
- "static-intel-debug"
- "test-driver-intel-debug"
The modes should be self-explicative: shared
, static
and test-driver
are the modes for building (in release, optimized form) the shared and static versions of the library and the Test Driver program, respectively. The other 3 modes are the same, but in debug form instead of release one. -gnu
use the GNU gfortran
compiler while -intel
the Intel one.
The shared
or static
directories are created accordingly to the form of the library built. The compiled objects and mod files are placed inside this directory, as well as the linked library.
FoBiS.py build -mode shared-gnu
FoBiS.py build -mode static-gnu
FoBiS.py build -mode shared-gnu-debug
FoBiS.py build -mode static-gnu-debug
The Test_Driver
directory is created. The compiled objects and mod files are placed inside this directory, as well as the linked program.
FoBiS.py build -mode test-driver-gnu
FoBiS.py build -mode test-driver-gnu-debug
Typing:
FoBiS.py rule -ls
the following message should be printed:
The fobos file defines the following rules:
- "makedoc" Rule for building documentation from source files
Command => rm -rf doc/html/*
Command => ford doc/main_page.md
Command => cp -r doc/html/publish/* doc/html/
- "deldoc" Rule for deleting documentation
Command => rm -rf doc/html/*
- "maketar" Rule for making tar archive of the project
Command => tar -czf FLAP.tar.gz *
- "makecoverage" Rule for performing coverage analysis
Command => FoBiS.py clean -mode test-driver-gnu
Command => FoBiS.py build -mode test-driver-gnu -coverage
Command => ./Test_Driver/Test_Driver
Command => ./Test_Driver/Test_Driver -v
Command => ./Test_Driver/Test_Driver -s 'Hello FLAP' -i 2
Command => ./Test_Driver/Test_Driver 33.0 -s 'Hello FLAP' --integer_list 10 -3 87 -i 3 -r 64.123d0 --boolean --boolean_val .false.
- "coverage-analysis" Rule for performing coverage analysis and saving reports in markdown
Command => FoBiS.py clean -mode test-driver-gnu
Command => FoBiS.py build -mode test-driver-gnu -coverage
Command => ./Test_Driver/Test_Driver
Command => ./Test_Driver/Test_Driver -v
Command => ./Test_Driver/Test_Driver -s 'Hello FLAP' -i 2
Command => ./Test_Driver/Test_Driver 33.0 -s 'Hello FLAP' --integer_list 10 -3 87 -i 3 -r 64.123d0 --boolean --boolean_val .false.
Command => gcov -o Test_Driver/obj/ src/*
Command => FoBiS.py rule -gcov_analyzer wiki/ Coverage-Analysis
Command => rm -f *.gcov
The rules should be self-explicative.
Bad choice :-)
However, a makefile (generated by FoBiS.py...) to be used with a compatible GNU Make tool is provided.
It is convenient to clone the whole FLAP repository and run a standard make:
git clone --recursive https://github.com/szaghi/FLAP
cd FLAP
make
This commands build all tests (executables are in exe/
directory). To build only the library (statically linked) type:
git clone --recursive https://github.com/szaghi/FLAP
cd FLAP
make STATIC=yes
Bad choice :-)
However, a CMake setup (kindly developed by victorsndvg) is provided.
It is convenient to clone the whole FLAP repository and run a standard CMake configure/build commands:
git clone --recursive https://github.com/szaghi/FLAP $YOUR_FLAP_PATH
mkdir build
cd build
cmake $YOUR_FLAP_PATH
make
If you want to run the tests suite type:
git clone --recursive https://github.com/szaghi/FLAP $YOUR_FLAP_PATH
mkdir build
cd build
cmake -DFLAP_ENABLE_TESTS=ON $YOUR_FLAP_PATH
make
ctest
Home | About | Getting Started Guide | Usage | Copyright © 2016 szaghi