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

Add catch trap for Apple Silicon CPUs to make it compile on M1 Apple computers #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janmalec
Copy link

@janmalec janmalec commented Feb 8, 2021

What the title says, I have added an ARM compatible catch trap so I can use NJOY on ARM based Macbook.

@jlconlin
Copy link
Member

jlconlin commented Feb 8, 2021

Thank you @janmalec for your input on this. Ideally, we would update to whatever the Catch2 folks are doing. However, we are far behind them.

Do you know how they are solving this issue?

@janmalec
Copy link
Author

janmalec commented Feb 8, 2021

I have just checked Catch2 and it appears that I have reinvented the wheel.
They have used the same fix in this commit:
catchorg/Catch2@a25c1a2

@janmalec
Copy link
Author

janmalec commented Nov 15, 2022

Hello, is there any chance you would accept this pull request as a temporary measure? The Catch2 code is using the same fix as this version. I agree with you on the fact that migrating to Catch2 would be the ideal solution.

@whaeck
Copy link
Member

whaeck commented Nov 15, 2022

Hi Jan,

Internally, we are now using a few ARM M1 Apple laptops (I now have one as well) and we have therefore noticed the issue.

I also noticed an additional issue with the M1. As you may know, some of our libraries like ENDFtk and ACEtk have python bindings that do compile on an M1 but when importing the module in python we are getting errors stating that the architecture used in the compilation is not as expected. We found that adding the following cmake directive when configuring on an M1 solves the python issue, but also the Catch issue you are experiencing:

-DCMAKE_OSX_ARCHITECTURES=x86_64

We are currently debating whether or not to retire the Catch adapter entirely and to use a regular Catch or Catch2 release instead - to reduce the number of internal dependencies that we need to maintain. Doing this would effectively solve the issue you pointed out as well.

As an additional FYI: if you are using NJOY21, you can actually move to NJOY2016 without issues since NJOY21 uses this version under the hood anyway.

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.

3 participants