Skip to content

Cannot build latest code on Ubuntu 14.04 #6

Closed

Description

@vitaliy-senchyshyn

I've just pulled the latest fboss code, pulled and installed latest folly and fbthrift from github, executed getdeps.sh. Till that moment everything is OK. But when I execute cmake .. from the created build dir(as this is mentioned in BUILD document) I got the error as follows:

CMake Error at CMakeLists.txt:63 (add_library):
Cannot find source file:

/home/vsenchyshyn/projects/xpliant/tmp/fboss/build/gen/common/network/if/gen-cpp/Address_reflection.cpp

Since the latest commit is fixing build I'm wondering what's wrong in my case? Do I need to install folly and fbthrift of specific version in order to make build working correctly? If yes then how can I do that? If not then what else could be wrong?

Activity

  1. superchild commented on Sep 15, 2015

    @superchild

    I found some bug in this CMakeList.txt
    Try to modify

    foreach(reflect ${arg_REFLECT})
        set(outputs ${outputs}
            ${CMAKE_BINARY_DIR}/gen/${dirname}/gen-${gen}/${reflect}_reflect.h
            ${CMAKE_BINARY_DIR}/gen/${dirname}/gen-${gen}/${reflect}_reflect.cpp)
    endforeach(reflect)
    

    to

    foreach(reflect ${arg_REFLECT})
        set(outputs ${outputs}
            ${CMAKE_BINARY_DIR}/gen/${dirname}/gen-${gen}/${reflect}_reflection.h
            ${CMAKE_BINARY_DIR}/gen/${dirname}/gen-${gen}/${reflect}_reflection.cpp)
    endforeach(reflect)
    

    and also needs to modify the cmake_parse_arguments.
    Try to modify

    function(fboss_add_thrift)
        cmake_parse_arguments("arg" "" "OPTIONS";"THRIFTSRC" "SERVICES" ${ARGN})
    

    to

    function(fboss_add_thrift)
        set(options)
        set(oneValueArgs OPTIONS REFLECT)
        set(multiValueArgs THRIFTSRC SERVICES)
        cmake_parse_argument("arg" "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
    
  2. vitaliy-senchyshyn commented on Sep 22, 2015

    @vitaliy-senchyshyn
    Author

    This helped a bit but now I see error as follows:
    fboss/external/fbthrift/thrift/compiler/thrift1: error while loading shared libraries: libfolly.so.48: cannot open shared object file: No such file or directory

    At the same time I see that this library is here:
    fboss$ find . -name libfolly.so.48
    ./external/folly/folly/.libs/libfolly.so.48

    So this looks quite strange. But perhaps this happens because ./getdeps.sh throws errors on gen-cpp2/ stage and fails to finish. Although ./getdeps.sh now has exact versions of folly, fbthrift and iproute2 which have to be downloaded but looks like there is still some mistake in versions mentioned there. First of all I've added the command "git reset --hard $2" after "cd $1" function build() but still see many errors as follows:

    In file included from gen-cpp2/SaslAuthService.cpp:7:0:
    gen-cpp2/SaslAuthService.h:79:37: error: expected type-specifier before ‘ProcessFunc’
    using BinaryProtocolProcessFunc = ProcessFunc<SaslAuthServiceAsyncProcessor, apache::thrift::BinaryProtocolReader>;
    ^
    gen-cpp2/SaslAuthService.h:80:36: error: expected type-specifier before ‘ProcessMap’
    using BinaryProtocolProcessMap = ProcessMap;
    ^
    gen-cpp2/SaslAuthService.h:81:16: error: ‘BinaryProtocolProcessMap’ in ‘class apache::thrift::sasl::SaslAuthServiceAsyncProcessor’ does not name a type
    static const SaslAuthServiceAsyncProcessor::BinaryProtocolProcessMap& getBinaryProtocolProcessMap();
    ^
    gen-cpp2/SaslAuthService.h:83:10: error: ‘BinaryProtocolProcessMap’ in ‘class apache::thrift::sasl::SaslAuthServiceAsyncProcessor’ does not name a type
    static SaslAuthServiceAsyncProcessor::BinaryProtocolProcessMap binaryProcessMap_;
    ^
    gen-cpp2/SaslAuthService.h:85:38: error: expected type-specifier before ‘ProcessFunc’
    using CompactProtocolProcessFunc = ProcessFunc<SaslAuthServiceAsyncProcessor, apache::thrift::CompactProtocolReader>;
    ^
    gen-cpp2/SaslAuthService.h:86:37: error: expected type-specifier before ‘ProcessMap’
    using CompactProtocolProcessMap = ProcessMap;
    ^
    gen-cpp2/SaslAuthService.h:87:16: error: ‘CompactProtocolProcessMap’ in ‘class apache::thrift::sasl::SaslAuthServiceAsyncProcessor’ does not name a type
    static const SaslAuthServiceAsyncProcessor::CompactProtocolProcessMap& getCompactProtocolProcessMap();
    ^
    gen-cpp2/SaslAuthService.h:89:10: error: ‘CompactProtocolProcessMap’ in ‘class apache::thrift::sasl::SaslAuthServiceAsyncProcessor’ does not name a type
    static SaslAuthServiceAsyncProcessor::CompactProtocolProcessMap compactProcessMap_;
    ^
    gen-cpp2/SaslAuthService.h: In constructor ‘apache::thrift::sasl::SaslAuthServiceAsyncClient::SaslAuthServiceAsyncClient(std::shared_ptrapache::thrift::RequestChannel)’:
    gen-cpp2/SaslAuthService.h:127:50: error: no matching function for call to ‘apache::thrift::Cpp2ConnContext::Cpp2ConnContext()’
    connectionContext_.reset(new apache::thrift::Cpp2ConnContext);
    ^
    gen-cpp2/SaslAuthService.h:127:50: note: candidates are:
    In file included from ../../../thrift/lib/cpp2/async/AsyncProcessor.h:29:0,
    from ../../../thrift/lib/cpp2/ServiceIncludes.h:5,
    from gen-cpp2/SaslAuthService.h:9,
    from gen-cpp2/SaslAuthService.cpp:7:
    ../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:39:12: note: apache::thrift::Cpp2ConnContext::Cpp2ConnContext(const folly::SocketAddress_, const apache::thrift::async::TAsyncSocket_, apache::thrift::transport::THeader_, const apache::thrift::SaslServer_, apache::thrift::async::TEventBaseManager_, const std::shared_ptrapache::thrift::RequestChannel&)
    explicit Cpp2ConnContext(
    ^
    ../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:39:12: note: candidate expects 6 arguments, 0 provided
    ../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:37:7: note: apache::thrift::Cpp2ConnContext::Cpp2ConnContext(const apache::thrift::Cpp2ConnContext&)
    class Cpp2ConnContext : public apache::thrift::server::TConnectionContext {
    ^
    ../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:37:7: note: candidate expects 1 argument, 0 provided
    ../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:37:7: note: apache::thrift::Cpp2ConnContext::Cpp2ConnContext(apache::thrift::Cpp2ConnContext&&)
    ../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:37:7: note: candidate expects 1 argument, 0 provided
    In file included from gen-cpp2/SaslAuthService.cpp:9:0:
    gen-cpp2/SaslAuthService.tcc: In member function ‘void apache::thrift::sasl::SaslAuthServiceAsyncProcessor::process_authFirstRequest(std::unique_ptrapache::thrift::ResponseChannel::Request, std::unique_ptrfolly::IOBuf, std::unique_ptr, apache::thrift::Cpp2RequestContext_, apache::thrift::async::TEventBase_, apache::thrift::concurrency::ThreadManager_)’:
    gen-cpp2/SaslAuthService.tcc:48:159: error: no matching function for call to ‘apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, const std::vector&, uint32_t)’
    queue.append(apache::thrift::transport::THeader::transform(queue.move(), ctx->getHeader()->getWriteTransforms(), ctx->getHeader()->getMinCompressBytes()));
    ^
    gen-cpp2/SaslAuthService.tcc:48:159: note: candidate is:
    In file included from ../../../thrift/lib/cpp/server/TConnectionContext.h:25:0,
    from ../../../thrift/lib/cpp/EventHandlerBase.h:25,
    from ../../../thrift/lib/cpp/TProcessor.h:25,
    from ../../../thrift/lib/cpp2/async/AsyncProcessor.h:20,
    from ../../../thrift/lib/cpp2/ServiceIncludes.h:5,
    from gen-cpp2/SaslAuthService.h:9,
    from gen-cpp2/SaslAuthService.cpp:7:
    ../../../thrift/lib/cpp/transport/THeader.h:140:40: note: static std::unique_ptrfolly::IOBuf apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, std::vector&, uint32_t)
    static std::unique_ptrfolly::IOBuf transform(
    ^
    ../../../thrift/lib/cpp/transport/THeader.h:140:40: note: no known conversion for argument 2 from ‘const std::vector’ to ‘std::vector&’
    In file included from gen-cpp2/SaslAuthService.cpp:9:0:
    gen-cpp2/SaslAuthService.tcc: In static member function ‘static void apache::thrift::sasl::SaslAuthServiceAsyncProcessor::throw_authFirstRequest(std::unique_ptrapache::thrift::ResponseChannel::Request, int32_t, apache::thrift::ContextStack_, std::exception_ptr::exception_ptr, apache::thrift::Cpp2RequestContext)’:
    gen-cpp2/SaslAuthService.tcc:91:165: error: no matching function for call to ‘apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, const std::vector&, uint32_t)’
    queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
    ^
    gen-cpp2/SaslAuthService.tcc:91:165: note: candidate is:
    In file included from ../../../thrift/lib/cpp/server/TConnectionContext.h:25:0,
    from ../../../thrift/lib/cpp/EventHandlerBase.h:25,
    from ../../../thrift/lib/cpp/TProcessor.h:25,
    from ../../../thrift/lib/cpp2/async/AsyncProcessor.h:20,
    from ../../../thrift/lib/cpp2/ServiceIncludes.h:5,
    from gen-cpp2/SaslAuthService.h:9,
    from gen-cpp2/SaslAuthService.cpp:7:
    ../../../thrift/lib/cpp/transport/THeader.h:140:40: note: static std::unique_ptrfolly::IOBuf apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, std::vector&, uint32_t)
    static std::unique_ptrfolly::IOBuf transform(
    ^
    ../../../thrift/lib/cpp/transport/THeader.h:140:40: note: no known conversion for argument 2 from ‘const std::vector’ to ‘std::vector&’
    In file included from gen-cpp2/SaslAuthService.cpp:9:0:
    gen-cpp2/SaslAuthService.tcc:104:165: error: no matching function for call to ‘apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, const std::vector&, uint32_t)’
    queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
    ^
    gen-cpp2/SaslAuthService.tcc:104:165: note: candidate is:
    In file included from ../../../thrift/lib/cpp/server/TConnectionContext.h:25:0,
    from ../../../thrift/lib/cpp/EventHandlerBase.h:25,
    from ../../../thrift/lib/cpp/TProcessor.h:25,
    from ../../../thrift/lib/cpp2/async/AsyncProcessor.h:20,
    from ../../../thrift/lib/cpp2/ServiceIncludes.h:5,
    from gen-cpp2/SaslAuthService.h:9,
    from gen-cpp2/SaslAuthService.cpp:7:
    ../../../thrift/lib/cpp/transport/THeader.h:140:40: note: static std::unique_ptrfolly::IOBuf apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, std::vector&, uint32_t)
    static std::unique_ptrfolly::IOBuf transform(
    ^
    ../../../thrift/lib/cpp/transport/THeader.h:140:40: note: no known conversion for argument 2 from ‘const std::vector’ to ‘std::vector&’
    In file included from gen-cpp2/SaslAuthService.cpp:9:0:
    gen-cpp2/SaslAuthService.tcc: In static member function ‘static void apache::thrift::sasl::SaslAuthServiceAsyncProcessor::throw_wrapped_authFirstRequest(std::unique_ptrapache::thrift::ResponseChannel::Request, int32_t, apache::thrift::ContextStack
    , folly::exception_wrapper, apache::thrift::Cpp2RequestContext_)’:
    gen-cpp2/SaslAuthService.tcc:126:165: error: no matching function for call to ‘apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, const std::vector&, uint32_t)’
    queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));

  3. oridb commented on Sep 22, 2015

    @oridb
    Contributor

    What version of Thrift are you building against?

  4. vitaliy-senchyshyn commented on Sep 23, 2015

    @vitaliy-senchyshyn
    Author

    v0.28.0 as mentioned in ./getdeps.sh

  5. oridb commented on Sep 28, 2015

    @oridb
    Contributor

    Odd. What compiler version?

  6. vitaliy-senchyshyn commented on Oct 1, 2015

    @vitaliy-senchyshyn
    Author

    /fboss$ g++ --version
    g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

  7. vitaliy-senchyshyn commented on Oct 12, 2015

    @vitaliy-senchyshyn
    Author

    Any updates?

  8. vitaliy-senchyshyn commented on Nov 18, 2015

    @vitaliy-senchyshyn
    Author

    After my hard disc clean up things are much better(I guess the problems above occurred because of thrift, folly and iproute2 libraries of versions other than required here were installed in system directories. Apparently they affected compilation).

    I still see one compilation error which should be fixed but as a temporary solution I've just commented it out and this helped - fboss was built successfully. The error is as follows and I guess has to be fixed anyway:

    /home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.cpp: In destructor ‘virtual facebook::fboss::NeighborUpdater::~NeighborUpdater()’:
    /home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.cpp:156:37: error: no matching function for call to ‘std::vectorfolly::Future<folly::Unit >::push_back(std::remove_referencefolly::Future<void&>::type)’
    stopTasks.push_back(std::move(f));
    ^
    /home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.cpp:156:37: note: candidates are:
    In file included from /usr/include/c++/4.8/vector:64:0,
    from /usr/include/c++/4.8/bits/random.h:34,
    from /usr/include/c++/4.8/random:50,
    from /usr/include/c++/4.8/bits/stl_algo.h:65,
    from /usr/include/c++/4.8/algorithm:62,
    from /usr/include/boost/container/detail/flat_tree.hpp:23,
    from /usr/include/boost/container/flat_map.hpp:25,
    from /home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.h:12,
    from /home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.cpp:10:
    /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = folly::Futurefolly::Unit; _Alloc = std::allocatorfolly::Future<folly::Unit >; std::vector<_Tp, _Alloc>::value_type = folly::Futurefolly::Unit]
    push_back(const value_type& __x)
    ^
    /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from ‘std::remove_referencefolly::Future<void&>::type {aka folly::Future}’ to ‘const value_type& {aka const folly::Futurefolly::Unit&}’
    /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = folly::Futurefolly::Unit; _Alloc = std::allocatorfolly::Future<folly::Unit >; std::vector<_Tp, _Alloc>::value_type = folly::Futurefolly::Unit]
    push_back(value_type&& __x)
    ^
    /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from ‘std::remove_referencefolly::Future<void&>::type {aka folly::Future}’ to ‘std::vectorfolly::Future<folly::Unit >::value_type&& {aka folly::Futurefolly::Unit&&}’

  9. oridb commented on Jan 15, 2016

    @oridb
    Contributor

    This should be fixed.

  10. added a commit that references this issue on Nov 17, 2021
  11. added a commit that references this issue on Sep 26, 2023
  12. added a commit that references this issue on Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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