Skip to content

Commit 36313f7

Browse files
committed
Merge pull request #4 from gijsbers/master
Update How-To-Build guide to new Github situation. Add a handy install script.
2 parents 30159ed + 8abe5e3 commit 36313f7

File tree

2 files changed

+193
-17
lines changed

2 files changed

+193
-17
lines changed

content/howtobuild.markdown

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,26 @@ layout: pages
33
title: Setting up and compiling
44
---
55

6-
1. First define some handy environment variables for your
6+
1. As an alternative to this How-To-Build-Guide a
7+
single script which installs everything automatically
8+
can be found [here](install-snet?raw=true). Edit the destination
9+
directories at the top of this script and then execute it.
10+
11+
12+
2. First define some handy environment variables for your
713
preferred installation directory prefixes:
814

915
`export PCL_PREFIX=/your/PCL/prefix`
1016
`export LPEL_PREFIX=/your/LPEL/prefix`
1117
`export SNET_PREFIX=/your/SNET/prefix`
1218

1319
They may very well have the same prefix destinations
14-
such as "`/usr/local`". In the remainder of this page we will
20+
such as "`/usr/local`" or "`$PWD/build`".
21+
In the remainder of this page we will
1522
use these variables to install the PCL, LPEL and S-Net software to.
1623

1724

