Skip to content

Commit

Permalink
Merge branch 'ssashir06-mac-cmake'
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Jan 18, 2018
2 parents aada63d + f1c0f4c commit 3f7d618
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 33 deletions.
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,26 @@ deps/
car_assets.zip
/PythonClient/cloud.txt
__pycache__/
/PythonClient/metrics/
/PythonClient/metrics/

### Xcode ###
build/
DerivedData/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
*.moved-aside
*.xccheckout
*.xcscmblueprint
*.xcworkspacedata
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
3 changes: 3 additions & 0 deletions AirLib/src/api/RpcLibClientBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ STRICT_MODE_OFF
#define RPCLIB_MSGPACK clmdep_msgpack
#endif // !RPCLIB_MSGPACK
#undef check
#ifdef nil
#undef nil
#endif // nil
#include "rpc/client.h"
#include "api/RpcLibAdapatorsBase.hpp"
STRICT_MODE_ON
Expand Down
3 changes: 3 additions & 0 deletions AirLib/src/vehicles/car/api/CarRpcLibClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ STRICT_MODE_OFF
#define RPCLIB_MSGPACK clmdep_msgpack
#endif // !RPCLIB_MSGPACK
#undef check
#ifdef nil
#undef nil
#endif // nil
#include "rpc/client.h"
#include "vehicles/car/api/CarRpcLibAdapators.hpp"
STRICT_MODE_ON
Expand Down
3 changes: 3 additions & 0 deletions AirLib/src/vehicles/multirotor/api/MultirotorRpcLibClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ STRICT_MODE_OFF
#define RPCLIB_MSGPACK clmdep_msgpack
#endif // !RPCLIB_MSGPACK
#undef check
#ifdef nil
#undef nil
#endif // nil
#include "rpc/client.h"
#include "vehicles/multirotor/api/MultirotorRpcLibAdapators.hpp"
STRICT_MODE_ON
Expand Down
27 changes: 27 additions & 0 deletions Unreal/Environments/Blocks/GenerateProjectFiles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -x
set -e

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

UnrealDir=$1
if [[ ! -e "$UnrealDir" ]]; then
# UnrealDir variable must be set like '/Users/Shared/Epic\ Games/UE_4.16'
echo "UnrealDir is not set."
exit 1
fi

if [ "$(uname)" == "Darwin" ]; then
# Call UnrealEngine shell scrpit
pushd "$UnrealDir/Engine/Build/BatchFiles/Mac/" >/dev/null
./GenerateProjectFiles.sh "$SCRIPT_DIR/Blocks.uproject"
popd >/dev/null
else
echo "Not implemented"
exit 1
fi

popd >/dev/null
set +x
9 changes: 7 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ if [[ !(-d "./llvm-build/output/lib") ]]; then
fi

# set up paths of clang compiler
export CC="clang-3.9"
export CXX="clang++-3.9"
if [ "$(uname)" == "Darwin" ]; then
export CC=/usr/local/opt/llvm\@3.9/bin/clang
export CXX=/usr/local/opt/llvm\@3.9/bin/clang++
else
export CC="clang-3.9"
export CXX="clang++-3.9"
fi

#install EIGEN library
if [[ !(-d "./AirLib/deps/eigen3/Eigen") ]]; then
Expand Down
34 changes: 10 additions & 24 deletions install_run_all.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,10 @@ set -x

#confirm unreal install directory
UnrealDir=$1
if [[ !(-z "UnrealDir") ]]; then
UnrealDir="$SCRIPT_DIR/UnrealEngine"
fi

read -p "Unreal will be installed in $UnrealDir. To change it invoke script with path argument. Continue? " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
popd >/dev/null
exit 0
fi

#install unreal
if [[ !(-d "$UnrealDir") ]]; then
git clone -b 4.17 https://github.com/EpicGames/UnrealEngine.git "$UnrealDir"
pushd "$UnrealDir" >/dev/null

./Setup.sh
./GenerateProjectFiles.sh
make

popd >/dev/null
if [[ -z "$UnrealDir" ]]; then
# UnrealDir variable must be set like '/Users/Shared/Epic\ Games/UE_4.16'
echo "UnrealDir is not set."
exit 1
fi

#install airsim
Expand All @@ -39,7 +21,11 @@ fi

#start Unreal editor with Blocks project
pushd "$UnrealDir" >/dev/null
Engine/Binaries/Linux/UE4Editor "$SCRIPT_DIR/AirSim/Unreal/Environments/Blocks/Blocks.uproject" -game -log
if [ "$(uname)" == "Darwin" ]; then
Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor "$SCRIPT_DIR/Unreal/Environments/Blocks/Blocks.uproject" -game -log
else
Engine/Binaries/Linux/UE4Editor "$SCRIPT_DIR/Unreal/Environments/Blocks/Blocks.uproject" -game -log
fi
popd >/dev/null

popd >/dev/null
popd >/dev/null
32 changes: 26 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ if [ "$(uname)" == "Darwin" ]; then

#below takes way too long
# brew install [email protected]
brew install --force-bottle homebrew/versions/llvm39
brew install --force-bottle [email protected]

brew install wget
brew install cmake

export C_COMPILER=/usr/local/opt/llvm\@3.9/bin/clang
export COMPILER=/usr/local/opt/llvm\@3.9/bin/clang++
else
if [[ ! -z "${whoami}" ]]; then #this happens when running in travis
sudo /usr/sbin/useradd -G dialout $USER
Expand All @@ -37,6 +43,9 @@ else
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-get update
sudo apt-get install -y clang-3.9 clang++-3.9

export C_COMPILER=clang-3.9
export COMPILER=clang++-3.9
fi

# Download high-polycount SUV model
Expand Down Expand Up @@ -84,12 +93,14 @@ else
fi

#build libc++
sudo rm -rf llvm-build
if [ "$(uname)" == "Darwin" ]; then
rm -rf llvm-build
else
sudo rm -rf llvm-build
fi
mkdir -p llvm-build
pushd llvm-build >/dev/null

export C_COMPILER=clang-3.9
export COMPILER=clang++-3.9

cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \
-LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF -DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=OFF \
Expand All @@ -99,12 +110,21 @@ cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \
make cxx

#install libc++ locally in output folder
sudo make install-libcxx install-libcxxabi
if [ "$(uname)" == "Darwin" ]; then
make install-libcxx install-libcxxabi
else
sudo make install-libcxx install-libcxxabi
fi

popd >/dev/null

#install EIGEN library
sudo rm -rf ./AirLib/deps/eigen3/Eigen

if [ "$(uname)" == "Darwin" ]; then
rm -rf ./AirLib/deps/eigen3/Eigen
else
sudo rm -rf ./AirLib/deps/eigen3/Eigen
fi
echo "downloading eigen..."
wget http://bitbucket.org/eigen/eigen/get/3.3.2.zip
unzip 3.3.2.zip -d temp_eigen
Expand Down

0 comments on commit 3f7d618

Please sign in to comment.