Skip to content

Commit

Permalink
[np] Replaced bash variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabyx committed Apr 11, 2019
1 parent 8c9285f commit 603cab7
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 52 deletions.
12 changes: 6 additions & 6 deletions clang-formatAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

export APPROXMVBB_REPO_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

find $APPROXMVBB_REPO_DIR/external -type f \( -name "*.hpp" -or -name "*.cpp" -or -name "*.h" -or -name "*.c" \) | xargs clang-format -i
find $APPROXMVBB_REPO_DIR/include -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
find $APPROXMVBB_REPO_DIR/src -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
find $APPROXMVBB_REPO_DIR/example -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
find $APPROXMVBB_REPO_DIR/tests -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
find $APPROXMVBB_REPO_DIR/benchmarks -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
find ${APPROXMVBB_REPO_DIR}/external -type f \( -name "*.hpp" -or -name "*.cpp" -or -name "*.h" -or -name "*.c" \) | xargs clang-format -i
find ${APPROXMVBB_REPO_DIR}/include -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
find ${APPROXMVBB_REPO_DIR}/src -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
find ${APPROXMVBB_REPO_DIR}/example -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
find ${APPROXMVBB_REPO_DIR}/tests -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
find ${APPROXMVBB_REPO_DIR}/benchmarks -type f \( -name "*.hpp" -or -name "*.cpp" \) | xargs clang-format -i
4 changes: 2 additions & 2 deletions cmake/parallelmake.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
cores=$(grep -c ^processor /proc/cpuinfo)
echo "Building with $cores cores!"
make -j$cores "$@"
echo "Building with ${cores} cores!"
make -j${cores} "$@"
exit
40 changes: 20 additions & 20 deletions travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@

set -e

echo "On branch: $branchName"
echo "On branch: ${branchName}"

# Check if we build the project
if [ "$BUILD_APPROXMVBB" == "OFF" ]; then
if [ "${BUILD_APPROXMVBB}" == "OFF" ]; then
echo "Do not build ApproxMVBB!"
return
fi

cd $ROOT_PATH
cd ${ROOT_PATH}
export CXX_FLAGS="-std=c++11"
export CXX_LINKER_FLAGS=""
if [ -z "$BUILD_TYPE" ]; then export BUILD_TYPE=Release; fi
if [ -z "${BUILD_TYPE}" ]; then export BUILD_TYPE=Release; fi

# make ApproxMVBB
echo "Build ApproxMVBB:"
cd $CHECKOUT_PATH
cd ${CHECKOUT_PATH}
### init submodules
#git submodule init
#git submodule update
## only for hig perf. tests
##- cd addtional/tests/files; cat Lucy* | tar xz

if [ ! -d $ROOT_PATH/build ]; then mkdir $ROOT_PATH/build; fi
cd $ROOT_PATH/build
cmake $CHECKOUT_PATH -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
if [ ! -d ${ROOT_PATH}/build ]; then mkdir ${ROOT_PATH}/build; fi
cd ${ROOT_PATH}/build
cmake ${CHECKOUT_PATH} -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-ApproxMVBB_USE_OPENMP=OFF \
-DApproxMVBB_FORCE_MSGLOG_LEVEL=2
Expand All @@ -39,28 +39,28 @@ cat ./CMakeCache.txt | grep "ApproxMVBB_"

make VERBOSE=1
make install
cd $ROOT_PATH
cd ${ROOT_PATH}

if [[ $branchName == "unitTests" ]]; then
if [[ ${branchName} == "unitTests" ]]; then

echo "ApproxMVBB: Run unit tests!"
cd $ROOT_PATH/build
cd ${ROOT_PATH}/build
make build_and_test

else

# make install and library usage!
echo "Install and test if ApproxMVBB links:"
mkdir $ROOT_PATH/buildLibUsage
cd $ROOT_PATH/buildLibUsage
INSTALL="$ROOT_PATH/build/install/share/ApproxMVBB/cmake"
echo "Install dir= $INSTALL"
cmake $CHECKOUT_PATH/example/libraryUsage -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
mkdir ${ROOT_PATH}/buildLibUsage
cd ${ROOT_PATH}/buildLibUsage
INSTALL="${ROOT_PATH}/build/install/share/ApproxMVBB/cmake"
echo "Install dir= ${INSTALL}"
cmake ${CHECKOUT_PATH}/example/libraryUsage -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DApproxMVBB_DIR=$INSTALL
-DApproxMVBB_DIR=${INSTALL}
make VERBOSE=1
cd $ROOT_PATH
cd ${ROOT_PATH}

fi

Expand Down
24 changes: 12 additions & 12 deletions travis/install_dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -e # exit on errors

cd $ROOT_PATH
cd ${ROOT_PATH}

export APPROXMVBB_CACHE_SIGNATURE_FILE="$APPROXMVBB_CACHE_DIR/APPROXMVBB_DEPS_CACHE_SUCCESSFUL"
export APPROXMVBB_CACHE_SIGNATURE_FILE="${APPROXMVBB_CACHE_DIR}/APPROXMVBB_DEPS_CACHE_SUCCESSFUL"

# Build the cache only
if [ ! -f "$APPROXMVBB_CACHE_SIGNATURE_FILE" ] ; then
if [ ! -f "${APPROXMVBB_CACHE_SIGNATURE_FILE}" ] ; then

echo "ApproxMVBB Build: Build only dependencies! and CACHE them"

