-
Notifications
You must be signed in to change notification settings - Fork 5
Compile
FiNeR has been developed on GNU/Linux architecture. Other OS are not supported (and in general there is no best alternative to GNU/Linux :-).
FiNeR relies on 4 other modules:
The most easy way to compile FiNeR is to use FoBiS.py or use the provided makefile.
Consequently, it is strongly encouraged to install FoBiS.py or a Make
program (preferably GNU make http://www.gnu.org/software/make/).
Adding FiNeR to your CMake project is also straightforward (see below).
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...). FiNeR 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 realese, 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.
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-intel
FoBiS.py build -mode static-intel
FoBiS.py build -mode shared-intel-debug
FoBiS.py build -mode static-intel-debug
The Test_Driver
directory is. The compiled objects and mod files are placed inside this directory, as well as the linked program.
FoBiS.py build -mode test-driver-intel
FoBiS.py build -mode test-driver-intel-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 FiNeR.tar.gz *
- "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 => 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.
No makefile is provided. However it can be easily written by hand or with the help of FoBiS.py 😄
git clone [email protected]:szaghi/FiNeR.git --recursive
cd FiNeR/
cmake .
make
ctest .
To use if from existing CMake project put
add_subdirectory(FiNeR)
to CMakeLists.txt
in the same directory with a recursive clone of FiNeR. To link it put
target_link_libraries(your_target FiNeR::FiNeR)
to the target related CMakeLists.txt
(it can be the same one, or in some other directory, when both FiNeR and your target are add_subdirectory() chained from some root CMakeLists.txt
)