Closed danilomo closed 8 years ago
Did you have the package irods-runtime installed? It seems that the linkage will go smoother against the dynamic version of the libirods_client library. I think I'll fix the linkage to be able to link against the static one as well.
At least I was able to do a build on Ubuntu 15.04 against irods-4.1.6 packages when I had the dynamic libs installed which come in the irods-runtime package. Let me know if this solved the issue!
The irods-runtime package was installed.
I couldn't yet reproduce the linkage error you got, but it seems that for some reason, your linker tends to prefer the static version of libirods_client while my builds always go to the dynamic libirods_client.so and the linkage works and all symbols are resolved.
However I made a change to the linkage order which might help. Now it should work when linking against the static version. Could you try cloning from the develop branch and retrying the build?
I got another error! :(
g++ -m64 -Wl,-O1 -o irodsclient main.o rodsmainwindow.o rodsconnection.o rodsobjtreeitem.o rodsobjtreemodel.o rodsgenquery.o rodsmetadatawindow.o rodsqueuewindow.o rodsqueuemodel.o rodsmetadataitem.o rodsmetadatamodel.o rodsobjmetadata.o rodsfindwindow.o rodsmetadataschema.o rodsconnectthread.o rodsdownloadthread.o rodsobjentry.o rodsuploadthread.o rodstransferwindow.o rodsdatastream.o rodsdatainstream.o rodsdataoutstream.o rodserrorlogwindow.o qrc_icons.o moc_rodsmainwindow.o moc_rodsobjtreemodel.o moc_rodsmetadatawindow.o moc_rodsqueuewindow.o moc_rodsqueuemodel.o moc_rodsmetadatamodel.o moc_rodsfindwindow.o moc_rodsconnectthread.o moc_rodsdownloadthread.o moc_rodsuploadthread.o moc_rodstransferwindow.o moc_rodserrorlogwindow.o -L/usr/X11R6/lib64 -ldl -lm -lcurl -L/usr/lib/irods/externals -lirods_client -lirods_client_api -lboost_regex -lboost_system -lboost_thread -lboost_chrono -lboost_date_time -lboost_filesystem -lboost_iostreams -lboost_program_options /usr/lib/irods/externals/libjansson.a -lcrypto -lssl -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Xml -lQt5Core -lGL -lpthread /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libirods_client.a(apiHandler.o): referência indefinida ao símbolo 'dlclose@@GLIBC_2.2.5' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Makefile:252: recipe for target 'irodsclient' failed make: *\ [irodsclient] Error 1
I'll ask for my colleague trying to compile in his machine, and I'll give feedback!
Hi Ilari, first of all, thanks for your support... Look, I also tried to compile kanki right now on Ubuntu 14.4, following your instructions and downloading the code from dev branch. Unfortunately it did not work, getting the same error of colleague Danilo ("error adding symbols"). Do you have another possible solution in mind?
Thank You!
For some reason your linker resorts to linking against the static version of libirods_client, I don't know why yet. I made another change to the linkage order which should now enable the linker to find the missing symbols the static lib dependency of libirods_client.a needs to resolve at link-time.
The change is committed to the develop branch, could you try again? Thanks for the patience!
You could also try rebuilding the dynamic linker cache using
sudo ldconfig -v | grep irods
and grepping from the output irods making sure the libs appear on the ldconfig output. This should make sure the dynamic linker can resolve the dynamic irods libs. The cache should be automatically rebuild after the you have installed the irods packages, but if for some reason it has not, this should work.
Nothing yet, I`m not used to dynamic linking issues. I synchronized and run the idconfig command. Can you take a look?....
airton@airtonPC:~/git/kanki-irodsclient$ sudo ldconfig -v | grep irods
[sudo] password for airton:
/sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path /lib/x86_64-linux-gnu' given more than once /sbin/ldconfig.real: Path
/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: /lib/i386-linux-gnu/ld-2.19.so is the dynamic linker, ignoring
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.19.so is the dynamic linker, ignoring
Ok, that tells us that your linker can't find the libirods_client.so
dynamic library at all and that's why its forced to use the static one. Those libraries should come with the irods-runtime
package and install in /usr/lib
. I'll keep digging, but did you try pulling again from the develop branch and building again?
Well, I rebuilt, the error with the libs seems that is gone. The error now is at code level. Probably just a synchronization problem :D
irods_pam_auth_object.cpp:(.text+0x5db): undefined reference to irods::auth_mgr' irods_pam_auth_object.cpp:(.text+0x61d): undefined reference to
irods::auth_manager::resolve(std::string const&, boost::shared_ptrirods::auth&)'
irods_pam_auth_object.cpp:(.text+0xa0d): undefined reference to irods::auth_manager::init_from_type(std::string const&, std::string const&, std::string const&, std::string const&, boost::shared_ptr<irods::auth>&)' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libirods_client_api.a(irods_tcp_object.o): In function
irods::tcp_object::resolve(std::string const&, boost::shared_ptrirods::plugin_base&)':
irods_tcp_object.cpp:(.text+0x3f7): undefined reference to irods::netwk_mgr' irods_tcp_object.cpp:(.text+0x40a): undefined reference to
irods::network_manager::resolve(std::string, boost::shared_ptrirods::network&)'
irods_tcp_object.cpp:(.text+0x7f4): undefined reference to irods::netwk_mgr' irods_tcp_object.cpp:(.text+0x811): undefined reference to
irods::network_manager::init_from_type(std::string const&, std::string const&, std::string const&, std::string const&, boost::shared_ptrirods::network&)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libirods_client_api.a(irods_osauth_auth_object.o): In function irods::osauth_auth_object::resolve(std::string const&, boost::shared_ptr<irods::plugin_base>&)': irods_osauth_auth_object.cpp:(.text+0x6cb): undefined reference to
irods::auth_mgr'
irods_osauth_auth_object.cpp:(.text+0x70d): undefined reference to irods::auth_manager::resolve(std::string const&, boost::shared_ptr<irods::auth>&)' irods_osauth_auth_object.cpp:(.text+0xafd): undefined reference to
irods::auth_manager::init_from_type(std::string const&, std::string const&, std::string const&, std::string const&, boost::shared_ptrirods::auth&)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libirods_client_api.a(irods_gsi_object.o): In function irods::gsi_auth_object::resolve(std::string const&, boost::shared_ptr<irods::plugin_base>&)': irods_gsi_object.cpp:(.text+0xbc0): undefined reference to
irods::auth_mgr'
irods_gsi_object.cpp:(.text+0xbe7): undefined reference to irods::auth_manager::resolve(std::string const&, boost::shared_ptr<irods::auth>&)' irods_gsi_object.cpp:(.text+0xced): undefined reference to
irods::auth_mgr'
irods_gsi_object.cpp:(.text+0xd02): undefined reference to irods::auth_manager::init_from_type(std::string const&, std::string const&, std::string const&, std::string const&, boost::shared_ptr<irods::auth>&)' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libirods_client_api.a(irods_krb_object.o): In function
irods::krb_auth_object::resolve(std::string const&, boost::shared_ptrirods::plugin_base&)':
irods_krb_object.cpp:(.text+0xbc0): undefined reference to irods::auth_mgr' irods_krb_object.cpp:(.text+0xbe7): undefined reference to
irods::auth_manager::resolve(std::string const&, boost::shared_ptrirods::auth&)'
irods_krb_object.cpp:(.text+0xced): undefined reference to irods::auth_mgr' irods_krb_object.cpp:(.text+0xd02): undefined reference to
irods::auth_manager::init_from_type(std::string const&, std::string const&, std::string const&, std::string const&, boost::shared_ptrirods::auth&)'
collect2: error: ld returned 1 exit status
make: *\ [irodsclient] Error 1
Ok, so now it's the dependencies between the static libirods_client_api
and libirods_client
libraries, I looked into the symbol tables and irods::auth_mgr::resolve
and irods::netwk_mgr::resolve
are defined in libirods_client.a
and libirods_client_api.a
is depending on them. I reversed the linkage order of the two libs (commit now in develop branch).
Update: doesn't work, I tried myself in an environment without the shared libs. Got this solved, but more problems arise. Eventually I just got the link to go thru with the all static irods libs, but then it clashes with the network plugins, which when dynamically loaded can't resolve all symbols....
I'll keep digging. Sorry about this, before this I hadn't even tested the link with static libs, always depended that the dynamic libs are available in Linux builds. If you can resolve the issue why your linker can't find the irods dynamic libs in /usr/lib
then this issue goes away too. I'll keep in touch.
Thanks for the patience!
Ok, thank you!
Hi Ilari, did you try to fix the problem with Ubuntu again? We did not progress on that, yet :(
I was able to get the linker errors to go away on Ubuntu 14.04.1 by copying that final "g++" command and pasting inside of a new bash script. Then, I copy-and-pasted all of the linking parts of that command and pasted that after the linking flags. The linking flags now appear twice.
Here are the contents of my script:
g++ -m64 -Wl,-O1 -o irodsclient main.o rodsmainwindow.o rodsconnection.o rodsobjtreeitem.o rodsobjtreemodel.o rodsgenquery.o rodsmetadatawindow.o rodsqueuewindow.o rodsqueuemodel.o rodsmetadataitem.o rodsmetadatamodel.o rodsobjmetadata.o rodsfindwindow.o rodsmetadataschema.o rodsconnectthread.o rodsdownloadthread.o rodsobjentry.o rodsuploadthread.o rodstransferwindow.o rodsdatastream.o rodsdatainstream.o rodsdataoutstream.o rodserrorlogwindow.o rodsstringconditionwidget.o rodsconditionwidget.o rodsdateconditionwidget.o rodsmetadataconditionwidget.o qrc_icons.o moc_rodsmainwindow.o moc_rodsobjtreemodel.o moc_rodsmetadatawindow.o moc_rodsqueuewindow.o moc_rodsqueuemodel.o moc_rodsmetadatamodel.o moc_rodsfindwindow.o moc_rodsconnectthread.o moc_rodsdownloadthread.o moc_rodsuploadthread.o moc_rodstransferwindow.o moc_rodserrorlogwindow.o moc_rodsconditionwidget.o moc_rodsstringconditionwidget.o moc_rodsmetadataconditionwidget.o -L/usr/X11R6/lib64 -L/usr/lib/irods/externals -lirods_client_api -lirods_client -lboost_regex -lboost_system -lboost_thread -lboost_chrono -lboost_date_time -lboost_filesystem -lboost_iostreams -lboost_program_options /usr/lib/irods/externals/libjansson.a -lcrypto -lssl -ldl -lm -lcurl -lQt5Svg -L/usr/lib/x86_64-linux-gnu -lQt5Widgets -lQt5Xml -lQt5Gui -lQt5Core -lGL -lpthread -L/usr/X11R6/lib64 -L/usr/lib/irods/externals -lirods_client_api -lirods_client -lboost_regex -lboost_system -lboost_thread -lboost_chrono -lboost_date_time -lboost_filesystem -lboost_iostreams -lboost_program_options /usr/lib/irods/externals/libjansson.a -lcrypto -lssl -ldl -lm -lcurl -lQt5Svg -L/usr/lib/x86_64-linux-gnu -lQt5Widgets -lQt5Xml -lQt5Gui -lQt5Core -lGL -lpthread
Note: I would not recommend copying-and-pasting this block of text because -L/usr/X11R6/lib64 is a specific path for my machine, so other paths may also be different.
Then, you can give executable permissions to this script and move it into the src/ directory and run it there.
I hope this helps!
Update: I also had to install the irods-dev, irods-runtime, irods-icommands, libssl1.0.0, libssl-dev, and libboost-all-dev.
I'm sorry but I haven't had time to resolve this yet, I had a tough case of a flu and now have been catching up with work duties. I will get back to this as soon as possible.
Hi Ilari,
It is working now.
Thanks
Excellent!
Sorry I didn't have time to get to it more, just came back from holiday yesterday. Can I ask what the solution was? I was unable to replicate the problem myself so for a fix it would be very helpful if you could point it out.
Thanks!
Actually we did nothing. We just tried again and it worked. Since you did not change the code I think the iRODS developers have updated the libraries.
This is great news! I'm relieved. Must be an update in the irods-runtime
Ubuntu package or something.
Closing this issue as resolved.
Hi, I'm trying to build this project on Ubuntu 15.04, and I'm getting the following error:
(...) g++ -c -m64 -pipe -std=c++0x -Wno-write-strings -fPIC -Wno-deprecated -D_FILE_OFFSET_BITS=64 -DPARA_OPR=1 -D_REENTRANT -DTAR_STRUCT_FILE -DGNU_TAR -DTAR_EXEC_PATH=/bin/tar -DZIP_EXEC_PATH=/usr/bin/zip -DUNZIP_EXEC_PATH=/usr/bin/unzip -DPAM_AUTH -DUSE_BOOST -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_CORE_LIB -I. -isystem /usr/include/openssl -isystem /usr/include/irods -isystem /usr/include/irods/boost -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o moc_rodstransferwindow.o moc_rodstransferwindow.cpp g++ -m64 -Wl,-O1 -o irodsclient main.o rodsmainwindow.o rodsconnection.o rodsobjtreeitem.o rodsobjtreemodel.o rodsgenquery.o rodsmetadatawindow.o rodsqueuewindow.o rodsqueuemodel.o rodsmetadataitem.o rodsmetadatamodel.o rodsobjmetadata.o rodsfindwindow.o rodsmetadataschema.o rodsconnectthread.o rodsdownloadthread.o rodsobjentry.o rodsuploadthread.o rodstransferwindow.o rodsdatastream.o rodsdatainstream.o rodsdataoutstream.o qrc_icons.o moc_rodsmainwindow.o moc_rodsobjtreemodel.o moc_rodsmetadatawindow.o moc_rodsqueuewindow.o moc_rodsqueuemodel.o moc_rodsmetadatamodel.o moc_rodsfindwindow.o moc_rodsconnectthread.o moc_rodsdownloadthread.o moc_rodsuploadthread.o moc_rodstransferwindow.o -L/usr/X11R6/lib64 -ldl -lm -lcurl -lssl -lcrypto -L/usr/lib/irods/externals -lirods_client -lirods_client_api -lboost_regex -lboost_system -lboost_thread -lboost_chrono -lboost_date_time -lboost_filesystem -lboost_iostreams -lboost_program_options /usr/lib/irods/externals/libjansson.a -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Xml -lQt5Core -lGL -lpthread /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib/libirods_client.a(sslSockComm.o): Invalid symbol reference. 'X509_free@@OPENSSL_1.0.0' /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libcrypto.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Makefile:250: recipe for target 'irodsclient' failed make: *\ [irodsclient] Error 1