pytorch/cmake/Modules
Alin Pahontu 21d77bcf80 added path to correct directory containing headers (#110063)
After make install the headers are placed in include/openblas/ folder instead of include/ folder. Updated FindOpenBLAS.cmake to make that change clear.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/110063
Approved by: https://github.com/Blackhex, https://github.com/kit1980
2023-10-04 21:56:36 +00:00
..
FindARM.cmake
FindAtlas.cmake Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
FindAVX.cmake add explicit vectorization for Half dtype on CPU (#96076) 2023-04-03 10:58:37 +00:00
FindBenchmark.cmake
FindBLAS.cmake Specify "Generic" BLAS library name. (#74269) 2022-06-20 18:44:54 +00:00
FindBLIS.cmake Adding a new include directory in BLIS search path (#58166) 2021-05-24 08:57:02 -07:00
FindCUB.cmake Update CMake and use native CUDA language support (#62445) 2021-10-11 09:05:48 -07:00
FindCUDAToolkit.cmake Use FindCUDAToolkit to find cuda dependencies (#82695) 2023-03-01 17:26:36 +00:00
FindCUSPARSELT.cmake Fix finding Intel MKL on Windows, as well as LAPACK, cuDNN and cuSPARSELt (#108040) 2023-09-08 14:41:00 +00:00
FindFFmpeg.cmake
FindFlexiBLAS.cmake Add FlexiBLAS build support per #64752 (#64815) 2021-10-28 11:28:00 -07:00
FindGloo.cmake
FindHiredis.cmake Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
FindITT.cmake Enable Intel® VTune™ Profiler's Instrumentation and Tracing Technology APIs (ITT) to PyTorch (#63289) 2022-07-13 13:50:15 +00:00
FindLAPACK.cmake Add FlexiBLAS build support per #64752 (#64815) 2021-10-28 11:28:00 -07:00
FindLevelDB.cmake
FindLMDB.cmake
FindMAGMA.cmake CMake: Clean up unused definitions (#69216) 2022-01-31 22:49:11 +00:00
FindMatlabMex.cmake
FindMKL.cmake Fix finding Intel MKL on Windows, as well as LAPACK, cuDNN and cuSPARSELt (#108040) 2023-09-08 14:41:00 +00:00
FindMKLDNN.cmake [ONEDNN][BC-breaking] update onednn from v2.7.3 to v3.1.1 (#97957) 2023-08-25 12:13:18 +00:00
FindNCCL.cmake
FindNuma.cmake Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
FindNumPy.cmake Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
FindOpenBLAS.cmake added path to correct directory containing headers (#110063) 2023-10-04 21:56:36 +00:00
FindOpenMP.cmake [Reland] Improve MKL related logic in FindOpenMP.cmake (#104224) 2023-09-02 07:55:11 +00:00
Findpybind11.cmake
FindRocksDB.cmake Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
FindSanitizer.cmake lower cmake version requirement in FindSanitizer.cmake (#97073) 2023-04-22 02:02:14 +00:00
FindSnappy.cmake Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
FindvecLib.cmake
FindVSX.cmake Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
FindZMQ.cmake
FindZVECTOR.cmake Reintroduce s390x SIMD support (#99057) 2023-04-15 00:24:44 +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.