Page 1 of 1

Linux binaries - missing libraries...

Posted: Mon Jan 14, 2013 5:06 pm
by tlin067
Hi all,

I am attempting to run my exisitng OpenSim API code from linux to take advantage of additional computation facilities at our institute. I have downloaded the Linux binaries but are having some problems.

I have set the "LD_LIBRARY_PATH" to the installation directory as per the instructions and I can run the test.cpp code if I exclude the Visualizer. If I try to use the Visualizer I can run the code but get the following exception...
SimTK Exception thrown at VisualizerProtocol.cpp:121:
Error detected by Simbody method VisualizerProtocol::ctor(): Unable to spawn executable 'VisualizerGUI' from directories:
/home/ubuntu/Documents/opensim30/sdk/APIExamples/testEnvironment/
/usr/local/Simbody/bin/
/usr/local/SimTK/bin/
If I try to run any of the other examples however, I cannot seem to get any of them to work. The executeable wont build and I get the following errors...
Linking CXX executable exampleMain
/usr/bin/ld: cannot find -lOpenSim_SimTKcommon
/usr/bin/ld: cannot find -lOpenSim_SimTKmath
/usr/bin/ld: cannot find -lOpenSim_SimTKsimbody
...
The software versions I am using are CMake version 2.8.7, gcc version 4.6.3, Ubuntu 12.04 (Virtual machine).

Any help would be much appreciated!

Thanks

Re: Linux binaries - missing libraries...

Posted: Tue Jan 15, 2013 12:30 pm
by kevinxu
Hi Tom,

You can link to the library at compile time by setting the LIBRARY_PATH variable to where the OpenSim libraries are installed. Also the program would find Visualizer in where OpenSim is installed, so if you set the variable OPENSIM_HOME it should launch the Visualizer. I realized there's an issue with the Visualizer version with the release, so if you encounter such problem please use the attached Visualizer instead. You can just replace this one with the existing VisualizerGUI in $OPENSIM_HOME/bin. The Linux binary release has been updated. Let me know if you have any more problems.


Cheers,
Kevin

Re: Linux binaries - missing libraries...

Posted: Tue Jan 15, 2013 2:23 pm
by tlin067
Hi Kevin,

Thanks for the help but I am still having some issues. I replaced the VisualizerGUI with the one you attached and now I get the following error. The Visualizer is not too important for me but I guess it would still be good to get sorted.
VisualizerGUI failed with exception:
SimTK Exception thrown at VisualizerGUI.cpp:2573:
Error detected by Simbody method VisualizerGUI::shakeHandsWithSimulator(): The Simbody Visualizer class protocol version 31 is not compatible with VisualizerGUI protocol 29; this may be an installation problem. Can't continue.
(Required condition 'SimVersion == ProtocolVersion' was not met.)
When I run the other examples, it says it cannot find "/usr/bin/ld: cannot find -lOpenSim_SimTKcommon" etc. Are these the libraries which should be in $OPENSIM_HOME/lib? The name of the respective library in the lib folder is "libSimTKcommon.so". Are these naming differences the issue?

Other than the updated VisualizerGUI, are there any additional changes to the binaries in the recent update?

Thanks alot for all your help.
Tom

Re: Linux binaries - missing libraries...

Posted: Wed Jan 16, 2013 1:25 pm
by kevinxu
Hi Tom,

The ld issue is related to namespace of the libraries as we use them to differentiate on Windows. You can change that by changing the value of the NameSpace field in the CMake configuration from "OpenSim_" to blank. That should solve the linking problem.

As for the Visualizer versioning there could be a conflict if you happen to have a build from trunk and also binary. In your case I think your old VisualizerGUI had the correct version, so if you revert back it should be good. Sorry for the confusion. Let me know if you have other problems.


Cheers,
Kevin

Re: Linux binaries - missing libraries...

Posted: Wed Jan 16, 2013 5:04 pm
by tlin067
All fixed.
Thanks very much for your patient replies!

Re: Linux binaries - missing libraries...

Posted: Mon Jan 21, 2013 6:35 pm
by tlin067
Hi all,

One more question following the same thread... I successfully linked the opensim linux binaries in Ubuntu (version 12.04) but when I tried to repeat this in our Institutes hpc computer I had the following issue.
Linking CXX executable test
/people/tlin067/opensim30/lib/libSimTKmath.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
/people/tlin067/opensim30/lib/libSimTKmath.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15'
/people/tlin067/opensim30/lib/libosimCommon.so: undefined reference to `memcpy@GLIBC_2.14'
/people/tlin067/opensim30/lib/libSimTKmath.so: undefined reference to `std::__detail::_List_node_base::swap(std::__detail::_List_node_base&, std::__detail::_List_node_base&)@GLIBCXX_3.4.15'
/people/tlin067/opensim30/lib/libSimTKmath.so: undefined reference to `std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
collect2: ld returned 1 exit status
make[2]: *** [test] Error 1
make[1]: *** [CMakeFiles/test.dir/all] Error 2
make: *** [all] Error 2
It seems the libraries were linked correctly but there was some error occurring within them. I am wondering if it is because the c++ compiler is an older version than the one that compiled the libraries in the binary distribution. The compiler info of the hpc computer is "gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)".

Do you recommend building from source or is there an easier fix?

Thanks alot,
Tom

Re: Linux binaries - missing libraries...

Posted: Tue Jan 22, 2013 11:04 am
by aymanh
Hi Tom,

If you build on one machine and try to run what you built on another machine then you need to make sure that supporting libraries match. In your case GLIBCXX is included in libstdc++, if the two versions of libstdc++ on the machine used for building and running are different you'll run into this kind of problem.

Unless you know what dependent libraries you need and copy those (or upgrade compilers to have this done), it would be more robust to build from sources. If you build on a machine you should be able to run on it without issues. You might also be able to leverage a better, custom made lapack library.

Hope this helps and please let us know if you have any questions,
-Ayman