-
Notifications
You must be signed in to change notification settings - Fork 859
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
Undefined libjpeg symbols for architecture arm64 (macOS) #859
Comments
I added the macOS 13 (x86_64) runner in this PR: #903. This passes. Unfortunately, the arm64 runners for macOS are not for free. Can you reproduce this when compiling for the x86_64 architecture as on the CI? |
Oh gosh I don't have an x86 machine readily available to try. |
Can you run a compiler or VM through Apple's Intel->ARM translation? Or compile via cross-compilation? |
I don't think so, certainly not without a lot more effort than I have time to dedicate right now. How much money would the arm64 runners cost? Perhaps I can sponsor that work with cash? |
In the "M1 macOS larger runner" announcement (https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/) they say this will be $0.12 to $0.16 per minute. The two pipelines that currently run take approx. 6 minutes each. That would be at least $1.44 per pipeline run. That's quite a lot just for testing on a different CPU architecture. Also, I don't know who would need to manage the subscription. I assume that those arm64 runners will be available in the free subscription over time. Maybe a better solution would be cross-compiling to arm64 on the current macOS runners. I will leave this open for someone else to implement and test locally on Apple silicon hardware. |
The CI pipeline now tests on |
So sorry, I completely missed your reply about the cost of the runners! |
I just build cmake -B build -GNinja
-- libpng Found and Enabled
-- libjpeg Found and Enabled
-- libtiff Found and Enabled
-- liblz4 Found and Enabled
-- libzstd Found and Enabled
-- Found Eigen: '/opt/homebrew/include/eigen3'
-- ffmpeg Found and Enabled: /opt/homebrew/include;/opt/homebrew/include;/opt/homebrew/include;/opt/homebrew/include;/opt/homebrew/include
-- Configuring done (1.4s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/liangdeo/pyproj/Pangolin/build
cmake --build build
[24/158] Building CXX object CMakeFiles/pango_image.dir/components/pango_image/src/image_io_zstd.cpp.o
/Users/liangdeo/pyproj/Pangolin/components/pango_image/src/image_io_zstd.cpp:29:32: warning: unknown warning group '-Wstringop-truncation', ignored [-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wstringop-truncation"
^
1 warning generated.
[30/158] Linking CXX shared library libpango_image.dylib
FAILED: libpango_image.dylib
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -dynamiclib -Wl,-headerpad_max_install_names -o libpango_image.dylib -install_name @rpath/libpango_image.dylib CMakeFiles/pango_image.dir/components/pango_image/src/pixel_format.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_exr.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_jpg.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_lz4.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_packed12bit.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_pango.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_png.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_ppm.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_raw.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_tga.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_bmp.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_zstd.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_libraw.cpp.o CMakeFiles/pango_image.dir/components/pango_image/src/image_io_tiff.cpp.o -Wl,-rpath,/Users/liangdeo/pyproj/Pangolin/build /opt/homebrew/lib/libpng.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/libz.tbd /opt/homebrew/lib/libjpeg.dylib /opt/homebrew/lib/libtiff.dylib /opt/homebrew/lib/liblz4.dylib /opt/homebrew/lib/libzstd.dylib libpango_core.dylib && :
Undefined symbols for architecture arm64:
"jpeg_std_error(jpeg_error_mgr*)", referenced from:
pangolin::LoadJpg(std::__1::basic_istream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
pangolin::GetMJpegOffsets(std::__1::basic_ifstream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
pangolin::SaveJpg(pangolin::Image<unsigned char> const&, pangolin::PixelFormat const&, std::__1::basic_ostream<char, std::__1::char_traits<char>>&, float) in image_io_jpg.cpp.o
NOTE: found '_jpeg_std_error' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_read_header(jpeg_decompress_struct*, int)", referenced from:
pangolin::LoadJpg(std::__1::basic_istream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
pangolin::GetMJpegOffsets(std::__1::basic_ifstream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
NOTE: found '_jpeg_read_header' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_set_quality(jpeg_compress_struct*, int, int)", referenced from:
pangolin::SaveJpg(pangolin::Image<unsigned char> const&, pangolin::PixelFormat const&, std::__1::basic_ostream<char, std::__1::char_traits<char>>&, float) in image_io_jpg.cpp.o
NOTE: found '_jpeg_set_quality' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_set_defaults(jpeg_compress_struct*)", referenced from:
pangolin::SaveJpg(pangolin::Image<unsigned char> const&, pangolin::PixelFormat const&, std::__1::basic_ostream<char, std::__1::char_traits<char>>&, float) in image_io_jpg.cpp.o
NOTE: found '_jpeg_set_defaults' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_CreateCompress(jpeg_compress_struct*, int, unsigned long)", referenced from:
pangolin::SaveJpg(pangolin::Image<unsigned char> const&, pangolin::PixelFormat const&, std::__1::basic_ostream<char, std::__1::char_traits<char>>&, float) in image_io_jpg.cpp.o
NOTE: found '_jpeg_CreateCompress' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned int)", referenced from:
pangolin::LoadJpg(std::__1::basic_istream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
pangolin::GetMJpegOffsets(std::__1::basic_ifstream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
NOTE: found '_jpeg_read_scanlines' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_start_compress(jpeg_compress_struct*, int)", referenced from:
pangolin::SaveJpg(pangolin::Image<unsigned char> const&, pangolin::PixelFormat const&, std::__1::basic_ostream<char, std::__1::char_traits<char>>&, float) in image_io_jpg.cpp.o
NOTE: found '_jpeg_start_compress' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_finish_compress(jpeg_compress_struct*)", referenced from:
pangolin::SaveJpg(pangolin::Image<unsigned char> const&, pangolin::PixelFormat const&, std::__1::basic_ostream<char, std::__1::char_traits<char>>&, float) in image_io_jpg.cpp.o
NOTE: found '_jpeg_finish_compress' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_write_scanlines(jpeg_compress_struct*, unsigned char**, unsigned int)", referenced from:
pangolin::SaveJpg(pangolin::Image<unsigned char> const&, pangolin::PixelFormat const&, std::__1::basic_ostream<char, std::__1::char_traits<char>>&, float) in image_io_jpg.cpp.o
NOTE: found '_jpeg_write_scanlines' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned long)", referenced from:
pangolin::LoadJpg(std::__1::basic_istream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
pangolin::GetMJpegOffsets(std::__1::basic_ifstream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
NOTE: found '_jpeg_CreateDecompress' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_destroy_compress(jpeg_compress_struct*)", referenced from:
pangolin::SaveJpg(pangolin::Image<unsigned char> const&, pangolin::PixelFormat const&, std::__1::basic_ostream<char, std::__1::char_traits<char>>&, float) in image_io_jpg.cpp.o
NOTE: found '_jpeg_destroy_compress' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_start_decompress(jpeg_decompress_struct*)", referenced from:
pangolin::LoadJpg(std::__1::basic_istream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
pangolin::GetMJpegOffsets(std::__1::basic_ifstream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
NOTE: found '_jpeg_start_decompress' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_finish_decompress(jpeg_decompress_struct*)", referenced from:
pangolin::LoadJpg(std::__1::basic_istream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
pangolin::GetMJpegOffsets(std::__1::basic_ifstream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
NOTE: found '_jpeg_finish_decompress' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_resync_to_restart(jpeg_decompress_struct*, int)", referenced from:
pangolin::LoadJpg(std::__1::basic_istream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
pangolin::GetMJpegOffsets(std::__1::basic_ifstream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
NOTE: found '_jpeg_resync_to_restart' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
"jpeg_destroy_decompress(jpeg_decompress_struct*)", referenced from:
pangolin::LoadJpg(std::__1::basic_istream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
pangolin::GetMJpegOffsets(std::__1::basic_ifstream<char, std::__1::char_traits<char>>&) in image_io_jpg.cpp.o
NOTE: found '_jpeg_destroy_decompress' in libjpeg.8.3.2.dylib, declaration possibly missing 'extern "C"'
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[39/158] Building CXX object CMakeFiles/pango_geometry.dir/components/pango_geometry/src/geometry_ply.cpp.o
ninja: build stopped: subcommand failed. |
Hard to say without further information. Are you following the instructions to install the dependencies? The CI pipeline for macOS arm64 (https://github.com/stevenlovegrove/Pangolin/actions/runs/10222724033/job/28287848313) runs successfully. I don't have access to macOS hardware and rely on the CI for testing. If you can reproduce this on the CI, I can check if there is something wrong with the installation scripts for the dependencies. |
Getting link errors when building on an M1 Mac under Ventura 13.3.1
CMakeCache.txt
showsAnd checking the exports using
nm -gU /opt/homebrew/lib/libjpeg.dylib | grep std_error
The text was updated successfully, but these errors were encountered: