dds-bridge / dds

Double Dummy Solver written in C++ for the Bridge Card Game
Apache License 2.0
128 stars 93 forks source link

Building on MAC with M1-chip #125

Open ThorvaldAagaard opened 1 year ago

ThorvaldAagaard commented 1 year ago

When executing

brew reinstall gcc --without-multilib

I got this response: Error: invalid option: --without-multilib

 gcc -v
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.6.0
Thread model: posix

Well this is probably only a performance problem

I went on and copied the makefile for Mac clang, and now hit the next problem as sprint is deprecated.

After replacing sprint with snprintf (second parameter is now a length of first parameter) the compile error went away, and I hit the next problem.

In file included from System.cpp:19:
./parallel.h:21:12: fatal error: 'boost/thread.hpp' file not found
  #include <boost/thread.hpp>
           ^~~~~~~~~~~~~~~~~~

Anyone got a compiled version for the M1-processor?

ZiggerZZ commented 1 year ago

Check #126

timanderson commented 6 months ago

I just used Xcode

ThorvaldAagaard commented 6 months ago

I just used Xcode

How? I have solved the problem following ZiggerZZ, but interested in using Xcode if there comes an update

timanderson commented 6 months ago

This is what I did as I recall:

Run Xcode, choose Library template, give it a name dds, Framework None, Type Dynamic, click Create. Click Add files, check copy files if needed, add the include and src directories from the dds source, leave Add to targets checked. Remove the makefiles. Build then worked, even without fixing up sprintf

ThorvaldAagaard commented 6 months ago

Thx, I will try that, I assume Xcode 15?

timanderson commented 6 months ago

Yes Xcode 15.2 currently. Need to look at the multi-threading.

timanderson commented 6 months ago

I found that defining the DDS_THREADS_GCD preprocessor macro is enough to get threading working

fanyf22 commented 3 months ago

I used brew install boost, and replaced the CC_BOOST location in Makefiles/Makefile_Mac_clang_shared with the installed path. In addition, I remove the warning flags. Everything worked after I did these steps. Hope it can help you.