Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Error while linking storage_test #57

@renoust

Description

@renoust

Hi,

Running Ubuntu 16.04.2 LTS, I'm facing an error also referred in issue #50 (the issue was closed by
@freshcoderman without providing a direct solution to the problem).

My initial goal is to install fblualib, which provides an easy installation script, which however fails from fbthrift (which does not compile with autoreconf anymore).
I'm now trying to compile THPP.

As of today, I have installed all dependencies without a problem, including fbthrift.

While running build.sh (same issue with cmake), I'm facing the following linking error:

[ 80%] Linking CXX executable storage_test
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwExceededSizeLimit()'
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwReportedTypeMismatch()'
../libthpp.so: undefined reference to `apache::thrift::util::detail::throwInvalidVarint()'
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwMissingRequiredField(folly::Range<char const*>, folly::Range<char const*>)'
../libthpp.so: undefined reference to `apache::thrift::CompactProtocolReader::throwBadType(unsigned char)'
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwNegativeSize()'
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwBoolValueOutOfRange(unsigned char)'
collect2: error: ld returned 1 exit status

The definitions seem to appear in libthriftprotocol.a
nm /usr/local/lib/libthriftprotocol.a | grep 'throwExceed returns

000000000000034f T _ZN6apache6thrift6detail4json22throwExceededSizeLimitEll
                 U _ZN6apache6thrift6detail4json22throwExceededSizeLimitEll
                 U _ZN6apache6thrift8protocol18TProtocolException22throwExceededSizeLimitEv
                 U _ZN6apache6thrift8protocol18TProtocolException22throwExceededSizeLimitEv

Is there something wrong with fbthrift?
I'm trying understand this error and work my way around...

The compilation line which poses error (make VERBOSE=1)

/usr/bin/c++    -std=gnu++14   CMakeFiles/storage_test.dir/StorageTest.cpp.o  -o storage_test  -L/home/me/faces/torch/install/lib -rdynamic ../libthpp.so ../googletest-release-1.7.0/libgtest.a ../googletest-release-1.7.0/libgtest_main.a /home/me/faces/torch/install/lib/libTH.so.0 -lopenblas -lrt -lm /usr/local/lib/libfolly.so /usr/local/lib/libthrift.a /usr/local/lib/libthriftcpp2.a -lglog ../googletest-release-1.7.0/libgtest.a -lpthread -Wl,-rpath,/home/me/faces/thpp/thpp/build2:/home/me/faces/torch/install/lib:/usr/local/lib 

We can notice that libthriftprotocol.a is not mentioned, so I tried a manual addition:

/usr/bin/c++    -std=gnu++14   CMakeFiles/storage_test.dir/StorageTest.cpp.o  -o storage_test  -L/home/brenoust/faces/torch/install/lib -rdynamic ../libthpp.so ../googletest-release-1.7.0/libgtest.a ../googletest-release-1.7.0/libgtest_main.a /home/brenoust/faces/torch/install/lib/libTH.so.0 -lopenblas -lrt -lm /usr/local/lib/libfolly.so /usr/local/lib/libthrift.a /usr/local/lib/libthriftprotocol.a /usr/local/lib/libthriftcpp2.a -lglog ../googletest-release-1.7.0/libgtest.a -lpthread -Wl,-rpath,/home/brenoust/faces/thpp/thpp/build2:/home/brenoust/faces/torch/install/lib:/usr/local/lib 

But get some additional errors:

/usr/local/lib/libthriftprotocol.a(CompactProtocol.cpp.o): In function `void apache::thrift::util::detail::readVarintMediumSlow<int, folly::io::Cursor, false>(folly::io::Cursor&, int&, unsigned char const*, unsigned long)':
CompactProtocol.cpp:(.text._ZN6apache6thrift4util6detail20readVarintMediumSlowIiN5folly2io6CursorELb0EEEvRT0_RT_PKhm[_ZN6apache6thrift4util6detail20readVarintMediumSlowIiN5folly2io6CursorELb0EEEvRT0_RT_PKhm]+0x17b): undefined reference to `apache::thrift::util::detail::throwInvalidVarint()'
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwExceededSizeLimit()'
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwReportedTypeMismatch()'
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwMissingRequiredField(folly::Range<char const*>, folly::Range<char const*>)'
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwNegativeSize()'
../libthpp.so: undefined reference to `apache::thrift::protocol::TProtocolException::throwBoolValueOutOfRange(unsigned char)'

Any suggestion?

Side question. It seems that many pull requests including the obvious but necessary -std=gnu++11 -> -std=gnu++14 update for CMakeList have been proposed but never integrated in the repository. It makes me wonder if this project is still maintained or has been abandoned.

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions