Skip to content

Commit

Permalink
fixing empty packages (#507)
Browse files Browse the repository at this point in the history
* fixing empty packages

* no more sample packaging
  • Loading branch information
ntrost57 authored Aug 16, 2024
1 parent 2c0881f commit ba0a906
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 53 deletions.
39 changes: 7 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
43 changes: 22 additions & 21 deletions clients/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()

0 comments on commit ba0a906

Please sign in to comment.