jgaa / restc-cpp

Modern C++ REST Client library
MIT License
603 stars 95 forks source link

Building On m1 MacBook Pro #120

Closed MustCodeAl closed 2 years ago

MustCodeAl commented 2 years ago

I've tried installing the x86 version of boost library and i'm still gettings errors, I also tried the arm64 version of boost which I installed through brew and im still getting errors. Then I also tried g++11 which I installed through homebrew which compiles but failes all the tests, and i also tried the built in apple gcc compiler, im able to pass half of the test, but the library wont work just wont work when I try to make something with.

::open_record<boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::severity, boost::log::v2_mt_posix::trivial::severity_level const> > >(boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::severity, boost::log::v2_mt_posix::trivial::severity_level const> > const&) in librestc-cpp.a(ReplyImpl.cpp.o) ld: symbol(s) not found for architecture arm64

this is when I use the following setting I used for built in gcc:

c817466b138d4b7763ab3faac551be58 323156e9d3d4c5daeec8e36062922697

then this is the settings for gcc using openssl3 I installed through homebrew in rosetta mode:

cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 -DOPENSSL_LIBRARIES=/usr/local/opt/openssl@3/lib -DZLIB_INCLUDE_DIRS=/usr/local/opt/zlib/include/ -DZLIB_LIBRARIES=/usr/local/opt/zlib/lib -DBoost_NO_BOOST_CMAKE=TRUE -DBoost_NO_SYSTEM_PATHS=TRUE -DBOOST_LIBRARIES=/usr/local/opt/boost/lib -DBOOSTL_ROOT_DIR=/usr/local/opt/boost -DBOOST_ROOT=/usr/local/opt/boost -DCMAKE_C_COMPILER=/usr/local/bin/gcc-11 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-11 ..

946040bd6deb220b5d4e9451c28dadbb
rogerkoehler commented 2 years ago

Maybe it's time to start looking at using Rust to send and receive JSON data. See https://actix.rs/.

jgaa commented 2 years ago

Maybe it's time to start looking at using Rust to send and receive JSON data. See https://actix.rs/.

That was not what they were asking about.

jgaa commented 2 years ago

If I understand correctly, the project compiles, which it should with the latest clang and boost. The problem is running the tests.

The tests require docker under Linux to run some mock services that they connect to.

When I tested (I removed support for Apple when they announced their coming-out-party to the cult of evil last year) with Apple, or test with Windows, I run the test back-end containers in a VM with Linux, and then I set the RESTC_CPP_TEST_DOCKER_ADDRESS environment variable to the IP of that VM.

You can see here in the jenkins file how I start the containers: https://github.com/jgaa/restc-cpp/blob/55ae334f077aaa58a530ed9fd5488b8605b64f4d/ci/jenkins/Jenkinsfile.groovy#L19

MustCodeAl commented 2 years ago

If I understand correctly, the project compiles, which it should with the latest clang and boost. The problem is running the tests.

The tests require docker under Linux to run some mock services that they connect to.

When I tested (I removed support for Apple when they announced their coming-out-party to the cult of evil last year) with Apple, or test with Windows, I run the test back-end containers in a VM with Linux, and then I set the RESTC_CPP_TEST_DOCKER_ADDRESS environment variable to the IP of that VM.

You can see here in the jenkins file how I start the containers:

https://github.com/jgaa/restc-cpp/blob/55ae334f077aaa58a530ed9fd5488b8605b64f4d/ci/jenkins/Jenkinsfile.groovy#L19

I was getting errors the same x86 errors trying to use the restlib functions, even with the version that successfully compiled, but failed the tests. I have since given up on c++ on the m1, since I was and still am a beginner, and c++ is a difficult language, especially on a new architecture such as the m1. I have actually went with the guys suggestion and tried rust actix and its been pretty good to me so far, but I'm willing to given this lib another try if it gets updated for the m1 again.