-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
94 lines (62 loc) · 2.49 KB
/
README.txt
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
PURPOSE
=======
This is an "umbrella" of many projects in the OPM suite. Its purpose is
to provide a way to build everything in one go. It demonstrates two
features:
A. How to use sub-modules to maintain a consistent suite of projects
B. How to use a top-level CMake project to drive the build
These two items are orthogonal; you can have one, the other or both at
the same time.
Notice that a bug/feature (depending on what you want) of Git submodules
is that the submodule is pinned to a particular version of the project,
and does not automatically track the running head/tip of the repository.
You can of course update the subdirectory, but if you want that change
to be persistent, you must do a commit in the parent directory, as if
the version of the submodule was the content of a file under version
control.
DIRECTORY ORGANIZATION
======================
I have a src directory which contains this project; all the individual
projects will be created as sub-directory underneath that one. Then I
have a build directory with the corresponding structure but in a
different location. It will look like this:
~ / opm / src / opm-core
/ dune-cornerpoint
/ opm-porsol
/ bld / opm-core
/ dune-cornerpoint
/ opm-porsol
BASIC USAGE
===========
# 0. Create directory structure
mkdir -p ~/opm/bld
# 1. Get the repository from the 'net
cd ~/opm
git clone http://github.com/rolk/opm src
cd src
# 2. Add submodule urls to config file
git submodule init
# 3. Checkout the version of submodule specified in project
git submodule update
# 4. Configure and build with:
cd ../bld
cmake ../src -DBUILD_SHARED_LIBS=ON
env MAKEFLAGS="-j 5 -l 3" ionice -c2 -n7 nice -20 cmake --build .
The degree of parallelism depends on your system; in particular, if
you run this on your workstation you don't want the build to outcrowd
your X11 server! A rule of thumb is that the number of simultaneous
processes ("-j" parameter) should be:
j = min (num of cores + 1, num of GiB RAM - 1)
and the load limit ("-l" parameter) should be:
l = num of cores - 1
UPDATING LINKS TO SUB-PROJECTS
==============================
# 1. Retrieve latest tip of all sub-projects
for module in $(cmake -P projects.cmake); do
(cd $module ; git pull origin && git submodule update)
done
# 2. Check-in these pointers
for module in $(cmake -P projects.cmake); do
git add $module
done
git commit