Skip to content
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

camp-2022.03.0 isn't exporting BLT HIP targets #982

Closed
cyrush opened this issue Aug 5, 2022 · 1 comment
Closed

camp-2022.03.0 isn't exporting BLT HIP targets #982

cyrush opened this issue Aug 5, 2022 · 1 comment
Labels
Milestone

Comments

@cyrush
Copy link
Member

cyrush commented Aug 5, 2022

From ascent's using-with-cmake example:

/cmake-3.23.2-linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/ascent_render_example.dir/link.txt --verbose=1
/opt/rocm/llvm/bin/amdclang++ -lm -ldl CMakeFiles/ascent_render_example.dir/ascent_render_example.cpp.o -o ascent_render_example  -Wl,-rpath,/home/user/ascent/install/lib://install/umpire-2022.03.1/lib://install/camp-2022.03.0/lib://install/vtk-m-v1.8.0/lib://install/kokkos-3.6.01/lib:/opt/rocm/lib://install/mfem-4.4/lib://install/conduit-v0.8.3/lib:/install/hdf5-1.12.2/lib /home/user/ascent/install/lib/libascent.so /home/user/ascent/install/lib/libascent_flow.so //install/umpire-2022.03.1/lib/libumpire.so //install/camp-2022.03.0/lib/libcamp.so -lblt_hip_runtime /home/user/ascent/install/lib/librover.so /home/user/ascent/install/lib/libvtkh_rendering.so /home/user/ascent/install/lib/libvtkh_filters.so /home/user/ascent/install/lib/libvtkh_compositing.so /home/user/ascent/install/lib/libvtkh_core.so /home/user/ascent/install/lib/libvtkh_utils.so /home/user/ascent/install/lib/libascent_lodepng.so //install/vtk-m-v1.8.0/lib/libvtkm_filter_extra-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_connected_components-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_contour-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_density_estimate-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_field_conversion-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_field_transform-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_geometry_refinement-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_mesh_info-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_vector_analysis-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_zfp-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_rendering-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_entity_extraction-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_clean_grid-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_image_processing-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_filter_core-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_worklet-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_io-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkm_cont-1.8.so.1 //install/vtk-m-v1.8.0/lib/libvtkmdiympi_nompi.so //install/kokkos-3.6.01/lib/libkokkoscontainers.so.3.6.01 //install/kokkos-3.6.01/lib/libkokkoscore.so.3.6.01 /usr/lib/x86_64-linux-gnu/libdl.so /opt/rocm/lib/libamdhip64.so.5.1.50103 /opt/rocm/llvm/lib/clang/14.0.0/lib/linux/libclang_rt.builtins-x86_64.a --hip-link --offload-arch=gfx90a //install/mfem-4.4/lib/libmfem.so -Wl,-rpath,//install/conduit-v0.8.3/lib -L//install/conduit-v0.8.3/lib -lconduit -Wl,-rpath,//install/conduit-v0.8.3/lib -L//install/conduit-v0.8.3/lib -lconduit_relay -Wl,-rpath,//install/conduit-v0.8.3/lib -L//install/conduit-v0.8.3/lib -lconduit_blueprint //install/conduit-v0.8.3/lib/libconduit_relay.so -lpthread -lrt /install/hdf5-1.12.2/lib/libhdf5.so.200.2.0 -lm -ldl //install/conduit-v0.8.3/lib/libconduit_blueprint.so //install/conduit-v0.8.3/lib/libconduit.so 
ld.lld: error: unable to find library -lblt_hip_runtime

This lead me to believe that I wasn't exporting blt's hip targets correctly and to mistakenly re-export them again, which landed me in a confused state (LLNL/blt#591)

Backing up a few steps, i saw:

//install/camp-2022.03.0/lib/libcamp.so -lblt_hip_runtime

Then, looking at camps generated cmake exports:

# Create imported target camp
add_library(camp SHARED IMPORTED)

set_target_properties(camp PROPERTIES
  INTERFACE_COMPILE_FEATURES "cxx_std_14"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "blt_hip_runtime"
)

compared to raja's

set_target_properties(RAJA::blt_hip_runtime PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "__HIP_PLATFORM_HCC__=1;__HIP_PLATFORM_AMD__=1"
  INTERFACE_INCLUDE_DIRECTORIES "/opt/rocm/include;/opt/rocm/include"
  INTERFACE_LINK_LIBRARIES "hip::amdhip64;/opt/rocm/llvm/lib/clang/14.0.0/lib/linux/libclang_rt.builtins-x86_64.a"
  INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "/opt/rocm/include"
)
...
set_target_properties(RAJA PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "RAJA::blt_hip;RAJA::blt_hip_runtime;RAJA::rocPRIM;camp;dl"
)

Reviewing camp's setup - when using blt targets here:

https://github.com/LLNL/camp/blob/3a7486edb8b1c50ce36ecace56384d32a1009e4f/CMakeLists.txt#L75

There needs to be additional logic to export them like:

https://github.com/LLNL/RAJA/blob/a60ce492c9b4a8d21bbc1d83630e5d1264083cec/cmake/SetupPackages.cmake#L107

or else folks downstream w/o blt won't be able to use cmake to compile when camp is a dependency.

@cyrush
Copy link
Member Author

cyrush commented Oct 17, 2022

resolved with changes in #987 and using camp 2022.03.2

@cyrush cyrush closed this as completed Oct 17, 2022
@cyrush cyrush added this to the 0.9.0 milestone Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant