Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS build error fatal error: 'boost/beast/core/string.hpp' file not found #2362

Closed
wangdar opened this issue Jan 31, 2018 · 18 comments
Closed

Comments

@wangdar
Copy link

wangdar commented Jan 31, 2018

[  0%] Running C++ protocol buffer compiler on /app/ripple/rippled/src/ripple/proto/ripple.proto
Scanning dependencies of target rippled
[  0%] Building CXX object CMakeFiles/rippled.dir/src/ripple/beast/unity/beast_insight_unity.cpp.o
[  0%] Building CXX object CMakeFiles/rippled.dir/src/ripple/beast/unity/beast_net_unity.cpp.o
[  0%] Building CXX object CMakeFiles/rippled.dir/src/ripple/beast/unity/beast_utility_unity.cpp.o
[  0%] Building CXX object CMakeFiles/rippled.dir/src/ripple/unity/app_consensus.cpp.o
[  9%] Building CXX object CMakeFiles/rippled.dir/src/ripple/unity/app_ledger.cpp.o
[  9%] Building CXX object CMakeFiles/rippled.dir/src/ripple/unity/app_ledger_impl.cpp.o
In file included from /app/ripple/rippled/src/ripple/unity/app_consensus.cpp:21:
In file included from /app/ripple/rippled/src/ripple/app/consensus/RCLConsensus.cpp:21:
In file included from /app/ripple/rippled/src/ripple/app/consensus/RCLConsensus.h:24:
In file included from /app/ripple/rippled/src/ripple/app/consensus/RCLCxLedger.h:23:
In file included from /app/ripple/rippled/src/ripple/app/ledger/Ledger.h:24:
In file included from /app/ripple/rippled/src/ripple/ledger/View.h:34:
In file included from /app/ripple/rippled/src/ripple/core/Config.h:23:
/app/ripple/rippled/src/ripple/basics/BasicConfig.h:25:10: fatal error: 'boost/beast/core/string.hpp' file not found
#include <boost/beast/core/string.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /app/ripple/rippled/src/ripple/unity/app_ledger_impl.cpp:22:
In file included from /app/ripple/rippled/src/ripple/app/ledger/impl/InboundLedger.cpp:21:
In file included from /app/ripple/rippled/src/ripple/app/ledger/InboundLedger.h:23:
In file included from /app/ripple/rippled/src/ripple/app/main/Application.h:24:
In file included from /app/ripple/rippled/src/ripple/shamap/TreeNodeCache.h:24:
In file included from /app/ripple/rippled/src/ripple/shamap/SHAMapTreeNode.h:25:
In file included from /app/ripple/rippled/src/ripple/basics/TaggedCache.h:24:
/app/ripple/rippled/src/ripple/basics/Log.h:24:10: fatal error: 'boost/beast/core/string.hpp' file not found
#include <boost/beast/core/string.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /app/ripple/rippled/src/ripple/unity/app_ledger.cpp:22:
In file included from /app/ripple/rippled/src/ripple/app/ledger/AcceptedLedger.cpp:21:
In file included from /app/ripple/rippled/src/ripple/app/ledger/AcceptedLedger.h:23:
In file included from /app/ripple/rippled/src/ripple/app/ledger/AcceptedLedgerTx.h:23:
In file included from /app/ripple/rippled/src/ripple/app/ledger/Ledger.h:24:
In file included from /app/ripple/rippled/src/ripple/ledger/View.h:34:
In file included from /app/ripple/rippled/src/ripple/core/Config.h:23:
/app/ripple/rippled/src/ripple/basics/BasicConfig.h:25:10: fatal error: 'boost/beast/core/string.hpp' file not found
#include <boost/beast/core/string.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  9%] Building CXX object CMakeFiles/rippled.dir/src/ripple/unity/app_main1.cpp.o
1 error generated.
make[2]: *** [CMakeFiles/rippled.dir/src/ripple/unity/app_consensus.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [CMakeFiles/rippled.dir/src/ripple/unity/app_ledger.cpp.o] Error 1
In file included from /app/ripple/rippled/src/ripple/unity/app_main1.cpp:22:
In file included from /app/ripple/rippled/src/ripple/app/main/Application.cpp:21:
In file included from /app/ripple/rippled/src/ripple/app/main/Application.h:24:
In file included from /app/ripple/rippled/src/ripple/shamap/TreeNodeCache.h:24:
In file included from /app/ripple/rippled/src/ripple/shamap/SHAMapTreeNode.h:25:
In file included from /app/ripple/rippled/src/ripple/basics/TaggedCache.h:24:
/app/ripple/rippled/src/ripple/basics/Log.h:24:10: fatal error: 'boost/beast/core/string.hpp' file not found
#include <boost/beast/core/string.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/rippled.dir/src/ripple/unity/app_ledger_impl.cpp.o] Error 1
1 error generated.
make[2]: *** [CMakeFiles/rippled.dir/src/ripple/unity/app_main1.cpp.o] Error 1
make[1]: *** [CMakeFiles/rippled.dir/all] Error 2
make: *** [all] Error 2
@bachase
Copy link
Collaborator

bachase commented Jan 31, 2018

Are you building the latest from the develop branch? If so, are you using boost 1.66.0?

@wangdar
Copy link
Author

wangdar commented Feb 1, 2018

hi @bachase
no I use boost_1_65_1,building the latest from the develop branch.

@seelabs
Copy link
Collaborator

seelabs commented Feb 1, 2018

@wangdar rippled 0.90.0-b5 requires boost 1.66. The reason for this is the beast library, which was originally part of rippled, is now part of boost. In order to get important bug fixes we need to use boost 1.66 (or back-port the changes ourselves, which is less attractive).

Upgrading to boost 1.66 should fix this issue for you (assuming you are also building rippled 0.90.0-b5).

@wangdar
Copy link
Author

wangdar commented Feb 1, 2018

hi @seelabs
I build for boost 1.66.0, show another error [ error: invalid operands to binary expression]


-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning .....


-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Boost version: 1.66.0
-- Found the following Boost libraries:
--   chrono
--   coroutine
--   context
--   date_time
--   filesystem
--   program_options
--   regex
--   serialization
--   system
--   thread
--   atomic
-- Found OpenSSL: /usr/local/opt/openssl/lib/libcrypto.dylib (found version "1.0.2m") 
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11") 
-- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found version "2.6.1") 
CMake Warning at CMakeLists.txt:490 (message):
  Boost b2 executable not found.  docs target will not be buildable


