Repository navigation
CoderFAQ
Create a new build directory when switching to another compiler!
Using gfortran
export CC=clang; export CXX=clang++; export FC=gfortran you can also use the Intel Fortran compiler (see below for compilervars.sh)
export CC=clang; export CXX=clang++; export FC=ifort to download the intel compilers follow the instructions on the intel homepage. You will need at least the basekit and the hpckit. Additionally, you need to activate the API kits, e.g., via calling
. /opt/intel/oneapi/setvars.shfor all users or
. ~/intel/oneapi/setvars.shfor a single user. You can add one of these commands to your .bashrc / .zshrc file to activate automatically when opening the terminal.
Check your installation by typing icc --version and icpc --version.
another, perhaps deprecated way is to source compilervars.sh to set your path, e.g.,
source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh intel64in your .bashrc.
To use the intel compilers, then set the environment variables:
export CC=icc; export CXX=icpc; export FC=ifort before you do the first cmake / ccmake in your build folder. If you have no ifort you can use gfortran. Note that icc and icpc are deprecated and will be replaced by ipx and icpx in future.
For a standard freshly created cfs build directory no parallel make (make -j) is possible for the initial make due to the integration of cfsdeps via external projects. However, there is a chance that it works with precompiled cfsdeps as
make cfsdeps -jafter that you can build cfs via
make cfsbin -jor just
make -j- To export all variables available within cmake call DISPLAY_ALL_VARIABLES() which is defined in CFS_macros.cmake
- if you use cmake .. instead of ccmake .. you see the full output. cmake .. does twice configure and then generate.
- useful cmake variables: https://cmake.org/Wiki/CMake_Useful_Variables
Very helpful is to see what is actually compiled and linked:
export VERBOSE=1Then execute "make". You can now examine the gcc command end even copy -> modify -> paste. Unset by unset VERBOSE
A log file of all the linking options might be cleaned to separate lines via
sed 's|../../|\n|g' link_release.txtYou might want to add the linker command -Wl,--verbose so see how the libs are searched.
This is a script for searching for (unresolved) symbols. You have to edit the symbol and search path inside the script. https://cfs.mdmt.tuwien.ac.at/trac/attachment/wiki/DevelopCfs/recursive_nm.py
The message means that the application tried to access invalid memory - typically via null or uninitialized pointer. In the CFS case, when CFS runs with
cfs -fmight also mean that an exception occured. You then see the error message followed by the segmentation fault.
For PiezoSIMP one mechanic and one electrostatic load must be defined
In file 'NO_FILENAME'
Segmentation fault
- invalid memory access and memory leaks can be found with valgrinds memcheck tool.
- This is is a good introductory article (in German): http://www.heise.de/developer/artikel/Einfuehrung-in-die-Arbeit-mit-Valgrind-und-Memcheck-Teil-1-2480976.html
- valgrid reports a lot of false errors ins libs (e.g. printing lines), the background is explained in the heise article. A cure is to use a suppressions file like cfs.supp as
valgrind --tool=memcheck --suppressions=cfs.supp --track-origins=yes cfs -m bulk2d_3.mesh mech- generate a suppressions file with the help of
valgrind --tool=memcheck --gen-suppressions=all --leak-check=full cfs -m bulk2d_5.mesh mec- Eclipse has a valgrind plugin which is a good frontend
- To enable debug info in release mode (line numbers) add in ccmake after toggling to advanced mode for
CMAKE_CXX_FLAGS_RELEASEthe option-g