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

compiling on mac m1 the current branch ldpc_v2 #19

Open
alexandrupaler opened this issue Nov 22, 2023 · 6 comments
Open

compiling on mac m1 the current branch ldpc_v2 #19

alexandrupaler opened this issue Nov 22, 2023 · 6 comments

Comments

@alexandrupaler
Copy link

alexandrupaler commented Nov 22, 2023

In order to compile the version of the branch I had to do the following:

  1. brew install libomp
  2. edit line 24 in CMakeLists.txt to be target_include_directories(ldpc INTERFACE src_cpp include/robin_map include/rapidcsv /opt/homebrew/opt/libomp/include)
  3. comment the tests from TestDecoder.cpp lines 347 and 378 -- compiler was complaining about constructors
@alexandrupaler
Copy link
Author

and line 125 in setup.py
include_dirs=[np.get_include(),'src_cpp', 'include/robin_map','include/ldpc/src_cpp', '/opt/homebrew/opt/libomp/include'],

@quantumgizmos
Copy link
Owner

Hi Alexandru. Thanks for testing out the new version!

It seems as though this a problem specefic to the M1 Macs. The latest commit includes the "-fopenmp" cxx compile flag. Could you check whether it compiles and runs now?

I'll integrate the fix into the github action once we've pinpointed the problem.

@quantumgizmos
Copy link
Owner

Hi Alexandru. Temporary fix (I hope) is to remove OpenMp support. Could you test the latest version on your M1 Mac. You can install from TestPyPi by running the following:

pip install -U numpy scipy tqdm pytest
pip install -i https://test.pypi.org/simple/ ldpc

@burgholzer
Copy link
Contributor

Just a side comment, since I noticed the discussion over here. Cross-compilation with external dependencies can be painful.
We made that work after lots of trial and error in the past for our Munich Quantum Toolkit.

In the meantime we switched to CirrusCI (https://cirrus-ci.org) which offers free native apple silicon runners for open source projects. Works like a charm in combination with the standard GitHub actions to build the regular wheels.
You can find an example for a CI setup here: https://github.com/cda-tum/mqt-ddsim/blob/main/.cirrus.yml
Maybe it's also interesting for you to adopt that. Also makes it easier to test since you can actually run tests in CI.
(And a simple brew install libomp will just work)

@quantumgizmos
Copy link
Owner

Hi @burgholzer

Thanks. Yes getting the Github actions to work has always been a nightmare.
Cirrus CI definitely sounds like it's worth a try. Thanks for the tip!

@alexandrupaler
Copy link
Author

apologies for late response.
on apple silicon the openmp libraries seem to be disconnected from the compiler and one needs to point the compiler with linker and include paths

the 'brew install libomp` will work almost out of the box if the paths are added to the cmakefile and setup.py

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

No branches or pull requests

3 participants