diff --git a/CMakeLists.txt b/CMakeLists.txt index 269f46255..2b5fe2470 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +14,7 @@ # limitations under the License. cmake_minimum_required(VERSION 3.20.1) -project(Holohub-internal CXX) +project(Holohub CXX) # set CMAKE_MODULE_PATH list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) @@ -45,7 +45,8 @@ endif() # Set the default data directory set(HOLOHUB_DATA_DIR "${CMAKE_BINARY_DIR}/data" CACHE PATH "Data Download directory") -set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib:/opt/nvidia/holoscan/lib/") +set(CMAKE_INSTALL_RPATH + "\$ORIGIN:\$ORIGIN/../../../lib:\$ORIGIN/../../lib:/opt/nvidia/holoscan/lib/") # Build the applications add_subdirectory(applications) diff --git a/applications/deltacast_transmitter/deltacast_transmitter.yaml b/applications/deltacast_transmitter/deltacast_transmitter.yaml index 02a501683..9f7a0fa49 100644 --- a/applications/deltacast_transmitter/deltacast_transmitter.yaml +++ b/applications/deltacast_transmitter/deltacast_transmitter.yaml @@ -15,7 +15,7 @@ # limitations under the License. --- extensions: - - gxf_extensions/deltacast_videomaster/libgxf_videomaster.so + - lib/gxf_extensions/libgxf_videomaster.so replayer: basename: "surgical_video" diff --git a/applications/endoscopy_tool_tracking/cpp/CMakeLists.txt b/applications/endoscopy_tool_tracking/cpp/CMakeLists.txt index bf7081763..0e53ac074 100644 --- a/applications/endoscopy_tool_tracking/cpp/CMakeLists.txt +++ b/applications/endoscopy_tool_tracking/cpp/CMakeLists.txt @@ -156,29 +156,10 @@ endif() # Install application and dependencies into the install/ directory for packaging install( TARGETS endoscopy_tool_tracking - DESTINATION endoscopy_tool_tracking_cpp - COMPONENT "holohub-apps" + DESTINATION bin/endoscopy_tool_tracking/cpp ) -file(READ "${CMAKE_CURRENT_SOURCE_DIR}/endoscopy_tool_tracking.yaml" APP_YAML_FILE) -string(REPLACE "gxf_extensions/lstm_tensor_rt_inference/" "" APP_YAML_FILE "${APP_YAML_FILE}") -file(WRITE "${CMAKE_BINARY_DIR}/packaging/cpp/endoscopy_tool_tracking.yaml" "${APP_YAML_FILE}") - install( - FILES ${CMAKE_BINARY_DIR}/packaging/cpp/endoscopy_tool_tracking.yaml - DESTINATION endoscopy_tool_tracking_cpp - COMPONENT "holohub-apps" + FILES endoscopy_tool_tracking.yaml + DESTINATION bin/endoscopy_tool_tracking/cpp ) - -install( - DIRECTORY ${CMAKE_BINARY_DIR}/gxf_extensions/lstm_tensor_rt_inference/ - DESTINATION endoscopy_tool_tracking_cpp - FILES_MATCHING PATTERN "*.so" - PATTERN "CMakeFiles" EXCLUDE) - -install( - FILES - ${CMAKE_BINARY_DIR}/operators/lstm_tensor_rt_inference/liblstm_tensor_rt_inference.so - ${CMAKE_BINARY_DIR}/operators/tool_tracking_postprocessor/libtool_tracking_postprocessor.so - DESTINATION endoscopy_tool_tracking_cpp - COMPONENT "holohub-apps") \ No newline at end of file diff --git a/applications/endoscopy_tool_tracking/cpp/endoscopy_tool_tracking.yaml b/applications/endoscopy_tool_tracking/cpp/endoscopy_tool_tracking.yaml index 4fbdf366b..11ac047eb 100644 --- a/applications/endoscopy_tool_tracking/cpp/endoscopy_tool_tracking.yaml +++ b/applications/endoscopy_tool_tracking/cpp/endoscopy_tool_tracking.yaml @@ -29,11 +29,11 @@ resources: gpuMemory: 1Gi extensions: - - gxf_extensions/lstm_tensor_rt_inference/libgxf_lstm_tensor_rt_inference.so + - lib/gxf_extensions/libgxf_lstm_tensor_rt_inference.so # Uncomment the following extension when using deltacast as a source -# - gxf_extensions/deltacast_videomaster/libgxf_videomaster.so +# - lib/gxf_extensions/libgxf_videomaster.so # Uncomment the following extension when using yuan as source -# - gxf_extensions/yuan_qcap/libgxf_qcap_source.so +# - lib/gxf_extensions/libgxf_qcap_source.so source: "replayer" # "replayer" or "aja" or "deltacast" or "yuan" visualizer: "holoviz" # "holoviz" or "vtk" diff --git a/applications/endoscopy_tool_tracking/python/CMakeLists.txt b/applications/endoscopy_tool_tracking/python/CMakeLists.txt index 563ddd230..23c9c9584 100644 --- a/applications/endoscopy_tool_tracking/python/CMakeLists.txt +++ b/applications/endoscopy_tool_tracking/python/CMakeLists.txt @@ -67,35 +67,10 @@ endif() # Install application and dependencies into the install/ directory for packaging install( FILES endoscopy_tool_tracking.py - DESTINATION endoscopy_tool_tracking_python - COMPONENT "holohub-apps" + DESTINATION bin/endoscopy_tool_tracking/python ) -file(READ "${CMAKE_CURRENT_SOURCE_DIR}/endoscopy_tool_tracking.yaml" APP_YAML_FILE) -string(REPLACE "gxf_extensions/lstm_tensor_rt_inference/" "" APP_YAML_FILE "${APP_YAML_FILE}") -file(WRITE "${CMAKE_BINARY_DIR}/packaging/python/endoscopy_tool_tracking.yaml" "${APP_YAML_FILE}") - install( - FILES ${CMAKE_BINARY_DIR}/packaging/python/endoscopy_tool_tracking.yaml - DESTINATION endoscopy_tool_tracking_python - COMPONENT "holohub-apps" + FILES endoscopy_tool_tracking.yaml + DESTINATION bin/endoscopy_tool_tracking/python ) - -install( - DIRECTORY ${CMAKE_BINARY_DIR}/gxf_extensions/lstm_tensor_rt_inference/ - DESTINATION endoscopy_tool_tracking_python - FILES_MATCHING PATTERN "*.so" - PATTERN "CMakeFiles" EXCLUDE -) - -install( - FILES - ${CMAKE_BINARY_DIR}/operators/lstm_tensor_rt_inference/liblstm_tensor_rt_inference.so - ${CMAKE_BINARY_DIR}/operators/tool_tracking_postprocessor/libtool_tracking_postprocessor.so - DESTINATION endoscopy_tool_tracking_python - COMPONENT "holohub-apps" -) - -install( - DIRECTORY ${CMAKE_BINARY_DIR}/python/lib/holohub - DESTINATION endoscopy_tool_tracking_python) diff --git a/applications/endoscopy_tool_tracking/python/endoscopy_tool_tracking.yaml b/applications/endoscopy_tool_tracking/python/endoscopy_tool_tracking.yaml index af29308b4..542eb0a7e 100644 --- a/applications/endoscopy_tool_tracking/python/endoscopy_tool_tracking.yaml +++ b/applications/endoscopy_tool_tracking/python/endoscopy_tool_tracking.yaml @@ -29,8 +29,8 @@ resources: gpuMemory: 1Gi extensions: -- gxf_extensions/lstm_tensor_rt_inference/libgxf_lstm_tensor_rt_inference.so -- gxf_extensions/yuan_qcap/libgxf_qcap_source.so +- lib/gxf_extensions/libgxf_lstm_tensor_rt_inference.so +- lib/gxf_extensions/libgxf_qcap_source.so visualizer: "holoviz" # "holoviz" or "vtk" diff --git a/applications/endoscopy_tool_tracking_distributed/cpp/endoscopy_tool_tracking.yaml b/applications/endoscopy_tool_tracking_distributed/cpp/endoscopy_tool_tracking.yaml index 5ae03a2fd..f3896bb14 100644 --- a/applications/endoscopy_tool_tracking_distributed/cpp/endoscopy_tool_tracking.yaml +++ b/applications/endoscopy_tool_tracking_distributed/cpp/endoscopy_tool_tracking.yaml @@ -19,7 +19,7 @@ extensions: - libgxf_cuda.so - libgxf_multimedia.so - libgxf_serialization.so - - gxf_extensions/lstm_tensor_rt_inference/libgxf_lstm_tensor_rt_inference.so + - lib/gxf_extensions/libgxf_lstm_tensor_rt_inference.so replayer: basename: "surgical_video" diff --git a/applications/endoscopy_tool_tracking_distributed/python/endoscopy_tool_tracking.yaml b/applications/endoscopy_tool_tracking_distributed/python/endoscopy_tool_tracking.yaml index ab95b42aa..dd3da122d 100644 --- a/applications/endoscopy_tool_tracking_distributed/python/endoscopy_tool_tracking.yaml +++ b/applications/endoscopy_tool_tracking_distributed/python/endoscopy_tool_tracking.yaml @@ -15,7 +15,7 @@ # limitations under the License. --- extensions: -- gxf_extensions/lstm_tensor_rt_inference/libgxf_lstm_tensor_rt_inference.so +- lib/gxf_extensions/libgxf_lstm_tensor_rt_inference.so replayer: diff --git a/applications/h264/h264_endoscopy_tool_tracking/cpp/h264_endoscopy_tool_tracking.yaml b/applications/h264/h264_endoscopy_tool_tracking/cpp/h264_endoscopy_tool_tracking.yaml index 57254ef5d..b6bcae5ab 100644 --- a/applications/h264/h264_endoscopy_tool_tracking/cpp/h264_endoscopy_tool_tracking.yaml +++ b/applications/h264/h264_endoscopy_tool_tracking/cpp/h264_endoscopy_tool_tracking.yaml @@ -19,7 +19,7 @@ extensions: - libgxf_videodecoderio.so - libgxf_videoencoder.so - libgxf_videoencoderio.so - - ../../../../gxf_extensions/lstm_tensor_rt_inference/libgxf_lstm_tensor_rt_inference.so + - ../../../../lib/gxf_extensions/libgxf_lstm_tensor_rt_inference.so record_output: true # Setting this to `false` disables H264 encoding of output and recording it to the file. diff --git a/applications/h264/h264_endoscopy_tool_tracking/python/h264_endoscopy_tool_tracking.yaml b/applications/h264/h264_endoscopy_tool_tracking/python/h264_endoscopy_tool_tracking.yaml index 08f297768..1866c8cc4 100644 --- a/applications/h264/h264_endoscopy_tool_tracking/python/h264_endoscopy_tool_tracking.yaml +++ b/applications/h264/h264_endoscopy_tool_tracking/python/h264_endoscopy_tool_tracking.yaml @@ -15,7 +15,7 @@ # limitations under the License. --- extensions: - - gxf_extensions/lstm_tensor_rt_inference/libgxf_lstm_tensor_rt_inference.so + - lib/gxf_extensions/libgxf_lstm_tensor_rt_inference.so record_output: true # Setting this to `false` disables H264 encoding of output and recording it to the file. diff --git a/applications/high_speed_endoscopy/cpp/high_speed_endoscopy.yaml b/applications/high_speed_endoscopy/cpp/high_speed_endoscopy.yaml index 8e80b1bd2..a6beca28a 100644 --- a/applications/high_speed_endoscopy/cpp/high_speed_endoscopy.yaml +++ b/applications/high_speed_endoscopy/cpp/high_speed_endoscopy.yaml @@ -15,7 +15,7 @@ # limitations under the License. --- extensions: - - gxf_extensions/emergent_source/libgxf_emergent_source.so + - lib/gxf_extensions/libgxf_emergent_source.so # Modify the width/height and framerate for the camera used # Current is for Emergent HB-5000-SB diff --git a/applications/high_speed_endoscopy/python/high_speed_endoscopy.yaml b/applications/high_speed_endoscopy/python/high_speed_endoscopy.yaml index d67444f5f..cac6c5276 100644 --- a/applications/high_speed_endoscopy/python/high_speed_endoscopy.yaml +++ b/applications/high_speed_endoscopy/python/high_speed_endoscopy.yaml @@ -15,7 +15,7 @@ # limitations under the License. --- extensions: - - gxf_extensions/emergent_source/libgxf_emergent_source.so + - lib/gxf_extensions/libgxf_emergent_source.so emergent: width: 4200 diff --git a/applications/object_detection_torch/CMakeLists.txt b/applications/object_detection_torch/CMakeLists.txt index cced22d9a..08089e7c6 100644 --- a/applications/object_detection_torch/CMakeLists.txt +++ b/applications/object_detection_torch/CMakeLists.txt @@ -119,16 +119,11 @@ if(BUILD_TESTING) ) endif() -# Install application and dependencies into the install/ directory for packaging -install( - TARGETS object_detection_torch - DESTINATION object_detection_torch - COMPONENT "holohub-apps" +# Install application +install(TARGETS object_detection_torch + DESTINATION bin/object_detection_torch ) -install( - FILES - "${object_detection_torch_BINARY_DIR}/object_detection_torch.yaml" - DESTINATION object_detection_torch - COMPONENT "holohub-apps" -) \ No newline at end of file +install(FILES object_detection_torch.yaml + DESTINATION bin/object_detection_torch +) diff --git a/applications/orsi/orsi_in_out_body/cpp/orsi_in_out_body.yaml b/applications/orsi/orsi_in_out_body/cpp/orsi_in_out_body.yaml index 27c37c999..3488b643e 100644 --- a/applications/orsi/orsi_in_out_body/cpp/orsi_in_out_body.yaml +++ b/applications/orsi/orsi_in_out_body/cpp/orsi_in_out_body.yaml @@ -15,7 +15,7 @@ # limitations under the License. --- extensions: - - gxf_extensions/deltacast_videomaster/libgxf_videomaster.so + - lib/gxf_extensions/libgxf_videomaster.so source: "replayer" # Valid values "replayer", "aja" or "videomaster" diff --git a/applications/orsi/orsi_multi_ai_ar/cpp/orsi_multi_ai_ar.yaml b/applications/orsi/orsi_multi_ai_ar/cpp/orsi_multi_ai_ar.yaml index ac98f7381..2f7b0439b 100644 --- a/applications/orsi/orsi_multi_ai_ar/cpp/orsi_multi_ai_ar.yaml +++ b/applications/orsi/orsi_multi_ai_ar/cpp/orsi_multi_ai_ar.yaml @@ -15,7 +15,7 @@ # limitations under the License. --- extensions: - - gxf_extensions/deltacast_videomaster/libgxf_videomaster.so + - lib/gxf_extensions/libgxf_videomaster.so source: "replayer" # Valid values "replayer", "aja" or "videomaster" diff --git a/applications/orsi/orsi_segmentation_ar/cpp/orsi_segmentation_ar.yaml b/applications/orsi/orsi_segmentation_ar/cpp/orsi_segmentation_ar.yaml index 2d6c7b06c..55d9c0ca5 100644 --- a/applications/orsi/orsi_segmentation_ar/cpp/orsi_segmentation_ar.yaml +++ b/applications/orsi/orsi_segmentation_ar/cpp/orsi_segmentation_ar.yaml @@ -15,7 +15,7 @@ # limitations under the License. --- extensions: - - gxf_extensions/deltacast_videomaster/libgxf_videomaster.so + - lib/gxf_extensions/libgxf_videomaster.so source: "replayer" # Valid values "replayer", "aja" or "videomaster" diff --git a/dev_container b/dev_container index 25795e60a..aed4889c2 100755 --- a/dev_container +++ b/dev_container @@ -864,6 +864,7 @@ build_and_run() { local extra_run_args="" local run_app=1 local install="" + local configure_args="" # Parse CLI arguments next while [[ $# -gt 0 ]]; do @@ -924,7 +925,7 @@ build_and_run() { ;; --build_args) if [[ -n "$2" ]]; then - extra_build_args="--configure-args '$2'" + configure_args="${configure_args} '$2'" shift 2 else echo "Error: --build_args requires a value" @@ -1011,6 +1012,10 @@ build_and_run() { container_build_args+=" --docker_file ${docker_file}" fi + if [[ -n "${configure_args}" ]]; then + extra_build_args+=" --configure-args ${configure_args}" + fi + if [[ -z "$image_name" ]]; then if [[ -n "${docker_file}" ]] && [[ "${docker_file}" != "${SCRIPT_DIR}/Dockerfile" ]]; then image_name="holohub:${app_name}" diff --git a/gxf_extensions/CMakeLists.txt b/gxf_extensions/CMakeLists.txt index de5765ea0..3060e50e8 100644 --- a/gxf_extensions/CMakeLists.txt +++ b/gxf_extensions/CMakeLists.txt @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gxf_extensions) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/gxf_extensions) + add_holohub_extension(deltacast_videomaster) add_holohub_extension(emergent_source) add_holohub_extension(lstm_tensor_rt_inference) diff --git a/gxf_extensions/lstm_tensor_rt_inference/CMakeLists.txt b/gxf_extensions/lstm_tensor_rt_inference/CMakeLists.txt index d8d65f380..6175810cc 100644 --- a/gxf_extensions/lstm_tensor_rt_inference/CMakeLists.txt +++ b/gxf_extensions/lstm_tensor_rt_inference/CMakeLists.txt @@ -18,7 +18,7 @@ project(gxf_lstm_tensor_rt_inference) find_package(holoscan REQUIRED CONFIG PATHS "/opt/nvidia/holoscan" "/workspace/holoscan-sdk/install") - # Create library +# Create library add_library(gxf_lstm_tensor_rt_inference_lib SHARED tensor_rt_inference.cpp tensor_rt_inference.hpp @@ -45,3 +45,8 @@ add_library(gxf_lstm_tensor_rt_inference SHARED target_link_libraries(gxf_lstm_tensor_rt_inference PUBLIC gxf_lstm_tensor_rt_inference_lib ) + +install(TARGETS gxf_lstm_tensor_rt_inference_lib + gxf_lstm_tensor_rt_inference + DESTINATION lib/gxf_extensions + ) diff --git a/operators/CMakeLists.txt b/operators/CMakeLists.txt index ca332744b..cced4d745 100644 --- a/operators/CMakeLists.txt +++ b/operators/CMakeLists.txt @@ -50,3 +50,11 @@ add_holohub_operator(XrTransformOp) add_holohub_operator(yuan_qcap DEPENDS EXTENSIONS yuan_qcap) +# install +install( + DIRECTORY "${CMAKE_BINARY_DIR}/python/lib/holohub" + DESTINATION python/lib + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + PATTERN "__pycache__" EXCLUDE +) diff --git a/operators/lstm_tensor_rt_inference/CMakeLists.txt b/operators/lstm_tensor_rt_inference/CMakeLists.txt index 7bcbf4183..3e6720c13 100644 --- a/operators/lstm_tensor_rt_inference/CMakeLists.txt +++ b/operators/lstm_tensor_rt_inference/CMakeLists.txt @@ -29,3 +29,7 @@ target_include_directories(lstm_tensor_rt_inference INTERFACE ${CMAKE_CURRENT_SO if(HOLOHUB_BUILD_PYTHON) add_subdirectory(python) endif() + +# Installation +install(TARGETS lstm_tensor_rt_inference) + diff --git a/operators/tool_tracking_postprocessor/CMakeLists.txt b/operators/tool_tracking_postprocessor/CMakeLists.txt index 19e1767b7..cc90a3e54 100644 --- a/operators/tool_tracking_postprocessor/CMakeLists.txt +++ b/operators/tool_tracking_postprocessor/CMakeLists.txt @@ -33,3 +33,6 @@ target_include_directories(tool_tracking_postprocessor INTERFACE ${CMAKE_CURRENT if(HOLOHUB_BUILD_PYTHON) add_subdirectory(python) endif() + +install(TARGETS tool_tracking_postprocessor) + diff --git a/tutorials/creating-multi-node-applications/scenario2/endoscopy_distributed_app.yaml b/tutorials/creating-multi-node-applications/scenario2/endoscopy_distributed_app.yaml index ecf80c089..7549e3513 100644 --- a/tutorials/creating-multi-node-applications/scenario2/endoscopy_distributed_app.yaml +++ b/tutorials/creating-multi-node-applications/scenario2/endoscopy_distributed_app.yaml @@ -15,7 +15,7 @@ # limitations under the License. --- extensions: -- gxf_extensions/lstm_tensor_rt_inference/libgxf_lstm_tensor_rt_inference.so +- lib/gxf_extensions/libgxf_lstm_tensor_rt_inference.so aja: width: 1920