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

Link Boost.Json #4632

Merged
merged 2 commits into from
Sep 21, 2023
Merged

Link Boost.Json #4632

merged 2 commits into from
Sep 21, 2023

Conversation

thejohnfreeman
Copy link
Collaborator

@thejohnfreeman thejohnfreeman commented Jul 20, 2023

This seems to be required for Intel Macs.

Should fix a build error which looks something like this:

[100%] Linking CXX executable rippled
Undefined symbols for architecture x86_64:
  "boost::json::value::value(boost::json::value&&)", referenced from:
      ripple::test::Expected_test::run()::'lambda9'()::operator()() const in Expected_test.cpp.o
  "boost::json::value::~value()", referenced from:
      ripple::test::Expected_test::run() in Expected_test.cpp.o
      ripple::test::Expected_test::run()::'lambda9'()::operator()() const in Expected_test.cpp.o
      ripple::Expected<boost::json::value, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::~Expected() in Expected_test.cpp.o
  "boost::json::object::object(boost::json::object&&)", referenced from:
      ripple::test::Expected_test::run()::'lambda9'()::operator()() const in Expected_test.cpp.o
  "boost::json::object::object(std::initializer_list<std::__1::pair<boost::core::basic_string_view<char>, boost::json::value_ref>>, unsigned long, boost::json::storage_ptr)", referenced from:
      ripple::test::Expected_test::run()::'lambda9'()::operator()() const in Expected_test.cpp.o
  "boost::json::object::~object()", referenced from:
      ripple::test::Expected_test::run()::'lambda9'()::operator()() const in Expected_test.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [rippled] Error 1
make[1]: *** [CMakeFiles/rippled.dir/all] Error 2
make: *** [all] Error 2

@thejohnfreeman
Copy link
Collaborator Author

Seems required for ARM Macs too.

@intelliot
Copy link
Collaborator

@florent-uzio to try this

@sgramkumar
Copy link
Collaborator

This commit builds successfully on Intel Mac

..
[100%] Linking CXX executable rippled
[100%] Built target rippled

@florent-uzio
Copy link
Collaborator

So I removed the .build directory and tried again the build process from the beginning.

When I am at step 3 and I run this in the .build directory:

cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release ..

I get the error:

-- Configuring done (1.4s)
CMake Error at Builds/CMake/deps/Boost.cmake:25 (target_link_libraries):
  The link interface of target "ripple_boost" contains:

    Boost::json

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  CMakeLists.txt:69 (include)


-- Generating done (0.1s)
CMake Generate step failed.  Build files cannot be regenerated correctly.

I also tried to rm -rf ~/.conan/data, then the conan install command worked but cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release .. gave me the same error.

I was using your flr branch and included the few changes of this PR.

@thejohnfreeman
Copy link
Collaborator Author

@florent-uzio I just pushed branch fuzio that has:

  • my branch flr
  • merged with my branch boost
  • and a script in the root directory named build.sh

That script builds the project, from a clean Conan cache and build directory, on my M1 MacBook Pro running macOS 13.4.1. Please try it out.

@florent-uzio
Copy link
Collaborator

@thejohnfreeman I could build using the fuzio branch.
image

@intelliot
Copy link
Collaborator

@florent-uzio - would it make sense to apply the changes from the fuzio branch to develop? If so, can you open a PR?

@florent-uzio
Copy link
Collaborator

@intelliot I think it does as it allowed me to build on my M1 macbook pro.

Isn't this a PR already? It seems @thejohnfreeman just needs to update it with the develop branch.

@thejohnfreeman
Copy link
Collaborator Author

Do not merge branch fuzio to develop. fuzio includes FLR2, which is not ready to merge, and a throw-away helper script, which should never be merged. This branch, boost, should be merged on its own. I'll bring this branch up to date.

@intelliot intelliot merged commit 77e0912 into XRPLF:develop Sep 21, 2023
15 checks passed
ckeshava pushed a commit to ckeshava/rippled that referenced this pull request Sep 22, 2023
Add Boost::json to the list of linked Boost libraries.

This seems to be required for macOS.
sophiax851 pushed a commit to sophiax851/rippled that referenced this pull request Jun 12, 2024
Add Boost::json to the list of linked Boost libraries.

This seems to be required for macOS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants