I couldn't see Mac listen on read.me, so I wanted to be sure. does it have mac support ?
Not yet. Unfortunately Apple doesn't let us run a free version of their OS in a virtual machine, and as you can imagine there are not too many spare Mac computers around Microsoft for us to test on. But given that the Mac kernel is a close cousin to Linux, it shouldn't be that hard to get the Linux build working on Mac, right? There are some cmake files in the cmake folder that should get you going. Not sure what the translation is from gcc command line args to llvm though. We would just add another if (MAC) block in the CommonSetup.cmake file next to if (UNIX) and if (Win32). MavLinkCom depends on boost, I assume that works on Mac, and Eigen. Then there's one more spot where you'd need to implement "createdirectory", although the Unix code "mkdir" should work there, and there's a place where we'd like to find the user's Document folder to store our settings.json file, not sure what the convention on Mac is for that, but on unix we just use ~/Documents/AirSim. other than that the rest of the code is full cross platform except some of our tools (like LogViewer). But there are other tools that can view mavlink logs on Mac already.
Would appreciate if somebody shares compiled version
Here is the first hurdle...
$ brew install [email protected]
$ cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/[email protected]/3.2.10/
-- Running CommonSetup...
-- found AIRSIM_ROOT=/Users/kfinisterre/Desktop/AirSim
-- Found Eigen3: /usr/local/Cellar/[email protected]/3.2.10/include/eigen3 (Required is at least version "3")
-- Running CommonSetup...
-- found AIRSIM_ROOT=/Users/kfinisterre/Desktop/AirSim
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Running CommonSetup...
-- found AIRSIM_ROOT=/Users/kfinisterre/Desktop/AirSim
-- Boost_INCLUDE_DIR=/usr/local/include
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- system
-- Running CommonSetup...
-- found AIRSIM_ROOT=/Users/kfinisterre/Desktop/AirSim
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- Running CommonSetup...
-- found AIRSIM_ROOT=/Users/kfinisterre/Desktop/AirSim
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- Running CommonSetup...
-- found AIRSIM_ROOT=/Users/kfinisterre/Desktop/AirSim
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/kfinisterre/Desktop/AirSim/cmake
Kevins-MBP:cmake kfinisterre$ make
Scanning dependencies of target AirLib
[ 2%] Building CXX object AirLib/CMakeFiles/AirLib.dir/Users/kfinisterre/Desktop/AirSim/AirLib/src/control/DroneControlBase.cpp.o
clang: error: -Wl,--no-as-needed: 'linker' input unused [-Werror,-Wunused-command-line-argument]
clang: error: -ldl: 'linker' input unused [-Werror,-Wunused-command-line-argument]
clang: error: -ldl: 'linker' input unused [-Werror,-Wunused-command-line-argument]
make[2]: * [AirLib/CMakeFiles/AirLib.dir/Users/kfinisterre/Desktop/AirSim/AirLib/src/control/DroneControlBase.cpp.o] Error 1
make[1]: [AirLib/CMakeFiles/AirLib.dir/all] Error 2
make: ** [all] Error 2
That's cool, do you need to edit the CommonSetup.cmake file to modify the CMAKE_CXX_FLAGS so llvm is happy ?
Yeah this gets me a little further:
diff --git a/cmake/cmake-modules/CommonSetup.cmake b/cmake/cmake-modules/CommonSetup.cmake
index 75df3a3..c85e080 100644
--- a/cmake/cmake-modules/CommonSetup.cmake
+++ b/cmake/cmake-modules/CommonSetup.cmake
@@ -11,10 +11,10 @@ macro(CommonSetup)
IF(UNIX)
## I had to remove the following for Eigen to build properly: -Wlogical-op -Wsign-promo
## boost does not built cleam, so I had to disable these checks:
- set(BOOST_OVERRIDES " -Wno-error=undef -Wno-error=ctor-dtor-privacy -Wno-error=old-style-cast -Wno-error=shadow -Wno-error=redundant-decls -Wno-error=missing-field-initializers -Wno-error=unused-parameter")
+ set(BOOST_OVERRIDES " -Wno-error=ctor-dtor-privacy -Wno-error=shadow -Wno-error=redundant-decls -Wno-error=missing-field-initializers")
## Mavlink requires turning off -pedantic and -Wno-error=switch-default
set(MAVLINK_OVERRIDES "-Wno-error=switch-default ")
- set(CMAKE_CXX_FLAGS "-std=c++14 -ggdb -Wall -Wextra -Wstrict-aliasing -Werror -fmax-errors=2 -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option ${MAVLINK_OVERRIDES} ${BOOST_OVERRIDES} -Wl,--no-as-needed -ldl -ldl ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "-std=c++14 -ggdb -Wall -Wextra -Wstrict-aliasing -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option ${MAVLINK_OVERRIDES} ${BOOST_OVERRIDES} ${CMAKE_CXX_FLAGS}")
set(BUILD_PLATFORM "x64")
ELSE()
Next up is this:
/Users/xxx/Desktop/AirSim/AirLib/src/control/MavLinkDroneControl.cpp:287:32: error: default initialization of an object of const type 'const msr::airlib::VehicleParams' without a user-provided
default constructor
static const VehicleParams vehicle_params_;
^
{}
Which can be worked around by removing the const declaration
diff --git a/AirLib/src/control/MavLinkDroneControl.cpp b/AirLib/src/control/MavLinkDroneControl.cpp
index f243329..ac0935d 100644
--- a/AirLib/src/control/MavLinkDroneControl.cpp
+++ b/AirLib/src/control/MavLinkDroneControl.cpp
@@ -284,7 +284,7 @@ const VehicleParams& MavLinkDroneControl::getVehicleParams()
//TODO: decouple DroneControlBase, VehicalParams and SafetyEval
const VehicleParams& MavLinkDroneControl::getInternalVehicleParams()
{
- static const VehicleParams vehicle_params_;
+ static VehicleParams vehicle_params_;^M
return vehicle_params_; //defaults are good for DJI Matrice 100
}
Right now we are seeing some odd behaviour in GCC but theoretically our C++ code is designed to be cross platform so it should be compilable on Mac. Unreal also works on Mac so theoretically you should be able to make things work. A limiting factor, however, would be GPU capacity on Mac. Even moderate scale environments require 4GB GPU RAM. I highly doubt underpowered MBPs would cut it.
so, we need to have strong GPU (like nvidia 1070 or so?) to use this software ? integrated graphics has no luck then ? gosh :(
can you specify the minimum requirements on the readMe ? thanks
Thanks to Will Sackfield, the OSX build now works. See commit details.
I still get an error...
1 warning generated.
[ 97%] Linking CXX executable MavLinkTest
[ 97%] Built target MavLinkTest
1 warning generated.
[100%] Linking CXX executable DroneShell
ld: warning: ignoring file /Users/kfinisterre/Desktop/AirSim/AirLib/deps/rpclib/lib/x64/linux/librpc.a, file was built for archive which is not the architecture being linked (x86_64): /Users/kfinisterre/Desktop/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
std::__1::future
Ah, so we need a mac build for the GitHub "rpclib" library then...
there is a pull request that moves rpclib to git submodule, which is the right fix for OSX.
@clovett This should help you get going... I have the manual steps to try to PR (before it gets merged) https://github.com/Microsoft/AirSim/pull/16#issuecomment-280828193
I've merged PR16. Let's continue this discussion at https://github.com/Microsoft/AirSim/issues/36. I'll close this issue as duplicate for now.
@lovettchris, WRT Apple doesn't let us run a free version of their OS in a virtual machine, it looks like Travis CI offers OS X build environments with XCode (up to and including 10.12 and XCode 8.2):
https://docs.travis-ci.com/user/osx-ci-environment/#Compilers-and-Build-toolchain
Since this is a public github project, that service is free. I've started an example yml file that is a work in progress (build not successful). I can make a pull request when it's building or make one now and let more people help fix it. Getting/keeping this working would go along way to help address #2, #15, #36, #18, #19, #43, #72
In the OpenPilot project we used to have trusted project members run the OSX build agents for Atlassian toolset on our machines. Can we do that for you in this case? Offer up a legit machine agent for your builds ?
@ghexp That is very cool - didn't know that option was available in Travis CI. Would love to see AirSim working right out of the box on a Mac - I know several people who would be interested immediately.
Can anyone share the steps to get AirSim running in MacOS?
I gave up a while ago... has anything changed recently?
On Tue, Oct 3, 2017 at 9:38 AM, Raymond Chua notifications@github.com
wrote:
Can anyone share the steps to get AirSim running in MacOS?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/AirSim/issues/2#issuecomment-333844328, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AYdcf0tZwuv6Hjjn1hQ-aFYk6idUYLz-ks5soji_gaJpZM4MCdFT
.
Most helpful comment
Not yet. Unfortunately Apple doesn't let us run a free version of their OS in a virtual machine, and as you can imagine there are not too many spare Mac computers around Microsoft for us to test on. But given that the Mac kernel is a close cousin to Linux, it shouldn't be that hard to get the Linux build working on Mac, right? There are some cmake files in the cmake folder that should get you going. Not sure what the translation is from gcc command line args to llvm though. We would just add another if (MAC) block in the CommonSetup.cmake file next to if (UNIX) and if (Win32). MavLinkCom depends on boost, I assume that works on Mac, and Eigen. Then there's one more spot where you'd need to implement "createdirectory", although the Unix code "mkdir" should work there, and there's a place where we'd like to find the user's Document folder to store our settings.json file, not sure what the convention on Mac is for that, but on unix we just use ~/Documents/AirSim. other than that the rest of the code is full cross platform except some of our tools (like LogViewer). But there are other tools that can view mavlink logs on Mac already.