pytorch/cmake/Modules
Dmitry Rogozhkin 9f73c65b8f xpu: pass MAX_JOBS building xpu_mkldnn_proj (#126562)
mkldnn is quite big project and MAX_JOBS support is essential when building on a system with big number of cpus and limited memory.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/126562
Approved by: https://github.com/jgong5, https://github.com/guangyey, https://github.com/albanD
2024-05-30 12:10:33 +00:00
..
FindARM.cmake
FindAtlas.cmake
FindAVX.cmake [Build] Fix AVX detection logic (#122708) 2024-03-26 20:37:35 +00:00
FindBenchmark.cmake
FindBLAS.cmake
FindBLIS.cmake
FindCUB.cmake
FindCUDAToolkit.cmake
FindCUSPARSELT.cmake Fix finding Intel MKL on Windows, as well as LAPACK, cuDNN and cuSPARSELt (#108040) 2023-09-08 14:41:00 +00:00
FindFlexiBLAS.cmake
FindGloo.cmake
FindITT.cmake
FindLAPACK.cmake fix: unknown CMake command "check_function_exists" (#126165) 2024-05-14 20:54:06 +00:00
FindMAGMA.cmake
FindMatlabMex.cmake
FindMKL.cmake Revert "[Submodule] Remove deprecated USE_TBB option and TBB submodule (#127051)" 2024-05-30 01:16:57 +00:00
FindMKLDNN.cmake xpu: pass MAX_JOBS building xpu_mkldnn_proj (#126562) 2024-05-30 12:10:33 +00:00
FindNCCL.cmake
FindNuma.cmake
FindOpenBLAS.cmake added path to correct directory containing headers (#110063) 2023-10-04 21:56:36 +00:00
FindOpenMP.cmake
FindOpenTelemetryApi.cmake [rfc] opentelemetry in pytorch (#122999) 2024-04-21 15:20:21 +00:00
Findpybind11.cmake
FindSanitizer.cmake
FindSYCLToolkit.cmake [Intel GPU] oneDNN GPU GEMM support (#117202) 2024-04-17 23:06:38 +00:00
FindvecLib.cmake
FindVSX.cmake
FindZVECTOR.cmake s390x: use runtime detection for vectorization support (#123936) 2024-05-03 21:34:37 +00:00
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.