Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OSX compiler support #15

Merged
merged 5 commits into from
Feb 18, 2017

Conversation

8W9aG
Copy link
Contributor

@8W9aG 8W9aG commented Feb 18, 2017

This introduces some minor changes which enables AirSim to be compiled on OSX successfully.

Tested on:
Xcode 8.2.1
OSX 10.12.3

I have yet to test whether this works, but thought I'd get that going after this is in.

* Apple requires this for mkdir
* Unix supports UTF8 paths which the converter will
handle
* Unix does not have support for wstring initializations
of ofstream or ifstream
* AppleClang will error when this not provided
@msftclas
Copy link

Hi @8W9aG, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@lovettchris lovettchris merged commit 82f0790 into microsoft:master Feb 18, 2017
@lovettchris
Copy link
Member

Thanks!

@lovettchris
Copy link
Member

Now you can test it by following these instructions: https://youtu.be/HNWdYrtw3f0

@lovettchris
Copy link
Member

Hey can you also do the cla thing? Thanks.

@DJISDKUser
Copy link

Can you include the proper linking for OS X ?

1 warning generated.
[100%] Linking CXX executable DroneShell
ld: warning: ignoring file /tmp/AirSim/AirLib/deps/rpclib/lib/x64/linux/librpc.a, file was built for archive which is not the architecture being linked (x86_64): /tmp/AirSim/AirLib/deps/rpclib/lib/x64/linux/librpc.a
Undefined symbols for architecture x86_64:
"rpc::client::get_next_call_idx()", referenced from:
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<float, float, float, float, float>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float, float, float, float, float) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<std::__1::vector<msr::airlib_rpclib::RpcLibAdapators::Vector3r, std::__1::allocatormsr::airlib_rpclib::RpcLibAdapators::Vector3r >, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::vector<msr::airlib_rpclib::RpcLibAdapators::Vector3r, std::__1::allocatormsr::airlib_rpclib::RpcLibAdapators::Vector3r >, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float) in libAirLib.a(RpcLibClient.cpp.o)
...
"rpc::client::post(std::__1::shared_ptr<clmdep_msgpack::v1::sbuffer>, int, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::shared_ptr<std::__1::promise<clmdep_msgpack::v1::object_handle> >)", referenced from:
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<float, float, float, float, float>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float, float, float, float, float) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<std::__1::vector<msr::airlib_rpclib::RpcLibAdapators::Vector3r, std::__1::allocatormsr::airlib_rpclib::RpcLibAdapators::Vector3r >, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::vector<msr::airlib_rpclib::RpcLibAdapators::Vector3r, std::__1::allocatormsr::airlib_rpclib::RpcLibAdapators::Vector3r >, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float) in libAirLib.a(RpcLibClient.cpp.o)
...
"rpc::client::wait_conn()", referenced from:
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<float, float, float, float, float>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float, float, float, float, float) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<std::__1::vector<msr::airlib_rpclib::RpcLibAdapators::Vector3r, std::__1::allocatormsr::airlib_rpclib::RpcLibAdapators::Vector3r >, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::vector<msr::airlib_rpclib::RpcLibAdapators::Vector3r, std::__1::allocatormsr::airlib_rpclib::RpcLibAdapators::Vector3r >, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float) in libAirLib.a(RpcLibClient.cpp.o)
std::__1::future<clmdep_msgpack::v1::object_handle> rpc::client::async_call<float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, float, float, float, float, msr::airlib::DrivetrainType, msr::airlib_rpclib::RpcLibAdapators::YawMode, float, float) in libAirLib.a(RpcLibClient.cpp.o)
...
"rpc::client::client(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, unsigned short)", referenced from:
msr::airlib::RpcLibClient::impl::impl(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, unsigned short) in libAirLib.a(RpcLibClient.cpp.o)
"rpc::client::~client()", referenced from:
msr::airlib::RpcLibClient::impl::~impl() in libAirLib.a(RpcLibClient.cpp.o)
"typeinfo for rpc::rpc_error", referenced from:
main::$_0::operator()(std::exception&) const in main.cpp.o
GCC_except_table1287 in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [DroneShell/DroneShell] Error 1
make[1]: *** [DroneShell/CMakeFiles/DroneShell.dir/all] Error 2

@8W9aG
Copy link
Contributor Author

8W9aG commented Feb 18, 2017

Sorry about that I was just compiling the AirLib library, I'll fix the linking issues on the HelloDrone target pronto

@DJISDKUser
Copy link

Don't be sorry! Thanks for what you have done thus far. Seeing it hit 100% made me grin.

@8W9aG
Copy link
Contributor Author

8W9aG commented Feb 18, 2017

Fix here: #16

@sytelus sytelus mentioned this pull request Feb 22, 2017
@lzl200102109
Copy link

I am trying to compile the code using cmake. I installed all the prerequisites and did a git submodule update to clone the external/rpclib.

But then when I ran build.sh under the cmake folder, it gives me an error saying that

CMake Error at CMakeLists.txt:4 (add_subdirectory):
  add_subdirectory given source "{AIRSIM_ROOT}/external/rpclib" which is not
  an existing directory.


CMake Error at CMakeLists.txt:5 (ADD_CUSTOM_COMMAND):
  No TARGET 'rpc' has been created in this directory.

Did anyone have this issue? How do I solve it?

@sytelus
Copy link
Contributor

sytelus commented Feb 25, 2017

Aha... first you need to get rpclib submodule.

git submodule update --init --recursive

BTW, there is a bug in CMakeLists.txt. We need to make AirLib dependent on rpclib. Please feel free to change. I've get my Linux m/c ready for testing this first...

@lzl200102109
Copy link

@sytelus I followed your instruction and ran this line in a brand new clone of AirSim.

git submodule update --init --recursive

But I still get the same error as before. I have Eigen, Boost, and gcc/g++6 installed and detected properly.

And how do I fix the CMakeLists.txt, to make AirLib dependent on rpclib? I am not very good with cmake.

Thank you! I am very excited about this, and really want to try it out.

@lovettchris
Copy link
Member

I'm working on fixing this right now, stay tuned...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants