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

Trouble compiling on macos (Monterey 12.7.4) #3568

Open
zpamaral opened this issue May 10, 2024 · 0 comments
Open

Trouble compiling on macos (Monterey 12.7.4) #3568

zpamaral opened this issue May 10, 2024 · 0 comments
Labels
building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone

Comments

@zpamaral
Copy link

Describe the bug
I had a hard time compiling libjxl. First, it failed because could not find “-lgmock”. Second, it failed because could not find the header files for highway.

To Reproduce
In addition to the OS mentioned, libjxl-0.10.2, my Clang is Apple clang version 14.0.0 (clang-1400.0.29.202); my gtest (gmock) is 1.14.0; my highway is 1.1.0; and my gcc is gcc (the real one) is 10.2.0 (do not think is relevant, but list it anyway).

Expected behavior
I expected the libraries and associated files to compile.

Solution
I was able to compile everything I wanted successfully, by doing the following:

  1. Running:

./deps.sh

  1. Running:

cmake -S . -B build -DJPEGXL_FORCE_SYSTEM_BROTLI=ON -DJPEGXL_FORCE_SYSTEM_LCMS2=ON -DJPEGXL_FORCE_SYSTEM_HWY=ON -DJPEGXL_ENABLE_DEVTOOLS=ON -DJPEGXL_TEST_TOOLS=OFF -DJPEGXL_ENABLE_JNI=OFF -DJPEGXL_ENABLE_JPEGLI=OFF -DJPEGXL_ENABLE_SKCMS=OFF -DJPEGXL_ENABLE_MANPAGES=OFF -DCMAKE_INSTALL_RPATH=/usr/local -DCMAKE_BUILD_TYPE=Release

  1. Replacing the string “-lgmock” with the full path to the library:

find ./ -name link.txt -exec sed -i '.bak' 's/-lgmock//usr/local/lib/libgmock.a/g' {} ;

  1. Adding a link to the directory hwy to the directory the contained the CMakeLists.txt (in this case libjxl-0.10.2)

ln -s third_party/highway/hwy hwy

  1. After these steps, running:

cmake --build build

built everything without issues.

Environment

  • OS: macos 12.7.4
  • Compiler version: Apple clang-1400.0.29.202
  • CPU type: x86_64
  • cjxl/djxl version string: cjxl v0.10.2 [AVX2,SSE4,SSE2] (but irrelevant because post hoc)

ZP

@mo271 mo271 added building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone
Projects
None yet
Development

No branches or pull requests

2 participants