forked from bendudson/BOUT
-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile.README
53 lines (32 loc) · 1.35 KB
/
makefile.README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
A quick tutorial for the new makefile system:
There are two modes for adding to BOUT++:
1) Writing an example or executable (see **EXAMPLES**)
2) Adding a feature to BOUT++ (see **BOUT++ MODULE**)
+++ In all makefiles, BOUT_TOP is required! +++
**EXAMPLES**:
If writing an example (or physics module that executes) then the makefile is very simple:
>>>>>>>>>
BOUT_TOP = ../..
SOURCEC = <filename>.cpp
include $(BOUT_TOP)/make.config
<<<<<<<<<
where,
BOUT_TOP - refers to the relative (or absolute) location of the BOUT directory (the one that includes '/lib' and '/src')
SOURCEC - is the name of your file, e.g. gas_compress.cpp
--Optional--
TARGET - defines what the executable should be called (e.g. if you multiple source files)
That's it!
**BOUT++ MODULE**:
If you are writing a new module (or concrete implementation), then it is again pretty simple
>>>>>>>>>
BOUT_TOP = ../..
SOURCEC = communicator.cpp difops.cpp geometry.cpp grid.cpp interpolation.cpp topology.cpp
SOURCEH = $(SOURCEC:%.cpp=%.h)
INCLUDE = -I../sys -I../field -I../fileio -I../invert
TARGET = lib
include $(BOUT_TOP)/make.config
<<<<<<<<<
TARGET - must be 'lib' to signify you are adding to libbout++.a
The other variables should be pretty self explanatory.
+++ Adding a new subdirectory to 'src?' +++
No worries, just make sure to edit src/makefile to add it to the DIRS variable