-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJamroot
226 lines (186 loc) · 6.13 KB
/
Jamroot
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# Copyright 2004-2008 Spencer Olson
# Usage:
#
# bjam [options] [properties] [install|stage]
#
# Builds and installs olson-tools.
#
# Targets and Related Options:
#
# install Install headers and compiled library files to the
# ======= configured locations (below).
#
# --prefix=<PREFIX> Install architecture independent files here.
# Default; C:\olson-tools on Win32
# Default; /usr/local on Unix. Linux, etc.
#
# --exec-prefix=<EPREFIX> Install architecture dependent files here.
# Default; <PREFIX>
#
# --libdir=<DIR> Install library files here.
# Default; <EPREFIX>/lib
#
# --includedir=<HDRDIR> Install header files here.
# Default; <PREFIX>/include
#
# stage Build and install only compiled library files
# ===== to the ./stage directory.
#
# Other Options:
#
# --build-dir=DIR Build in this location instead of building
# within the distribution tree. Recommended!
#
# --help This message.
#
# Properties:
#
# toolset=toolset Indicates the toolset to build with.
#
# variant=debug|release Select the build variant
#
# link=static|shared Whether to build static or shared libraries
#
# threading=single|multi Whether to build single or multithreaded binaries
#
# runtime-link=static|shared
# Whether to link to static or shared C and C++ runtime.
#
import mpi ; # for converting xml2-config output to features.
import os ;
import testing ; # for unit tests
import path ; # for getting a better glob
import package ; # used for installing whole package (provides --prefix related
# options )
path-constant TOP : . ;
#constant VERSION : [ MATCH "\\$Revision: *([0-9]*) *\\$" : "$Revision: 636 $" ] ;
constant VERSION : [ SHELL "printf `cd $(TOP); git describe 2> /dev/null` || printf olson-tools-0.1.0 " ] ;
local xml2-features = [ mpi.cmdline_to_features [ SHELL "printf '%s ' compiler `xml2-config --cflags --libs`" ] ] ;
rule supports_fast_pow ( )
{
# this will not work for the pgi compiler
if [ MATCH "([xX]86).*" : [ os.platform ] ]
{
return
<toolset>gcc:<define>USE_SPENCERS_FAST_POW
<toolset>pathscale:<define>USE_SPENCERS_FAST_POW
<toolset>intel:<define>USE_SPENCERS_FAST_POW
;
}
}
use-project /physical : ../physical ;
use-project /boost : ../boost ;
project /olson-tools
: requirements
$(xml2-features)
<threading>multi:<define>USE_PTHREAD
<define>OLSON_TOOLS_VERSION=\\\"$(VERSION)\\\"
[ supports_fast_pow ]
: usage-requirements
$(xml2-features)
<threading>multi:<define>USE_PTHREAD
<define>OLSON_TOOLS_VERSION=\\\"$(VERSION)\\\"
[ supports_fast_pow ]
;
alias headers : : : : <include>src ;
# the xml piece uses <library>/physical//physical, though it is not necessary if
# you don't use the 'physical-parse' stuff.
# there could be some other pieces that will require this too.
# Maybe I should isolate the things that require linkage to the physical
# library a little better.
alias xml : : : : <library>/olson-tools//headers <library>/physical//calc ;
lib random
: src/olson-tools/random/random.cpp
: <link>static
<library>/olson-tools//headers
;
lib fit
: src/olson-tools/fit/debug.cpp
src/olson-tools/fit/Gene.cpp
src/olson-tools/fit/io.cpp
: <link>static
<library>/olson-tools//headers
<library>/olson-tools//random
;
lib pow
: src/olson-tools/power.c
: <link>static
<library>/olson-tools//headers
;
lib misc
: src/olson-tools/options.cpp
src/olson-tools/logger.c
src/olson-tools/3j.c
src/olson-tools/util.cpp
src/olson-tools/m_eps.cpp
: <link>static
<library>/olson-tools//headers
;
# need special compilation for libtrapfe.a
obj trapfe
: src/olson-tools/trapfe.cpp
: <optimization>off <variant>debug
<library>/olson-tools//headers
# : <os>sunos:<define>__EXTENSIONS__<include>/opt/SUNWspro/WS6U2/include/cc
;
obj rk
: src/olson-tools/rk.F
: #properties
<library>/olson-tools//headers
<toolset>gcc:<fflags>-ffree-form
<toolset>intel:<fflags>-free
<toolset>pathscale:<fflags>"-freeform -fno-second-underscore"
<toolset>pgi:<fflags>"-Mfreeform -Mnosecond_underscore"
<link>static
:
: # usage requirements
<toolset>pathscale:<linkflags>-lpathfortran
<toolset>gcc:<linkflags>-lgfortran
<toolset>intel:<linkflags>"-lifcore -lifport"
<toolset>pgi:<linkflags>"-lpgf90 -lpgf90rtl -lpghpf2 -lpghpf_rpm1 -lpgftnrtl"
;
# installation configuration
# options:
install-properties =
<install-no-version-symlinks>on
;
if [ modules.peek : NT ] {
install-properties += <install-default-prefix>C:/olson-tools ;
} else if [ modules.peek : UNIX ] {
install-properties += <install-default-prefix>/usr/local ;
}
# the list of libraries to build and install
local libraries = random fit pow misc trapfe ; #rk ;
# all headers to install
local all_headers = [ path.glob-tree src : *.h *.cpp : .svn ] ;
# docs to install
local docs = [ path.glob-tree docs/api/html docs/api/latex : * : .svn ] ;
# Complete install allowing --prefix and related command line options
alias install : install-code install-docs ;
explicit install ;
# Complete install allowing --prefix and related command line options
package.install install-code
: $(install-properties)
<install-source-root>$(TOP)/src
:
: $(libraries)
: $(all_headers)
;
explicit install-code ;
# install data allowing --prefix and related command line options
package.install install-docs
: $(install-properties)
<install-source-root>$(TOP)
<install-header-subdir>../share/olson-tools
:
:
: $(docs)
;
explicit install-docs ;
# install the libs into a staging dir
install stage : $(libraries) ;
explicit stage ;
#
# figure out the way to install this:
# pkgconfig_DATA = olson-tools.pc
#