#!/bin/bash BUILD_TYPE=Release INSTALL_PREFIX=/usr/local/ossim-dev OS=`cat /etc/os-release | grep -e "^ID=" | cut -d'=' -f2 | sed 's/"//g'` OS_VERSION=`cat /etc/os-release | grep -e "^VERSION_ID=" | cut -d'=' -f2 | sed 's/"//g'` OSV=$OS$OS_VERSION SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" BUILDDIR="$SCRIPTDIR/Build-$OSV-$BUILD_TYPE" SRCDIR="$SCRIPTDIR/ossim" echo "SRC: $SRCDIR" echo "BUILD: $BUILDDIR" CMAKE=cmake MPIINC=/usr/include/openmpi-x86_64 MPIDIR=/usr/lib64/openmpi MPI_C_HEADER_DIR=$MPIINC MPI_CXX_HEADER_DIR=$MPIINC MPI_C_COMPILER=$MPIDIR/bin/mpicc MPI_CXX_COMPILER=$MPIDIR/bin/mpicxx MPI_mpi_LIBRARY=$MPIDIR/lib/libmpi.so MPI_mpi_cxx_LIBRARY=$MPIDIR/lib/libmpi_cxx.so MPIEXEC_EXECUTABLE=/usr/bin/srun OPTIONS=" -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX " OPTIONS+=" -DCMAKE_BUILD_TYPE=$BUILD_TYPE " if [ "$OSV" = "fedora32" ] ; then OPTIONS+=" -DMPI_C_HEADER_DIR=$MPI_C_HEADER_DIR " OPTIONS+=" -DMPI_CXX_HEADER_DIR=$MPI_CXX_HEADER_DIR " OPTIONS+=" -DMPI_mpi_LIBRARY=$MPI_mpi_LIBRARY " OPTIONS+=" -DMPI_mpi_cxx_LIBRARY=$MPI_mpi_cxx_LIBRARY " OPTIONS+=" -DBUILD_OSSIM_HDF5_SUPPORT=OFF " else OPTIONS+=" -DMPI_C_INCLUDE_PATH=$MPI_C_HEADER_DIR " OPTIONS+=" -DMPI_CXX_INCLUDE_PATH=$MPI_CXX_HEADER_DIR " OPTIONS+=" -DMPI_C_LIBRARIES=$MPI_mpi_LIBRARY " OPTIONS+=" -DMPI_CXX_LIBRARIES=$MPI_mpi_cxx_LIBRARY " OPTIONS+=" -DBUILD_OSSIM_HDF5_SUPPORT=ON " fi OPTIONS+=" -DMPI_C_COMPILER=$MPI_C_COMPILER " OPTIONS+=" -DMPI_CXX_COMPILER=$MPI_CXX_COMPILER " OPTIONS+=" -DMPIEXEC_EXECUTABLE=$MPIEXEC_EXECUTABLE " OPTIONS+=" -DBUILD_OSSIM_MPI_SUPPORT:BOOL=ON " OPTIONS+=" -DBUILD_OSSIM_GUI=ON " OPTIONS+=" -DINSTALL_DOC=ON " OPTIONS+=" -DBUILD_OMS:BOOL=ON " OPTIONS+=" -DBUILD_OSSIM_APPS:BOOL=ON " OPTIONS+=" -DBUILD_OSSIM_CURL_APPS:BOOL=OFF " OPTIONS+=" -DBUILD_OSSIM_FRAMEWORKS:BOOL=ON " OPTIONS+=" -DBUILD_OSSIM_FREETYPE_SUPPORT:BOOL=ON " OPTIONS+=" -DBUILD_OSSIM_ID_SUPPORT:BOOL=ON " OPTIONS+=" -DBUILD_OSSIM_PLANET:BOOL=ON " OPTIONS+=" -DBUILD_OSSIM_TESTS:BOOL=ON " OPTIONS+=" -DBUILD_OSSIM_VIDEO:BOOL=ON " OPTIONS+=" -DBUILD_OSSIM_WMS:BOOL=ON " OPTIONS+=" -DBUILD_SHARED_LIBS:BOOL=ON " mkdir -p $BUILDDIR; cd $BUILDDIR $CMAKE $OPTIONS -B "$BUILDDIR" -S "$SRCDIR"