Skip to content

Commit

Permalink
Add scripst to install FairRoot, AliRoot, and DDS. These three packag…
Browse files Browse the repository at this point in the history
…es are not installed when running configure.sh. If one want to install these packages one has

to use the script alfaconfig.sh which will call configure.sh and will afterwards install the new packages. Add configuration option for ALFA which is needed for
some error and debug output. The new stuff is documented in README.md.
  • Loading branch information
fuhlig1 committed Oct 17, 2014
1 parent 96b0472 commit 0ffa1e1
Show file tree
Hide file tree
Showing 10 changed files with 343 additions and 4 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ run a simulation. If unsure choose _Yes_.

If the previous choice was _Yes_ one has to define in the next menu how to handle the
Geant4 data files. These files have after installation a size of approximately 650 MB.
If you don't intent to use Geant4 you shoule choose _Don't install_, if unsure choose
If you don't intent to use Geant4 you should choose _Don't install_, if unsure choose
one of the other options described below.

If the data files should be installed it is normally save to choose the
Expand Down Expand Up @@ -103,7 +103,21 @@ directory of FairSoft.
* ZeroMQ 3.2.4
* Protocoll Buffers 2.5.0
* Nano Message 0.4-beta
Packages included:

##Installation of ALFA (Alice-FAIR software)

The ALFA installation will install the FairSoft as above and after that it will install
three more packages:

* FairRoot
* DDS
* AliRoot

FairSoft> ./alfaconfig.sh

The script will get the source code of all the packages from there own repostories,
compile and install tme. The versions and the urls of the different repostories used
are specified in the file "scripts/package_versions.sh"



Expand Down
25 changes: 25 additions & 0 deletions alfaconfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
#
# AlFa package installation script
# m.al-turany@gsi.de, Sept. 2014

install_alfasoft=yes
##################### FairSoft#############################################
source configure.sh

##################### FairRoot#############################################
if [ "$check" = "1" ];
then
source scripts/install_fairroot.sh
fi
##################### DDS #############################################
if [ "$check" = "1" ];
then
source scripts/install_DDS.sh
fi
##################### AliRoot #############################################
if [ "$check" = "1" ];
then
source scripts/install_aliroot.sh
fi

42 changes: 41 additions & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,41 @@ then
onlyreco=1
fi

#echo $installation_type

#if [ "$installation_type" = "custom" ]
#then
# echo "Custom mode"
#elif [ "$installation_type" = "automatic" ]
#then
# compiler=
# if [ "$compiler" = "" ]; then
# echo "*** Edit the configure.sh script and add the compiler in line 112."
# echo "*** The following error is due to the undefinded compiler."
# exit 1
# fi
#elif [ "$installation_type" = "grid" ]
#then
#elif [ "$installation_type" = "onlyreco" ]
#then
# compiler=
# if [ "$compiler" = "" ]; then
# echo "*** Edit the configure.sh script and add the compiler in line 140."
# echo "*** The following error is due to the undefinded compiler."
# exit 1
# fi
#else
# echo "Parameter given to the script is not known."
# echo "Call the script either with no parameter, then your are guided through the installation procedure,"
# echo "or with one parameter which defines the installation type."
# echo "The supported installation types are:"
# echo " - automatic"
# echo " - custom"
# echo " - grid"
# echo " - onlyreco"
# exit 42
#fi

if [ "$installation_type" = "grid" ];
then
export BUILD_BATCH=TRUE
Expand Down Expand Up @@ -332,7 +367,12 @@ then
echo "During the installation a new version of CMake has been installed in $SIMPATH_INSTALL/bin."
echo "Please add this path to your environment variable PATH to use this new version of CMake."
fi
exit 0
if [ "$install_alfasoft" = "yes" ];
then
echo "----------------- End of FairSoft installation ---------------"
else
exit 0
fi
else
echo "*** End installation of external packages with Errors***" | tee -a $logfile
exit 42
Expand Down
15 changes: 15 additions & 0 deletions scripts/check_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,14 @@ if [ "$result" = "0" ]; then
exit 1
fi

if [ "$install_alfasoft" = "yes" ];
then
echo "----------------- Install AlFaSoft ---------------"
else
echo "----------------- Install FairSoft ---------------"
fi


mkdir -p $SIMPATH/test/build
cd $SIMPATH/test

Expand All @@ -406,6 +414,7 @@ hascxx11=$(grep HasCxx11 $SIMPATH/test/configure | cut -f2 -d:)
haslibcxx=$(grep HasLibCxx $SIMPATH/test/configure | cut -f2 -d:)
_hascurl=$(grep HasCurl $SIMPATH/test/configure | cut -f2 -d:)


