diamond icon indicating copy to clipboard operation
diamond copied to clipboard

Issues with building diamond with zstd support

Open kbipinkumar opened this issue 2 years ago • 2 comments

i am trying to build and package diamond with zstd support under Archlinux per the instructions given in the wiki. I have version both zlib and zstd installed below is the options used in build script i have used in accordance to your wiki as well as Arch wiki's recommended practice for building packages using cmake

$ cmake -B build \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=None \
    -DWITH_ZSTD=ON \
    -DZSTD_LIBRARY=/usr/lib/libzstd.so \
    -DZLIB_INCLUDE_DIR=/usr/include \
    -Wno-dev
    
$ cmake --build build

$ DESTDIR="$pkgdir" cmake --install build

the compile process seems to proceed without issues but the process of creation of diamond executable errors out with with following output.

[100%] Linking CXX executable diamond
/usr/bin/ld: CMakeFiles/diamond.dir/src/align/align.cpp.o: warning: relocation against `_ZTVN17ExtensionPipeline5Swipe8PipelineE' in read-only section `.text._ZN17ExtensionPipeline5Swipe8PipelineD2Ev[_ZN17ExtensionPipeline5Swipe8PipelineD5Ev]'
/usr/bin/ld: CMakeFiles/diamond.dir/src/align/align.cpp.o: in function `legacy_pipeline(HitIterator::Hits const&, Search::Config&, Statistics&)':
align.cpp:(.text+0x633): undefined reference to `vtable for ExtensionPipeline::Swipe::Pipeline'
/usr/bin/ld: CMakeFiles/diamond.dir/src/align/align.cpp.o: in function `ExtensionPipeline::Swipe::Pipeline::~Pipeline()':
align.cpp:(.text._ZN17ExtensionPipeline5Swipe8PipelineD0Ev[_ZN17ExtensionPipeline5Swipe8PipelineD5Ev]+0x7): undefined reference to `vtable for ExtensionPipeline::Swipe::Pipeline'
/usr/bin/ld: CMakeFiles/diamond.dir/src/align/align.cpp.o: in function `ExtensionPipeline::Swipe::Pipeline::~Pipeline()':
align.cpp:(.text._ZN17ExtensionPipeline5Swipe8PipelineD2Ev[_ZN17ExtensionPipeline5Swipe8PipelineD5Ev]+0x7): undefined reference to `vtable for ExtensionPipeline::Swipe::Pipeline'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/diamond.dir/build.make:2783: diamond] Error 1
make[1]: *** [CMakeFiles/Makefile2:169: CMakeFiles/diamond.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

it would be of great help if someone could take a look at this log an tell me what i doing wrong or is it due to incompatibility with zstd version (1.5.2) i am using

kbipinkumar avatar Jan 26 '23 06:01 kbipinkumar

Looks like you already solved the zstd error, but I'm not sure about the linker error. What archlinux version are you using?

bbuchfink avatar Feb 03 '23 13:02 bbuchfink

Looks like you already solved the zstd error, but I'm not sure about the linker error. What archlinux version are you using?

Archlinux being a rolling release distro there is no version number per se. that said figured the issue being usage of DCMAKE_BUILD_TYPE=none flag in the build process instead of -DCMAKE_BUILD_TYPE=Release as instructed in your wiki.

archlinux build instructions for cmake based projects discourages of use of -DCMAKE_BUILD_TYPE=Release as mentioned here

kbipinkumar avatar Feb 09 '23 04:02 kbipinkumar