Skip to content

Commit

Permalink
ROCtracer: Include as System library
Browse files Browse the repository at this point in the history
Because of GNU extensions in the roctracer include files for the legacy include.
But we should make this `-isystem` anyway to be robust for the future.

The 5.2 deprecated include file `<roctracer_ext.h>` throws warnings
because they rely on GNU extensions:
```
In file included from /opt/rocm/hip/../roctracer/include/ext/prof_protocol.h:27:
/opt/rocm/hip/../roctracer/include/ext/../../../include/roctracer/ext/prof_protocol.h:70:7: warning: anonymous structs are a GNU extension [-Wgnu-anonymous-struct]
      struct {
      ^
/opt/rocm/hip/../roctracer/include/ext/../../../include/roctracer/ext/prof_protocol.h:70:7: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
/opt/rocm/hip/../roctracer/include/ext/../../../include/roctracer/ext/prof_protocol.h:75:7: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
      struct {
      ^
/opt/rocm/hip/../roctracer/include/ext/../../../include/roctracer/ext/prof_protocol.h:82:7: warning: anonymous structs are a GNU extension [-Wgnu-anonymous-struct]
      struct {
      ^
/opt/rocm/hip/../roctracer/include/ext/../../../include/roctracer/ext/prof_protocol.h:86:7: warning: anonymous structs are a GNU extension [-Wgnu-anonymous-struct]
      struct {
      ^
/opt/rocm/hip/../roctracer/include/ext/../../../include/roctracer/ext/prof_protocol.h:90:7: warning: anonymous structs are a GNU extension [-Wgnu-anonymous-struct]
      struct {
      ^
/opt/rocm/hip/../roctracer/include/ext/../../../include/roctracer/ext/prof_protocol.h:82:7: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
      struct {
      ^
/opt/rocm/hip/../roctracer/include/ext/../../../include/roctracer/ext/prof_protocol.h:86:7: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
      struct {
      ^
/opt/rocm/hip/../roctracer/include/ext/../../../include/roctracer/ext/prof_protocol.h:90:7: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
      struct {
      ^
```
  • Loading branch information
ax3l committed Sep 14, 2022
1 parent f361617 commit 0a536cc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Tools/CMake/AMReXParallelBackends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,15 @@ if (AMReX_HIP)
if(AMReX_ROCTX)
# To be modernized in the future, please see:
# https://github.com/ROCm-Developer-Tools/roctracer/issues/56
target_include_directories(amrex PUBLIC ${HIP_PATH}/../roctracer/include ${HIP_PATH}/../rocprofiler/include)
target_link_libraries(amrex PUBLIC "-L${HIP_PATH}/../roctracer/lib/ -lroctracer64" "-L${HIP_PATH}/../roctracer/lib -lroctx64")
endif ()
target_include_directories(amrex SYSTEM PUBLIC
${HIP_PATH}/../roctracer/include
${HIP_PATH}/../rocprofiler/include
)
target_link_libraries(amrex PUBLIC
"-L${HIP_PATH}/../roctracer/lib -lroctracer64"
"-L${HIP_PATH}/../roctracer/lib -lroctx64"
)
endif()
target_link_libraries(amrex PUBLIC hip::hiprand roc::rocrand roc::rocprim)

# avoid forcing the rocm LLVM flags on a gfortran
Expand Down

0 comments on commit 0a536cc

Please sign in to comment.