Lines Matching +full:cmake +full:- +full:ext

5 #     build with -O0 and -g (debug symbols)
8 # build with optimizations and -g (debug symbols)
23 # default behavior of autogoo and cmake build systems.)
32 # build CUDA kernels with -lineinfo --source-in-ptx. Note that
67 # MKL-DNN threading mode: TBB or OMP (default)
70 # Prefer to link with MKL statically - Unix only
90 # disables use of system-wide nccl (we will use our submoduled
113 # specify the version of PyTorch, rather than the hard-coded version
127 # specify a namespace for ONNX built here rather than the hard-coded
147 # /usr/local/cuda-x.y
178 # ATen parallel backend to use for intra- and inter-op parallelism
180 # OMP - use OpenMP for intra-op and native backend for inter-op tasks
181 # NATIVE - use native thread pool for both intra- and inter-op tasks
184 # Use system-provided libraries to satisfy the build dependencies.
185 # When turned on, the following cmake variables will be toggled as well:
193 # Uses prioritized text form cmake/prioritized_text.txt for LD
207 "32-bit Windows Python runtime is not supported. Please switch to 64-bit Python."
209 sys.exit(-1)
223 sys.exit(-1)
243 from tools.setup_helpers.cmake import CMake
255 file_path = loader.get_filename() # type: ignore[attr-defined]
286 if arg == "--cmake":
289 if arg == "--cmake-only":
290 # Stop once cmake terminates. Leave users a chance to adjust build
297 if arg == "--":
300 if arg == "-q" or arg == "--quiet":
317 # Make distutils respect --quiet too
326 # CMAKE: full path to python library
355 report(f"Building wheel {package_name}-{version}")
357 cmake = CMake() variable
386 report("Did you run 'git submodule update --init --recursive'?")
400 print(" --- Trying to initialize submodules")
403 ["git", "submodule", "update", "--init", "--recursive"], cwd=cwd
406 print(f" --- Submodule initialization took {end - start:.2f} sec")
408 print(" --- Submodule initalization failed")
409 print("Please run:\n\tgit submodule update --init --recursive")
468 report("-- Building version " + version)
479 cmake=cmake,
484 'Finished running cmake. Run "ccmake build" or '
485 '"cmake-gui build" to adjust build options and '
499 "third_party/valgrind-headers/callgrind.h",
500 "third_party/valgrind-headers/valgrind.h",
541 subprocess.check_output(["otool", "-l", libtorch_cpu_path])
542 .decode("utf-8")
550 libs.append(lib_name.split(" ", 1)[1].rsplit("(", 1)[0][:-1])
555 rpaths.append(rpath.split(" ", 1)[1].rsplit("(", 1)[0][:-1])
578 "-rpath",
590 for include_dir in [f[2:] for f in omp_cflags.split(" ") if f.startswith("-I")]:
601 cmake_cache_vars = defaultdict(lambda: False, cmake.get_cmake_cache_variables())
603 report("-- Building with NumPy bindings")
605 report("-- NumPy not found")
608 "-- Detected cuDNN at "
614 report("-- Not using cuDNN")
616 report("-- Detected CUDA at " + cmake_cache_vars["CUDA_TOOLKIT_ROOT_DIR"])
618 report("-- Not using CUDA")
620 report("-- Detected XPU runtime at " + cmake_cache_vars["SYCL_LIBRARY_DIR"])
622 report("-- Not using XPU")
624 report("-- Using MKLDNN")
626 report("-- Using Compute Library for the Arm architecture with MKLDNN")
629 "-- Not using Compute Library for the Arm architecture with MKLDNN"
632 report("-- Using CBLAS in MKLDNN")
634 report("-- Not using CBLAS in MKLDNN")
636 report("-- Not using MKLDNN")
639 "-- Using system provided NCCL library at {}, {}".format(
645 report("-- Building NCCL library")
647 report("-- Not using NCCL")
650 report("-- Building without distributed package")
652 report("-- Building with distributed package: ")
654 " -- USE_TENSORPIPE={}".format(cmake_cache_vars["USE_TENSORPIPE"])
656 report(" -- USE_GLOO={}".format(cmake_cache_vars["USE_GLOO"]))
657 report(" -- USE_MPI={}".format(cmake_cache_vars["USE_OPENMPI"]))
659 report("-- Building without distributed package")
662 "-- Using static dispatch with backend {}".format(
667 report("-- Using lightweight dispatch")
669 report("-- Building Executorch")
672 report("-- Using ITT")
674 report("-- Not using ITT")
676 # Do not use clang to compile extensions if `-fstack-clash-protection` is defined
681 and "-fstack-clash-protection" in c_flags
686 # It's an old-style class in Python 2.7...
697 lib_filename = ".".join(ext_filename.split(".")[:-1]) + ".lib"
720 # tmp_install/lib/pythonM.m/site-packages/caffe2/python/
735 ext = self.extensions[i]
736 if ext.name not in caffe2_pybind_exts:
739 fullname = self.get_ext_fullname(ext.name)
741 report(f"\nCopying extension {ext.name}")
754 report(f"Copying {ext.name} from {src} to {dst}")
762 for i, ext in enumerate(self.extensions):
763 if ext.name != "functorch._C":
765 fullname = self.get_ext_fullname(ext.name)
771 report(f"Copying {ext.name} from {src} to {dst}")
815 LICENSE is the main PyTorch license, LICENSES_BUNDLED.txt is auto-generated
904 pat = re.compile(r"^#( BEGIN NOT-CLEAN-FILES )?")
931 return defaultdict(lambda: False, cmake.get_cmake_cache_variables())
964 "-Wall",
965 "-Wextra",
966 "-Wno-strict-overflow",
967 "-Wno-unused-parameter",
968 "-Wno-missing-field-initializers",
969 "-Wno-unknown-pragmas",
970 # Python 2.6 requires -fno-strict-aliasing, see
971 # http://legacy.python.org/dev/peps/pep-3123/
973 "-fno-strict-aliasing",
993 extra_compile_args += ["-O0", "-g"]
994 extra_link_args += ["-O0", "-g"]
1001 extra_compile_args += ["-g"]
1002 extra_link_args += ["-g"]
1015 # Cross-compile for M1
1023 ["xcrun", "--show-sdk-path", "--sdk", "macosx"]
1025 .decode("utf-8")
1029 "-arch",
1031 "-isysroot",
1034 extra_link_args += ["-arch", macos_target_arch]
1038 return ["-Wl,-rpath,@loader_path/" + path]
1042 return ["-Wl,-rpath,$ORIGIN/" + path]
1069 # These extensions are built by cmake and copied manually in build_extensions()
1098 "convert-caffe2-to-onnx = caffe2.python.onnx.bin.conversion:caffe2_to_onnx",
1099 "convert-onnx-to-caffe2 = caffe2.python.onnx.bin.conversion:onnx_to_caffe2",
1123 To force cmake to re-generate native build files (off by default):
1124 $ python setup.py develop --cmake
1131 print("-" * (size + 2))
1133 print("|{}{}|".format(l, " " * (size - len(l))))
1134 print("-" * (size + 2))
1144 "typing-extensions>=4.8.0",
1170 filein="cmake/prioritized_text.txt", fout="cmake/linker_script.ld"
1172 linker_script_path = os.path.abspath("cmake/linker_script.ld")
1173 os.environ["LDFLAGS"] = os.getenv("LDFLAGS", "") + f" -T{linker_script_path}"
1175 os.getenv("CFLAGS", "") + " -ffunction-sections -fdata-sections"
1178 os.getenv("CXXFLAGS", "") + " -ffunction-sections -fdata-sections"
1182 # building deps and setup. We need to set values so `--help` works.
1207 "opt-einsum": ["opt-einsum>=3.3"],
1211 with open(os.path.join(cwd, "README.md"), encoding="utf-8") as f:
1380 "share/cmake/ATen/*.cmake",
1381 "share/cmake/Caffe2/*.cmake",
1382 "share/cmake/Caffe2/public/*.cmake",
1383 "share/cmake/Caffe2/Modules_CUDA_fix/*.cmake",
1384 "share/cmake/Caffe2/Modules_CUDA_fix/upstream/*.cmake",
1385 "share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/*.cmake",
1386 "share/cmake/Gloo/*.cmake",
1387 "share/cmake/Tensorpipe/*.cmake",
1388 "share/cmake/Torch/*.cmake",
1492 "Development Status :: 5 - Production/Stable",
1510 license="BSD-3-Clause",