diff --git a/Fortran/Compilers.md b/Fortran/Compilers.md new file mode 100644 index 0000000000000000000000000000000000000000..8d4aa29e7cf5b39ce1e031fc2a89a8dc19e1d107 --- /dev/null +++ b/Fortran/Compilers.md @@ -0,0 +1,23 @@ +# Compiling & Building + +under development :) + +## Makefile + + +### Environmental Modules & Makefile + +It is quite handy to use environmental modules and load different version of libraries, but how to make use of these ever changing **PATHs**. Take a look at the following examples to help with making your `Makefile` ready for modules. + +``` +# use the environmental variable $INCLUDE +# split the paths separated by : +INC = $(subst :, ,$(INCLUDE)) +# add a -I/path/to/include +INC := $(INC:%=-I%) +# use the environmental variable $LIBRARY_PATH +LIBS = $(subst :, ,$(LIBRARY_PATH)) +LIBS := $(LIBS:%=-L%) +``` + +With this code snippet in your Makefile you should be able to use environmental variables such as `$INCLUDE` or `$LIBRARY_PATH` efficiently. These paths adapt to your loaded modules.