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

h3 3.6.4 OSX builds failed #361

Closed
chenrui333 opened this issue Jun 28, 2020 · 2 comments · Fixed by #362
Closed

h3 3.6.4 OSX builds failed #361

chenrui333 opened this issue Jun 28, 2020 · 2 comments · Fixed by #362
Assignees

Comments

@chenrui333
Copy link

chenrui333 commented Jun 28, 2020

github action log, https://github.com/Homebrew/homebrew-core/runs/792748977

build failure log
[  8%] Linking C shared library lib/libh3.dylib
/usr/local/Cellar/cmake/3.17.3/bin/cmake -E cmake_link_script CMakeFiles/h3WithTestAllocators.dir/link.txt --verbose=1
/usr/local/Cellar/cmake/3.17.3/bin/cmake -E cmake_link_script CMakeFiles/h3.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 1.0.0 -o lib/libh3.1.dylib -install_name @rpath/libh3.1.dylib CMakeFiles/h3.dir/src/h3lib/lib/algos.c.o CMakeFiles/h3.dir/src/h3lib/lib/coordijk.c.o CMakeFiles/h3.dir/src/h3lib/lib/bbox.c.o CMakeFiles/h3.dir/src/h3lib/lib/polygon.c.o CMakeFiles/h3.dir/src/h3lib/lib/h3Index.c.o CMakeFiles/h3.dir/src/h3lib/lib/vec2d.c.o CMakeFiles/h3.dir/src/h3lib/lib/vec3d.c.o CMakeFiles/h3.dir/src/h3lib/lib/linkedGeo.c.o CMakeFiles/h3.dir/src/h3lib/lib/localij.c.o CMakeFiles/h3.dir/src/h3lib/lib/geoCoord.c.o CMakeFiles/h3.dir/src/h3lib/lib/h3UniEdge.c.o CMakeFiles/h3.dir/src/h3lib/lib/mathExtensions.c.o CMakeFiles/h3.dir/src/h3lib/lib/vertexGraph.c.o CMakeFiles/h3.dir/src/h3lib/lib/faceijk.c.o CMakeFiles/h3.dir/src/h3lib/lib/baseCells.c.o  /usr/lib/libm.dylib 
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 1.0.0 -o lib/libh3WithTestAllocators.1.dylib -install_name @rpath/libh3WithTestAllocators.1.dylib CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/algos.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/coordijk.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/bbox.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/polygon.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/h3Index.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/vec2d.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/vec3d.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/linkedGeo.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/localij.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/geoCoord.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/h3UniEdge.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/mathExtensions.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/vertexGraph.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/faceijk.c.o CMakeFiles/h3WithTestAllocators.dir/src/h3lib/lib/baseCells.c.o  /usr/lib/libm.dylib 
Undefined symbols for architecture x86_64:
  "_test_prefix_calloc", referenced from:
      _kRingDistances in algos.c.o
      __polyfillInternal in algos.c.o
      _compact in h3Index.c.o
      _addNewLinkedPolygon in linkedGeo.c.o
      _addNewLinkedLoop in linkedGeo.c.o
      _normalizeMultiPolygon in linkedGeo.c.o
      _initVertexGraph in vertexGraph.c.o
      ...
  "_test_prefix_free", referenced from:
      _kRingDistances in algos.c.o
      __polyfillInternal in algos.c.o
      _compact in h3Index.c.o
      _destroyLinkedGeoLoop in linkedGeo.c.o
      _destroyLinkedPolygon in linkedGeo.c.o
      _normalizeMultiPolygon in linkedGeo.c.o
      _destroyVertexGraph in vertexGraph.c.o
      ...
  "_test_prefix_malloc", referenced from:
      __polyfillInternal in algos.c.o
      _compact in h3Index.c.o
      _addLinkedCoord in linkedGeo.c.o
      _normalizeMultiPolygon in linkedGeo.c.o
      _addVertexNode in vertexGraph.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/usr/local/Cellar/cmake/3.17.3/bin/cmake -E cmake_symlink_library lib/libh3.1.dylib lib/libh3.1.dylib lib/libh3.dylib
make[2]: *** [lib/libh3WithTestAllocators.1.dylib] Error 1
make[1]: *** [CMakeFiles/h3WithTestAllocators.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  8%] Built target h3
make: *** [all] Error 2

PR reference, Homebrew/homebrew-core#56633

cc @robsalasco

@isaacbrodsky isaacbrodsky self-assigned this Jun 28, 2020
@isaacbrodsky
Copy link
Collaborator

This is an older post but it looks like this may have to do with XCode defaulting to not looking up undefined symbols dynamically: https://glandium.org/blog/?p=2764 I was able to reproduce this problem with XCode 11.5 installed.

The undefined symbols are only used in tests to confirm that the library can built with undefined symbols for memory allocation that are then provided at runtime. If that functionality isn't being used, we could just disable the test.

@chenrui333
Copy link
Author

@isaacbrodsky applied the patch in Homebrew/homebrew-core#57084, working well for me. Thanks for the fix!

Closing the issue now.

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

Successfully merging a pull request may close this issue.

2 participants