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

Mac compiling #69

Merged
merged 148 commits into from
Jul 31, 2017
Merged

Mac compiling #69

merged 148 commits into from
Jul 31, 2017

Conversation

TylerADavis
Copy link
Collaborator

@TylerADavis TylerADavis commented Jun 30, 2017

Resolves #54 . Set up cirrus so that it compiles on MacOS. I set this up as a pull request into the TCP branch so that it's easier to see what I changed, as this is based off the TCP branch. I reckon if we want to merge right into master we could just do that after we merge TCP.

Compiles on both Linux and Mac, and make check passes. cpplint has no errors.

Edit: Make check actually fails on linux. I'll look into this.

Make benchmark currently does not work due to the setup of run_benchmarks.py, but this is fixed in the main TCP branch.

Changes

  • Removed error.h header file from Synchronization.h as it was unused, and is not present on Macs
  • Renamed Time.h to CirrusTime.h. G++ was using our Time.h instead of the system time.h, leading to issues with compilation.
  • Switched to named semaphores, as unnamed semaphores are deprecated on MacOS
  • Added function to generate random unique names for semaphores in Synchronization.h
  • Removed Epoll Server, as we were not using it and as epoll is linux only
  • Added lines to bootstrap.sh that automatically rename the dynamic version of libcityhash so that it cannot be found by the linker. Does so in a platform dependent manner.
  • Added checks to all semaphore code to check for spurious wakeups
  • Split call to setsockopt into two, as Mac only allows for one option to be set at a time.
  • Set ip of all tests to be localhost

@TylerADavis TylerADavis changed the base branch from tcp to master July 10, 2017 18:02
@TylerADavis
Copy link
Collaborator Author

It turns out that test_mult_clients fails on mac for some reason, so I opened an issue ( #105 ). The latest two commits wrap the code for the named semaphore in an #ifdef __APPLE__ statement, so that linux uses unnamed semaphores. This roughly doubled the throughput at the 128 byte level (where the change would have the most impact) to 20,000 msg/s and 2.6MB/s

@jcarreira
Copy link
Owner

Managed to compile this after installing gcc 5.4 with ports:

sudo /opt/local/bin/port install gcc5
sudo /opt/local/bin/port select --list gcc

and changing the PATH environment variable.

@jcarreira
Copy link
Owner

Any problems with this? Looks good to me.

@jcarreira jcarreira merged commit 5e11b69 into master Jul 31, 2017
@jcarreira
Copy link
Owner

Latency with TCP is now around ~110us for a small put or get op. In line with the latency I get from ping.

@jcarreira jcarreira deleted the mac_compiling branch August 17, 2017 04:53
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.

Make Cirrus compile in MacOS
3 participants