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

Installing on Mac with Apple Silicon (M1) #52

Open
0xsoria opened this issue Mar 27, 2023 · 2 comments
Open

Installing on Mac with Apple Silicon (M1) #52

0xsoria opened this issue Mar 27, 2023 · 2 comments

Comments

@0xsoria
Copy link

0xsoria commented Mar 27, 2023

Anyone had success installing IO2D on M1 macs?

I downloaded the recommended version of LLVM, but it's a X86 version, so I downloaded a newer version that supports arm64, but when building the project I had a compilation error on catch.hpp, it says it can't find this file.
Then I changed Xcode to run under Rosetta, downloaded the 6.0.0 version of LLVM, and tried to build IO2D and I even more errors. I think if I change my terminal to run under Rosetta and download all dependencies and cmake for X86 I would manage to run the project, but that is too much, there should be a way to run the project on arm64. Can someone help me?

@ali-samer
Copy link

The catch.hpp file may contain instructions that are not fully compatible with the m1 architecture. In my case I was able to work around that issue by commenting out the function call that is supposedly not supported by my system. {
#define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } open the P0267 project and
locate the function call in your catch.hpp file. comment it and build again using your prefered build automation tool. if that doesn't work then I'd say your best bet is to completely disregard the Test directory by commenting out the line that includes it in the build process. navigate over to cmakelists.txt, locate add_subdirectory(Tests) and comment it out. You obviously won't be able to build your test files after doing this and I believe this temporary solution should at least help you get started with the project.

@nellsummer
Copy link

nellsummer commented Oct 25, 2024

The Catch2 version in the io2d repo is outdated for Apple M1. I found two solutions:

Solution 1, the easy one:
In P0267_RefImpl/CMakeLists.txt, comment out test so when run ALL_BUILD, tests don't get compiled.
#if( NOT DEFINED IO2D_WITHOUT_TESTS )
#enable_testing()
#add_subdirectory(P0267_RefImpl/Tests)
#endif()

Solution 2, if you want to use Catch for io2d:

  1. Update thirdparty/P0267_RefImpl/P0267_RefImpl/Tests/Catch2 to V2.13.10 from https://github.com/catchorg/Catch2/tree/v2.x. The reason to use V2 not V3 which is the latest version is that V2.13.10 still has the catch.cpp in single_include folder so it requires less modification to the codes.
  2. Modify include in all test files in thirdparty/P0267_RefImpl/P0267_RefImpl/Tests from #include "catch.hpp" to #include "catch2/catch.hpp".

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