Expand All @@ -18,32 +18,32 @@ if [ ! -f "$APPROXMVBB_CACHE_SIGNATURE_FILE" ] ; then
cd ${ROOT_PATH}/eigen3 && hg update 3.3
mkdir ${ROOT_PATH}/eigen3Build
cd ${ROOT_PATH}/eigen3Build
export EIGEN_ROOT_DIR=$INSTALL_PREFIX/include/eigen3 # no idea why this is needed?
cmake ../eigen3 -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH"
export EIGEN_ROOT_DIR=${INSTALL_PREFIX}/include/eigen3 # no idea why this is needed?
cmake ../eigen3 -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}"
sudo make VERBOSE=1 install

# Install meta =========================================================
git clone https://github.com/ericniebler/meta.git ${ROOT_PATH}/meta
sudo cp -r ${ROOT_PATH}/meta/include/* $INSTALL_PREFIX/include/
sudo cp -r ${ROOT_PATH}/meta/include/* ${INSTALL_PREFIX}/include/
#ls -a /usr/local/include/meta

# Install pugixml =====================================================
git clone https://github.com/zeux/pugixml.git ${ROOT_PATH}/pugixml
perl -pi -e 's/\/\/\s*#define\s*PUGIXML_HAS_LONG_LONG/#define PUGIXML_HAS_LONG_LONG/g' ${ROOT_PATH}/pugixml/src/pugiconfig.hpp
mkdir ${ROOT_PATH}/pugixmlBuild
cd ${ROOT_PATH}/pugixmlBuild
cmake ../pugixml -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH"
cmake ../pugixml -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}"
sudo make VERBOSE=1 install

echo "successful" | sudo tee -a $APPROXMVBB_CACHE_SIGNATURE_FILE > /dev/null
echo "content in $APPROXMVBB_CACHE_DIR :"
ls -al $APPROXMVBB_CACHE_DIR
echo "successful" | sudo tee -a ${APPROXMVBB_CACHE_SIGNATURE_FILE} > /dev/null
echo "content in ${APPROXMVBB_CACHE_DIR} :"
ls -al ${APPROXMVBB_CACHE_DIR}

else

echo "ApproxMVBB Build: Use cached dependencies..."
echo "content in $APPROXMVBB_CACHE_DIR :"
ls -al $APPROXMVBB_CACHE_DIR/{bin,include,lib,share}
echo "content in ${APPROXMVBB_CACHE_DIR} :"
ls -al ${APPROXMVBB_CACHE_DIR}/{bin,include,lib,share}

export BUILD_APPROXMVBB="ON"
fi
Expand Down
12 changes: 6 additions & 6 deletions travis/install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
set -e # exit on error

# "DEPENDECIES ========================================================================"
export INSTALL_PREFIX="$APPROXMVBB_CACHE_DIR"
export PATH="$INSTALL_PREFIX/bin:/usr/local/bin:$PATH"
export INSTALL_PREFIX="${APPROXMVBB_CACHE_DIR}"
export PATH="${INSTALL_PREFIX}/bin:/usr/local/bin:${PATH}"

cd $ROOT_PATH
cd ${ROOT_PATH}

if [ -n "${GCC_VERSION}" ]; then
# https://stackoverflow.com/questions/37603238/fsanitize-not-using-gold-linker-in-gcc-6-1
export CPPFLAGS="-fuse-ld=gold"
export CXXFLAGS="$CPPFLAGS"
export CXXFLAGS="${CPPFLAGS}"
export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}";
fi
if [ -n "${CLANG_VERSION}" ]; then
Expand All @@ -28,9 +28,9 @@ cmake --version
echo "cmake at $(which cmake)"


chmod +x $CHECKOUT_PATH/travis/install_dep.sh
chmod +x ${CHECKOUT_PATH}/travis/install_dep.sh
# run the command in this process -> env varibales!
. $CHECKOUT_PATH/travis/install_dep.sh
. ${CHECKOUT_PATH}/travis/install_dep.sh
# "DEPENDECIES COMPLETE ================================================================="

set +e # exit on errors off
12 changes: 6 additions & 6 deletions travis/install_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
set -e # exit on errors

# "DEPENDECIES ========================================================================"
cd $ROOT_PATH
cd ${ROOT_PATH}

#install prefix and path
export INSTALL_PREFIX="$APPROXMVBB_CACHE_DIR"
export PATH="$INSTALL_PREFIX/bin:$PATH"
export INSTALL_PREFIX="${APPROXMVBB_CACHE_DIR}"
export PATH="${INSTALL_PREFIX}/bin:${PATH}"

brew update
brew tap homebrew/versions
Expand All @@ -20,7 +20,7 @@ brew link --overwrite gcc
if [[ ${APPLE_CLANG} != "YES" ]]; then
brew install llvm
brew link --overwrite llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
export PATH="/usr/local/opt/llvm/bin:${PATH}"
fi

# Cmake
Expand All @@ -35,8 +35,8 @@ echo "CC set to ${CC}"
${CXX} --version
cmake --version

chmod +x $CHECKOUT_PATH/travis/install_dep.sh
. $CHECKOUT_PATH/travis/install_dep.sh
chmod +x ${CHECKOUT_PATH}/travis/install_dep.sh
. ${CHECKOUT_PATH}/travis/install_dep.sh

# "DEPENDECIES COMPLETE ================================================================="

Expand Down

0 comments on commit 603cab7

Please sign in to comment.