forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boost.spec
79 lines (70 loc) · 2.02 KB
/
boost.spec
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
### RPM external boost 1.72.0
%define tag 88b813f91130f8d34977861990c24d8c0e3b6e47
%define branch cms/v%realversion
%define github_user cms-externals
Source: git+https://github.com/%github_user/%n.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz
Requires: python bz2lib zlib openmpi xz zstd
%prep
%setup -n %{n}-%{realversion}
%build
case %cmsos in
osx*) TOOLSET=darwin ;;
*) TOOLSET=gcc ;;
esac
pushd tools/build
sh bootstrap.sh ${TOOLSET}
mkdir ./tmp-boost-build
./b2 install --prefix=./tmp-boost-build
export PATH=${PWD}/tmp-boost-build/bin:${PATH}
popd
# enable boost::mpi
echo "using mpi ;" > user-config.jam
b2 -q \
-d2 \
%{makeprocesses} \
--build-dir=build-boost \
--disable-icu \
--without-atomic \
--without-container \
--without-context \
--without-coroutine \
--without-exception \
--without-graph \
--without-graph_parallel \
--without-locale \
--without-log \
--without-math \
--without-random \
--without-wave \
--user-config=${PWD}/user-config.jam \
toolset=${TOOLSET} \
link=shared \
threading=multi \
variant=release \
-sBZIP2_INCLUDE=${BZ2LIB_ROOT}/include \
-sBZIP2_LIBPATH=${BZ2LIB_ROOT}/lib \
-sZLIB_INCLUDE=${ZLIB_ROOT}/include \
-sZLIB_LIBPATH=${ZLIB_ROOT}/lib \
-sLZMA_INCLUDE=${XZ_ROOT}/include \
-sLZMA_LIBPATH=${XZ_ROOT}/lib \
-sZSTD_INCLUDE=${ZSTD_ROOT}/include \
-sZSTD_LIBPATH=${ZSTD_ROOT}/lib \
stage
%install
case %{cmsos} in
osx*) so=dylib ;;
*) so=so ;;
esac
mkdir -p %{i}/lib %{i}/include
# copy files around in their final location.
# We use tar to reduce the number of processes required
# and because we need to build the build hierarchy for
# the files that we are copying.
pushd stage/lib
find . -name "*.${so}*" -type f | tar cf - -T - | (cd %{i}/lib; tar xfp -)
popd
find boost -name '*.[hi]*' | tar cf - -T - | ( cd %{i}/include; tar xfp -)
for l in $(find %{i}/lib -name "*.${so}.*")
do
ln -s $(basename ${l}) $(echo ${l} | sed -e "s|[.]${so}[.].*|.${so}|")
done