-- Configuring done
-- Generating done
-- Build files have been written to: /app/ripple/rippled/build
In file included from /app/ripple/rippled/src/ripple/unity/basics.cpp:29:
/app/ripple/rippled/src/ripple/basics/impl/ResolverAsio.cpp:245:16: error: invalid operands to binary expression
      ('const boost::system::error_code' and 'int')
        if (ec == false)
            ~~ ^  ~~~~~
1 error generated.
make[2]: *** [CMakeFiles/rippled.dir/src/ripple/unity/basics.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/rippled.dir/all] Error 2
make: *** [all] Error 2

@seelabs
Copy link
Collaborator

seelabs commented Feb 1, 2018

@wangdar Thanks for the report. I'm not a mac user, but I'll flag the error for the other mac users in the group.

@HowardHinnant
Copy link
Contributor

HowardHinnant commented Feb 1, 2018

What does the shell command printenv BOOST_ROOT output?

@wangdar
Copy link
Author

wangdar commented Feb 1, 2018

hi @HowardHinnant

the boost_1_66_0 is download from
https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2
and build , install to /app/boost_1_66_0

[wangdar@wangdar-MacBook-Pro rippled]$ printenv BOOST_ROOT
/app/boost_1_66_0
[wangdar@wangdar-MacBook-Pro rippled]$ 


@HowardHinnant
Copy link
Contributor

Ok, thanks. And within [wangdar@wangdar-MacBook-Pro boost_1_66_0] did you:

./bootstrap.sh
./b2 cxxflags="-std=c++14"

And did that look successful?

@wangdar
Copy link
Author

wangdar commented Feb 1, 2018

yes I will build boost with below

./bootstrap.sh
./b2 cxxflags="-std=c++14"

[boost::system::error_code const& ec]

ec is boost::system::error_code and compare to bool,
I don't know this is ok in c++?

@HowardHinnant
Copy link
Contributor

checking...
In the meantime, what does clang++ --version output for you?

@wangdar
Copy link
Author

wangdar commented Feb 1, 2018

clang++ --version

Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@HowardHinnant
Copy link
Contributor

No, it is not valid to compare boost::system::error_code and false.

From [wangdar@wangdar-MacBook-Pro rippled]$, what does git log -1 output?

@wangdar
Copy link
Author

wangdar commented Feb 1, 2018

$ git log -1
commit 1c44c4a43eb9e46d8270892a9e49466ec7cc3efb (HEAD -> develop, origin/develop, origin/HEAD)
Author: seelabs <[email protected]>
Date:   Mon Jan 29 20:28:33 2018 -0500

    Set version to 0.90.0-b5

@HowardHinnant
Copy link
Contributor

What is the cmake command you used? For example I often use:

cmake -Dtarget=clang.debug.nounity -Dassert=On ../rippled/

@seelabs
Copy link
Collaborator

seelabs commented Feb 1, 2018

@wangdar That line of code should be ec == 0 (see: https://github.com/seelabs/rippled/blob/develop/src/ripple/basics/impl/ResolverAsio.cpp#L245). I'm not sure how it was changed on your system, but if you change it back it should fix the issue.

@HowardHinnant
Copy link
Contributor

HowardHinnant commented Feb 1, 2018

Scott beat me to it: :-)

It is beginning to look like your build directory (with cmake) is pointing to another rippled repository, other than commit 1c44c4a. I'm saying this because src/ripple/basics/impl/ResolverAsio.cpp:245 in this repository does not look like:

if (ec == false)

It instead looks like:

if (ec == 0)

@wangdar
Copy link
Author

wangdar commented Feb 1, 2018

hi @bachase ,@HowardHinnant
I rm ripple folder, and check out again,
now it resolved.
I am sorry and apologize to you for the inconvenience.

@HowardHinnant
Copy link
Contributor

No worries! Glad you're up and running!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants