Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Can this be built on an Intel or M1 Mac? #16

Open
rwhitby opened this issue Feb 19, 2022 · 9 comments
Open

Can this be built on an Intel or M1 Mac? #16

rwhitby opened this issue Feb 19, 2022 · 9 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@rwhitby
Copy link
Contributor

rwhitby commented Feb 19, 2022

Using this issue to determine if there is a viable build process for macOS.

Anyone tried this already?

@hansfbaier
Copy link
Collaborator

I'll try it gladly for a hardware donation 🙂

@jrrk2
Copy link
Contributor

jrrk2 commented Feb 19, 2022

Last time I tried openFPGAloader build in home brew (M1 iMac), but it didn’t find any devices.

@jrrk2 jrrk2 closed this as completed Feb 19, 2022
@jrrk2 jrrk2 reopened this Feb 19, 2022
@kdunn926
Copy link

@rwhitby - I built this on mac OS 10.13. I cobbled it together with some dependencies from Anaconda and brew - not the best approach. One specific worth noting was making sure to use clang for prjxray and nextpnr-xilinx... I did it roughly like this:

$ env BOOST_ROOT=/opt/anaconda3 CC=/usr/local/Cellar/llvm/10.0.1_1/bin/clang CXX=/usr/local/Cellar/llvm/10.0.1_1/bin/clang++ cmake -DARCH=xilinx -DCMAKE_INSTALL_PREFIX=/opt/nextpnr ..
$ make install
$ install_name_tool -add_rpath /opt/anaconda3/lib /opt/nextpnr/bin/nextpnr-xilinx

If I recall, one thing I needed to get openFPGAloader working correctly was this:
https://koblents.com/Ches/Original-Work/171-Unloading-FTDI-drivers-on-a-Mac-for-libftdi/

@rwhitby
Copy link
Contributor Author

rwhitby commented Feb 20, 2022

This command line seems to work for me on macOS Intel Montery 12.1:

env CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++ LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" cmake -DARCH=xilinx -DCMAKE_INSTALL_PREFIX=~/opt/nextpnr -DBUILD_GUI=0 ..

Will update this comment with the homebrew packages required later ...

@unbtorsten unbtorsten added the enhancement New feature or request label Feb 20, 2022
@rwhitby
Copy link
Contributor Author

rwhitby commented Feb 20, 2022

rwhitby#1 now supports building on Intel macOS.

@jrrk2
Copy link
Contributor

jrrk2 commented Feb 21, 2022

brew install boost-python is disabled on apple silicon, this could be the main issue stopping it from working on M1 Mac. Not sure why but rebuilding boost from source might reveal a more detailed reason. Python is wonderful except when it goes wrong, and I have a hard time debugging anything Python related.

@jrrk2
Copy link
Contributor

jrrk2 commented Feb 21, 2022

Duh, boost-python is obsolete and replaced by boost-python3

@jrrk2
Copy link
Contributor

jrrk2 commented Feb 21, 2022

It builds on AppleSilicon.

time make BOARD=genesys2 clean blinky.bit takes 12.4s on Intel Frost Canyon and 6.68s on AppleSilicon M1 iMac.

This is the first time I have seen Xilinx programming working on ARM, and leads to the interesting possibility of an FPGA modifying itself (using hard ARM or RISCV processor)

(the .fasm files are different between the two versions, but both seem to work)

openFPGAloader works on Apple as well, but Python3 and libusb had to be installed from source for unknown reasons, possibly cmake is treating python@3.9 as python2 (?)

@unbtorsten unbtorsten added the documentation Improvements or additions to documentation label Feb 23, 2022
@rwhitby
Copy link
Contributor Author

rwhitby commented Feb 26, 2022

Please comment on #28 with the macOS packages required.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants