1
0
mirror of synced 2024-12-23 13:20:22 +01:00
TheChymera-overlay/sci-libs/pytorch/files/0005-Change-library-directory-according-to-CMake-build.patch

32 lines
1.1 KiB
Diff
Raw Normal View History

From 52019a3f395e5fa97b26d424152d91f73b400f8e Mon Sep 17 00:00:00 2001
From: Alexey Chernov <4ernov@gmail.com>
Date: Wed, 13 Nov 2019 23:44:12 +0300
Subject: [PATCH 5/5] Change library directory according to CMake build
Change `lib_path` in favour of out-of-tree CMake build
directory, so that all the C++ libraries be found.
---
setup.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index 60502b6add..cbced52192 100644
--- a/setup.py
+++ b/setup.py
@@ -234,9 +234,10 @@ else:
# Constant known variables used throughout this file
cwd = os.path.dirname(os.path.abspath(__file__))
-lib_path = os.path.join(cwd, "torch", "lib")
+cmake_build_dir = os.environ.get("CMAKE_BUILD_DIR", os.path.join(cwd, "build"))
+lib_path = os.path.join(cmake_build_dir, "lib")
third_party_path = os.path.join(cwd, "third_party")
-caffe2_build_dir = os.environ.get("CMAKE_BUILD_DIR", os.path.join(cwd, "build"))
+caffe2_build_dir = cmake_build_dir
# lib/pythonx.x/site-packages
rel_site_packages = distutils.sysconfig.get_python_lib(prefix='')
# full absolute path to the dir above
--
2.23.0