# Expert/Developper installation (sources-install)= ## From sources > **WARNING:** *the instalation from source can be very long due to library conflict, unlinked library path, etc. and may require adaptation to your own system. So if you are not confortable with source building on UNIX, please go directly to [container images installation](#container-install).* ### Linux packages If you can install some package on you PC, then it will smoothed the installation otherwise skip this section. Ubuntu: ```bash sudo apt install mercurial git wget gcc-14 cmake autoconf flex bison libgtk2.0-dev pkg-config sudo apt install lib{arpack2-,parpack2-,lapack-,scalapack-mpi-,suitesparse-,scotch-,hwloc-,readline6-}dev sudo apt install lib{netcdf-,gsl-,geotiff-,tiff-,jpeg-,gdal-,shp-,proj-}dev ``` OpenSUSE: ```bash bash -cx 'sudo zypper addrepo http://download.opensuse.org/repositories/science/`lsb-release -sd |sed -re "s/ /_/g;s/\"//g"`/science.repo' sudo zypper -n in mercurial git wget gcc{-fortran,-c++,-info} cmake automake flex bison gtk2-devel sudo zypper -n in suitesparse-devel arpack-ng-devel parpack-openmpi2-devel mumps-openmpi2-devel ; sudo zypper -n in netcdf{,-devel} gsl-{devel,doc} geotiff{,-devel} lib{tiff,jpeg}-devel gdal{,-devel} libshp-devel proj-devel ; ``` The sources are available on the IN2P3 GitLab and you will need to download the three following directories: ```bash git clone https://gitlab.in2p3.fr/sirocco/sirocco_solvers/sirocco_solvers poc-solvers git clone https://gitlab.in2p3.fr/sirocco/sirocco_tools/sirocco_tools tools git clone https://gitlab.in2p3.fr/sirocco/sirocco_view/sirocco_view pocvip ``` Otherwise, the mercurial depots are also available on summit2 for LEGOS colleagues: ```bash hg clone ssh://summit2//ecola/share/src/poc-solvers/poc-solvers-depot poc-solvers hg clone ssh://summit2//ecola/share/src/tools/tools-depot tools hg clone ssh://summit2//ecola/share/src/pocvip/pocvip-depot pocvip ``` ### Build achitecture To better control your install (for exemple on a cluster), we recommande to install all the dependencies on a specific directory *local*. ```bash ncpu=6 #the number of available CPUs to speedup the compilation INSTALL_PATH=$PWD #where poc-solvers, tools and pocvip directory are LOCAL_INSTALL_PATH=$PWD/local mkdir $LOCAL_INSTALL_PATH for dir in lib include bin ubin do mkdir $LOCAL_INSTALL_PATH/$dir done export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LOCAL_INSTALL_PATH/lib export CMAKE_LIBRARY_PATH=$LD_LIBRARY_PATH export CMAKE_INCLUDE_PATH=$LOCAL_INSTALL_PATH/include ``` ### posc-solvers dependencies The poc-solvers will need several dependencies to be installed in *local* (comment the one already installed with packages or local environement): ```bash #Download the poc-solver librairies wget http://www.netlib.org/blas/blas.tgz wget http://www.netlib.org/lapack/lapack-3.5.0.tgz wget http://www.netlib.org/scalapack/scalapack-2.0.2.tgz wget http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.4.3.tar.gz wget https://download.open-mpi.org/release/hwloc/v2.5/hwloc-2.5.0.tar.bz2 # Unfold the librairies sources tar -xf blas.tgz tar -xf lapack-3.5.0.tgz tar -xf scalapack-2.0.2.tgz tar -xf SuiteSparse-4.4.3.tar.gz tar -xf hwloc-2.5.0.tar.bz2 ### COMPILATION # BLAS cd BLAS-3.12.0 make cp -v *.a $LOCAL_INSTALL_PATH/lib/libblas.a cd .. # LAPACK cd lapack-3.5.0 sed -re "s|= (-O)|= -g \1|;s|-O2|-O3|;\ s|^( *BLASLIB *= *).*|\1$LOCAL_INSTALL_PATH/lib/libblas.a|" make.inc.example >make.inc make make lapackelib cp -v liblapack.a $LOCAL_INSTALL_PATH/lib cd .. # SCALAPACK cd scalapack-2.0.2 sed -re "s|= (-O)|= -g \1|" SLmake.inc.example >SLmake.inc make cp -v libscalapack.a $LOCAL_INSTALL_PATH/lib cd .. # SuiteSparse cd SuiteSparse/SuiteSparse_config sed -re "s|^( *INSTALL_[^ ]+ *= *).*/([^/]+$)|\1$LOCAL_INSTALL_PATH/\2|;\ s|^( *(LAPACK\|BLAS) *= *)|\1-L$LOCAL_INSTALL_PATH/lib |;\ /^\s*#/! s| -O| -g -O|#;" \ SuiteSparse_config_linux.mk >SuiteSparse_config.mk cd .. make -j$ncpu library make install cd .. # HWLOC cd hwloc-2.5.0 ./configure --prefix=$LOCAL_INSTALL_PATH make -j$ncpu make install cd .. ``` ### poc-solvers compilation : ```bash cd poc-solvers mkdir cmade-mpi cd cmade-mpi cmake ../src -DLOCAL_INSTALL=$LOCAL_INSTALL_PATH/ -DHIPS=NO -DMUMPS=NO -DPASTIX_5=NO -DPASTIX_6=NO -DPETSC=NO -DUMFPACK=NO -DARPACK=NO -DPARPACK=NO make -j$ncpu install cd ../.. ``` ### tools dependencies The tools will need several dependencies to be installed in *local* (comment the one already installed with packages or local environement): ```bash #Download the tools librairies wget https://sqlite.org/2024/sqlite-autoconf-3460100.tar.gz wget http://download.osgeo.org/proj/proj-6.3.1.tar.gz wget http://ftpmirror.gnu.org/gsl/gsl-1.16.tar.gz wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.6/src/hdf5-1.10.6.tar.bz2 wget https://downloads.unidata.ucar.edu/netcdf-c/4.9.2/netcdf-c-4.9.2.tar.gz wget https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.27.1-Source.tar.gz wget https://github.com/OSGeo/gdal/releases/download/v3.7.3/gdal-3.7.3.tar.gz wget http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.6.0.tar.gz wget https://github.com/LASzip/LASzip/releases/download/v2.2.0/laszip-src-2.2.0.tar.gz wget http://download.osgeo.org/liblas/libLAS-1.8.1.tar.bz2 # Unfold the librairies sources tar -xf sqlite-autoconf-3460100.tar.gz tar -xf proj-6.3.1.tar.gz tar -xf gsl-1.16.tar.gz tar -xf hdf5-1.10.6/src/hdf5-1.10.6.tar.bz2 tar -xf netcdf-c-4.9.2.tar.gz tar -xf eccodes-2.27.1-Source.tar.gz tar -xf gdal-3.7.3.tar.gz tar -xf libgeotiff-1.6.0.tar.gz tar -xf laszip-src-2.2.0.tar.gz tar -xf libLAS-1.8.1.tar.bz2 ### COMPILATION # SQLITE3 cd sqlite-autoconf-3460100 ./configure --prefix=$LOCAL_INSTALL_PATH make -j$ncpu make install cd .. #PROJ (need sqlite3) cd proj-6.3.1 ./configure --prefix=$LOCAL_INSTALL_PATH make -j$ncpu make install cd .. #GSL cd gsl-1.16 ./configure --prefix=$LOCAL_INSTALL_PATH make -j$ncpu make install cd .. #ECCODES cd eccodes-2.27.1-Source mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL_PATH \ -DENABLE_{PYTHON,FORTRAN,NETCDF,JPG,AEC}=OFF make -j$ncpu make install cp -v lib/libgrib_api.so $LOCAL_INSTALL_PATH/lib/ cp -v ../src/grib_api.h $LOCAL_INSTALL_PATH/include/ cd ../../ # GDAL (need proj) cd gdal-3.7.3 #### WARNING Highly buggy version !! mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL_PATH make -j$ncpu make install cd .. # ln -s $CONDA_PREFIX/lib/libgdal.so $LOCAL_INSTALL_PATH/lib/libgdal.so #libGEOTIFF cd libgeotiff-1.6.0 ./configure --prefix=$LOCAL_INSTALL_PATH make -j$ncpu make install cd .. # ln -s $CONDA_PREFIX/lib/libgeotiff.so $LOCAL_INSTALL_PATH/lib/libgeotiff.so #LASzip cd laszip-src-2.2.0 ./configure --prefix=$LOCAL_INSTALL_PATH make -j$ncpu make install cd .. # libLAS (need libgeotiff) cd libLAS-1.8.1 mkdir build cd build cmake .. -DGEOTIFF_INCLUDE_DIR=$LOCAL_INSTALL_PATH/include -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL_PATH make -j$ncpu make install cd .. ``` ### sirocco-tools compilation : Now install the sirocoo tools : ```bash cd tools autoreconf -si # WARNING about pkg-config error during the configuration # if not found, try autoreconf -si -I/usr/share/aclocal # otherwise add pkg.m4 into $LOCAL_INSTALL_PATH/share/aclocal/ then run # autoreconf -si -I$LOCAL_INSTALL_PATH/share/aclocal #FOR MPI CALCULATION (cluster only) export CXX='mpicxx -std=gnu++11' rm -r parallel mkdir parallel cd parallel ../configure --with-parallel --prefix=$LOCAL_INSTALL_PATH POCSOLVERBUILDDIR=$INSTALL_PATH/poc-solvers/cmade-mpi ### for all the command (11Go) make -j$ncpu -k # ### for custom install # make -j$ncpu tools-config # for name in vertical-eigenmodes comodo-detidor showarg concatenator # do # make -j$ncpu $name # # rm $LOCAL_INSTALL_PATH/bin/$name # # ln -s $PWD/src/$name $LOCAL_INSTALL_PATH/bin/$name # done #verify that the file ./src/tools-config exist #installation: exe_path=$PWD/src cp -v src/*.a $LOCAL_INSTALL_PATH/lib/ cp -s $exe_path/* $LOCAL_INSTALL_PATH/ubin/ rm $LOCAL_INSTALL_PATH/ubin/*.* cd ../../ #Cleaning to save some storage rm src/*.* ``` ### pocvip compilation Now install POCViP : ```bash cd pocvip autoreconf -si # WARNING about pkg-config error during the configuration # if not found, try autoreconf -si -I/usr/share/aclocal # otherwise add pkg.m4 into $LOCAL_INSTALL_PATH/share/aclocal/ then run # autoreconf -si -I$LOCAL_INSTALL_PATH/share/aclocal rm -r fast mkdir fast cd fast #FOR STANDARD CALCULATION (PC) ../configure TOOLSCONFIG=$INSTALL_PATH/ubin/tools-config make -j $ncpu #installation: cp -s $PWD/pocvip $LOCAL_INSTALL_PATH/ubin/ ``` ## Updates In order to apply the laster update of the software, retrieve the new sources and then recompile. With git : ```bash for d in tools pocvip cd $d git pull cd fast make clean make -j $ncpu -k cd ../../ ``` With mercurial : ```bash for d in tools pocvip cd $d hg pull hg up cd fast make clean make -j $ncpu -k cd ../../ ```