18-
2. Install
25+
3. Install
1926
[libPCL](http://www.xmailserver.org/libpcl.html)
2027
- the GNU Portable Coroutine Library, currently
2128
[version 1.12](http://www.xmailserver.org/pcl-1.12.tar.gz)
@@ -29,13 +36,6 @@ title: Setting up and compiling
2936
`cd ..`
3037

3138

32-
3. In case the PCL libraries have been installed into
33-
`$PCL_PREFIX/lib64` move them to `$PCL_PREFIX/lib`:
34-
35-
`mkdir -p $PCL_PREFIX/lib`
36-
`mv -f $PCL_PREFIX/lib64/libpcl* $PCL_PREFIX/lib/.`
37-
38-
3939
4. Use [Git](http://git-scm.com) to clone
4040
the LPEL repository from [Github](https://github.com),
4141
build and install it:
@@ -52,11 +52,6 @@ title: Setting up and compiling
5252
`make install`
5353
`cd ..`
5454

55-
In case the LPEL libraries were installed into `$LPEL_PREFIX/lib64`
56-
move them to `$LPEL_PREFIX/lib`:
57-
58-
`mv -f $LPEL_PREFIX/lib64/liblpel* $LPEL_PREFIX/lib/.`
59-
6055

6156
5. Clone the snet-runtime repository from Github, build and install it:
6257

@@ -93,8 +88,8 @@ title: Setting up and compiling
9388

9489

9590
8. Download the S-Net compiler archive:
96-
[Linux x86_64](https://github.com/snetdev/releases/blob/master/2013/merijn/snetc-20130206.x86_64),
97-
[OS X](https://github.com/snetdev/releases/blob/master/2013/merijn/snetc-20130206.osx)
91+
[Linux x86_64](https://github.com/snetdev/releases/blob/master/2013/snetc-20130425.x86_64.bz2?raw=true),
92+
[OS X](https://github.com/snetdev/releases/blob/master/2013/merijn/snetc-20130206.osx?raw=true)
9893

9994
The archive contains a compiled binary. For convenience you may want to consider placing the compiler binary into a directory in your $PATH.
10095

content/install-snet

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
#!/bin/bash
2+
#
3+
# This script installs PCL, LPEL and S-Net.
4+
# Please set the 3 *_PREFIX environment variables
5+
# to your liking before invoking this script.
6+
#
7+
8+
# Abort on error
9+
set -e
10+
11+
# Where to install PCL to
12+
export PCL_PREFIX=$PWD/build
13+
14+
# Where to install LPEL to
15+
export LPEL_PREFIX=$PWD/build
16+
17+
# Where to install SNET-RTS to
18+
export SNET_PREFIX=$PWD/build
19+
20+
# Where to get PCL from
21+
export PCL_DIST=http://www.xmailserver.org/pcl-1.12.tar.gz
22+
23+
# Where to get LPEL from
24+
export LPEL_REPO=https://github.com/snetdev/lpel.git
25+
26+
# Where to get SNET-RTS from
27+
export SNET_REPO=https://github.com/snetdev/snet-rts.git
28+
29+
# Where to get the S-Net compiler
30+
export COMPILER_LINUX_64="https://raw.github.com/snetdev/releases/master/2013/snetc-20130507.x86_64.bz2"
31+
export COMPILER_LINUX_32="https://raw.github.com/snetdev/releases/master/2013/snetc-20130507.i686.bz2"
32+
33+
mkdir -p $PCL_PREFIX $LPEL_PREFIX $SNET_PREFIX
34+
35+
function get_pcl () {
36+
if [ ! -f pcl-1.12.tar.gz ]; then
37+
wget $PCL_DIST
38+
fi
39+
}
40+
41+
function build_pcl () {
42+
tar zxf pcl-1.12.tar.gz
43+
cd pcl-1.12
44+
./configure --prefix=$PCL_PREFIX
45+
make
46+
make check
47+
make install
48+
cd ..
49+
}
50+
51+
function get_lpel () {
52+
if [ ! -x lpel/build-aux/bootstrap ]; then
53+
rm -rf lpel
54+
git clone $LPEL_REPO
55+
elif [ -d lpel ]; then
56+
cd lpel
57+
git pull
58+
[ -f Makefile ] && make distclean || true
59+
cd ..
60+
fi
61+
}
62+
63+
function build_lpel () {
64+
cd lpel
65+
sed -e 's/LT_PREREQ(.*)/LT_PREREQ([2.2])/' < configure.ac > configure.$$
66+
mv -f configure.$$ configure.ac
67+
./build-aux/bootstrap
68+
69+
./configure --with-pcl=$PCL_PREFIX \
70+
--with-mctx=pcl \
71+
--prefix=$LPEL_PREFIX --disable-hwloc
72+
73+
make
74+
make install
75+
cd ..
76+
}
77+
78+
function get_snet_rts () {
79+
if [ ! -x snet-rts/bootstrap ]; then
80+
rm -rf snet-rts
81+
git clone $SNET_REPO
82+
elif [ -d snet-rts ]; then
83+
cd snet-rts
84+
git pull
85+
[ -f Makefile ] && make distclean || true
86+
cd ..
87+
fi
88+
}
89+
90+
function build_snet_rts () {
91+
if [ -f "$LPEL_PREFIX/lib64/liblpel.so.0.0.0" ]; then
92+
lpel=$LPEL_PREFIX/lib64
93+
elif [ -f "$LPEL_PREFIX/lib/liblpel.so.0.0.0" ]; then
94+
lpel=$LPEL_PREFIX/lib
95+
else
96+
echo "$0: Could not locate the installed LPEL libraries!" >&2
97+
exit 1
98+
fi
99+
100+
cd snet-rts
101+
sed -e 's/LT_PREREQ(.*)/LT_PREREQ([2.2])/' < configure.ac > configure.$$
102+
mv -f configure.$$ configure.ac
103+
./bootstrap
104+
105+
./configure --with-lpel-includes=$LPEL_PREFIX/include \
106+
--with-lpel-libs=$lpel \
107+
--disable-dist-mpi \
108+
--prefix=$SNET_PREFIX
109+
110+
make
111+
make install
112+
cd ..
113+
}
114+
115+
function get_snetc () {
116+
case "`uname -p`" in
117+
i?86) COMPILER=$COMPILER_LINUX_32 ;;
118+
x86_64) COMPILER=$COMPILER_LINUX_64 ;;
119+
*) echo "$0: Unknown platform. Not downloading a compiler..." ;;
120+
esac
121+
if [ "$COMPILER" != "" ]; then
122+
raw=${COMPILER##*/}
123+
bz2=${raw%\?*}
124+
snc=${bz2%.bz2}
125+
rm -fv -- "$raw" "$bz2" "$snc"
126+
wget "$COMPILER"
127+
if [ "$raw" != "$bz2" ]; then
128+
mv -f "$raw" "$bz2"
129+
fi
130+
bunzip2 "$bz2"
131+
chmod +x "$snc"
132+
fi
133+
}
134+
135+
function show_env () {
136+
137+
if [ -f "$LPEL_PREFIX/lib64/liblpel.so.0.0.0" ]; then
138+
lpel=$LPEL_PREFIX/lib64
139+
elif [ -f "$LPEL_PREFIX/lib/liblpel.so.0.0.0" ]; then
140+
lpel=$LPEL_PREFIX/lib
141+
else
142+
echo "$0: Could not locate the installed LPEL libraries!" >&2
143+
exit 1
144+
fi
145+
if [ -f "$SNET_PREFIX/lib64/snet/libC4SNet.so.0.0.0" ]; then
146+
snet=$SNET_PREFIX/lib64/snet
147+
elif [ -f "$SNET_PREFIX/lib/snet/libC4SNet.so.0.0.0" ]; then
148+
snet=$SNET_PREFIX/lib/snet
149+
else
150+
echo "$0: Could not locate the installed SNet libraries!" >&2
151+
exit 1
152+
fi
153+
154+
echo
155+
echo "### The following variables should be added to your environment:"
156+
echo
157+
echo "export SNET_INCLUDES=$SNET_PREFIX/include/snet"
158+
echo "export SNET_LIBS=$snet"
159+
echo "export SNET_MISC=$SNET_PREFIX/share/snet"
160+
161+
echo "export LD_LIBRARY_PATH=$snet:$lpel":'$LD_LIBRARY_PATH'
162+
}
163+
164+
function do_fun () {
165+
echo
166+
echo "##############################################################################"
167+
echo "### executing $1 "
168+
eval $1
169+
}
170+
171+
do_fun get_pcl
172+
do_fun build_pcl
173+
do_fun get_lpel
174+
do_fun build_lpel
175+
do_fun get_snet_rts
176+
do_fun build_snet_rts
177+
do_fun get_snetc
178+
do_fun show_env
179+
180+
exit 0
181+

0 commit comments

Comments
 (0)