if [ ${_hascurl} ];
then
install_curl=no
Expand All @@ -419,6 +428,12 @@ if [ $hascxx11 ];
then
export CXXFLAGS="${CXXFLAGS} -std=c++11"
export build_cpp11=yes
else
if [ "$install_alfasoft" = "yes" ];
then
echo "AlFaSoft require C++11, please install a compiler that support C++11 "
exit
fi
fi

if [ $haslibcxx ];
Expand Down
127 changes: 127 additions & 0 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,120 @@ check_yes_no() {
fi
}

#_____________________________________________________________________
# The function checks if all needed variables are defined in the input file and
# if only valid values and value combinations are present in the input file.
function check_variables {

if [ "$compiler" = "" ]; then
echo "*** The compiler definition is not set in the input file."
echo "*** Please add the compiler definition in the input file."
echo "*** e.g.: compiler=gcc"
echo "*** possible values are gcc, Clang, intel" # CC, PGI
exit 1
else
if [ ! "$compiler" = "gcc" -a ! "$compiler" = "Clang" -a ! "$compiler" = "intel" ]; then
echo "*** The compiler definition $compiler is not known."
echo "*** possible values are gcc, Clang, intel" # CC, PGI
echo "*** Please correct the compiler definition in the input file."
echo "*** e.g.: compiler=gcc"
exit 1
fi
fi
if [ "$debug" = "" ]; then
echo "*** The debug definition is not set in the input file."
echo "*** Please add the debug definition in the input file."
echo "*** e.g.: debug=no or debug=yes"
exit 1
else
check_yes_no debug
fi
if [ "$optimize" = "" ]; then
echo "*** The optimize definition is not set in the input file."
echo "*** Please add the optimize definition in the input file."
echo "*** e.g.: optimize=no or optimize=yes"
exit 1
else
check_yes_no optimize
fi
if [ "$geant4_download_install_data_automatic" = "" ]; then
echo "*** It is not defined in the input file if the geant4 data should be downloaded automatically."
echo "*** Please add the missing definition in the input file."
echo "*** e.g.: geant4_download_install_data_automatic=[no/yes]"
exit 1
else
check_yes_no geant4_download_install_data_automatic
fi
if [ "$geant4_install_data_from_dir" = "" ]; then
echo "*** It is not defined in the input file if the geant4 data should be installed from the directory."
echo "*** Please add the missing definition in the input file."
echo "*** e.g.: geant4_install_data_from_dir=[no/yes]"
exit 1
else
check_yes_no geant4_install_data_from_dir
fi
if [ "$build_python" = "" ]; then
echo "*** It is not defined in the input file if the python bindings should be installed."
echo "*** Please add the missing definition in the input file."
echo "*** e.g.: build_python=[no/yes]"
exit 1
else
check_yes_no build_python
fi
if [ "$install_sim" = "" ]; then
echo "*** It is not defined in the input file if all tools for simulation should be installed."
echo "*** Please add the missing definition in the input file."
echo "*** e.g.: install_sim=[no/yes]"
exit 1
else
check_yes_no install_sim
fi
if [ "$SIMPATH_INSTALL" = "" ]; then
echo "*** No installation directory is defined in the input file."
echo "*** Please add the missing definition in the input file."
echo "*** e.g.: SIMPATH_INSTALL=<installation directory>"
exit 1
else
# expand variables, which could be in the filepath.
# A example is if $PWD is in the path
eval SIMPATH_INSTALL=$SIMPATH_INSTALL
#check if the user can write to the installation path
mkdir -p $SIMPATH_INSTALL
if [ $? -ne 0 ]; then
echo "Cannot write to the installation directory $SIMPATH_INSTALL."
exit 1
fi
fi
if [ "$debug" = "yes" -a "$optimize" = "yes" ]; then
echo "*** The variables \"debug\" and \"otimize\" can't be set both to \"yes\" at the"
echo "*** same time. All other combinations yes/no, no/no, and no/yes are valid."
echo "*** Please change the definitions in the input file."
exit 1
fi
if [ "$geant4_download_install_data_automatic" = "yes" -a "$geant4_install_data_from_dir" = "yes" ]; then
echo "*** The variables \"geant4_download_install_data_automatic\" and"
echo "*** \"geant4_install_data_from_dir\" can't be set both to \"yes\" at the"
echo "*** same time. All other combinations yes/no, no/no, and no/yes are valid."
echo "*** Please change the definitions in the input file."
exit 1
fi

}

