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

Add libatomic when needed #427

Merged
merged 1 commit into from
Mar 7, 2023
Merged

Add libatomic when needed #427

merged 1 commit into from
Mar 7, 2023

Conversation

pantierra
Copy link
Contributor

I'm the maintainer of tilemaker in Debian and have recently run into a few problems building tilemaker for the not-so-common ARMel, mips64el, and powerpc architectures:

[100%] Linking CXX executable tilemaker
/usr/bin/cmake -E cmake_link_script CMakeFiles/tilemaker.dir/link.txt --verbose=1
/usr/bin/c++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DTM_VERSION=2.2.0 -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now -rdynamic CMakeFiles/tilemaker.dir/vector_tile.pb.cc.o CMakeFiles/tilemaker.dir/osmformat.pb.cc.o CMakeFiles/tilemaker.dir/src/attribute_store.cpp.o CMakeFiles/tilemaker.dir/src/coordinates.cpp.o CMakeFiles/tilemaker.dir/src/geom.cpp.o CMakeFiles/tilemaker.dir/src/helpers.cpp.o CMakeFiles/tilemaker.dir/src/mbtiles.cpp.o CMakeFiles/tilemaker.dir/src/osm_lua_processing.cpp.o CMakeFiles/tilemaker.dir/src/osm_mem_tiles.cpp.o CMakeFiles/tilemaker.dir/src/osm_store.cpp.o CMakeFiles/tilemaker.dir/src/output_object.cpp.o CMakeFiles/tilemaker.dir/src/pbf_blocks.cpp.o CMakeFiles/tilemaker.dir/src/read_pbf.cpp.o CMakeFiles/tilemaker.dir/src/read_shp.cpp.o CMakeFiles/tilemaker.dir/src/shared_data.cpp.o CMakeFiles/tilemaker.dir/src/shp_mem_tiles.cpp.o CMakeFiles/tilemaker.dir/src/tile_data.cpp.o CMakeFiles/tilemaker.dir/src/tile_worker.cpp.o CMakeFiles/tilemaker.dir/src/tilemaker.cpp.o CMakeFiles/tilemaker.dir/src/write_geometry.cpp.o -o tilemaker  -lprotobuf -lshp -lsqlite3 -llua5.1 -lm -lz -lpthread -ldl /usr/lib/arm-linux-gnueabi/libboost_system.so.1.74.0 /usr/lib/arm-linux-gnueabi/libboost_filesystem.so.1.74.0 /usr/lib/arm-linux-gnueabi/libboost_program_options.so.1.74.0 /usr/lib/arm-linux-gnueabi/libboost_iostreams.so.1.74.0 
/usr/bin/ld: CMakeFiles/tilemaker.dir/src/osm_lua_processing.cpp.o: undefined reference to symbol '__atomic_fetch_sub_8@@LIBATOMIC_1.0'
/usr/bin/ld: /usr/lib/arm-linux-gnueabi/libatomic.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/tilemaker.dir/build.make:428: tilemaker] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-arm-linux-gnueabi'
make[2]: *** [CMakeFiles/Makefile2:86: CMakeFiles/tilemaker.dir/all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-arm-linux-gnueabi'
make[1]: *** [Makefile:139: all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-arm-linux-gnueabi'
dh_auto_build: error: cd obj-arm-linux-gnueabi && make -j4 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:16: build-arch] Error 25

These do not support atomic operations, instead relying on emulation provided by libatomic. Therefore, "-latomic" should be added to the command. This PR introduces a check to verify if libatomic needs to be added and adds them if necessary.

@systemed systemed merged commit 2703d73 into systemed:master Mar 7, 2023
@systemed
Copy link
Owner

systemed commented Mar 7, 2023

Thank you (and sorry for the delay in merging!).

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 this pull request may close these issues.

2 participants