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 support for building on Mac OS X #2433

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

geohot
Copy link

@geohot geohot commented Feb 3, 2020

This is all the work of analog-cbarber, I just rebased it on master and submitted the pull request. Would close issue #150

It would be great to have OS X binaries. Should be possible to refactor this to duplicate the build scripts less as well.

What would it take to get this merged?


This change is Reviewable

analog-cbarber and others added 30 commits August 16, 2018 15:41
This uses a standard UE 4.19 download with one minor
addition: copy the GenerateProjectFiles.sh script from
a UnrealEngine source tree into the root 4.19 directory.

Requires Xcode 9.2, which is the latest version that is
compatiable with OSX 10.12.6 (Sierra).

Was able to build everything using python2 API.

You may need to define a ~/user-config.jam file to
describe your Python installations to be able to
build boost-python.

Still need to figure out how to build more than one
version of libboost-python.
Someone was able to make 9.4.1 work (see comment for issue carla-simulator#150),
so I will assume anything with version 9.2 or later is ok.
You can run Setup.command with --no-xcode command to
use the Linux build tools (Ninja and make).
Had been failing on test for Message exceeding max size.
This fixes the broken python tests, which were failing
because the path to the egg was incorrect for the Mac.
@update-docs
Copy link

update-docs bot commented Feb 3, 2020

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update our CHANGELOG.md based on your changes.

@@ -105,7 +105,7 @@ namespace adaptor {

private:

template <uint64_t I>
template <unsigned long I>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Make this OS dependent?

@@ -22,8 +22,7 @@ namespace client {
/// @todo Works as a list but its actually a map. We should assess the use
/// cases and reconsider this implementation.
class BlueprintLibrary
: public EnableSharedFromThis<BlueprintLibrary>,
private NonCopyable {
: public EnableSharedFromThis<BlueprintLibrary> {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this due to a complaint about the move constructor, can look more into it.

@@ -37,7 +37,7 @@ namespace std {

using argument_type = carla::road::element::Waypoint;

using result_type = uint64_t;
using result_type = unsigned long;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate based on OS?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any problem using uint64_t in Mac?

mono = default_font if default_font in fonts else fonts[0]
mono = pygame.font.match_font(mono)
self._font_mono = pygame.font.Font(mono, 14)
if sys.platform == 'darwin':
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be removed, pygame works fine on my Mac.

@@ -30,13 +30,13 @@ static void TestSequence(carla::ListView<Iterator> view) {
TEST(listview, sequence) {
int array[] = {0, 1, 2, 3, 4, 5};
TestSequence(MakeListView(array));
std::array<int, 6u> std_array = {0, 1, 2, 3, 4, 5};
std::array<int, 6u> std_array = {{0, 1, 2, 3, 4, 5}};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be changed?

# How to build CARLA on Mac OSX

Note that unlike the Linux build, this one uses the standard Mac compiler tools and
the standard Unreal Engine 4.21 distribution.
Copy link
Author

@geohot geohot Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Change to 4.22

@germanros1987
Copy link
Member

Hi @geohot hope things are going well at comma.

Thanks for taking care of this PR. We need to make sure that the existing CIs don't break. Also, if we want to take MacOS seriously, we need to put together new infrastructure for MacOS, so that this effort doesn't die with the next release.

@marcgpuig I know you are busy, but could you please become the champion for this PR? Please, don't let it die.

@wuxiaohua1011
Copy link

oh, is this thread dead? anybody still working on it?

@germanros1987
Copy link
Member

@wuxiaohua1011, This thread is just complicated, because we don't have a good way to put together a CI for MacOS with GPU support, making the automatic building and testing of a new build system for MacOS a big pain.

@geohot made an effort to build support, but without a proper CI it will be very hard for the CARLA team to maintain it.

Help is more than welcome.

@evdoks
Copy link

evdoks commented Jul 23, 2020

I have tried building Carla on Mac OS 10.15 Catalina with XCode 10 and ended up with a bunch of only virtual member functions can be marked 'override' errors.

E.g.,
carla/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Walker/WalkerController.h:48:33: error: only virtual member functions can be marked 'override'
I suspect it is caused by using XCode 10 instead of 9.4, as it is recommended in the installation guide. Unfortunately, Mac OS 10.15 Catalina does not support XCode 9.4, so XCode 10 is the only option.

Tried compiling with the latest version of XCode (11.6) and it breaks in the very beginning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog build system Changes related to the build system help wanted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants