From ba0a906efa6e6e42a18080be242bcdffd2b762ca Mon Sep 17 00:00:00 2001 From: Nico <31079890+ntrost57@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:25:22 +0200 Subject: [PATCH] fixing empty packages (#507) * fixing empty packages * no more sample packaging --- CMakeLists.txt | 39 ++++++------------------------ clients/samples/CMakeLists.txt | 43 +++++++++++++++++----------------- 2 files changed, 29 insertions(+), 53 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03eec01d..7375538a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,42 +147,17 @@ if(BUILD_CLIENTS_SAMPLES OR BUILD_CLIENTS_TESTS OR BUILD_CLIENTS_BENCHMARKS) set(GFORTRAN_RPM "gfortran") endif() - rocm_package_setup_component(clients) - rocm_package_setup_client_component(clients-common) if(BUILD_CLIENTS_TESTS) - rocm_package_setup_client_component( - tests - DEPENDS - COMPONENT clients-common - DEB "${GFORTRAN_DEB}" - RPM "${GFORTRAN_RPM}") - rocm_package_setup_client_component( - tests - DEPENDS - COMPONENT clients-common - DEB "${OPENMP_DEB}" - RPM "${OPENMP_RPM}" - ) - endif() - if(BUILD_CLIENTS_SAMPLES) - rocm_package_setup_client_component( - samples - DEPENDS - COMPONENT clients-common - DEB "${GFORTRAN_DEB}" - RPM "${GFORTRAN_RPM}") + rocm_package_setup_client_component(tests) endif() +# if(BUILD_CLIENTS_SAMPLES) +# rocm_package_setup_client_component(samples) +# endif() - if( BUILD_CLIENTS_BENCHMARKS ) - rocm_package_setup_client_component( - benchmarks - DEPENDS - COMPONENT clients-common - DEB "${OPENMP_DEB}" - RPM "${OPENMP_RPM}" - ) + if(BUILD_CLIENTS_BENCHMARKS) + rocm_package_setup_client_component(benchmarks) endif() - + add_subdirectory( clients ) if(NOT WIN32) diff --git a/clients/samples/CMakeLists.txt b/clients/samples/CMakeLists.txt index e1ce6259..a0efd0f1 100644 --- a/clients/samples/CMakeLists.txt +++ b/clients/samples/CMakeLists.txt @@ -26,6 +26,7 @@ set(HIPSPARSE_CLIENTS_COMMON ../common/utility.cpp) # Function to add hipsparse examples function(add_hipsparse_example EXAMPLE_SOURCE) get_filename_component(EXAMPLE_TARGET ${EXAMPLE_SOURCE} NAME_WE) + list(TRANSFORM EXAMPLE_TARGET PREPEND "hipsparse-") add_executable(${EXAMPLE_TARGET} ${EXAMPLE_SOURCE} ${HIPSPARSE_CLIENTS_COMMON}) get_filename_component(EXAMPLE_EXTENSION ${EXAMPLE_SOURCE} LAST_EXT) @@ -49,34 +50,34 @@ function(add_hipsparse_example EXAMPLE_SOURCE) endif() set_target_properties(${EXAMPLE_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/staging") + + rocm_install(TARGETS ${EXAMPLE_TARGET} COMPONENT samples) endfunction() # Examples add_hipsparse_example(example_handle.cpp) if(NOT USE_CUDA OR (USE_CUDA AND CUDA_VERSION LESS 11)) -add_hipsparse_example(example_csrmv.cpp) -add_hipsparse_example(example_hybmv.cpp) + add_hipsparse_example(example_csrmv.cpp) + add_hipsparse_example(example_hybmv.cpp) endif() if (NOT WIN32) -# Fortran examples -if(TARGET hipsparse AND NOT USE_CUDA) - # Compile Fortran examples only if built directly with package - # else the Fortran module file is not generated - - - add_hipsparse_example(example_fortran_auxiliary.f90) - add_hipsparse_example(example_fortran_csrsv2.f90) - add_hipsparse_example(example_fortran_bsric02.f90) - add_hipsparse_example(example_fortran_csric02.f90) - add_hipsparse_example(example_fortran_bsrilu02.f90) - add_hipsparse_example(example_fortran_csrilu02.f90) - add_hipsparse_example(example_fortran_csrsm2.f90) - add_hipsparse_example(example_fortran_dotci.f90) - add_hipsparse_example(example_fortran_roti.f90) - add_hipsparse_example(example_fortran_spmv.f90) - add_hipsparse_example(example_fortran_bsrmm.f90) - -endif() + # Fortran examples + if(TARGET hipsparse AND NOT USE_CUDA) + # Compile Fortran examples only if built directly with package + # else the Fortran module file is not generated + + add_hipsparse_example(example_fortran_auxiliary.f90) + add_hipsparse_example(example_fortran_csrsv2.f90) + add_hipsparse_example(example_fortran_bsric02.f90) + add_hipsparse_example(example_fortran_csric02.f90) + add_hipsparse_example(example_fortran_bsrilu02.f90) + add_hipsparse_example(example_fortran_csrilu02.f90) + add_hipsparse_example(example_fortran_csrsm2.f90) + add_hipsparse_example(example_fortran_dotci.f90) + add_hipsparse_example(example_fortran_roti.f90) + add_hipsparse_example(example_fortran_spmv.f90) + add_hipsparse_example(example_fortran_bsrmm.f90) + endif() endif()