fixed writing out entries in advective bc
[openfoam-extend-OpenFOAM-1.6-ext.git] / ThirdParty / README.ThirdParty
blob4305ee83ba4c432e4ee35319aa7944c8c881e4e0
1 A new design for the ThirdParty packages:
2 =========================================
4 The main purpose of this new development is to build a complete ThirParty packages set for OpenFOAM 1.6-ext using only the original package source
5 tarball and some patch files ( when necessary).
7 A useful by-product of this development is also to provide some kind of binary packaging of the ThirdParty packages. 
9 The RPM suite of tools was selected to develop a first prototype. 
10 The whole process needs to run and install in user-space, without the need to be root for installing the packages. 
12 Here is what's available:
14  a: A set of rpm spec files for specific ThirdParty packages.
15  b: A suite of bash scripts to automate the complete sequence of downloading, compiling, installing and generating RPMs.
16  c: An empty directory structure pre-configured and ready to proceed with the download, compilation and installation of
17     chosen ThirdParty packages for OF-1.6-ext.
19 Quick description of the main scripts:
20 -------------------------------------- 
21    a: AllMake:
22       Main wrapper script that will call AllMake.stage0 to AllMake.stage4 scripts in sequence.
24    b: AllMake.stage0:
25       This script is useful only for populating what I am calling the local "RPM vault" with pre-generated RPMs.
26       This is the script written to address the use-case: "I have some pre-generated RPM files, now what"
27       Basically, you call this script with a list of RPMs generated by the AllMake.stage(1-4) in order to populate the local  RPMS  vault.
28       Once in place, these are the RPMs will be installed instead of proceeding with the standard compilation process.
30    c: AllMake.stage1:
31       This script is taking care of the basic ThirdParty tools like compilers, cmake , python, etc.
32       If we ever need to override the local version of flex or bison, this is where we will add those additional packages.
33       This stage will also generate a .sh and .csh file one needs to source in order to initialize the PATH and LD_LIBRARY_PATH env. variable.
34       If you need to compile the rest of the ThirdParty packages with a new gcc compiler, you will need to source those .sh or .csh file in before activating the other
35       AllMake.stage(2-4) scripts.
37    d: AllMake.stage2:
38       This script is taking care of the MPI communication libraries. Right now, only OpenMPI is supported.
39       This stage will also generate a .sh and .csh file one needs to source in order to initialize the PATH and LD_LIBRARY_PATH env. variable.
40       You will need to source those .sh or .csh file in before activating the other AllMake.stage(3-4) scripts because some packages depends on the communication library.
42    e: AllMake.stage3:
43       This script is taking care of the "standard" ThirdParty libraries like metis, scotch, mesquite, etc.
44       This stage will also generate a .sh and .csh file one needs to source in order to initialize the PATH and LD_LIBRARY_PATH env. variable.
45       You will need to source those .sh or .csh file in before compiling OpenFOAM because some "Make/options" files will refer to environment variable that are
46       specific to those packages
48    f: AllMake.stage4:
49       This script is taking care of Paraview and QT (and takes an awfull long time to compile, honest...).
50       This stage will also generate a .sh and .csh file one needs to source in order to initialize the PATH and LD_LIBRARY_PATH env. variable.
51       You will need to source those .sh or .csh file in before compiling OpenFOAM because some "Make/options" files will refer to environment variable that are specific to those packages
53    g: tools/makeThirdPartyFunctionsForRPM:
54        A suite of bash functions useful for wrapping the rpmbuild and rpm commands
57 For every packages, this is the basic process we will be going through when starting building the ThirdParty packages from scratch::
58     a: Verify in the local "RPM vault" if a RPM file is available for a given package
59     b: If it is, simply install this RPM and move on to the next package
60     c: if the RPM is absent:
61         i: verify if the source tarbal is available from the SOURCES "vault"
62         ii: if it is not, download the tarball using the specified URL.
63         iii: proceed with the extraction, patching, configuration, compilation, RPM generation and installation of the package. 
64              The generated RPM is always used for installation.
66              Important notice:
67              Please note that a compressed tarball (.tgz) is now also generated for systems where using rpm for installing packages
68              as a non-root user might be a problem.
70              The .rpm files will be located under the directory $WM_THIRD_PARTY_DIR/rpmBuild/RPMS
71              The .tgz files will be located under the directory $WM_THIRD_PARTY_DIR/rpmBuild/TGZS
73     d: The default installation root  directory is "$WM_THIRD_PARTY_DIR". This can be overriden though when installing the RPM.
75 Relocating the RPM root installation directory: 
76     a: All the generated RPMs can be relocated, meaning that you can override the hard-coded root installation directory when using those RPMs for installation.
77     b: You can check that the RPM is relocatable by using the command rpm -qip thePackage.rpm. For example, from the cmake-2.8.3 package generated on one of my machine:
79       > rpm -qip cmake-2.8.3-darwinIntelGccDPOpt.i386.rpm| grep Relocations
80          Name        : cmake                        Relocations: /Users/beaudoin/Projets/SAMH/OpenFOAM/ThirdParty-1.6-ext-RPM-based
82     The Relocations path is the actual location pointed by the $WM_THIRD_PARTY_DIR on my laptop when I generated the RPM.
83     It is the indication that the RPM is relocatable
84     This path will end up being hardcoded in the RPM because the environment variable was expanded before generating the RPM..
85     This is the default root directory where the RPM will install its "payload"
86     This can be overridden using the 'rpm' command-line parameter --relocate OLDPATH=NEWPATH .
88     For example, let's say you want to install the RPM under the root directory /tmp/someDir instead.
89     You will need to call the 'rpm' command like this:
91     rpm -ivh ./cmake-2.8.3-darwinIntelGccDPOpt.i386.rpm --relocate /Users/beaudoin/Projets/SAMH/OpenFOAM/ThirdParty-1.6-ext-RPM-based=/tmp/someDir
93     Even better, you can dig down the hard-coded path even deeper in order to relocate the whole installation directory, down to the last hard-coded subdirectory.
94     Just specify the whole path when using the --relocate  parameter
95     So basically, you can install the RPM right under /usr if you want, hence bypassing the default sequence of package subdirectories I have chosen in order to stay
96     close to the "traditional" ThirdParty layout.
98 9: Things to do:
99     a: Testing testing testing. This prototype was tested on the following platforms:
101       Mac OS X 10.6 (Snow Leopard) (non RPM based)
102       Ubuntu 10.04 32bit (non RPM based)
103       Centos 5.5 64bit (RPM based)
104       OpenSUSE 11.3 64bit (RPM based)
105    
106    b: Maybe adding some RPM dependencies might be useful. I have not explored this yet.
109 10: Gotchas and solutions:
111    1: It was reported that version 5.2.0 of rpm does not work well with the provided scripts.
112       rpm version 5.2.1 works nicely.
114    2: Error messages from rpm:
115    ---------------------------
117    Problem : error: can't create transaction lock on /var/lock/rpm/transaction
118    Solution: add the following entry in your file ~/.rpmmacros
119              
120              %_rpmlock_path %{_dbpath}/__db.000
122              
124 To be continued...
127 Martin Beaudoin
128 May 2011