pytorch/cmake/Modules
Joseph Macaranas 92381a5aa7 [ROCm] Custom OpenBLAS library name (#166333)
- TheRock build system for ROCm builds OpenBLAS from source and uses a custom name for the library.
- Following existing conventions in `FindOpenBLAS.cmake` to support finding a custom named version of OpenBLAS.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/166333
Approved by: https://github.com/jeffdaily
2025-10-27 22:13:05 +00:00
..
FindACL.cmake
FindAPL.cmake
FindARM.cmake [BE] fix typos in cmake/ (#156079) 2025-06-17 19:25:43 +00:00
FindAtlas.cmake
FindAVX.cmake
FindBenchmark.cmake
FindBLAS.cmake Check F2C BLAS for OpenBLAS and other vendors (#143846) 2025-07-01 05:56:24 +00:00
FindBLIS.cmake
FindCUB.cmake [1/N] Don't use CUDA.cmake module (#157188) 2025-07-08 03:05:35 +00:00
FindCUDAToolkit.cmake Revert "Use official CUDAToolkit module in CMake (#154595)" 2025-06-23 21:15:31 +00:00
FindCUDSS.cmake
FindCUSPARSELT.cmake
FindFlexiBLAS.cmake
FindGloo.cmake gloo: fix building system gloo with CUDA/HIP (#146637) 2025-08-06 22:56:31 +00:00
FindITT.cmake
FindLAPACK.cmake
FindMAGMA.cmake
FindMKL.cmake
FindMKLDNN.cmake [Intel GPU] Upgrade OneDNN XPU Tag to v3.9.1 (#161932) 2025-09-04 11:05:10 +00:00
FindNCCL.cmake [Binary-builds]Use System NCCL by default in CI/CD. (#152835) 2025-05-30 18:51:48 +00:00
FindNuma.cmake
FindOpenBLAS.cmake [ROCm] Custom OpenBLAS library name (#166333) 2025-10-27 22:13:05 +00:00
FindOpenMP.cmake
FindOpenTelemetryApi.cmake
Findpybind11.cmake
FindSanitizer.cmake
FindSYCLToolkit.cmake Remove torch XPU ABI=0 build logic for old compiler (#150095) 2025-06-06 13:13:19 +00:00
FindvecLib.cmake Improve PATH hints in FindvecLib.cmake (#165881) 2025-10-21 16:44:12 +00:00
FindVSX.cmake
FindZVECTOR.cmake
README.md

This folder contains various custom cmake modules for finding libraries and packages. Details about some of them are listed below.

FindOpenMP.cmake

This is modified from the file included in CMake 3.13 release, with the following changes:

  • Replace VERSION_GREATER_EQUAL with NOT ... VERSION_LESS as VERSION_GREATER_EQUAL is not supported in CMake 3.5 (our min supported version).

  • Update the separate_arguments commands to not use NATIVE_COMMAND which is not supported in CMake 3.5 (our min supported version).

  • Make it respect the QUIET flag so that, when it is set, try_compile failures are not reported.

  • For AppleClang compilers, use -Xpreprocessor instead of -Xclang as the later is not documented.

  • For AppleClang compilers, an extra flag option is tried, which is -Xpreprocessor -openmp -I${DIR_OF_omp_h}, where ${DIR_OF_omp_h} is a obtained using find_path on omp.h with brew's default include directory as a hint. Without this, the compiler will complain about missing headers as they are not natively included in Apple's LLVM.

  • For non-GNU compilers, whenever we try a candidate OpenMP flag, first try it with directly linking MKL's libomp if it has one. Otherwise, we may end up linking two libomps and end up with this nasty error:

    OMP: Error #15: Initializing libomp.dylib, but found libiomp5.dylib already
    initialized.
    
    OMP: Hint This means that multiple copies of the OpenMP runtime have been
    linked into the program. That is dangerous, since it can degrade performance
    or cause incorrect results. The best thing to do is to ensure that only a
    single OpenMP runtime is linked into the process, e.g. by avoiding static
    linking of the OpenMP runtime in any library. As an unsafe, unsupported,
    undocumented workaround you can set the environment variable
    KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but
    that may cause crashes or silently produce incorrect results. For more
    information, please see http://openmp.llvm.org/
    

    See NOTE [ Linking both MKL and OpenMP ] for details.