1 Below are the build instructions for Arch Linux over the Raspberry Pi
3 These instructions assume that your Arch Linux installation is up and running on
4 the Raspberry Pi with full network access. If not, please visit the following
5 Web sites for further instructions. As always, Google will also be your friend.
6 https://www.raspberrypi.org/documentation/
7 https://wiki.archlinux.org/index.php/Raspberry_Pi
10 * Update your Arch Linux installation:
14 * Install required packages:
16 pacman -S git gcc cmake bison flex make openmpi --needed base-devel
18 * Create the foam-extend installation directory:
20 These instructions assume that you install in the default location, which is
21 ~/foam/ . Create this folder with:
25 * Obtain and unpack source code (if you read this, you probably already have):
27 The recommended way is to get the source code through git source code
28 management system. This way, you can get updates and bugfixes easily by running
29 "git pull". To install into the default location run:
32 git clone git://git.code.sf.net/p/foam-extend/foam-extend-3.2
34 * For Arch Linux, you need to customize your file etc/prefs.sh in order to enable
35 the usage of system-provided packages, and to enable the compilation of other.
37 Here is a list of commands that will do just that. You can copy/paste
38 the following block of commands in a control terminal in order to make
39 the necessary adjustments. You will need to be located at the root of your
40 foam-extend-3.2 installation for those commands to work.
42 ### - Start to copy commands here ###########################################
44 cd ~/foam/foam-extend-3.2
46 # Create a prefs.sh file
47 cp etc/prefs.sh-EXAMPLE etc/prefs.sh
50 cat <<'EOF' >> patch.txt
51 --- etc/prefs.sh-EXAMPLE 2015-11-23 22:54:50.341631348 -0500
52 +++ etc/prefs.sh 2015-12-05 13:31:02.967676779 -0500
55 # Specify system compiler
56 # ~~~~~~~~~~~~~~~~~~~~~~~
57 -#compilerInstall=System
58 +compilerInstall=System
61 # Specify system openmpi
63 # The other openmpi related variables will be initialized using
64 # the command mpicc --showme:
66 -#export WM_MPLIB=SYSTEMOPENMPI
67 -#export OPENMPI_DIR=path_to_system_installed_openmpi
68 -#export OPENMPI_BIN_DIR=$OPENMPI_DIR/bin
70 -#export OPENMPI_LIB_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:libdirs`"
71 -#export OPENMPI_INCLUDE_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:incdirs`"
72 -#export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
73 -#export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`"
74 +export WM_MPLIB=SYSTEMOPENMPI
75 +export OPENMPI_DIR=/usr
76 +export OPENMPI_BIN_DIR=$OPENMPI_DIR/bin
78 +export OPENMPI_LIB_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:libdirs`"
79 +export OPENMPI_INCLUDE_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:incdirs`"
80 +export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
81 +export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`"
83 # Specify system installed ThirdParty packages/libraries
84 # NB: The packages installed under $WM_THIRD_PARTY_DIR
87 #export WM_THIRD_PARTY_USE_GCC_492=1
88 #export WM_THIRD_PARTY_USE_GCC_484=1
89 -#export WM_THIRD_PARTY_USE_GCC_474=1
90 #export WM_THIRD_PARTY_USE_GCC_463=1
91 #export WM_THIRD_PARTY_USE_GCC_451=1
92 #export WM_THIRD_PARTY_USE_GCC_445=1
94 #export WM_THIRD_PARTY_USE_M4_1416=1
95 #export WM_THIRD_PARTY_USE_BISON_27=1
96 #export WM_THIRD_PARTY_USE_FLEX_2535=1
97 -export WM_THIRD_PARTY_USE_CMAKE_322=1
98 +#export WM_THIRD_PARTY_USE_CMAKE_322=1
99 +unset WM_THIRD_PARTY_USE_CMAKE_322
105 # Patch the file prefs.sh
106 patch -p0 < patch.txt
113 ### - Stop to copy commands here ###########################################
114 ############################################################################
117 * Set environment variables:
119 cd ~/foam/foam-extend-3.2
122 * Before compiling on the Raspberry Pi 2:
124 Even though the Raspberry Pi2 has a more onboard RAM memory (1 GB), it cannot
125 compile some parts of foam-extend in parallel without borrowing some virtual
126 memory (swap). Depending on your system configuration and the amount of enabled
127 services on your Raspberry Pi, you might even ran out of memory completely. So
128 it is recommended not to compile foam-extend in parallel unless you keep an eye
129 regularly on the compilation process and adjust your environment variable
130 WM_NCOMPPROCS accordingly so you can compile some libraries/applications in
131 parallel and some others using just 1 core.
133 export WM_NCOMPPROCS=1 # or maybe 2
137 # This will take a very long time but it will compile completely
138 ./Allwmake.firstInstall
141 * Create user directory:
146 And you are ready to start.