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
building failed on Arm64 MacOS #1686
Comments
For my own reference, I can appear to recreate this on my intel mac using:
Seems to also be popping up online for other libraries. Hopefully can find a solution. |
There are solutions to translate SSE instructions to NEON, e.g. using https://github.com/DLTcollab/sse2neon or https://github.com/simd-everywhere/simde. But this would require adding additional dependencies to libigl, so imho we should move the |
Did the upstream code fix this SSE issue? |
No the upstream code is the same, but if we add the sse2neon dependency to the fast winding number code, I think we should do it in the upstream repository rather than keep it inside libigl. |
It doesn't seem like Neil is continuing to maintain that code. If we start maintaining it, why keep it in a separate repository? |
We could maintain it as a fork, like we do for triangle or tetgen. But jamming everything into a single header file and embedding it in libigl has several disadvantages. First you removed the TBB dependency, which is a performance hit. Second, others may want to use the code directly without going pulling all of libigl, and I think it's valuable to have a self-contained piece of code for that. Third, making everything header-only has other drawbacks, as discussed in #1696 (header pollution, compilation times, cannot separate interface from implementation, etc.). |
Hi, The errors after calling cmake and then make are just the same as posted here. |
I have similar problems building for Emscripten (WebAssembly). Would it be possible to add a preprocessor flag to disable FastWindingNumberForSoups? Version v2.2.0 works fine.
Edit: Just for the record, even with activated SIMD support in Emscripten it will not compile, because |
FYI I have created a PR against the original WindingNumber code, adding support for M1 architecture via SIMDE: |
Hi, Thanks a lot and sorry for my poor english :D |
We're working on a non-vectorized replacement and should have it integrated soon. For now, if you don't need fast winding numbers, then use libigl in header only mode. |
I'm using Fast Winding Number for an Offset Iso-Surface feature. |
If you read my message above, you will see that I have a fork of the FastWindingNumber repository that works on M1: This work is not integrated in libigl, but if you really want to use the fast winding numbers on M1, you should be able to do so via this fork. |
@jdumas - Thanks for the PR to try to fix this! Looking at the PR, it's hard to know how to go about integrating it into a project that uses libigl's fast winding number header. Can you clarify in the PR? You've added cmake stuff. Does that mean there are extra dependencies? We're using libigl in header-only mode. Thanks! |
Yes there's an extra dependency which is SIMDe (this does the translation of intrinsics). To use it just put these lines of codes in your CMake project: include(FetchContent)
FetchContent_Declare(
WindingNumber
GIT_REPOSITORY https://github.com/jdumas/WindingNumber.git
GIT_TAG cd81346bc8e31a5a77330b841d001e0efbf12f7f
)
FetchContent_MakeAvailable(WindingNumber)
target_link_libraries(my_lib PUBLIC WindingNumber::WindingNumber) |
Thank you. Does this mean that it's not possible to use this in header-only mode? |
No. |
Can you explain? If I'm reading this right, it's introducing a link-time dependency on the WindingNumber project? |
You have two options:
|
With #1975, the status for M1 compilation is: LIBIGL_EMBREE → not working (need to bump embree) Everything else compiles and tests pass except |
#1976 fixes LIBIGL_EMBREE Matlab doesn't yet support native m1 source and neither does mosek source. One option for Matlab, would be to use apple's rosetta (build x86_64 binaries), this is a bit of a pain for dependencies though, in particular CGAL's dependences on gmp and mpfr, which are gnarly to build from source. |
Meanwhile, it does seem possible to build libigl (including LIBIGL_RESTRICTED_MATLAB and LIBIGL_COPYLEFT_CGAL) using Rosetta. Here's a proof of concept script. I'm not sure if it makes sense / is possible to cmake-ify this script into something that would be easy to expose as a cmake option. |
FYI, 2.4.0 compiles fine again on Emscripten. |
great to know! thanks |
With #1985 merged, LIBIGL_COPYLEFT_CGAL compiles with rosetta. This means that libraries compiling with LIBIGL_RESTRICTED_MATLAB can compile under rosetta and link to the rosetta matlab on M1s. So keeping tally, only LIBIGL_MOSEK → untested remains. |
This seems to all be working now. I still haven't tried mosek but that modules also getting kind of out date anyway. |
Here are errors when I built it on a macbookpro with apple's new m1 processor:
The text was updated successfully, but these errors were encountered: