Closed BillZhuOpenX closed 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
cmake --version
g++ --version
echo -e '#include <boost/version.hpp>\nBOOST_VERSION' | gcc -x c++ -E -
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
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`
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!
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 .
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
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"
Let me know how it goes.
@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
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.
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?