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

“compact unwind compressed function offset doesn't fit in 24 bits” during build from source [macOS, ARM64] #6931

Closed
3 tasks done
cwreynolds opened this issue Aug 25, 2024 · 6 comments

Comments

@cwreynolds
Copy link

cwreynolds commented Aug 25, 2024

Checklist

Steps to reproduce the issue

I attempted to do a full local build (macOS, ARM64) of Open3D following instructions on Build from source [0.18.0]:

git clone https://github.com/isl-org/Open3D
cd Open3D

mkdir build
cd build
cmake ..
make -j$(sysctl -n hw.physicalcpu)

During the make step I got the error below: ld: Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp, line 5758.

(I got the same error when I first followed obsolete instructions on Find Pre-Installed Open3D Package in CMake, then when I retried it the current doc (Build from source [0.18.0]) but skipped over the “Setup Python environments” step, and then got it again (below) when I did set the Python environment. Whatever the cause of this problem is it fairly robust with regard to build details.)

Error message

...
[ 92%] Building CXX object cpp/pybind/CMakeFiles/pybind.dir/docstring.cpp.o
[ 92%] Building CXX object cpp/pybind/CMakeFiles/pybind.dir/open3d_pybind.cpp.o
[ 92%] Building CXX object cpp/pybind/CMakeFiles/pybind.dir/pybind_utils.cpp.o
[ 92%] Linking CXX shared module ../../lib/Release/Python/cpu/pybind.cpython-310-darwin.so
0  0x10412b648  __assert_rtn + 72
1  0x1040e60f0  ___Z13dispatchApplyIRKmZ15dispatchForEachIKN6mach_o13CompactUnwind11Diff24FixupEZNK2ld16LayoutExecutable18writeCompactUnwindENSt3__14spanIhLm18446744073709551615EEEyRKNS7_13SectionLayoutEE4$_26EvNSA_IT_Lm18446744073709551615EEEmT0_EUlmE_EvOSG_SI__block_invoke + 0
2  0x19b83c440  _dispatch_client_callout2 + 20
3  0x19b851544  _dispatch_apply_invoke_and_wait + 224
4  0x19b85084c  _dispatch_apply_with_attr_f + 1180
5  0x19b850a38  dispatch_apply + 96
6  0x1040e6398  ld::LayoutExecutable::writeContentWithoutLinkEdit(std::__1::span<unsigned char, 18446744073709551615ul>, unsigned long long) + 672
7  0x1040ec020  ld::LayoutExecutable::writeToFile(char const*) + 15248
8  0x10409e2e8  main + 9424
ld: Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp, line 5758.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/Release/Python/cpu/pybind.cpython-310-darwin.so] Error 1
make[1]: *** [cpp/pybind/CMakeFiles/pybind.dir/all] Error 2
make: *** [all] Error 2

Open3D, Python and System information

- Operating system: macOS 13.5.2
- Python version: Python 3.10.10 (main, Mar 21 2023, 13:41:05)
- Open3D version: 0.18.0 + commit 18a47ef
- System architecture: arm64 / apple-silicon
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): Clang 14.0.6 (?)

Additional information

No response

@rxba
Copy link
Contributor

rxba commented Aug 26, 2024

Hey @cwreynolds , not sure if this will be of much help, but just to give you some feedback, running the build as you described works flawlessly for me (MacOS 14.5 and Command Line Tools 15.3).

It could be linked to the version of the xcode command line tools you are using. Running pkgutil --pkg-info=com.apple.pkg.CLTools_Executables will show you that. Maybe using a different version will fix your issue.

There are other reports of this linker error that are unrelated to Open3D, so I assume it's an issue with the xcode CL tools.

@cwreynolds
Copy link
Author

@rxba thank you for looking at this, for the verification it works for you, and your hints. Indeed, I am a whole macOS release out of date, and at least “0.3 of a release” behind on my Command Line Tools:

> pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 15.0.0.0.1.1694021235
...

I guess I need to bite the bullet and upgrade my macOS, then retry this build. These issues may underlie the original problem I encountered that led me here. See #6923 where I note I'm quite behind on OS updates.

@rxba
Copy link
Contributor

rxba commented Aug 26, 2024

@cwreynolds Another thing you could try, if there's something else holding you back from upgrading your macOS, is trying an older version of the xcode CL tools by downgrading them.
It could just be version 15.0 that is causing this specific issue. Hope it helps.

@cwreynolds
Copy link
Author

(@rxba — no, just inertia and fear of the unknown. When Sonoma came out last fall, it was not a good time for a disruption, and I never got back to it.)

So I am now running a brand, spankin‘ new macOS Sonoma 14.6.1 and CTL 15.3. That upgrade was painless and, so far, trouble free. And indeed, my Open3D build-from-source now works just fine!

However, if I can lean on your helpful expertise just a bit more? I tried to build my own app using the CMakeLists.txt I wrote a few days ago (one of my first) and it did not succeed, failing to find Open3D (via my find_package(Open3D REQUIRED)). Do I need an install step after the make?

Similarly, what is the best way to get the newly built Open3D/build/lib/Release/libOpen3D.a in some place (/usr/local/lib?) where I could easily link to it from Xcode?

Transcript of building my app:

> cmake ..
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:48 (find_package):
  By not providing "FindOpen3D.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Open3D", but
  CMake did not find one.

  Could not find a package configuration file provided by "Open3D" with any
  of the following names:

    Open3DConfig.cmake
    open3d-config.cmake

  Add the installation prefix of "Open3D" to CMAKE_PREFIX_PATH or set
  "Open3D_DIR" to a directory containing one of the above files.  If "Open3D"
  provides a separate development package or SDK, be sure it has been
  installed.

@rxba
Copy link
Contributor

rxba commented Aug 26, 2024

@cwreynolds I'm glad it all worked out.
There is actually an example of how to use CMake with a compiled Open3D (open3d-cmake-find-package), so you can just follow that and I'm sure your issues will resolve.

@cwreynolds
Copy link
Author

Closing, @rxba's suggestion to follow open3d-cmake-find-package got me past this issue.

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

2 participants