-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboost.build
50 lines (46 loc) · 1.84 KB
/
boost.build
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
@LSST UPS@ &&
# their version name
version=@VERSION.replace(".", "_")@ &&
# but 1_35_0 is installed as 1_35 grrrrr
installed_version=@VERSION.replace(".", "_").sub(r"(_0)*$", "")@ &&
# change to false if you don't want to download source again
if true; then
curl -L \
http://downloads.sourceforge.net/boost/boost_$version.tar.gz \
> @PRODUCT@-@VERSION@.tar.gz &&
gunzip < @PRODUCT@-@VERSION@.tar.gz | tar -xf - &&
rm -rf @PRODUCT@-@VERSION@ &&
mv @PRODUCT@_$version @PRODUCT@-@VERSION@
fi &&
cd @PRODUCT@-@VERSION@ &&
product_dir=$(eups path 0)/$(eups flavor)/@PRODUCT@/@VERSION@ &&
# Parallelisation on Linux
parallel=-j2 &&
if [ -e /proc/cpuinfo ]; then
nproc=`grep '^processor' /proc/cpuinfo | sort -r | head -1 | sed -e 's/^.*: //'`
ncores=`grep '^cpu cores' /proc/cpuinfo | head -1 | sed -e 's/^.*: //'`
[ -n "$nproc" -a -n "$ncores" ] && {
totcores=$(( ($nproc + 1) * $ncores ))
if [ "$totcores" -gt 4 ]; then
parallel=-j6
elif [ "$totcores" -gt 2 ]; then
parallel=-j4
fi
}
fi &&
# Apply patch
if [ @VERSION@ == "1.51.0" ]; then
git archive --format=tar --remote=git://hsca.ipmu.jp/repos/devenv/buildFiles.git HEAD boost-gil-clang-c++11-narrowing.patch | tar --extract --verbose
patch -p0 boost/gil/channel_algorithm.hpp < boost-gil-clang-c++11-narrowing.patch || echo Unable to apply patch
elif [ @VERSION@ == "1.55.0" ]; then
git archive --format=tar --remote=git://hsca.ipmu.jp/repos/devenv/buildFiles.git HEAD boost-clang3.4-int128.patch | tar --extract --verbose &&
patch -p1 < boost-clang3.4-int128.patch || echo Unable to apply patch
fi &&
# Test for clang
C=$(basename "$CXX")
if [ "${C:0:5}" == "clang" ]; then
toolset="toolset=clang"
fi &&
./bootstrap.sh --prefix=$product_dir &&
./b2 $parallel $toolset install &&
lsst_ups @PRODUCT@ @VERSION@ $product_dir