User:Hoogs/Installation
1 1.6.x
Now that I routinely make additions and modifications of my local code, and OpenCFD provide a git repository, I no longer use a system wide installation (I now appreciate the wisdom of the OpenCFD recommendation to go with a local installation). Here are notes from a local installation on openSUSE 11.1 with WM_PROJECT_INST_DIR=$HOME/OpenFOAM. I have rarely had a problem-free compilation process (due mainly to differences between linux systems), but usually the errors are easily resolved with a little patience, and the scripting automation is gradually getting better.
cd $WM_PROJECT_INST_DIR git clone git://repo.or.cz/OpenFOAM-1.6.x.git
This created $WM_PROJECT_INST_DIR/OpenFOAM-1.6.x and $WM_PROJECT_INST_DIR/ThirdParty-1.6. The environment needs to be updated so I added
File: $HOME/.bashrc |
... source $HOME/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc ... |
and re-sourced
source ~/.bashrc
then jumped into the OpenFOAM directory and ran the Allwmake script:
cd $WM_PROJECT_INST_DIR/OpenFOAM-1.6.x ./Allwmake 2>&1 > log.wmake.00 & tail -f log.wmake.00
1.1 First error
The end of the log showed failure
7244 make[2]: *** [/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/mixtureAdiabaticFlameT] Error 1 7245 make[2]: Leaving directory `/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT' 7246 make[1]: *** [mixtureAdiabaticFlameT] Error 2 7247 make[1]: Target `application' not remade because of errors. 7248 make[1]: Leaving directory `/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical' 7249 make: *** [thermophysical] Error 2 7250 make: Target `application' not remade because of errors.
But the original error was found by searching for the first appearance of the word "Error", which indicated that mpi.h could not be found to build libPstream. The problem was that the git clone operation had created the directory ThirdParty-1.6 but $WM_THIRD_PARTY_DIR was set to $WM_PROJECT_INST_DIR/ThirdParty-1.6.x. When the directory was renamed, mpi.h was found in $WM_PROJECT_INST_DIR/ThirdParty-1.6.x/openmpi-1.3.3/platforms/linux64GccDPOpt/include. So tried again:
./Allwmake 2>&1 > log.wmake.01 & tail -f log.wmake.01
Actually, a better solution is probably to use a simlink
ln -s $WM_PROJECT_INST_DIR/ThirdParty-1.6 $WM_PROJECT_INST_DIR/ThirdParty-1.6.x
1.2 Second error
2853 g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate- >depth-40 -I/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/src /thermophysicalModels/specie/lnInclude -IlnInclude -I. -I/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/ >src/OpenFOAM/lnInclude -I/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/mixtureAdiabaticFlameT.o - >L/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt \ 2854 -lspecie -lOpenFOAM -liberty -ldl -lm -o /home/hoogland/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/mixtureAdiabaticFlameT 2855 make[2]: Leaving directory `/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical/mixtureAdiabaticFlameT' 2856 make[1]: Leaving directory `/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/thermophysical' 2857 make: Target `application' not remade because of errors.
The first sign of a problem was
2531 + cd PV3FoamReader 2532 + mkdir -p Make/linux64GccDPOpt 2533 + cd Make/linux64GccDPOpt 2534 + cmake ../.. 2535 ./Allwmake: line 14: cmake: command not found 2536 + make 2537 make[3]: Entering directory `/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/Make/ >linux64GccDPOpt' 2538 make[3]: *** No targets specified and no makefile found. Stop. 2539 make[3]: Leaving directory `/home/hoogland/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/Make/ >linux64GccDPOpt' 2540 make[2]: *** [PV3FoamReader] Error 2
This was not really an error, since Paraview needs to be built first. So following the README, i.e.
160 * Compiling Paraview 3.6.1 and the PV3FoamReader module 161 If there are problems encountered with ParaView, then it may be necessary to 162 compile ParaView from sources. The compilation 163 is a fairly simple process using the supplied makeParaView script that 164 has worked in our tests with other packages supplied in the ThirdParty 165 directory, namely cmake-2.6.4 and gcc-4.3.3. Execute the following: 166 + cd $WM_THIRD_PARTY_DIR 167 + rm -rf paraview-3.6.1/platforms 168 + makeParaView
I got
ParaView_DIR=/home/hoogland/OpenFOAM/ThirdParty-1.6.x/paraview-3.6.1/platforms/linux64Gcc removing old build/install directory ---- Configuring paraview-3.6.1 (major version: 3.6) MPI support : false Python support : false MESA support : false Qt dev support : true Source : /home/hoogland/OpenFOAM/ThirdParty-1.6.x/paraview-3.6.1 Target : /home/hoogland/OpenFOAM/ThirdParty-1.6.x/paraview-3.6.1/platforms/linux64Gcc ---- cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/hoogland/OpenFOAM/ThirdParty-1.6.x/paraview-3.6.1/platforms/linux64Gcc -DVTK_USE_TK=FALSE -DBUILD_SHARED_LIBS:BOOL=ON -DVTK_USE_RPATH:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DPARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON -DPARAVIEW_BUILD_QT_GUI=ON ../.. ---- ...
because cmake-2.6.4 was not present in the ThirdParty-1.6 directory of the git repo. Apparently cmake is available in the 32-bit ThirdParty download, but I couldn't see it. The easiest thing to do was install a system wide version as root:
cd /tmp wget wget http://download.opensuse.org/distribution/11.1/repo/oss/suse/x86_64/cmake-2.6.2-2.19.x86_64.rpm rpm -ivh cmake-2.6.2-2.19.x86_64.rpm
I wanted to build Paraview with python and mesa support (for off screen rendering) and modified the make script accordingly
File: $WM_PROJECT_INST_DIR/ThirdParty-1.6.x/makeParaView |
44 # Python support: 45 # note: script will try to determine the appropriate python library. 46 # If it fails, specify the path using the PYTHON_LIBRARY variable 47 withPYTHON=true 48 #PYTHON_LIBRARY="" 49 PYTHON_LIBRARY="$HOME/opt/Python-2.5.4/lib/libpython2.5.so.1.0" 50 PYTHON_INCLUDE="$HOME/opt/Python-2.5.4/include/python2.5" 51 52 # MESA graphics support: 53 withMESA=true 54 MESA_INCLUDE="/usr/include/GL" 55 MESA_LIBRARY="/usr/lib64/libOSMesa.so" |
I added PYTHON_INCLUDE because I have a non-standard Python installation
File: $WM_PROJECT_INST_DIR/ThirdParty-1.6.x/tools/makeParaViewFunctions |
114 if [ -n "$PYTHON_INCLUDE" ] 115 then 116 pythonInclude=$PYTHON_INCLUDE 117 # check $PYTHON_INCLUDE if it has been set 118 if [ ! -d "$pythonInclude" ] 119 then 120 echo "*** Error: python include dir not found at location specified " \ 121 "by PYTHON_INCLUDE=$pythonInclude" 122 fi 123 else 124 pythonInclude=/usr/include/python$pythonMajor 125 if [ ! -e "$pythonInclude" ] 126 then 127 echo "*** Error: Unable to determine path to python include dir." 128 fi 129 fi |