Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Problem building on Fedora #58

Closed
zeroepoch opened this issue Nov 25, 2016 · 11 comments
Closed

Problem building on Fedora #58

zeroepoch opened this issue Nov 25, 2016 · 11 comments
Assignees
Labels

Comments

@zeroepoch
Copy link

I don't know if this has something to do with cmake 3.6.2, Fedora, or something in the build scripts, but it's looking in ../install-deps/lib instead of ../install-deps/lib64 for libnanomsg.so. See the error below:

$ make
[  1%] Built target parson
[  7%] Built target gateway
[ 10%] Built target broker_ut_exe
[ 13%] Built target dynamic_library_ut_exe
[ 16%] Built target event_system_ut_exe
[ 19%] Built target gateway_ut_exe
[ 22%] Built target gateway_createfromjson_ut_exe
[ 25%] Built target gwmessage_ut_exe
[ 29%] Built target dynamic_loader_ut_exe
[ 33%] Built target module_loader_ut_exe
[ 35%] Built target ble_c2d_static
[ 42%] Built target ble_static
make[2]: *** No rule to make target '../install-deps/lib/libnanomsg.so', needed by 'modules/ble/libble_c2d.so'.  Stop.
CMakeFiles/Makefile2:1696: recipe for target 'modules/ble/CMakeFiles/ble_c2d.dir/all' failed
make[1]: *** [modules/ble/CMakeFiles/ble_c2d.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

To workaround the problem I moved everything from lib to lib64 and created a symlink (lib -> lib64). After doing that and running make again everything worked.

@andrew-buckley
Copy link
Contributor

Hi @zeroepoch. Thanks for reporting this, I'll have a look at this and update you on the progress as it's resolved.

@zeroepoch
Copy link
Author

I built the SDK inside an Ubuntu 14.04 VM and I noticed it doesn't create lib64 although it's a 64-bit VM. FYI, on Fedora 24 after building everything the hello world example worked but it segfaults when doing a call into libcurl when I run the simulated cloud example, but that's a separate issue.

@andrew-buckley
Copy link
Contributor

In your original issue you were using a 64-bit installation of Fedora, correct?

@zeroepoch
Copy link
Author

Yes my Fedora 24 install is also 64-bit on physical hardware.

@andrew-buckley
Copy link
Contributor

The fix for your original issue requires a change to one of our dependencies, nanomsg. I'm going to create a pull request against them and I'll provide the link to it here shortly. Would you mind creating a separate GitHub Issue for the second problem you brought up?

@andrew-buckley
Copy link
Contributor

You can see the PR here

@zeroepoch
Copy link
Author

I'll test the PR tonight just to confirm and also get the backtrace needed to file the other issue.

@zeroepoch
Copy link
Author

After replacing src/pkgconfig.in in nanomsg tools/builld.sh works without issues from a fresh checkout. Since you've already submitted the PR upstream I'll go ahead and close this ticket since nothing else can be done here.

@zeroepoch zeroepoch reopened this Nov 30, 2016
@zeroepoch
Copy link
Author

I spoke too soon. RPATH needs to be updated as well otherwise you get runtime errors. Sorry didn't know if it made sense to fork and submit a pull request for just a single line change.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2e37c1a..73e076e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,7 +29,7 @@ set(${dependency_install_prefix} ${dependency_install_prefix} CACHE INTERNAL "")
 
 if(DEFINED ${dependency_install_prefix})
   set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${dependency_install_prefix})
-  set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${dependency_install_prefix}/lib)
+  set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${dependency_install_prefix}/${CMAKE_INSTALL_LIBDIR})
   set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 endif()
 

@zeroepoch
Copy link
Author

BTW, it looks like Fedora does change a few of the common CMake variables, see one example here: https://bugzilla.redhat.com/show_bug.cgi?id=795542

@andrew-buckley
Copy link
Contributor

Yes, you're correct! As a matter of fact we fixed that this morning but it hasn't gone in quite yet. The RPATH needs to reference the proper lib install directory in the same way that the nanomsg.pc file needs to reference the proper lib install directory. See #53, as it is a similar issue.

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

No branches or pull requests

2 participants