Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 601610 - sys-cluster/ceph-10.2.3-r2 - rocksdb/librocksdb.a(format.o): In function `rocksdb::ZSTD_Uncompress(char const*, unsigned long, int*)': .../work/ceph-10.2.3/src/rocksdb/./util/compression.h:644: undefined reference to `ZSTD_decompress'
Summary: sys-cluster/ceph-10.2.3-r2 - rocksdb/librocksdb.a(format.o): In function `roc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-12-04 19:05 UTC by Ladislav Zitka
Modified: 2017-04-12 20:46 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info,6.14 KB, text/plain)
2016-12-04 19:05 UTC, Ladislav Zitka
Details
configure: link against zstd if detected (0001-configure-link-against-zstd-if-detected.patch,1.74 KB, patch)
2017-04-12 08:58 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ladislav Zitka 2016-12-04 19:05:22 UTC
Created attachment 455110 [details]
emerge --info

This version of ceph is failing on following errors:
=========================================================
x86_64-pc-linux-gnu-gcc -iquote /tmp/portage/sys-cluster/ceph-10.2.3-r2/work/ceph-10.2.3/src/include -Wall -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char -rdynamic -O2 -g -pipe -Wall -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fPIE -fstack-protector-strong -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing -march=skylake -mabm -maes -madx -mrtm -mavx256-split-unaligned-load -mavx256-split-unaligned-store --param l1-cache-line-size=64 --param l1-cache-size=32 --param l2-cache-size=6144 -O2 -pipe -fwrapv -DNDEBUG -iquote /tmp/portage/sys-cluster/ceph-10.2.3-r2/work/ceph-10.2.3/src/include -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_GNU_SOURCE -DCEPH_LIBDIR=/usr/lib64 -DCEPH_PKGLIBDIR=/usr/lib64/ceph -DGTEST_USE_OWN_TR1_TUPLE=0 -D_REENTRANT -fPIC -I/usr/include/python2.7 -c /tmp/portage/sys-cluster/ceph-10.2.3-r2/work/ceph-10.2.3/src/build/rados.c -o /tmp/portage/sys-cluster/ceph-10.2.3-r2/work/ceph-10.2.3/src/build/temp.linux-x86_64-2.7/tmp/portage/sys-cluster/ceph-10.2.3-r2/work/ceph-10.2.3/src/build/rados.o
rocksdb/librocksdb.a(format.o): In function `rocksdb::ZSTD_Uncompress(char const*, unsigned long, int*)':
/tmp/portage/sys-cluster/ceph-10.2.3-r2/work/ceph-10.2.3/src/rocksdb/./util/compression.h:644: undefined reference to `ZSTD_decompress'
rocksdb/librocksdb.a(block_based_table_builder.o): In function `rocksdb::ZSTD_Compress(rocksdb::CompressionOptions const&, char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/tmp/portage/sys-cluster/ceph-10.2.3-r2/work/ceph-10.2.3/src/rocksdb/./util/compression.h:620: undefined reference to `ZSTD_compressBound'
/tmp/portage/sys-cluster/ceph-10.2.3-r2/work/ceph-10.2.3/src/rocksdb/./util/compression.h:623: undefined reference to `ZSTD_compress'
collect2: error: ld returned 1 exit status
Makefile:15860: recipe for target 'ceph-objectstore-tool' failed
=========================================================

I created latest ebuild for ZSTD version 1.1.1 available here:
https://github.com/archenroot/gentoo-overlay/blob/master/app-arch/zstd/zstd-1.1.1.ebuild

I removed completely the patch from ebuild, it compiled well and and ceph looks also healthy now.
Comment 1 Ladislav Zitka 2016-12-04 19:21:10 UTC
Mistake, ZSTD 1.1.1 doesn't do any difference, actually I am not 100% sure now, if the errors are really related or not to ZSTD facebook package or not.
Comment 2 Sławomir Nizio 2017-01-17 22:28:13 UTC
In case it helps as I encountered this too:

ZSTD is being used in work/ceph-10.2.4/src/rocksdb/util/compression.h,
and seems to be enabled in work/ceph-10.2.4/src/rocksdb/build_tools/build_detect_platform:

...
    # Test whether zstd library is installed
    $CXX $CFLAGS $COMMON_FLAGS -x c++ - -o /dev/null 2>/dev/null  <<EOF
      #include <zstd.h>
      int main() {}
EOF
    if [ "$?" = 0 ]; then
        COMMON_FLAGS="$COMMON_FLAGS -DZSTD"
        PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lzstd"
        JAVA_LDFLAGS="$JAVA_LDFLAGS -lzstd"
    fi
...

but seems that -lzstd is not passed.
Comment 3 Ladislav Zitka 2017-01-18 08:47:23 UTC
Well even I try to emerge zstd, the libs are not visible, probably the ebuild for zstd could be broken?... Will check
Comment 4 Zac Medico gentoo-dev 2017-04-12 07:50:42 UTC
There's code to handle bzip2 and lz4 dependencies of librocksdb.a, but zstd is missing:

https://github.com/ceph/ceph/blob/v10.2.3/src/kv/CMakeLists.txt

I've experienced the same issue with ceph-10.2.6-r1.
Comment 5 Zac Medico gentoo-dev 2017-04-12 08:14:49 UTC
We're using autotools instead of cmake though...

The cmake code comes from this pull request:

https://github.com/ceph/ceph/pull/7126

And that references this commit which contains the autotools support:

https://github.com/ceph/ceph/commit/911e7a02a244a75595eac8644bb75b0f2011b04e
Comment 6 Zac Medico gentoo-dev 2017-04-12 08:58:53 UTC
Created attachment 469800 [details, diff]
configure: link against zstd if detected

This fixes it.