PMunch/futhark

MacOS build instructions

awr1 opened this issue · 3 comments

awr1 commented

Found out a way to build on Macs with Xcode.

  1. Make sure Xcode and its command line utilities are installed; i.e. xcode-select --install
  2. Build with: nimble install futhark --passL:"\"-L$(xcode-select --print-path)/usr/lib\"" to get Opir to properly link to the Xcode-provided libclang.

Thanks for the tip! Though, for me (MacOS Ventura 13.0), it was:

nimble install futhark --passL:"\"-L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib\"

xcode-select --print-path was returning only /Applications/Xcode.app/Contents/Developer, so the above command didn't work until I manually patched the path.

Combining the two: nimble install futhark --passL:'"-L$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/lib/"' works for me on MacOS 12.8 Monterey.

On Venture 13.1 (on Intel machine) the first suggestion worked for me, but not the others:

nimble install futhark --passL:"\"-L$(xcode-select --print-path)/usr/lib\""

It still couldn't run opir, though. I think a better solution is to do this first:

ln -s "$(xcode-select --print-path)/usr/lib/libclang.dylib" /usr/local/lib/libclang.dylib

then

nimble install futhark

should work