mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-03 16:47:47 +08:00
windows bundle fixes
This commit is contained in:
@@ -46,7 +46,9 @@ runs:
|
||||
run: |
|
||||
$vcpkg_path = "${{ runner.workspace }}\vcpkg_installed"
|
||||
echo "VCPKG_EXPORT_PATH=$vcpkg_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "$vcpkg_path\installed\x64-windows-release\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "$vcpkg_path\installed\x64-windows-release\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
# K4A runtime DLLs (k4a.dll, k4arecord.dll) live in the SDK bin; needed on PATH so fixup_bundle resolves them at package time.
|
||||
echo "$vcpkg_path\installed\x64-windows-release\sdk\windows-desktop\amd64\release\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "${{env.CUDA_PATH}}\bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "${{env.CUDA_PATH}}\extras\CUPTI\lib64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "$vcpkg_path\installed\x64-windows-release\tools\python3\Lib\site-packages\torch\lib" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
|
||||
@@ -34,4 +34,6 @@ runs:
|
||||
$vcpkg_path = "${{ runner.workspace }}\vcpkg_installed"
|
||||
echo "VCPKG_EXPORT_PATH=$vcpkg_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "$vcpkg_path\installed\x64-windows-release\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
# K4A runtime DLLs (k4a.dll, k4arecord.dll) live in the SDK bin; needed on PATH so fixup_bundle resolves them at package time.
|
||||
echo "$vcpkg_path\installed\x64-windows-release\sdk\windows-desktop\amd64\release\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "$vcpkg_path\installed\x64-windows-release\tools\python3\Lib\site-packages\numpy.libs" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
- build_name: windows-2022-cuda
|
||||
os: windows-2022
|
||||
extra_deps: ""
|
||||
extra_cmake_def: '-DWITH_TORCH=ON -DWITH_ZED=ON'
|
||||
extra_cmake_def: '-DWITH_TORCH=ON -DWITH_ZED=ON -DWITH_CUDASIFT=ON'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -46,10 +46,11 @@ jobs:
|
||||
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
# K4A and K4W2 are located via these env vars (FindK4A.cmake / FindKinectSDK2.cmake),
|
||||
# pointing at the export where the bundle script staged their SDK files.
|
||||
# K4A, K4W2 and ZED are located via these env vars (FindK4A.cmake / FindKinectSDK2.cmake
|
||||
# and the install rules), pointing at the export where the bundle staged their SDK files.
|
||||
$env:K4A_ROOT_DIR = "${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release"
|
||||
$env:KINECTSDK20_DIR = "${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release"
|
||||
$env:ZED_SDK_ROOT_DIR = "${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release"
|
||||
cmake `
|
||||
-B ${{github.workspace}}/build `
|
||||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
|
||||
|
||||
+19
-5
@@ -42,7 +42,7 @@ IF(APPLE AND BUILD_AS_BUNDLE)
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER "com.introlab.rtabmap"
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "${CMAKE_BUNDLE_NAME}")
|
||||
ELSEIF(WIN32 AND BUILD_AS_BUNDLE)
|
||||
ADD_EXECUTABLE(rtabmap_app ${SRC_FILES})
|
||||
ADD_EXECUTABLE(rtabmap_app WIN32 ${SRC_FILES})
|
||||
ELSE()
|
||||
ADD_EXECUTABLE(rtabmap_app ${SRC_FILES})
|
||||
ENDIF()
|
||||
@@ -111,12 +111,26 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||
ENDIF(OpenNI2_FOUND)
|
||||
|
||||
IF(k4a_FOUND)
|
||||
# Install needed depthengine_2_0.dll
|
||||
# Install needed depthengine_2_0.dll. Its location varies by K4A SDK version:
|
||||
# v1.4.1 ships it under sdk/windows-desktop/amd64/release/bin, or fallback in tools/.
|
||||
IF(WIN32)
|
||||
file(TO_CMAKE_PATH "$ENV{K4A_ROOT_DIR}" ENV_K4A_ROOT_DIR)
|
||||
INSTALL(FILES "${ENV_K4A_ROOT_DIR}/tools/depthengine_2_0.dll"
|
||||
DESTINATION ${thirdparty_dest_dir}
|
||||
COMPONENT runtime)
|
||||
set(DEPTHENGINE_DLL "")
|
||||
foreach(_depthengine_dir
|
||||
"${ENV_K4A_ROOT_DIR}/sdk/windows-desktop/amd64/release/bin"
|
||||
"${ENV_K4A_ROOT_DIR}/tools")
|
||||
if(EXISTS "${_depthengine_dir}/depthengine_2_0.dll")
|
||||
set(DEPTHENGINE_DLL "${_depthengine_dir}/depthengine_2_0.dll")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
IF(DEPTHENGINE_DLL)
|
||||
INSTALL(FILES "${DEPTHENGINE_DLL}"
|
||||
DESTINATION ${thirdparty_dest_dir}
|
||||
COMPONENT runtime)
|
||||
ELSE()
|
||||
MESSAGE(WARNING "depthengine_2_0.dll not found under $ENV{K4A_ROOT_DIR} (sdk/windows-desktop/amd64/release/bin or tools); Kinect for Azure depth may not work at runtime.")
|
||||
ENDIF()
|
||||
ENDIF(WIN32)
|
||||
ENDIF(k4a_FOUND)
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ echo [+] Installing dependencies via vcpkg manifest...
|
||||
--x-feature=openni2 ^
|
||||
--x-feature=gtsam-deps ^
|
||||
--x-feature=python ^
|
||||
--x-feature=pdal ^
|
||||
--x-feature=libpointmatcher-deps ^
|
||||
--x-feature=libfreenect2-deps || exit /b !errorlevel!
|
||||
|
||||
@@ -74,10 +73,16 @@ cd /d "%SRC_DIR%"
|
||||
:: Microsoft SDK layout (KINECTSDK20_DIR\inc and \Lib\x64), but vcpkg's kinectsdk2
|
||||
:: port installs vcpkg-style (include\ and lib\). Mirror the bundled headers/lib into
|
||||
:: the expected layout so it is found with KINECTSDK20_DIR pointing at the export.
|
||||
if "%KINECTSDK20_DIR%"=="" (
|
||||
echo Error: KINECTSDK20_DIR environment variable is not set! Install Kinect for Windows SDK v2: https://www.microsoft.com/en-us/download/details.aspx?id=44561
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
echo [+] Arranging Kinect SDK v2 layout for FindKinectSDK2...
|
||||
set "K4W2_ROOT=%FINAL_EXPORT_PATH%\installed\%TRIPLET%"
|
||||
robocopy "%K4W2_ROOT%\include" "%K4W2_ROOT%\inc" Kinect*.h Nui*.h /XO >nul
|
||||
robocopy "%K4W2_ROOT%\lib" "%K4W2_ROOT%\Lib\x64" Kinect20*.lib /XO >nul
|
||||
robocopy "%KINECTSDK20_DIR%\bin" "%K4W2_ROOT%\bin" Kinect20.dll /XO >nul
|
||||
:: Robocopy exit codes under 8 mean successful copies/no changes; 8+ is a failure.
|
||||
if !errorlevel! GEQ 8 (
|
||||
echo Error: Robocopy failed with exit code !errorlevel!
|
||||
@@ -379,6 +384,8 @@ goto :EndComment
|
||||
set VCPKG_UNZIPPED_EXPORT_PATH=%USERPROFILE%\Downloads\vcpkg-export-########-x64-vs2022
|
||||
|
||||
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release\bin;%PATH%
|
||||
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release\sdk\windows-desktop\amd64\release\bin;%PATH%
|
||||
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release\tools\python3\Lib\site-packages\numpy.libs;%PATH%
|
||||
set K4A_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
|
||||
set KINECTSDK20_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
|
||||
|
||||
@@ -395,6 +402,7 @@ cmake -B build -GNinja ^
|
||||
-DWITH_DEPTHAI=ON ^
|
||||
-DWITH_REALSENSE2=ON ^
|
||||
-DWITH_CCCORELIB=ON ^
|
||||
-DWITH_PDAL=OFF ^
|
||||
-DVCPKG_MANIFEST_INSTALL=OFF ^
|
||||
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
|
||||
-DVCPKG_INSTALLED_DIR="%VCPKG_UNZIPPED_EXPORT_PATH%/installed" ^
|
||||
|
||||
@@ -72,7 +72,8 @@ if not exist "%FINAL_EXPORT_PATH%" (
|
||||
xcopy "%CUDA_PATH%\bin\x64\cudnn*.dll" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\bin\" /Y
|
||||
)
|
||||
|
||||
:: For ZED, modify zed-config.cmake and remove all dependencies
|
||||
:: ZED: copy the main library + the zed-config.cmake so find_package(ZED) resolves
|
||||
:: it from the export (the config derives paths from ZED_SDK_ROOT_DIR/CMAKE_PREFIX_PATH).
|
||||
if "%ZED_SDK_ROOT_DIR%"=="" (
|
||||
echo Error: ZED_SDK_ROOT_DIR environment variable is not set!
|
||||
pause
|
||||
@@ -82,7 +83,10 @@ echo Copying ZED main library only...
|
||||
robocopy "%ZED_SDK_ROOT_DIR%\bin" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\bin" *.dll /XF nv*.dll
|
||||
robocopy "%ZED_SDK_ROOT_DIR%\lib" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\lib" /E /XO
|
||||
robocopy "%ZED_SDK_ROOT_DIR%\include" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\include" /E /XO
|
||||
:: Robocopy exit codes under 8 mean successful copies/no changes.
|
||||
:: Install ZED's CMake config at the export prefix root so find_package(ZED 2) (config
|
||||
:: mode, via the vcpkg toolchain CMAKE_PREFIX_PATH) finds it.
|
||||
robocopy "%ZED_SDK_ROOT_DIR%" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%" zed-config.cmake zed-config-version.cmake /XO
|
||||
:: Robocopy exit codes under 8 mean successful copies/no changes.
|
||||
:: 8 or higher means there was a failure.
|
||||
if !errorlevel! GEQ 8 (
|
||||
echo Error: Robocopy failed with exit code !errorlevel!
|
||||
@@ -228,6 +232,28 @@ cmake -S . -B build_cuda -GNinja ^
|
||||
cmake --build build_cuda --config Release --target install || exit /b !errorlevel!
|
||||
cd ..
|
||||
|
||||
:: CudaSift (CUDA SIFT/SURF GPU features, matlabbe fork; needs CUDA)
|
||||
echo [+] Building CudaSift...
|
||||
if not exist CudaSift (
|
||||
echo [+] Downloading...
|
||||
git clone https://github.com/matlabbe/CudaSift.git
|
||||
cd CudaSift
|
||||
git checkout f764e14ae59ee78ff5b282d38790301d80faadc3
|
||||
cd ..
|
||||
)
|
||||
cd CudaSift
|
||||
cmake -S . -B build -GNinja ^
|
||||
-DVCPKG_MANIFEST_INSTALL=OFF ^
|
||||
-DVCPKG_TARGET_TRIPLET=%TRIPLET% ^
|
||||
-DVCPKG_INSTALLED_DIR="%FINAL_EXPORT_PATH%\installed" ^
|
||||
-DCMAKE_TOOLCHAIN_FILE="%FINAL_EXPORT_PATH%\scripts\buildsystems\vcpkg.cmake" ^
|
||||
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
|
||||
-DCMAKE_BUILD_TYPE=Release ^
|
||||
-DVERBOSE=OFF ^
|
||||
-DBUILD_SHARED_LIBS=ON || exit /b !errorlevel!
|
||||
cmake --build build --config Release --target install || exit /b !errorlevel!
|
||||
cd ..
|
||||
|
||||
:: 5. ZIP the folder
|
||||
echo [+] Creating final package with 7-Zip...
|
||||
:: Rip off pdb files
|
||||
@@ -261,9 +287,9 @@ set PATH=%CUDA_PATH%\bin\x64;%PATH%
|
||||
set PATH=%CUDA_PATH%\extras\CUPTI\lib64;%PATH%
|
||||
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\tools\python3\Lib\site-packages\torch\lib;%PATH%
|
||||
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\tools\python3\Lib\site-packages\numpy.libs;%PATH%
|
||||
set K4A_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
|
||||
set KINECTSDK20_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
|
||||
set ZED_SDK_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
|
||||
set K4A_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%
|
||||
set KINECTSDK20_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%
|
||||
set ZED_SDK_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%
|
||||
|
||||
cmake -B build_cuda -GNinja ^
|
||||
-DCMAKE_BUILD_TYPE=Release ^
|
||||
@@ -271,6 +297,7 @@ cmake -B build_cuda -GNinja ^
|
||||
-DWITH_PYTHON=ON ^
|
||||
-DWITH_TORCH=ON ^
|
||||
-DWITH_ZED=ON ^
|
||||
-DWITH_CUDASIFT=ON ^
|
||||
-DWITH_CERES=ON ^
|
||||
-DWITH_ORBBEC_SDK=ON ^
|
||||
-DWITH_FREENECT2=ON ^
|
||||
@@ -279,6 +306,7 @@ cmake -B build_cuda -GNinja ^
|
||||
-DWITH_DEPTHAI=ON ^
|
||||
-DWITH_REALSENSE2=ON ^
|
||||
-DWITH_CCCORELIB=ON ^
|
||||
-DWITH_PDAL=OFF ^
|
||||
-DVCPKG_MANIFEST_INSTALL=OFF ^
|
||||
-DVCPKG_TARGET_TRIPLET=%TRIPLET% ^
|
||||
-DVCPKG_INSTALLED_DIR="%VCPKG_UNZIPPED_EXPORT_PATH%/installed" ^
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index e671b87..86b590c 100644
|
||||
index e671b87..2e2538e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -121,7 +121,7 @@ set( NANOFLANN_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE )
|
||||
@@ -11,3 +11,11 @@ index e671b87..86b590c 100644
|
||||
nanoflann::nanoflann
|
||||
)
|
||||
|
||||
@@ -236,6 +236,7 @@ install(
|
||||
CCCoreLib
|
||||
EXPORT
|
||||
CCCoreLib-targets
|
||||
+ RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
INCLUDES DESTINATION include
|
||||
|
||||
@@ -185,12 +185,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"pdal": {
|
||||
"description": "Build RTAB-Map with pdal support",
|
||||
"dependencies": [
|
||||
"pdal"
|
||||
]
|
||||
},
|
||||
"python": {
|
||||
"description": "Build RTAB-Map with python support",
|
||||
"dependencies": [
|
||||
|
||||
Reference in New Issue
Block a user