Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Windows dependencies from NuGet/Chocolatey repository #128

Closed
traversaro opened this issue Oct 20, 2018 · 6 comments
Closed

Get Windows dependencies from NuGet/Chocolatey repository #128

traversaro opened this issue Oct 20, 2018 · 6 comments

Comments

@traversaro
Copy link
Member

traversaro commented Oct 20, 2018

As part of the ROS on Windows effort (http://aka.ms/ros ) Microsoft is maintaining a NuGet/Chocolatey repository of C++ libraries in binary form: https://roswin.azurewebsites.net/packages . I never considered Chocolatey as a serious option to obtain the dependencies on Windows because the number of C++ libraries available in their main repo is quite limited, but this new repo contains most of our dependencies. I am opening this issue to track the possibilities of using this packages to build the robotology-superbuild on Windows.

Related ROS Discourse discussion: https://discourse.ros.org/t/moveit-now-enabled-for-ros1-on-windows/6509/2 .

Packages currently required by the robotology-superbuild but not available on the ROS NuGet repo:

  • ACE
  • GSL
  • IPOPT
  • ODE
  • libxml2

cc @drdanz @claudiofantacci @pattacini

@traversaro
Copy link
Member Author

traversaro commented Oct 20, 2018

Another interesting option that emerged only recently is https://bincrafters.github.io/ , but I did not checked it out.

@traversaro
Copy link
Member Author

traversaro commented Oct 28, 2018

I had to reinstall the superbuild on Windows so I gave it a try, installing the missing dependencies (ACE, GSL, ODE, Ipopt and libxml2) from the existing robotology installers. As mentioned in https://discourse.ros.org/t/moveit-now-enabled-for-ros1-on-windows/6509/2 , trying to build in Debug fails as RTF uses TinyXML that in its API uses STL objects (cc @claudiofantacci with which we discussed about it):

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK1319	6 mismatches detected	testrunner	C:\src\robotology-superbuild\build-nuget\robotology\RTF\bin\Debug\testrunner.exe	1	
Error	LNK2038	mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ErrorLogger.obj	testrunner	C:\src\robotology-superbuild\build-nuget\robotology\RTF\src\testrunner\tinyxml.lib(tinyxml.obj)	1	
Error	LNK2038	mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in ErrorLogger.obj	testrunner	C:\src\robotology-superbuild\build-nuget\robotology\RTF\src\testrunner\tinyxml.lib(tinyxml.obj)	1	
Error	LNK2038	mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ErrorLogger.obj	testrunner	C:\src\robotology-superbuild\build-nuget\robotology\RTF\src\testrunner\tinyxml.lib(tinyxmlparser.obj)	1	
Error	LNK2038	mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in ErrorLogger.obj	testrunner	C:\src\robotology-superbuild\build-nuget\robotology\RTF\src\testrunner\tinyxml.lib(tinyxmlparser.obj)	1	
Error	LNK2038	mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ErrorLogger.obj	testrunner	C:\src\robotology-superbuild\build-nuget\robotology\RTF\src\testrunner\tinyxml.lib(tinyxmlerror.obj)	1	
Error	LNK2038	mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in ErrorLogger.obj	testrunner	C:\src\robotology-superbuild\build-nuget\robotology\RTF\src\testrunner\tinyxml.lib(tinyxmlerror.obj)	1	

In Release however, compilation of RTF, YARP works fine.

YARP exectuables work fine, expect for the one that use Qt for which I have this error https://stackoverflow.com/questions/20495620/qt-5-1-1-application-failed-to-start-because-platform-plugin-windows-is-missi , but I get the same error when launching ROS executables, so probably I did something wrong in the ROS installation. Qt application work fine as long as you source setup.bat, so I get it is only a matter of setting a specific env variable.

However, compilation of ICUB fails due to some missing SDL symbol:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK1120	1 unresolved externals	iCub_SIM	C:\src\robotology-superbuild\build-nuget\robotology\ICUB\bin\Release\iCub_SIM.exe	1	
Error	LNK2019	unresolved external symbol __imp___iob_func referenced in function ShowError	joystickCheck	C:\src\robotology-superbuild\build-nuget\robotology\ICUB\src\tools\joystickCheck\SDLmain.lib(SDL_win32_main.obj)	1	
Error	LNK1120	1 unresolved externals	joystickCheck	C:\src\robotology-superbuild\build-nuget\robotology\ICUB\bin\Release\joystickCheck.exe	1	
Error	LNK2019	unresolved external symbol __imp___iob_func referenced in function ShowError	joystickCtrl	C:\src\robotology-superbuild\build-nuget\robotology\ICUB\src\tools\joystickCtrl\SDLmain.lib(SDL_win32_main.obj)	1	
Error	LNK1120	1 unresolved externals	joystickCtrl	C:\src\robotology-superbuild\build-nuget\robotology\ICUB\bin\Release\joystickCtrl.exe	1	
Error	LNK2001	unresolved external symbol __imp___iob_func	iCub_SIM	C:\src\robotology-superbuild\build-nuget\robotology\ICUB\src\simulators\iCubSimulation\SDLmain.lib(SDL_win32_main.obj)	1	

So, there are problems (the biggest the lack of Debug libraries) that complicates the use of this binaries, but the potential is huge: the Qt installation took approximatly one minute.

@traversaro
Copy link
Member Author

@traversaro
Copy link
Member Author

Note that for some repositories that are easy to build (so no IPOPT : ) ) a viable option if they are not available as external dependencies is to install them as subprojects in the superbuild. This should be doable for ODE, GSL ( https://github.com/ampl/gsl ) and libxml2 ( https://github.com/robotology-dependencies/libxml2-cmake-buildsystem ) and ACE (with some work). As already discussed, we could just have a small installer just for ipopt (this could be useful also for people using vcpkg).

@traversaro
Copy link
Member Author

traversaro commented Jan 3, 2019

I successfully compiled and run the superbuild with the options ROBOTOLOGY_ENABLE_CORE and especially ROBOTOLOGY_USES_GAZEBO (🎉).

The following PR needs to be merged to get this to work: All PRs have been merged!

In the following you will find a sketch of the steps necessary to get this to work. Note that this is still extremely experimental, and unfortunately quite invasive (you basically need to make sure that you existing dependencies binaries, installed either from installers or from vcpkg can't be found by CMake, to avoid conflicts with the chocolatey-provided versions).

  • First of all, remove all the existing binary dependencies on your systems, or at least the enviromental variables that permit CMake to find them (so <package>_DIR , CMAKE_PREFIX_PATH, PATH etc etc).
    You need to to so with all the binaries, with the exception of ACE: ACE is compulsory for YARP on Windows, and at the moment is not provided by Chocolatey. For now, I just installed it from YARP dependencies installer, avoid to install anything else from the installer.
  • After that, install ROS on Windows, following the instructions in https://ms-iot.github.io/ROSOnWindows/GettingStarted/Setup.html . The setup instructions suggest to create a shortcut named ROS that just loads the Visual Studio dev enviroment. As you will need to also load the ROS's setup.bat and Gazebo's setup.bat quite often, I additionally suggest to create a batch script called ROS-complete.bat in your desktop, that contains the following lines (change the VS line if you are using the Community Edition):
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
call "C:\opt\ros\melodic\x64\setup.bat"
call "C:\opt\rosdeps\x64\share\gazebo-9\setup.bat"

now you can create a new shortcut called ROS-complete-something that calls ROS-complete.bat before dropping you in the command prompt.

git clone https://github.com/robotology/robotology-superbuild
cd robotology-superbuild
md build
cd build
cmake -G"Visual Studio 15 2017 Win64" -DROBOTOLOGY_USES_GAZEBO:BOOL=ON ..
cmake --build . --config Release

At this point, everything should compile fine. Once the superbuild is installed, to use the software installed by the superbuild you need to configure the enviromental variables as documented in the README, also for the ROBOTOLOGY_USES_GAZEBO option. The superbuild will automatically generate a setup.bat that will set the necessary env variables (this is a non document feature at the moment, see #157 for more details), so you can just add a new line to the ROS-complete.bat batch script:

call "C:\src\robotology-superbuild\build-ros\install\share\robotology-superbuild\setup.bat"

clearly the path to the robotology-superbuild and the name of the build directory will change depending on your local setup.

  • If you don't want to use the superbuild, you can manually compile the YARP and GazeboYARPPlugins repositories. You will then manually need to update the enviroment variables, based on the documentation provided on the YARP and GazeboYARPPlugins repo.

At this point, you should be able to run the Gazebo simulation! On windows there is no gazebo executable, so to run the simulator you need to open three ROS-complete-something and launch the following three commands:

  • yarpserver --write
  • gzserver --verbose
  • gzclient --verbose
    You should now be able to drag and drop the iCub models, if the models (from either icub-gazebo or icub-models) are corretly installed, and GAZEBO_MODEL_PATH is correctly set. To verify that the simulation is working correctly, you can use the yarpmotorgui --robot icubSim command, to try to move the joints.

@traversaro
Copy link
Member Author

This would be nice, and should work fine in theory. I would nevertheless close the issue as no one is planning to work on this. If someone wants to make sure that this is working, I suggest to setup a CI job to check that the compilation works correctly (as it was attempted in #304) to make sure that there are no regression on this.
If someone is interested in working on this, feel free to comment on this issue so that we can reopen it.

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

No branches or pull requests

1 participant