fix for Savannah bug #80565
[u/mrichter/AliRoot.git] / README_CMake
CommitLineData
45526b5e 1
2Note: The CMake build of AliRoot builds out-of-source
3
529dfa42 4Steps to Build AliRoot with CMake :
dfa85384 5
8b0f7d96 61. Check out Aliroot source into a folder (usually specified by the environment variable ALICE)
45526b5e 7
8b0f7d96 8 cd $ALICE
11f822d1 9 svn co https://alisoft.cern.ch/AliRoot/trunk AliRoot
10
11Note: Please use https:// if you want to be able to commit changes to the SVN repository.
529dfa42 12
8b0f7d96 132. Set the environment variable ALICE_ROOT to point to the source you have checked out
14
15 cd AliRoot
16 export ALICE_ROOT=`pwd`
17
18
193. Create a new folder where the build will take place. It must be different from the source directory!
45526b5e 20
8b0f7d96 21 cd ..
22 mkdir objdir
23 cd objdir
24
254. Optionally specify the place for installation using the environment variable ALICE_INSTALL.
26It you do not specify it, "make install" will put lib, bin and include in ALICE_ROOT
27
285. Optionally specify the location of Geant3 using the environment variable GEANT3DIR
29
306. Execute the following commands to configure the build
31
32 cmake $ALICE_ROOT
33
aecc2ba0 34
8b0f7d96 35Note: Some files CMakeLists.txt will be created in the source tree, so you need write access there. This
36is a temporary situation that will change soon.
aecc2ba0 37
38 6a.Run
39 cmake -DCMAKE_BUILD_TYPE=DEBUG $ALICE_ROOT
40
41 to compile AliRoot in Debug configuration (-g compiler flags).
42 To change the configuration later on you can either edit
43 cache variable CMAKE_BUILD_TYPE using 'ccmake' command ('None' value for default configuration),
44 or setup default configuration by running
45 cmake $ALICE_ROOT
46
47 6b. By default -O -g options are setting up.
8b0f7d96 48
497. Build and install AliRoot. Note that the parralel build is fully operational with CMake.
50
51 make -j4
52 make install
529dfa42 53
8b0f7d96 54If you make changes in the source tree, it is enough to do
45526b5e 55
8b0f7d96 56 make
57 make install
529f129e 58
8b0f7d96 59to get them in use.
529dfa42 60
8b0f7d96 619. In order to build addtional targets like THydjet and SHUTTLE add the following options to the cmake command
45526b5e 62
63 cmake -DTHydjet=ON -DSHUTTLE=ON <path_to_source>
64
8b0f7d96 6510. Static libraries can be built using
529f129e 66
67 make alilibs-static
68
8b0f7d96 6911. Individual Modules can be built using
529f129e 70
71 make <Module>-all
72 make <Module>-all-static
73
74eg. make STEER-all STEER-all-static
75
8b0f7d96 7612. Individual Packages can be built using
529f129e 77
78 make <Package>
79 make <Package>-static
80
81eg. make STEERbase STEERbase-static
529dfa42 82
8b0f7d96 8313. The code can be checked for the ALICE coding conventions on a package, module or class level using the following targets.
c2a2c0b8 84
85 make check-all
86 make <Module>-check-all
87 make <Package>-check
8948a174 88 make <Module>-<ClassName>-check // To use this run cmake with -DCLASSCHECK="YES" option. It is turned off by default since it bloats the Makefile and slows down the internal makefile rule checking
c2a2c0b8 89
811ffdcc 90 The resulting violations will be written to the folder <Build_Directory>/<Module>/check/viols
c2a2c0b8 91
8b0f7d96 9214. To Build PARs the following targets can be used. The resulting packages will be created in the cmake build directory
6a9e2760 93
94 make par-all
95 make <Package>.par
8948a174 96 make <Module>-par-all //build all par packages in the module
3a8dbb31 97
8b0f7d96 9815. To test PARs after building run
3a8dbb31 99
100 make test-par-all
101 make test-<Package>
102 make test-<Module>-par-all
6a9e2760 103
45526b5e 104!IMPORTANT! - Make sure your source folder is clean. If you used the old make system to build aliroot run make clean in the source directory before you run cmake
529dfa42 105
dfa85384 106