Skip to content
Snippets Groups Projects
Commit 26efc6a4 authored by Michael Blaschek's avatar Michael Blaschek :bicyclist:
Browse files

Update Fortran/Compilers.md

parent 1bfb04ac
Branches
Tags
No related merge requests found
# 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.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment