memsharded / conan-zmq

ZeroMQ base C++ library conan package
MIT License
4 stars 5 forks source link

Dynamic lib libzmq.so should be copied to the package/ directory #6

Closed massenz closed 7 years ago

massenz commented 7 years ago

When trying to link against this library, one has to use the static variant, or the link with fail (libzmq.so cannot be found error).

However, the .so libs seem to be generated in the build process, but are not copied across to the package folder. This fixes the issue:

[~/.conan/data/ZMQ/4.1.1/memsharded/stable]
$ find . -name *.so
./build/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/libzmq.so
./build/2703393d92e3ca970d6bef80175f4a9efdd62bce/lib/libzmq.so
./build/2703393d92e3ca970d6bef80175f4a9efdd62bce/lib/libzmq1.so

$ find . -name *.a
./package/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/libzmq-static.a
./package/2703393d92e3ca970d6bef80175f4a9efdd62bce/lib/libzmq-static.a
./build/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/libzmq-static.a
./build/2703393d92e3ca970d6bef80175f4a9efdd62bce/lib/libzmq-static.a

$ cp ./build/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/libzmq.so ./package/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/

After that the build succeeds. (whether the binary then actually "works as intended" I've not been able to try yet, though).

memsharded commented 7 years ago

Yes, I think this is a problem of the 4.1.1 package recipe. I'd say that the 4.1.5 is much more maintained and already fixed this. It should be fully compatible with 4.1.1. Do you have any special constraint, or could you try to update to see if it works? Thanks!

massenz commented 7 years ago

Perfectly happy to try out 4.1.5 (I am not aware of any reason why not).

However, JFrog acquiring Conan.io has (predictably) completely screwed up the user experience there... how does one go about finding that package???

Searching for zmq first turns up no results in the bintray thingy, then it turns up 17 (seemingly irrelevant) packages... I tried to use

ZMQ/4.1.5@memsharded/stable

but I get the following error trying to install it:

ZMQ/4.1.5@memsharded/stable: WARN: HTTPConnectionPool(host='localhost', port=9300): Max retries exceeded with url: /v1/conans/ZMQ/4.1.5/memsharded/stable/download_urls (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f4c043a03d0>: Failed to establish a new connection: [Errno 111] Connection refused',))

I'm now afraid that if JFrog doesn't get its act together, I may have to reconsider using Conan... as it is, it looks pretty unusable :cry:

massenz commented 7 years ago

Ok - never mind that, figured it out, you moved the package name from ZMQ to libzmq :smile: (also discovered the "transit" site for Conan - searching stuff there seems more humane)

In my conanfile.txt I'm now using this: libzmq/4.1.5@memsharded/stable and it installs just fine.

That's for the good news - the bad news is that 1.4.5 seems to be having the same issue:

$ find libzmq/ -name *.so
libzmq/4.1.5/memsharded/stable/build/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/libzmq.so
[~/.conan/data]
$ find libzmq/ -name *.a
libzmq/4.1.5/memsharded/stable/package/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/libzmq-static.a
libzmq/4.1.5/memsharded/stable/build/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/libzmq-static.a
[~/.conan/data]
$ cp libzmq/4.1.5/memsharded/stable/build/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/libzmq.so libzmq/4.1.5/memsharded/stable/package/42e3e27319bddfce94af67d0ceccbc29de59407f/lib/

fixes the issue - my library builds as a .so dynlib and it all works just fine.

PS -- ...and I realize now that perhaps I should have said this earlier... so many thanks for creating, maintaining and making this freely available to everyone, this is greatly appreciated! Thanks! (ah... manners... what would my mom say if she saw me :smile: )

memsharded commented 7 years ago

Hi @massenz (Marco)

Yes, we just did the migration to conan-center and conan-transit 9 days ago, and we have still tons of work to do, lets go step by step, Rome was not built in one day, and building this takes some time and sometimes you have to do a small step back (like this lost of usability) to be able to make a great step forward.

Yes, conan-transit is more searchable, and the goal is to have conan-center in the future, not only searchable and populated (right now is empty), but also with high-quality packages that works for most people (as opposed to old conan.io, where packages quality was very variable).

I will have a look to libzmq-4.1.5 to check what can be happening.

PS: Thanks very much, your mom would be proud :) :) :) Thanks to you for all the support and feedback!

memsharded commented 7 years ago

I think I have a clue of what could be failing in your case. I am working to regenerate and update all packages and upload them to bintray conan-center.

It could be that you are installing the default package which is the "static" package. You can see the dynamic library there in the build folder, because the libzmq build scripts actually build both static and shared libraries, though only one is package in each different package version. If you want to use the shared library package, install it with:

$ conan install -o libzmq:shared=True

I will update when the new packages are ready in bintray, in case you want to try them.

Please tell me if the above makes sense and works. Thanks!

massenz commented 7 years ago

Bingo!

This reminded me of a similar (but opposite) issue I encountered with gtest - where I had to set it to be False.

So, what I have done was to remove the .so file I had manually copied, make clean, then modified my conanfile to have:

[options]
libzmq:shared=True

re-run conan install .. and then make - and it all worked just fine!

This is great, I'm closing this issue, please let me know if you'd like a PR to update the README so that other folks will know about this (I already did the same for gtest).

Thanks!

memsharded commented 7 years ago

Hi Marco,

I have submitted an issue to zeromq to let them know about this package: https://github.com/zeromq/libzmq/issues/2600

Depending on the feedback, I will submit my inclusion request to bintray conan-center, so it will be easier to maintain, update and consume them from there.