venediktov / vanilla-rtb

Real Time Bidding (RTB) - Demand Side Platform framework
http://forkbid.com
GNU General Public License v3.0
314 stars 84 forks source link

No bin directory after build under Mac OSX 10.14.5 Mojave Boost=1.70.0 GCC=8 or GCC=9 #88

Closed BillZhuOpenX closed 5 years ago

BillZhuOpenX commented 5 years ago

I tried installing on my Macbook, OSX 10.14.5 Mojave, boost = 1.70.0, tried GCC=8 and 9, but once I'm nearly done with build, there are errors as listed below. Also, there appears to be no bin directory?

In file included from /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:19:
/Users/bill.zhu/vanilla-rtb/rtb/datacache/generic_bidder_cache_loader.hpp:58:37: error: 
      'retrieve' following the 'template' keyword does not refer to a template
            return  entity.template retrieve(t, std::get<Idx>(std::forwa...
                                    ^
/Users/bill.zhu/vanilla-rtb/rtb/datacache/generic_bidder_cache_loader.hpp:50:27: note: 
      in instantiation of function template specialization
      'vanilla::GenericBidderCacheLoader<DomainEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      ICOCampaignEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      AdDataEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      vanilla::CampaignCache<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > > >::retrieve<Domain,
      std::__1::tuple<std::__1::basic_string<char> >, 0>' requested here
            return  this->retrieve(t, std::make_tuple(std::forward<Keys>...
                          ^
/Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:95:25: note: 
      in instantiation of function template specialization
      'vanilla::GenericBidderCacheLoader<DomainEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      ICOCampaignEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      AdDataEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      vanilla::CampaignCache<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > > >::retrieve<Domain, const std::__1::basic_string<char> &>'
      requested here
        if(!cacheLoader.retrieve(domain,dom)) {
                        ^
/Users/bill.zhu/vanilla-rtb/rtb/core/bidder.hpp:60:17: note: in instantiation of
      function template specialization
      'vanilla::Bidder<DSL::GenericDSL<std::__1::basic_string<char>,
      DSL::rapid_mapper>, vanilla::ad_selector<vanilla::BudgetManager, Ad>
      >::buildImpResponse<openrtb::Impression<std::__1::basic_string<char> >,
      std::__1::basic_string<char>, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:93:30),
      (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:101:36),
      (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:110:36)>'
      requested here
                buildImpResponse(request, imp, std::get<Idx>(std::forwar...
                ^
/Users/bill.zhu/vanilla-rtb/rtb/core/bidder.hpp:66:27: note: in instantiation of
      function template specialization
      'vanilla::Bidder<DSL::GenericDSL<std::__1::basic_string<char>,
      DSL::rapid_mapper>, vanilla::ad_selector<vanilla::BudgetManager, Ad>
      >::bid<openrtb::BidRequest<std::__1::basic_string<char> >,
      std::__1::tuple<std::__1::basic_string<char>, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:93:30),
      (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:101:36),
      (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:110:36)>,
      0, 1, 2, 3>' requested here
            return  this->bid(vanilla_request, std::make_tuple(std::forw...
                          ^
/Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:136:27: note: 
      in instantiation of function template specialization
      'vanilla::Bidder<DSL::GenericDSL<std::__1::basic_string<char>,
      DSL::rapid_mapper>, vanilla::ad_selector<vanilla::BudgetManager, Ad>
      >::bid<openrtb::BidRequest<std::__1::basic_string<char> >, const
      std::__1::basic_string<char> &, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:93:30)
      &, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:101:36)
      &, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:110:36)
      &>' requested here
            return bidder.bid(request,
                          ^
/Users/bill.zhu/vanilla-rtb/examples/matchers/domain.hpp:152:14: note: declared
      as a non-template here
        bool retrieve(Domain &domain, const std::string &url) {
             ^
In file included from /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:19:
/Users/bill.zhu/vanilla-rtb/rtb/datacache/generic_bidder_cache_loader.hpp:58:37: error: 
      'retrieve' following the 'template' keyword does not refer to a template
            return  entity.template retrieve(t, std::get<Idx>(std::forwa...
                                    ^
/Users/bill.zhu/vanilla-rtb/rtb/datacache/generic_bidder_cache_loader.hpp:50:27: note: 
      in instantiation of function template specialization
      'vanilla::GenericBidderCacheLoader<ICOCampaignEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      AdDataEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      vanilla::CampaignCache<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > > >::retrieve<std::__1::vector<ICOCampaign,
      std::__1::allocator<ICOCampaign> >, std::__1::tuple<unsigned int>, 0>'
      requested here
            return  this->retrieve(t, std::make_tuple(std::forward<Keys>...
                          ^
/Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:103:26: note: 
      in instantiation of function template specialization
      'vanilla::GenericBidderCacheLoader<DomainEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      ICOCampaignEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      AdDataEntity<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > >,
      vanilla::CampaignCache<vanilla::config::config<ico_bidder_config_data>,
      mpclmi::ipc::Shared, boost::interprocess::allocator<char,
      boost::interprocess::segment_manager<char,
      boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,
      boost::interprocess::offset_ptr<void, long, unsigned long, 0>, 0>,
      iset_index> > > >::retrieve<std::__1::vector<ICOCampaign,
      std::__1::allocator<ICOCampaign> >, unsigned int &>' requested here
        if (!cacheLoader.retrieve(ico_campains,*dom_id)) {
                         ^
/Users/bill.zhu/vanilla-rtb/rtb/core/bidder.hpp:60:17: note: in instantiation of
      function template specialization
      'vanilla::Bidder<DSL::GenericDSL<std::__1::basic_string<char>,
      DSL::rapid_mapper>, vanilla::ad_selector<vanilla::BudgetManager, Ad>
      >::buildImpResponse<openrtb::Impression<std::__1::basic_string<char> >,
      std::__1::basic_string<char>, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:93:30),
      (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:101:36),
      (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:110:36)>'
      requested here
                buildImpResponse(request, imp, std::get<Idx>(std::forwar...
                ^
/Users/bill.zhu/vanilla-rtb/rtb/core/bidder.hpp:66:27: note: in instantiation of
      function template specialization
      'vanilla::Bidder<DSL::GenericDSL<std::__1::basic_string<char>,
      DSL::rapid_mapper>, vanilla::ad_selector<vanilla::BudgetManager, Ad>
      >::bid<openrtb::BidRequest<std::__1::basic_string<char> >,
      std::__1::tuple<std::__1::basic_string<char>, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:93:30),
      (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:101:36),
      (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:110:36)>,
      0, 1, 2, 3>' requested here
            return  this->bid(vanilla_request, std::make_tuple(std::forw...
                          ^
/Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:136:27: note: 
      in instantiation of function template specialization
      'vanilla::Bidder<DSL::GenericDSL<std::__1::basic_string<char>,
      DSL::rapid_mapper>, vanilla::ad_selector<vanilla::BudgetManager, Ad>
      >::bid<openrtb::BidRequest<std::__1::basic_string<char> >, const
      std::__1::basic_string<char> &, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:93:30)
      &, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:101:36)
      &, (lambda at
      /Users/bill.zhu/vanilla-rtb/examples/bidder_experimental/ico_campaign_bidder_test.cpp:110:36)
      &>' requested here
            return bidder.bid(request,
                          ^
/Users/bill.zhu/vanilla-rtb/examples/matchers/ico_campaign.hpp:167:14: note: 
      declared as a non-template here
        bool retrieve(ICOCampaignCollection &ico_campaigns, uint32_t dom...
             ^
2 errors generated.
make[2]: *** [examples/bidder_experimental/CMakeFiles/ico_campaign_bidder_test.dir/ico_campaign_bidder_test.cpp.o] Error 1
make[1]: *** [examples/bidder_experimental/CMakeFiles/ico_campaign_bidder_test.dir/all] Error 2
venediktov commented 5 years ago

Hi @BillZhuOpenX - please try changing /Users/bill.zhu/vanilla-rtb/rtb/datacache/generic_bidder_cache_loader.hpp line 58

from return entity.template retrieve(t, std::get<Idx>(std::forward<Tuple>(tuple))...); to return entity.retrieve(t, std::get<Idx>(std::forward<Tuple>(tuple))...);

I have tried our code with GCC=8.3 and GCC=9.1 and did not get your errors , so please send me outputs from following commands

on your question about bin directory , it will be created here for Release /Users/bill.zhu/vanilla-rtb/Release/examples/bin and here for Debug /Users/bill.zhu/vanilla-rtb/Debug/examples/bin

if you follow our instructions and execute /Users/bill.zhu/vanilla-rtb/Release> make -j4 install or for Debug execute /Users/bill.zhu/vanilla-rtb/Debug> make -j4 install

When you build next time please build in verbose mode make VERBOSE=1 install
and send errors with a compilation output right before the error

BillZhuOpenX commented 5 years ago

Thanks for the feedback! I realize that g++ points to the xcode version; I have updated the alias to point to the Homebrew one. Regarding boost, I have boost installed through Homebrew, but that echo command is returning

(base) mbp-om-69:vanilla-rtb bill.zhu$ cmake --version
cmake version 3.15.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).
(base) mbp-om-69:vanilla-rtb bill.zhu$ g++ --version
g++-9 (Homebrew GCC 9.1.0) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(base) mbp-om-69:vanilla-rtb bill.zhu$ echo -e '#include <boost/version.hpp>\nBOOST_VERSION' | gcc -x c++ -E -
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
<stdin>:1:10: fatal error: boost/version.hpp: No such file or directory

Any suggestion on why that may be when I get

Warning: boost 1.70.0 is already installed and up-to-date
To reinstall 1.70.0, run `brew reinstall boost`
BillZhuOpenX commented 5 years ago

I think the problem is that xcode's CXX and C take precedent even if the aliases are set.

(base) mbp-om-69:Release bill.zhu$ which gcc
/usr/bin/gcc
(base) mbp-om-69:Release bill.zhu$ which gcc-9
/usr/local/bin/gcc-9

I used the llvm commands and with a sudo make to override some permissions, it works now. Thanks!

venediktov commented 5 years ago

Hi @BillZhuOpenX , your 1.7 boost is most likely in /usr/local/include

To use custom installed GCC you can pass it on command line to cmake , but you have to most likely remove the cmake cached files for it to take effect , or simple rm -rf Release and redo everything from scratch.

cmake -DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9 -DCMAKE_BUILD_TYPE=Release .. -G "Unix Makefiles"

cmake prints to console where it finds boost and other dependencies .

BillZhuOpenX commented 5 years ago

HI @venediktov, my 1.7 boost is indeed under /usr/local/include

However, even when passing custom GCC, I get the following error:

Scanning dependencies of target crud_service
Scanning dependencies of target generator
Scanning dependencies of target parsers
Scanning dependencies of target jsonv
[  1%] Building C object parsers/CMakeFiles/parsers.dir/jsmn.c.o
[  1%] Built target generator
[  3%] Linking CXX shared library libparsers.dylib
Scanning dependencies of target generator_experimental
ld: warning: directory not found for option '-L/usr/local/opt/gettext/lib'
[  5%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/algorithm_compare.cpp.o
[  5%] Built target generator_experimental
[  6%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/algorithm_map.cpp.o
[  6%] Built target parsers
[  8%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/algorithm_traverse.cpp.o
[ 10%] Building CXX object CRUD/service/CMakeFiles/crud_service.dir/mime_types.cpp.o
[ 11%] Building CXX object CRUD/service/CMakeFiles/crud_service.dir/reply.cpp.o
Scanning dependencies of target vanilla_tests
[ 13%] Building CXX object CRUD/service/CMakeFiles/crud_service.dir/request_handler.cpp.o
[ 15%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/array.cpp.o
[ 16%] Building CXX object tests/CMakeFiles/vanilla_tests.dir/vanilla_all.cpp.o
[ 18%] Building CXX object tests/CMakeFiles/vanilla_tests.dir/main.cpp.o
[ 20%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/char_convert.cpp.o
[ 21%] Building CXX object CRUD/service/CMakeFiles/crud_service.dir/request_parser.cpp.o
[ 23%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/coerce.cpp.o
[ 25%] Linking CXX shared library libcrud_service.dylib
ld: warning: directory not found for option '-L/usr/local/opt/gettext/lib'
[ 25%] Built target crud_service
[ 26%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/demangle.cpp.o
[ 28%] Linking CXX executable vanilla_tests
ld: warning: directory not found for option '-L/usr/local/opt/gettext/lib'
Undefined symbols for architecture x86_64:
  "boost::unit_test::ut_detail::normalize_test_case_name[abi:cxx11](boost::unit_test::basic_cstring<char const>)", referenced from:
      boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long) in vanilla_all.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [tests/vanilla_tests] Error 1
make[1]: *** [tests/CMakeFiles/vanilla_tests.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 30%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/detail.cpp.o
/Users/bill.zhu/vanilla-rtb/jsonv/src/jsonv/coerce.cpp: In function 'jsonv::value jsonv::coerce_merge(jsonv::value, jsonv::value)':
/Users/bill.zhu/vanilla-rtb/jsonv/src/jsonv/coerce.cpp:197:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
  197 |         if (can_coerce(b, kind::integer))
      |         ^~
/Users/bill.zhu/vanilla-rtb/jsonv/src/jsonv/coerce.cpp:200:5: note: here
  200 |     case kind::decimal:
      |     ^~~~
[ 31%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/detail/token_patterns.cpp.o
[ 33%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/encode.cpp.o
[ 35%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/functional.cpp.o
[ 36%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/object.cpp.o
[ 38%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/parse.cpp.o
[ 40%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/path.cpp.o
[ 41%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/serialization.cpp.o
[ 43%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/serialization_builder.cpp.o
[ 45%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/tokenizer.cpp.o
[ 46%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/util.cpp.o
[ 48%] Building CXX object jsonv/CMakeFiles/jsonv.dir/src/jsonv/value.cpp.o
/Users/bill.zhu/vanilla-rtb/jsonv/src/jsonv/util.cpp: In function 'jsonv::value jsonv::merge_explicit(const jsonv::merge_rules&, jsonv::path, jsonv::value, jsonv::value)':
/Users/bill.zhu/vanilla-rtb/jsonv/src/jsonv/util.cpp:118:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
  118 |             if (b.kind() == kind::integer)
      |             ^~
/Users/bill.zhu/vanilla-rtb/jsonv/src/jsonv/util.cpp:121:9: note: here
  121 |         case kind::decimal:
      |         ^~~~
[ 50%] Linking CXX shared library libjsonv.dylib
ld: warning: directory not found for option '-L/usr/local/opt/gettext/lib'
[ 50%] Built target jsonv
make: *** [all] Error 2
venediktov commented 5 years ago

Hi @BillZhuOpenX , Boost 1.7 has compatibility issue with Cmake as noted by others , not sure if your problem related to that .

on the top of that looking at linker errors ld: warning: directory not found for option '-L/usr/local/opt/gettext/lib' - not sure why linker can't find it on your mac but on my mac os this directory exists, so perhaps you need to reinstall gettext

Also , not sure why our build needs it , did not see any reference in our stack for gettext library .

can you run single threaded build and send me output

make VERBOSE=1 install

Second and more important , boost libraries must be installed for GCC compiler or you will have to build it yourself for gcc-9

brew remove boost - will remove your boost 1.70 anyway 1.70 version of boost is not compatible with cmake .

below instructions how to build and install boost yourself for GCC toolchain , make sure it builds boost with GCC-9 , same compiler version you use for vanilla-rtb build

mkdir boost167
wget --no-check-certificate --quiet -O - https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz | tar --strip-components=1 -xz -C boost167
cd boost167 
CC=/usr/local/bin/gcc-9 CXX=/usr/local/bin/g++-9   ./bootstrap.sh --with-toolset=gcc --with-libraries=all
./b2 toolset=gcc-9 variant=release install --prefix=/usr

you should see /usr/include/boost for headers and /usr/lib/libboost* for libraries .

Then repeat our build process

rm -rf Release
mkdir Release
cd Release
cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9 -DCMAKE_BUILD_TYPE=Release .. -G "Unix Makefiles"

updated WIKI

Let me know how it goes.

venediktov commented 5 years ago

@BillZhuOpenX , I created pull request addressing issues with boost 1.70.00 I have tested on my Mac OS it works with Apple clang compiler Xcode clang-1000.11.45.5 ( llvm 6.0.1 ) mapping of Apple version to LLVM is here

Mapping of Apple Xcode versions to LLVM Your first compilation issue is due to newer clang installed on your Mac it does not compile our code . In particular my version of LLVM clang=8 from brew install llvm had same issue as you reported first

clang++ --version
clang version 8.0.0 (tags/RELEASE_800/final)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

This version errors out in our code

/Users/vvenedik/vanilla-rtb/rtb/datacache/generic_bidder_cache_loader.hpp:58:37: error: 'retrieve' following the 'template' keyword does not refer to a template
            return  entity.template retrieve(t, std::get<Idx>(std::forward<Tuple>(tuple))...);

so back to boost 1.70.00 linking issues , after I fixed CMakeLists.txt see pull request Apple clang=1000.11.45.5 ( LLVM 6.0.1 ) below builds ok

g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

so on the top of taking our latest code after we merge you will have to update your clang in order to build vanilla-rtb Here is the output from cmake using clang-1000.11.45.5 installed with xcode-select --install

cmake -DCMAKE_BUILD_TYPE=Release .. -G "Unix Makefiles"
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost 1.70.0 at /usr/local/lib/cmake/Boost-1.70.0
--   Requested configuration: QUIET REQUIRED
-- Found boost_headers 1.70.0 at /usr/local/lib/cmake/boost_headers-1.70.0
-- Found Boost: /usr/local/lib/cmake/Boost-1.70.0/BoostConfig.cmake (found suitable version "1.70.0", minimum required is "1.67.0") 
....
....

vanilla-rtb also compiles with homebrew gcc=9 , but you have to build boost yourself can't rely on brew install boost anymore imho it complicates your build as you have to remember to pass compiler path to cmake.

/usr/local/bin/g++-9 --version
g++-9 (Homebrew GCC 9.1.0) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

To switch between clang and gcc boost versions you will have to have boost in separate directories and pass -DBOOST_ROOT to cmake

Unless you need GCC=9 I would stick to Apple clang=10 for MAC OSX either Xtools or standalone

BillZhuOpenX commented 5 years ago

I've built from your pr, and everything checks out now. Yes, the warnings did stem from the gettext library being incorrectly installed or incomplete; reinstalling it removed any warnings.