#_____________________________________________________________________
# The function checks if the varibale has either yes or no as value.
# In case any other value is given the script stops with an error message.
check_yes_no() {
variable=$1
eval value=\$$1 #eval forces update of $a which is set to the value of $1
if [ ! "$value" = "yes" -a ! "$value" = "no" ]; then
echo "*** For the variable $variable only yes or no are allowed."
echo "*** Please correct the definition of \"$variable=$value\" in the input file."
echo "*** e.g.: $variable=no or $variable=yes"
exit 1
fi
}

#_____________________________________________________________________
function is_in_path {
# This function checks if a file exists in the $PATH.
Expand Down Expand Up @@ -340,6 +454,19 @@ function generate_config_cache {
echo platform=$platform >> $cache_file
}

#_____________________________________________________________________
function generate_config_cache {
echo compiler=$compiler > $cache_file
echo debug=$debug >> $cache_file
echo optimize=$optimize >> $cache_file
echo geant4_download_install_data_automatic=$geant4_download_install_data_automatic >> $cache_file
echo geant4_install_data_from_dir=$geant4_install_data_from_dir >> $cache_file
echo build_python=$build_python >> $cache_file
echo install_sim=$install_sim >> $cache_file
echo SIMPATH_INSTALL=$SIMPATH_INSTALL >> $cache_file
echo platform=$platform >> $cache_file
}

#_____________________________________________________________________
function download_file {
# download the file from the given location using either wget or
Expand Down
30 changes: 30 additions & 0 deletions scripts/install_DDS.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash


if [ ! -d $SIMPATH/DDS ];
then
cd $SIMPATH
git clone $DDS_LOCATION
fi

install_prefix=$SIMPATH_INSTALL/DDS

checkfile=$install_prefix/bin/dds-server

if (not_there DDS $checkfile);
then
cd DDS
git checkout $DDSVERSION
if [ ! -d build_for_alfa ];
then
mkdir build_for_alfa
fi
cd build_for_alfa
BOOST_ROOT=$SIMPATH_INSTALL cmake -DCMAKE_INSTALL_PREFIX=install_prefix -C ../BuildSetup.cmake ../
$MAKE_command -j$number_of_processes wn_bin
$MAKE_command -j$number_of_processes install

fi

cd $SIMPATH
return 1
37 changes: 37 additions & 0 deletions scripts/install_aliroot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

if [ ! -d $SIMPATH/AliRoot ];
then
cd $SIMPATH
git clone $ALIROOT_LOCATION
fi

install_prefix=$SIMPATH_INSTALL/AliRoot
export GEANT3DIR=$SIMPATH_INSTALL/share/geant3
export ALICE_ROOT=$SIMPATH/AliRoot
export ALICE_TARGET=`root-config --arch`

export ROOTSYS=$SIMPATH_INSTALL


checkfile=$install_prefix/lib/libSTEER.so

if (not_there AliRoot $checkfile);
then
cd AliRoot
git checkout $ALIROOTVERSION

if [ ! -d build_for_alfa ];
then
mkdir build_for_alfa
fi
cd build_for_alfa

cmake -DCMAKE_INSTALL_PREFIX=$install_prefix -DGEANT3DIR=$SIMPATH_INSTALL -DGEANT3_INCLUDE_DIR=$SIMPATH_INSTALL/include/TGeant3 -DGEANT3_LIBRARY_DIR=SIMPATH_INSTALL/lib -DGEANT3_SYSTEM_DIR=$SIMPATH_INSTALL/share/geant3 -DZEROMQ_LIBRARY=$SIMPATH_INSTALL/lib -DZEROMQ_INCLUDE_DIR=$SIMPATH_INSTALL/include $ALICE_ROOT

$MAKE_command -j$number_of_processes
$MAKE_command install

fi
cd $SIMPATH
return 1
33 changes: 33 additions & 0 deletions scripts/install_fairroot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

if [ ! -d $SIMPATH/FairRoot ];
then
cd $SIMPATH
git clone $FAIRROOT_LOCATION
fi

install_prefix=$SIMPATH_INSTALL/FairRoot

checkfile=$install_prefix/lib/libBase.so

if (not_there FairRoot $checkfile);
then
cd FairRoot
git checkout $FAIRROOTVERSION
if [ ! -d build_for_alfa ];
then
mkdir build_for_alfa
fi
cd build_for_alfa
if [ "$onlyreco" = "0" ];
then
SIMPATH=$SIMPATH_INSTALL cmake -DCMAKE_INSTALL_PREFIX=$install_prefix ../
else
SIMPATH=$SIMPATH_INSTALL cmake -DCMAKE_INSTALL_PREFIX=$install_prefix -DRECO_ONLY=1 ../
fi
$MAKE_command -j$number_of_processes
$MAKE_command install

fi
cd $SIMPATH
return 1
Loading

0 comments on commit 0ffa1e1

Please sign in to comment.