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

Running [Make] in Apple M2 : Undefined symbols for architecture arm64 #87

Open
liumu96 opened this issue Jun 25, 2023 · 9 comments
Open

Comments

@liumu96
Copy link

liumu96 commented Jun 25, 2023

Hi! I tried running this program on macOS with Apple Silicon (M2) Chip, but when running make I got an error:

Undefined symbols for architecture arm64:
  "_oidnSetFilter1b", referenced from:
      GLSLPT::Renderer::Update(float) in Renderer.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [PathTracer] Error 1
make[1]: *** [CMakeFiles/PathTracer.dir/all] Error 2
make: *** [all] Error 2

I guess it doesn't work yet on macOS with Apple Silicon (M1) Chip?
Any recommendations how to bypass that?

@knightcrawler25
Copy link
Owner

knightcrawler25 commented Jun 25, 2023

Hey. The OIDN (OpenImageDenoise) library (v1.2.4) that this project uses probably doesn't support Apple Silicon and I haven't looked into the newer releases for the library.

For now, you can try disabling the denoiser. The dev branch has code that moves the denoiser behind a cmake option (defaulted to OFF)

@liumu96
Copy link
Author

liumu96 commented Jun 25, 2023

Does that mean this error won't happen if I run this program at the dev branch?
I'm not familiar with these code so I didn't find the code that moves the denoiser behind a cmake option.

@knightcrawler25
Copy link
Owner

Does that mean this error won't happen if I run this program at the dev branch?

Yes, and to confirm, you can try compiling the code from the dev branch and see if the linker error pops up again.

@liumu96
Copy link
Author

liumu96 commented Jun 26, 2023

I tried compiling the code from the dev branch and there was a new error, the compile failed.

mkdir build && cd build
cmake build -DCMAKE_BUILD_TYPE=RELEASE ..
make

Error

ld: library not found for -lSDL2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [PathTracer] Error 1
make[1]: *** [CMakeFiles/PathTracer.dir/all] Error 2
make: *** [all] Error 2

@knightcrawler25
Copy link
Owner

@liumu96
Copy link
Author

liumu96 commented Jun 26, 2023

Yeah, I installed sdl2 and open-image-denoise. The sdl2 version is 2.26.5.

brew install sdl2
Warning: sdl2 2.26.5 is already installed and up-to-date.
To reinstall 2.26.5, run:
  brew reinstall sdl2

@flaricy
Copy link

flaricy commented Jan 18, 2024

I've encountered the same problem in M2 chip. I've tried to build it in dev mode, which yields the following error info:
ld: Undefined symbols: _oidnCommitDevice, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o _oidnCommitFilter, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o _oidnExecuteFilter, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o _oidnGetDeviceError, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o _oidnNewDevice, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o _oidnNewFilter, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o _oidnReleaseDevice, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o oidn::DeviceRef::~DeviceRef() in Renderer.cpp.o _oidnReleaseFilter, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o oidn::FilterRef::~FilterRef() in Renderer.cpp.o _oidnSetFilter1b, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o _oidnSetSharedFilterImage, referenced from: GLSLPT::Renderer::Update(float) in Renderer.cpp.o GLSLPT::Renderer::Update(float) in Renderer.cpp.o clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [PathTracer] Error 1 make[1]: *** [CMakeFiles/PathTracer.dir/all] Error 2 make: *** [all] Error 2

How can I deal with it? Thanks.

@aceiii
Copy link

aceiii commented Feb 28, 2024

Im on an x86 mac, running MacOS 13.6.4 and I'm getting the same issue as the original poster.
Thinking it was somehow not picking the OIDN from homebrew, I manually cloned and compiled it but that lead to even more errors.

Wondering if anyone else has made any progress on this?

@tfiner
Copy link

tfiner commented Jun 16, 2024

I was able to build on an M2 with OIDN:

  1. installed oidn via homebrew
  2. deleted thirdparty/oidn
  3. changed CMakeLists.txt:
set(OIDN_LIBDIR /opt/homebrew/lib)
include_directories(/opt/homebrew/include)

deleted all the backslash junk starting with 
foreach(f ${SRCS})
...
endforeach()
This isn't needed, and I think it contributed to lldb trouble loading the symbols

Commented out this, it isn't needed, and it looked like it was wiping out the debug flag -g
# SET(LINK_OPTIONS " ") 

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

5 participants