1 Below are the build instructions for Raspbian Jessie (November 2015)
3 These instructions assume that your Raspbian installation is up and running with
4 full network access. If not, please visit the following Web sites for further
5 instructions. As always, Google will also be your friend.
6 https://www.raspberrypi.org/documentation/
7 https://www.raspberrypi.org/downloads/raspbian/
9 * Update your Raspbian installation:
14 * Install required packages:
16 sudo apt-get install git gcc cmake bison flex make build-essential \
17 bison zlib1g-dev qt4-dev-tools libqt4-dev libopenmpi-dev openmpi-bin \
18 rpm libncurses-dev libxt-dev libboost-system-dev libboost-thread-dev \
19 libgmp-dev libmpfr-dev
21 * Create the foam-extend installation directory:
23 These instructions assume that you install in the default location, which is
24 ~/foam/ . Create this folder with:
28 * Obtain and unpack source code (if you read this, you probably already have):
30 The recommended way is to get the source code through git source code
31 management system. This way, you can get updates and bugfixes easily by running
32 "git pull". To install into the default location run:
35 git clone git://git.code.sf.net/p/foam-extend/foam-extend-3.2
37 * For Raspbian, you need to customize your file etc/prefs.sh in order to enable
38 the usage of system-provided packages, and to enable the compilation of other.
40 Here is a list of commands that will do just that. You can copy/paste
41 the following block of commands in a control terminal in order to make
42 the necessary adjustments. You will need to be located at the root of your
43 foam-extend-3.2 installation for those commands to work.
45 ### - Start to copy commands here ###########################################
47 cd ~/foam/foam-extend-3.2
49 # Create a prefs.sh file
50 cp etc/prefs.sh-EXAMPLE etc/prefs.sh
53 cat <<'EOF' >> patch.txt
54 --- etc/prefs.sh-EXAMPLE 2015-11-26 05:01:05.676022832 +0000
55 +++ etc/prefs.sh 2015-12-05 17:27:58.100579669 +0000
58 # Specify system compiler
59 # ~~~~~~~~~~~~~~~~~~~~~~~
60 -#compilerInstall=System
61 +compilerInstall=System
65 # Specify system openmpi
66 # ~~~~~~~~~~~~~~~~~~~~~~
68 # The other openmpi related variables will be initialized using
69 # the command mpicc --showme:
71 -#export WM_MPLIB=SYSTEMOPENMPI
72 -#export OPENMPI_DIR=path_to_system_installed_openmpi
73 -#export OPENMPI_BIN_DIR=$OPENMPI_DIR/bin
75 -#export OPENMPI_LIB_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:libdirs`"
76 -#export OPENMPI_INCLUDE_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:incdirs`"
77 -#export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
78 -#export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`"
79 +export WM_MPLIB=SYSTEMOPENMPI
80 +export OPENMPI_DIR=/usr
81 +export OPENMPI_BIN_DIR=$OPENMPI_DIR/bin
83 +export OPENMPI_LIB_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:libdirs`"
84 +export OPENMPI_INCLUDE_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:incdirs`"
85 +export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
86 +export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`"
88 # Specify system installed ThirdParty packages/libraries
89 # NB: The packages installed under $WM_THIRD_PARTY_DIR
92 #export WM_THIRD_PARTY_USE_GCC_492=1
93 #export WM_THIRD_PARTY_USE_GCC_484=1
94 -#export WM_THIRD_PARTY_USE_GCC_474=1
95 #export WM_THIRD_PARTY_USE_GCC_463=1
96 #export WM_THIRD_PARTY_USE_GCC_451=1
97 #export WM_THIRD_PARTY_USE_GCC_445=1
99 #export WM_THIRD_PARTY_USE_M4_1416=1
100 #export WM_THIRD_PARTY_USE_BISON_27=1
101 #export WM_THIRD_PARTY_USE_FLEX_2535=1
102 -export WM_THIRD_PARTY_USE_CMAKE_322=1
103 +#export WM_THIRD_PARTY_USE_CMAKE_322=1
104 +unset WM_THIRD_PARTY_USE_CMAKE_322
110 # Patch the file prefs.sh
111 patch -p0 < patch.txt
118 ### - Stop to copy commands here ###########################################
119 ############################################################################
122 * Set environment variables:
124 cd ~/foam/foam-extend-3.2
127 * Before compiling on the Raspberry Pi 2:
129 Even though the Raspberry Pi2 has a more onboard RAM memory (1 GB), it cannot
130 compile some parts of foam-extend in parallel without borrowing some virtual
131 memory (swap). Depending on your system configuration and the amount of enabled
132 services on your Raspberry Pi, you might even ran out of memory completely. So
133 it is recommended not to compile foam-extend in parallel unless you keep an eye
134 regularly on the compilation process and adjust your environment variable
135 WM_NCOMPPROCS accordingly so you can compile some libraries/applications in
136 parallel and some others using just 1 core.
138 export WM_NCOMPPROCS=1 # or maybe 2
142 # This will take a very long time but it will compile completely
143 ./Allwmake.firstInstall
146 * Create user directory:
151 And you are ready to start.