-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[gazebo] new port #22466
Merged
Merged
[gazebo] new port #22466
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e9fc43b
Add gazebo11 port
Ace314159 d2ad4bc
[sdformat9] Use external tinyxml on Windows
Ace314159 c4e2e29
Update versions
Ace314159 3caf2cb
Use newer vcpkg functions
Ace314159 b039ed7
Fix sdformat9
Ace314159 fe87518
Update versions
Ace314159 d85241f
Try fixing gazebo
Ace314159 083d0ac
Copy extra ogre dlls
Ace314159 a0e05e4
Update gazebo ref
Ace314159 1dda1af
Update versions
Ace314159 d8754c8
Fix ogre dll dir
Ace314159 8f62ffe
Update version date
Ace314159 72e1706
Update versions
Ace314159 9c50f63
Merge branch 'upstreamMaster' into add-gazebo11
Ace314159 7812e52
Update versions
Ace314159 3639c4a
Add licenses
Ace314159 24e011b
Update versions
Ace314159 0b6a578
Rename to gazebo
Ace314159 85de6df
Update versions
Ace314159 3e5a916
Update versions
Ace314159 3fa2a11
Apply suggestions from code review
Ace314159 99590d0
Update ports/gazebo/portfile.cmake
Ace314159 14eef29
Make pkgconf a host dependency
Ace314159 adbfa28
Update versions
Ace314159 b49bd90
Copy PDBs
Ace314159 ce438c8
Update versions
Ace314159 1f63c2d
Change to normal installed directory
Ace314159 4427156
Update versions
Ace314159 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake | ||
index 4085b5aaeb..f89ac88333 100644 | ||
--- a/cmake/SearchForStuff.cmake | ||
+++ b/cmake/SearchForStuff.cmake | ||
@@ -179,7 +179,7 @@ if (PKG_CONFIG_FOUND) | ||
# (needed, at least, for MacOS) | ||
|
||
# Use system installation on UNIX and Apple, and internal copy on Windows | ||
- if (UNIX OR APPLE) | ||
+ if (true) | ||
message (STATUS "Using system tinyxml.") | ||
set (USE_EXTERNAL_TINYXML True) | ||
elseif(WIN32) | ||
@@ -225,7 +225,7 @@ if (PKG_CONFIG_FOUND) | ||
# (needed, at least, for MacOS) | ||
|
||
# Use system installation on UNIX and Apple, and internal copy on Windows | ||
- if (UNIX OR APPLE) | ||
+ if (true) | ||
message (STATUS "Using system tinyxml2.") | ||
set (USE_EXTERNAL_TINYXML2 True) | ||
elseif(WIN32) | ||
@@ -513,7 +513,7 @@ if (PKG_CONFIG_FOUND) | ||
endif () | ||
|
||
if (libavutil_FOUND AND libavformat_FOUND AND libavcodec_FOUND AND | ||
- libswscale_FOUND) | ||
+ libswscale_FOUND AND FFMPEG_FEATURE) | ||
set (HAVE_FFMPEG TRUE) | ||
else () | ||
set (HAVE_FFMPEG FALSE) | ||
@@ -538,7 +538,7 @@ if (PKG_CONFIG_FOUND) | ||
######################################## | ||
# Find GNU Triangulation Surface Library | ||
pkg_check_modules(gts gts) | ||
- if (gts_FOUND) | ||
+ if (GTS_FEATURE) | ||
message (STATUS "Looking for GTS - found") | ||
set (HAVE_GTS TRUE) | ||
else () | ||
@@ -551,13 +551,14 @@ if (PKG_CONFIG_FOUND) | ||
# First and preferred option is to look for bullet standard pkgconfig, | ||
# so check it first. if it is not present, check for the OSRF | ||
# custom bullet2.82.pc file | ||
- pkg_check_modules(BULLET bullet>=2.82) | ||
+ find_package(BULLET CONFIG 2.82) | ||
if (NOT BULLET_FOUND) | ||
pkg_check_modules(BULLET bullet2.82>=2.82) | ||
endif() | ||
|
||
if (BULLET_FOUND) | ||
set (HAVE_BULLET TRUE) | ||
+ set(BULLET_VERSION ${BULLET_VERSION_STRING}) | ||
add_definitions( -DLIBBULLET_VERSION=${BULLET_VERSION} ) | ||
else() | ||
set (HAVE_BULLET FALSE) | ||
@@ -572,7 +573,7 @@ if (PKG_CONFIG_FOUND) | ||
######################################## | ||
# Find libusb | ||
pkg_check_modules(libusb-1.0 libusb-1.0) | ||
- if (NOT libusb-1.0_FOUND) | ||
+ if (NO_LIBUSB_FEATURE) | ||
BUILD_WARNING ("libusb-1.0 not found. USB peripherals support will be disabled.") | ||
set (HAVE_USB OFF CACHE BOOL "HAVE USB" FORCE) | ||
else() | ||
@@ -648,7 +649,7 @@ endif () | ||
######################################## | ||
# Find gdal | ||
include (FindGDAL) | ||
-if (NOT GDAL_FOUND) | ||
+if (NO_GDAL_FEATURE) | ||
message (STATUS "Looking for libgdal - not found") | ||
BUILD_WARNING ("GDAL not found, Digital elevation terrains support will be disabled.") | ||
set (HAVE_GDAL OFF CACHE BOOL "HAVE GDAL" FORCE) | ||
@@ -718,7 +719,7 @@ endif() | ||
######################################## | ||
# Find graphviz | ||
include (${gazebo_cmake_dir}/FindGraphviz.cmake) | ||
-if (NOT GRAPHVIZ_FOUND) | ||
+if (NO_GRAPHVIZ_FEATURE) | ||
message (STATUS "Looking for libgraphviz-dev - not found") | ||
BUILD_WARNING ("Graphviz not found, Model editor's schematic view will be disabled.") | ||
set (HAVE_GRAPHVIZ OFF CACHE BOOL "HAVE GRAPHVIZ" FORCE) | ||
diff --git a/cmake/gazebo-config.cmake.in b/cmake/gazebo-config.cmake.in | ||
index b57a90dd76..63ce97095e 100644 | ||
--- a/cmake/gazebo-config.cmake.in | ||
+++ b/cmake/gazebo-config.cmake.in | ||
@@ -99,12 +99,13 @@ list(APPEND @PKG_NAME@_CFLAGS -I${GAZEBO_INSTALL_INCLUDE_DIR}/gazebo-@GAZEBO_MAJ | ||
|
||
if (GAZEBO_HAS_BULLET) | ||
if (PKG_CONFIG_FOUND) | ||
- pkg_check_modules(BULLET bullet>=2.82) | ||
+ find_package(BULLET CONFIG 2.82) | ||
if (NOT BULLET_FOUND) | ||
pkg_check_modules(BULLET bullet2.82>=2.82) | ||
endif() | ||
|
||
if (BULLET_FOUND) | ||
+ set(BULLET_VERSION ${BULLET_VERSION_STRING}) | ||
add_definitions(-DLIBBULLET_VERSION=${BULLET_VERSION}) | ||
else() | ||
message(FATAL_ERROR "Error: Bullet > 2.82 not found, please install libbullet2.82-dev.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO osrf/gazebo | ||
REF 382dcc3f36095a8d79b5bc9c8b8ad346e867c51d | ||
SHA512 57638cd0b23b5f2bfd32fdc159d6cd77ca34e3bd695c225591979aef4b7271eac93d3706fa1ffa2340f90013267a4171bebe1e4c142f19ad2bf67963dfed627e | ||
HEAD_REF gazebo11 | ||
PATCHES | ||
0001-Fix-deps.patch | ||
) | ||
|
||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
openal HAVE_OPENAL | ||
ffmpeg FFMPEG_FEATURE | ||
gts GTS_FEATURE | ||
INVERTED_FEATURES | ||
simbody CMAKE_DISABLE_FIND_PACKAGE_Simbody | ||
dart CMAKE_DISABLE_FIND_PACKAGE_DART | ||
bullet CMAKE_DISABLE_FIND_PACKAGE_BULLET | ||
libusb NO_LIBUSB_FEATURE | ||
gdal NO_GDAL_FEATURE | ||
graphviz NO_GRAPHVIZ_FEATURE | ||
) | ||
|
||
vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/debug/bin") | ||
vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/bin") | ||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DUSE_EXTERNAL_TINY_PROCESS_LIBRARY=ON | ||
-DPKG_CONFIG_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/pkgconf/pkgconf.exe | ||
${FEATURE_OPTIONS} | ||
) | ||
|
||
vcpkg_cmake_install() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/gazebo") | ||
vcpkg_copy_pdbs() | ||
|
||
vcpkg_copy_tools( | ||
TOOL_NAMES gazebo gz gzclient gzserver | ||
AUTO_CLEAN | ||
) | ||
set(EXTRA_OGRE_LIBS Codec_EXR Codec_FreeImage Codec_STBI OgreBites OgreMain OgreMeshLodGenerator OgreOverlay OgrePaging OgreProperty OgreRTShaderSystem OgreTerrain OgreVolume Plugin_BSPSceneManager Plugin_DotScene Plugin_OctreeSceneManager Plugin_OctreeZone Plugin_ParticleFX Plugin_PCZSceneManager RenderSystem_Direct3D11 RenderSystem_GL RenderSystem_GL3Plus) | ||
foreach(LIB IN LISTS EXTRA_OGRE_LIBS) | ||
set(FILE_NAME "${CMAKE_SHARED_LIBRARY_PREFIX}${LIB}${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
file(COPY "${CURRENT_INSTALLED_DIR}/bin/${FILE_NAME}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}") | ||
endforeach() | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") | ||
|
||
# Handle copyright | ||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{ | ||
"name": "gazebo", | ||
"version-date": "2022-01-20", | ||
"description": "Open source robotics simulator.", | ||
"homepage": "http://gazebosim.org", | ||
"license": "Apache-2.0", | ||
"dependencies": [ | ||
"boost-asio", | ||
"boost-date-time", | ||
"boost-filesystem", | ||
"boost-format", | ||
"boost-interprocess", | ||
"boost-iostreams", | ||
"boost-program-options", | ||
"boost-property-tree", | ||
"boost-regex", | ||
"boost-system", | ||
"boost-thread", | ||
"boost-uuid", | ||
"ccd", | ||
{ | ||
"name": "hdf5", | ||
"features": [ | ||
"cpp" | ||
] | ||
}, | ||
"ignition-common3", | ||
"ignition-fuel-tools4", | ||
"ignition-math6", | ||
"ignition-msgs5", | ||
"ignition-transport8", | ||
"ogre", | ||
{ | ||
"name": "pkgconf", | ||
"host": true | ||
}, | ||
"protobuf", | ||
"qwt", | ||
"sdformat9", | ||
"tbb", | ||
"tiny-process-library", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"default-features": [ | ||
"bullet", | ||
"dart", | ||
"ffmpeg", | ||
"gdal", | ||
"graphviz", | ||
"gts", | ||
"libusb", | ||
"openal", | ||
"simbody" | ||
], | ||
"features": { | ||
"bullet": { | ||
"description": "Use the bullet physics engine", | ||
"dependencies": [ | ||
"bullet3" | ||
] | ||
}, | ||
"dart": { | ||
"description": "Use the dart physics engine", | ||
"dependencies": [ | ||
"dartsim" | ||
] | ||
}, | ||
"ffmpeg": { | ||
"description": "Enable audio-video capabilities", | ||
"dependencies": [ | ||
{ | ||
"name": "ffmpeg", | ||
"features": [ | ||
"avcodec", | ||
"avformat", | ||
"swscale" | ||
] | ||
} | ||
] | ||
}, | ||
"gdal": { | ||
"description": "Enable digital elevation terrains support", | ||
"dependencies": [ | ||
"gdal" | ||
] | ||
}, | ||
"graphviz": { | ||
"description": "Enable model editor's schematic view", | ||
"dependencies": [ | ||
"graphviz" | ||
] | ||
}, | ||
"gts": { | ||
"description": "Enable CSG support", | ||
"dependencies": [ | ||
"gts" | ||
] | ||
}, | ||
"libusb": { | ||
"description": "Enable USB peripheral support", | ||
"dependencies": [ | ||
"libusb" | ||
] | ||
}, | ||
"openal": { | ||
"description": "Enable audio support", | ||
"dependencies": [ | ||
"openal-soft" | ||
] | ||
}, | ||
"simbody": { | ||
"description": "Use the simbody physics engine", | ||
"dependencies": [ | ||
"simbody" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 3dad12e5..e290a3be 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -113,7 +113,7 @@ include (${sdf_cmake_dir}/SDFUtils.cmake) | ||
|
||
message (STATUS "\n\n====== Finding 3rd Party Packages ======") | ||
# Use of tinyxml. System installation on UNIX. Internal copy on WIN | ||
-if (UNIX) | ||
+if (true) | ||
message (STATUS "Using system tinyxml") | ||
set (USE_EXTERNAL_TINYXML True) | ||
elseif(WIN32) | ||
diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake | ||
index 427e5e7a..655fafc0 100644 | ||
--- a/cmake/SearchForStuff.cmake | ||
+++ b/cmake/SearchForStuff.cmake | ||
@@ -9,7 +9,7 @@ if (USE_EXTERNAL_TINYXML) | ||
################################################# | ||
# Find tinyxml. Only debian distributions package tinyxml with a pkg-config | ||
# Use pkg_check_modules and fallback to manual detection (needed, at least, for MacOS) | ||
- pkg_check_modules(tinyxml tinyxml) | ||
+ find_package(tinyxml CONFIG REQUIRED) | ||
if (NOT tinyxml_FOUND) | ||
find_path (tinyxml_INCLUDE_DIRS tinyxml.h ${tinyxml_INCLUDE_DIRS} ENV CPATH) | ||
find_library(tinyxml_LIBRARIES NAMES tinyxml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "1333c50fe6f4c7b1a2adb5af2df122eaf1abb180", | ||
"version-date": "2022-01-20", | ||
"port-version": 0 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these needed? I don't see any host dependencies that would provide any
/bin
contents, so these should do nothing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required because the build process uses the
protoc
tool from protobuf, which indirectly needs the protobuf DLLs to be in the path.Just moving those DLLs to the
protoc
tool directory doesn't work because the DLLs are actually needed by thegazebomsgs_out.exe
mentioned in the below error. When building the debug version, it needs the debug DLLs and when building the release version, it needs the release version. I tried just adding the protobuf package bin to the path since we only need the protobuf DLLs, but it didn't work in the CI.Here's an example of the command run and the resulting error it shows:
I was able to find the solution with aid from gazebosim/gazebo-classic#2932.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps they shouldn't be in the host installed directory but just the normal installed directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about cross-compilation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be the normal installed directory assuming that the plugin is being built as part of this build. That design prevents cross-compilation, which is highly unfortunate.
Normally, our suggestion to enable cross-compilation here would be to add a way to export the plugin executable from the host build and consume it from target builds, then add a dependency from the target build onto the host build. However, gazebo's enormous dependency list (including all of Qt & ffmpeg) makes the prospect of building once for the host and again for the target quite daunting.
The ideal solution would be to split off the gazebomsgs-plugin into a separate port which could be built for the host and then consumed by the runtime build. I assume that plugin has few-to-no dependencies other than protobuf. However that's a very high bar of build system surgery to do as part of the vcpkg packaging and I wouldn't block the PR over that. +@traversaro for interest/comments on this point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @ras0219-msft . Furthermore, I would add that if one is interested in cross-compiling gazebo, it would first need to make sure that all its dependencies can be cross-compiled, and I do not think this is the case at the moment. For example, the
ignition-msgs5
library has exactly the same problem of gazebo (as it itself originates from a split/fork of an old version of themsgs
component of gazebo). However, the amount of dependencies of ignition-msgs5 are extremely limited, so it should be more doable, see the related upstream changes that I did and the changes that I did on conda-forge for enabling its cross-compilaton:As mentioned by @ras0219-msft once all its dependencies support cross-compilation, gazebo would may need similar changes to enable cross-compilation, and even better to have a CMake build system to just compile
gazebo-msgs
, but I did not check how much effort would be necessary for that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ras0219-msft Thanks for the detailed explanation regarding cross compilation!
Since it looks like
ignition-msgs5
currently doesn't support cross compiling in vcpkg, what do you propose I should do?