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

compilation error with arm neon and gcc 11.2.1 #383

Open
lmarz opened this issue Jun 24, 2022 · 8 comments
Open

compilation error with arm neon and gcc 11.2.1 #383

lmarz opened this issue Jun 24, 2022 · 8 comments

Comments

@lmarz
Copy link

lmarz commented Jun 24, 2022

When trying to build embree under aarch64, cmake doesn't detect arm neon and enables the -msse2 flag instead, which causes a compiler error.
gcc does support arm neon though with the header file "arm_neon.h" and the macro __ARM_NEON.

Manually enabling EMBREE_ARM in cmake gives the following error output for the first 4 files:
build-embree.log

embree compiles successfully, when using clang

@svenwoop
Copy link
Contributor

Could you please check if this worked with Embree 3.13.3?

@luyatshimbalanga
Copy link

luyatshimbalanga commented Jul 1, 2022

I confirm the issue with version 3.13.4 on aarch64 architecture which suggests a regression compared to the previous version with GCC compiler.
For references, the listed parameters on the %build section:

export CXXFLAGS="%{optflags} -Wl,--as-needed"
%cmake \
	-DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_CXX_STANDARD=17 \
	-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
	-DCMAKE_INSTALL_PREFIX=%{_prefix} \
	-DEMBREE_COMPACT_POLYS=ON \
	-DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF \
%if %{with ispc}
        -DEMBREE_ISPC_SUPPORT=ON \
%else
        -DEMBREE_ISPC_SUPPORT=OFF \
%endif
        -DEMBREE_MAX_ISA=DEFAULT \
	-DEMBREE_TUTORIALS=OFF 

The macros in %{...} are listed under the Fedora Packaging Guidelines.

The same codes lines works fine on v3.13.3 hence this log which potentially shows a regression on v3.13.4.

@ppisar
Copy link

ppisar commented Jul 4, 2022

I also recommend updating README.md which reads:

  Embree requires at least an x86 CPU with support for
  SSE2 or an Apple M1 CPU.

That's misleading because people think that they need Appli M1 CPU, while a generic AArch64 CPU is enough.

@StefanBruens
Copy link

The problem is caused by erroneous changes for the Apple silicon support.

The flags are set in e.g. gnu.cmake, included here:
https://github.com/embree/embree/blob/489b746c0d5010e0da10345e9dc96768bec9a037/CMakeLists.txt#L255

But for anything but APPLE, EMBREE_ARM is only set here:
https://github.com/embree/embree/blob/489b746c0d5010e0da10345e9dc96768bec9a037/CMakeLists.txt#L282-L285

I.e. all conditionals depending on EMBREE_ARM in gnu.cmake are wrong.

@akien-mga
Copy link
Contributor

I can confirm the issue in 3.13.5 on Mageia Cauldron aarch64, while 3.13.3 built fine.

I believe this was fixed by 82ca6b5, but 3.13.6 was never released with the fix (and now 4.0.0 is a compat breaking update).

@svenwoop
Copy link
Contributor

svenwoop commented Mar 3, 2023

Please just stay on Embree 3.13.3 when you compat with Embree 3 is important. Otherwise switching to Embree 4 should be straight forward.

@StefanBruens
Copy link

Please just stay on Embree 3.13.3 when you compat with Embree 3 is important. Otherwise switching to Embree 4 should be straight forward.

The correct answer is "Use Embree 3.13.5 and cherry-pick 82ca6b5". Otherwise, one misses the fixes in 3.13.4/3.13.5.

@StefanBruens
Copy link

Or even simpler, pass -DEMBREE_ARM=ON to cmake.

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

6 participants