Linuxbrew / legacy-linuxbrew

:skull: This repository is defunct, because it has been split into https://github.com/Linuxbrew/brew and https://github.com/Linuxbrew/homebrew-core
http://linuxbrew.sh
Other
2.23k stars 295 forks source link

libjson-rpc-cpp fails build - during make client stubfile #1078

Closed int03h closed 7 years ago

int03h commented 8 years ago

Hi - please help. tx.

brew install libjson-rpc-cpp

https://gist.github.com/anonymous/b3d1a80d8b41cfe4d869a69d85e7c209

==> Downloading https://github.com/cinemast/libjson-rpc-cpp/archive/v0.6.0.tar.gz
==> Downloading from https://codeload.github.com/cinemast/libjson-rpc-cpp/tar.gz/v0.6.0
######################################################################## 100.0%
==> cmake . -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/home/eth/.linuxbrew/Cellar/libjson-rpc-cpp/0.6.0_1 -DCMAKE_BUILD_TYPE=Re
==> make
Last 15 lines from /home/eth/.cache/Homebrew/Logs/libjson-rpc-cpp/02.make:
make[2]: Leaving directory '/tmp/libjson-rpc-cpp20160418-17186-wxupxl/libjson-rpc-cpp-0.6.0'
[ 64%] Built target simpleserversample
make -f src/examples/CMakeFiles/stubclientsample.dir/build.make src/examples/CMakeFiles/stubclientsample.dir/depend
make[2]: Entering directory '/tmp/libjson-rpc-cpp20160418-17186-wxupxl/libjson-rpc-cpp-0.6.0'
[ 65%] Generating Client Stubfile
cd /tmp/libjson-rpc-cpp20160418-17186-wxupxl/libjson-rpc-cpp-0.6.0/src/examples && ../../bin/jsonrpcstub /tmp/libjson-rpc-cpp20160418-17186-wxupxl/libjson-rpc-cpp-0.6.0/src/examples/spec.json --cpp-client=StubClient --cpp-client-file=/tmp/libjson-rpc-cpp20160418-17186-wxupxl/libjson-rpc-cpp-0.6.0/gen/stubclient.h
../../bin/jsonrpcstub: error while loading shared libraries: libjsonrpccpp-stub.so.0: cannot open shared object file: No such file or directory
src/examples/CMakeFiles/stubclientsample.dir/build.make:65: recipe for target 'gen/stubclient.h' failed
make[2]: *** [gen/stubclient.h] Error 127
make[2]: Leaving directory '/tmp/libjson-rpc-cpp20160418-17186-wxupxl/libjson-rpc-cpp-0.6.0'
CMakeFiles/Makefile2:562: recipe for target 'src/examples/CMakeFiles/stubclientsample.dir/all' failed
make[1]: *** [src/examples/CMakeFiles/stubclientsample.dir/all] Error 2
make[1]: Leaving directory '/tmp/libjson-rpc-cpp20160418-17186-wxupxl/libjson-rpc-cpp-0.6.0'
Makefile:163: recipe for target 'all' failed
make: *** [all] Error 2
rwhogg commented 8 years ago

Looks like the problem is LD_LIBRARY_PATH isn't getting set correctly - the libraries jsonrpcstub is looking for are already built, but they're only available in buildpath/"lib".

Will continue to look into this.

rwhogg commented 8 years ago

The problem appears to be caused by the presence of -DCMAKE_BUILD_WITH_INSTALL_RPATH=1 in std_cmake_flags.

Not sure why this isn't causing a problem on OS X; will continue to investigate.

int03h commented 8 years ago

deleted everything and did a clean install of just libjson-rpc-cpp ( and the dependencies it pulls ) ..

eth@eth ~ $ brew install libjson-rpc-cpp
==> Installing dependencies for libjson-rpc-cpp: jsoncpp, libmicrohttpd
==> Installing libjson-rpc-cpp dependency: jsoncpp
==> Downloading https://github.com/open-source-parsers/jsoncpp/archive/1.6.5.tar.gz
Already downloaded: /home/eth/.cache/Homebrew/jsoncpp-1.6.5.tar.gz
**Error: The selected compiler doesn't support C++11: gcc**

not sure if I fixed it more or broke it less !!?! :)

https://gist.github.com/b2bbfc8c02edac52b74bf1e0cf011ae0

rwhogg commented 8 years ago

Now a dependency of libjson-rpc-cpp is failing. The gist you've linked doesn't seem to include that error though, so I'm a little confused.

Furthermore, the gist shows some bizarre inconsistencies: CMake seems to know you have Linuxbrew's GCC 5.3 installed, but 00.config.out doesn't.

int03h commented 8 years ago

when I say I deleted everything .. I mean I did a rm -rf .linuxbrew and did a brand new brew install libjson-rpc-cpp .. and now it's failing on that dependency that previously got installed .. I guess because I had gcc and a bunch of other stuff installed in brew environment.

rwhogg commented 8 years ago

when I say I deleted everything .. I mean I did a rm -rf .linuxbrew and did a brand new brew install libjson-rpc-cpp

Ah, gotcha. Thanks for the clarification!

I do recommend reinstalling Linuxbrew's GCC: brew install gcc --with-glibc. It will make your life a lot easier.

int03h commented 8 years ago

HI ..

Same machine - totally different build environment - throws the same error - I started with a brew install gcc --with-glibc as suggested.

Last 15 lines from /home/eth/.cache/Homebrew/Logs/libjson-rpc-cpp/02.make:
make[2]: Leaving directory '/tmp/libjson-rpc-cpp20160420-24490-19j6w/libjson-rpc-cpp-0.6.0'
[ 61%] Built target simpleserversample
make -f src/examples/CMakeFiles/stubserversample.dir/build.make src/examples/CMakeFiles/stubserversample.dir/depend
make[2]: Entering directory '/tmp/libjson-rpc-cpp20160420-24490-19j6w/libjson-rpc-cpp-0.6.0'
[ 62%] Generating Server Stubfiles
cd /tmp/libjson-rpc-cpp20160420-24490-19j6w/libjson-rpc-cpp-0.6.0/src/examples && ../../bin/jsonrpcstub /tmp/libjson-rpc-cpp20160420-24490-19j6w/libjson-rpc-cpp-0.6.0/src/examples/spec.json --cpp-server=AbstractStubServer --cpp-server-file=/tmp/libjson-rpc-cpp20160420-24490-19j6w/libjson-rpc-cpp-0.6.0/gen/abstractstubserver.h
../../bin/jsonrpcstub: error while loading shared libraries: libjsonrpccpp-stub.so.0: cannot open shared object file: No such file or directory
src/examples/CMakeFiles/stubserversample.dir/build.make:65: recipe for target 'gen/abstractstubserver.h' failed
make[2]: *** [gen/abstractstubserver.h] Error 127
make[2]: Leaving directory '/tmp/libjson-rpc-cpp20160420-24490-19j6w/libjson-rpc-cpp-0.6.0'
CMakeFiles/Makefile2:524: recipe for target 'src/examples/CMakeFiles/stubserversample.dir/all' failed
make[1]: *** [src/examples/CMakeFiles/stubserversample.dir/all] Error 2
make[1]: Leaving directory '/tmp/libjson-rpc-cpp20160420-24490-19j6w/libjson-rpc-cpp-0.6.0'
Makefile:163: recipe for target 'all' failed
make: *** [all] Error 2

https://gist.github.com/2d827b371572ac3bada5d2ba8bf287e1

rwhogg commented 7 years ago

This formula appears to compile correctly for me now. My apologies that we weren't able to resolve this sooner.