Skip to content

Add Clang guards around usage of openmp config#1050

Merged
estewart08 merged 1 commit into
ROCm:developfrom
estewart08:find-openmp-cleanup
Jul 18, 2025
Merged

Add Clang guards around usage of openmp config#1050
estewart08 merged 1 commit into
ROCm:developfrom
estewart08:find-openmp-cleanup

Conversation

@estewart08
Copy link
Copy Markdown
Contributor

@estewart08 estewart08 commented Jul 17, 2025

This fixes a gcc issue where clang headers are being brought in by the openmp-config.

Additional cleanup:
Remove unnecessary options added to COMMON_LINK_LIBS. If the openmp config is not found then OpenMP::OpenMP_CXX will be the fallback for both gcc and clang.

This fixes a gcc issue where clang headers are being brought in by
the openmp-config.

Additional cleanup:
Remove unnecessary options added to COMMON_LINK_LIBS. If the openmp
config is not found then OpenMP::OpenMP_CXX will be the fallback for
both gcc and clang.
Copy link
Copy Markdown
Contributor

@TorreZuk TorreZuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-- Could NOT find OpenMP (missing: OpenMP_DIR)
-- Found OpenMP_CXX: -fopenmp=libomp (found version "5.1")
-- Found OpenMP_Fortran: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "5.1")
-- CLIENT COMMON_DEFINES: HIPBLAS_BFLOAT16_CLASS;ROCM_USE_FLOAT16;HIPBLAS_NO_DEPRECATED_WARNINGS
-- CLIENT COMMON CXX_OPTIONS:
-- CLIENT COMMON LINK: OpenMP::OpenMP_CXX;Threads::Threads

and I see it link against libomp140.x86_64.dll so presume this works if linux pipelines pass with older mainline and you did gcc and clang test with latest clang OMP config?

@estewart08
Copy link
Copy Markdown
Contributor Author

With the new openmp-config.cmake present:

Clang:
-- Found openmp-config.cmake at /opt/rocm/llvm/lib/cmake/openmp
-- CLIENT COMMON_DEFINES: HIPBLAS_BFLOAT16_CLASS;ROCM_USE_FLOAT16;HIPBLAS_NO_DEPRECATED_WARNINGS
-- CLIENT COMMON CXX_OPTIONS:
-- CLIENT COMMON LINK: OpenMP::omp;Threads::Threads

hipblas-bench link shows: /opt/rocm/llvm/lib/libomp.so

GCC:
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP_Fortran: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- CLIENT COMMON_DEFINES: HIPBLAS_BFLOAT16_CLASS;ROCM_USE_FLOAT16;HIPBLAS_NO_DEPRECATED_WARNINGS
-- CLIENT COMMON CXX_OPTIONS:
-- CLIENT COMMON LINK: OpenMP::OpenMP_CXX;Threads::Threads

hipblas-bench link shows: /usr/lib/gcc/x86_64-linux-gnu/11/libgomp.so

Simulated older ROCm building newer hipBLAS by removing openmp config:

Clang:
-- Could NOT find OpenMP (missing: OpenMP_DIR)
-- Found OpenMP_CXX: -fopenmp=libomp
-- Found OpenMP_Fortran: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- CLIENT COMMON_DEFINES: HIPBLAS_BFLOAT16_CLASS;ROCM_USE_FLOAT16;HIPBLAS_NO_DEPRECATED_WARNINGS
-- CLIENT COMMON CXX_OPTIONS:
-- CLIENT COMMON LINK: OpenMP::OpenMP_CXX;Threads::Threads

hipblas-bench link shows: /opt/rocm-7.0.0/lib/llvm/lib/libomp.so

GCC:
-- Could NOT find OpenMP (missing: OpenMP_DIR)
-- Found OpenMP_CXX: -fopenmp=libomp
-- Found OpenMP_Fortran: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- CLIENT COMMON_DEFINES: HIPBLAS_BFLOAT16_CLASS;ROCM_USE_FLOAT16;HIPBLAS_NO_DEPRECATED_WARNINGS
-- CLIENT COMMON CXX_OPTIONS:
-- CLIENT COMMON LINK: OpenMP::OpenMP_CXX;Threads::Threads

hipblas-bench link shows /usr/lib/gcc/x86_64-linux-gnu/11/libgomp.so

@TorreZuk
Copy link
Copy Markdown
Contributor

Okay with my windows testing passed I think this should be fine to merge

@estewart08 estewart08 merged commit 4639103 into ROCm:develop Jul 18, 2025
12 of 13 checks passed
TorreZuk pushed a commit to TorreZuk/hipBLAS that referenced this pull request Jul 18, 2025
This fixes a gcc issue where clang headers are being brought in by
the openmp-config.

Additional cleanup:
Remove unnecessary options added to COMMON_LINK_LIBS. If the openmp
config is not found then OpenMP::OpenMP_CXX will be the fallback for
both gcc and clang.

(cherry picked from commit 4639103)
TorreZuk pushed a commit to TorreZuk/hipBLAS that referenced this pull request Jul 18, 2025
This fixes a gcc issue where clang headers are being brought in by
the openmp-config.

Additional cleanup:
Remove unnecessary options added to COMMON_LINK_LIBS. If the openmp
config is not found then OpenMP::OpenMP_CXX will be the fallback for
both gcc and clang.

(cherry picked from commit 4639103)
pradeepk31 pushed a commit that referenced this pull request Jul 24, 2025
This fixes a gcc issue where clang headers are being brought in by
the openmp-config.

Additional cleanup:
Remove unnecessary options added to COMMON_LINK_LIBS. If the openmp
config is not found then OpenMP::OpenMP_CXX will be the fallback for
both gcc and clang.
assistant-librarian Bot pushed a commit that referenced this pull request Jul 29, 2025
[hipBLAS] Add Clang guards around usage of openmp config
 (#1050) (#832)

This fixes a gcc issue where clang headers are being brought in by the
openmp-config.

Additional cleanup:
Remove unnecessary options added to COMMON_LINK_LIBS. If the openmp
config is not found then OpenMP::OpenMP_CXX will be the fallback for
both gcc and clang.

[ROCm/hipBLAS commit: 4639103]

This patch is dependent on the Ubuntu 24.04 docker file being updated to
use AOCL 4.2 instead of 4.0.

Co-authored-by: Torre Zuk <42548444+TorreZuk@users.noreply.github.com>
ammallya pushed a commit that referenced this pull request Oct 28, 2025
This fixes a gcc issue where clang headers are being brought in by
the openmp-config.

Additional cleanup:
Remove unnecessary options added to COMMON_LINK_LIBS. If the openmp
config is not found then OpenMP::OpenMP_CXX will be the fallback for
both gcc and clang.

[ROCm/hipBLAS commit: 4639103]
ammallya added a commit that referenced this pull request Oct 28, 2025
Add Clang guards around usage of openmp config (#1050)
Develop branch for release after ROCm 7.0 (#1022)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants