Skip to content

Commit

Permalink
fixed pushd issue in setup.sh, cmake issue with -L
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Jul 21, 2017
1 parent 9418af2 commit a2beb08
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 22 deletions.
5 changes: 3 additions & 2 deletions Unreal/Environments/Blocks/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

# get path of current script: https://stackoverflow.com/a/39340259/207661
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd "$SCRIPT_DIR"
pushd "$SCRIPT_DIR" >/dev/null

set -e
set -x

# clean temporary unreal folders
rm -rf Binaries
Expand All @@ -14,4 +15,4 @@ rm -rf Plugins/AirSim/Binaries
rm -rf Plugins/AirSim/Intermediate
rm -rf Plugins/AirSim/Saved

popd
popd >/dev/null
6 changes: 3 additions & 3 deletions Unreal/Environments/Blocks/update_from_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

# get path of current script: https://stackoverflow.com/a/39340259/207661
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd "$SCRIPT_DIR"
pushd "$SCRIPT_DIR" >/dev/null

set -e
set +x
set -x

rsync -a --exclude 'temp' --delete ../../Plugins/AirSim Plugins/AirSim
rsync -a --exclude 'temp' --delete ../../../AirLib Plugins/AirSim/Source/AirLib

popd
popd >/dev/null
14 changes: 7 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# get path of current script: https://stackoverflow.com/a/39340259/207661
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd "$SCRIPT_DIR"
pushd "$SCRIPT_DIR" >/dev/null

set -e
set -x
Expand Down Expand Up @@ -46,19 +46,19 @@ fi

if [[ ! -d $build_dir ]]; then
mkdir -p $build_dir
pushd $build_dir
pushd $build_dir >/dev/null

cmake ../cmake -DCMAKE_BUILD_TYPE=Debug \
|| (cd .. && rm -r $build_dir && exit 1)
popd &>/dev/null
|| (popd && rm -r $build_dir && exit 1)
popd >/dev/null
fi

pushd $build_dir
pushd $build_dir >/dev/null
# final linking of the binaries can fail due to a missing libc++abi library
# (happens on Fedora, see https://bugzilla.redhat.com/show_bug.cgi?id=1332306).
# So we only build the libraries here for now
make
popd &>/dev/null
popd >/dev/null


mkdir -p AirLib/lib/x64/Debug
Expand Down Expand Up @@ -94,4 +94,4 @@ echo "https://github.com/Microsoft/AirSim/blob/master/docs/linux_build.md"
echo "=================================================================="


popd
popd >/dev/null
4 changes: 2 additions & 2 deletions clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# get path of current script: https://stackoverflow.com/a/39340259/207661
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd "$SCRIPT_DIR"
pushd "$SCRIPT_DIR" >/dev/null

set -e
set +x
Expand All @@ -11,4 +11,4 @@ rm -rf build_debug
rm -rf build_release
rm -rf cmake/output

popd
popd >/dev/null
6 changes: 3 additions & 3 deletions cmake/cmake-modules/CommonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ macro(CommonSetup)
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
# make sure to match the compiler flags with which the Unreal
# Engine is built with
set(CMAKE_EXE_LINKER_FLAGS "\
${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++ -lc++abi -lm -lc -lgcc_s -lgcc -ldl \
-Wl,-rpath,${LIBCXX_LIB_PATH}")
set(CMAKE_CXX_FLAGS "\
-nostdinc++ -isystem ${LIBCXX_INC_PATH} \
-D__CLANG__ ${CMAKE_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "\
${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++ -lc++abi -lm -lc -lgcc_s -lgcc -ldl \
-L ${LIBCXX_LIB_PATH}")
set(CXX_EXP_LIB "-lc++experimental")

if("${BUILD_TYPE}" STREQUAL "debug")
Expand Down
13 changes: 8 additions & 5 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -x
set -e

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd "$SCRIPT_DIR"
pushd "$SCRIPT_DIR" >/dev/null

#get sub modules
git submodule update --init --recursive
Expand All @@ -28,7 +28,8 @@ fi

#build libc++
sudo rm -rf llvm-build
mkdir llvm-build && cd llvm-build
mkdir -p llvm-build
pushd llvm-build >/dev/null

export C_COMPILER=clang-3.9
export COMPILER=clang++-3.9
Expand All @@ -43,22 +44,24 @@ make cxx
#install libc++ locally in output folder
sudo make install-libcxx install-libcxxabi

popd >/dev/null

#install EIGEN library
if [[ -z "${EIGEN_ROOT}" ]] || [[ ! -d eigen ]]; then
echo "EIGEN_ROOT variable is not set"
if [[ ! -d eigen ]]; then
echo "downloading eigen..."
wget http://bitbucket.org/eigen/eigen/get/3.3.2.zip
unzip 3.3.2.zip -d eigen
pushd eigen
pushd eigen >/dev/null
mv eigen* eigen3
echo "3.3.2" > version
popd &>/dev/null
popd >/dev/null
rm 3.3.2.zip
fi
fi

popd
popd >/dev/null

set +x
echo ""
Expand Down

0 comments on commit a2beb08

Please sign in to comment.