Skip to content

Commit

Permalink
Fix torch_glow build on Mac OS X (pytorch#4241)
Browse files Browse the repository at this point in the history
Summary:
On Mac OS X, we install some third-party libraries with `brew` into `/usr/local`. Somehow, this system path in included as part of the dependency of some `lib` targets but previously torch_glow only includes a subset of those target hence missing the `/usr/local` system path. I haven't found out which specific target brings in the `/usr/local` path but w/e. The reason that CI works is probably because on Ubuntu, when we do `apt-get` it will install the files into `/usr` which probably is checked by default.

Documentation:

[Optional Fixes #issue]
Pull Request resolved: pytorch#4241

Test Plan: Please see a detailed explanation of how to fill out the fields in the relevant sections in PULL_REQUEST.md.

Differential Revision: D20212116

Pulled By: yinghai

fbshipit-source-id: f24c81469917d7e2ff90538c407ac80e46c27e8f
  • Loading branch information
Yinghai Lu authored and facebook-github-bot committed Mar 3, 2020
1 parent e1063b2 commit 14eb676
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
18 changes: 13 additions & 5 deletions torch_glow/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,27 @@ target_compile_options(PyTorchModelLoader
target_link_libraries(PyTorchModelLoader
PRIVATE
torch_cpu
c10
Support
HostManager
c10)
target_link_libraries(PyTorchModelLoader
PUBLIC
Backends
ExecutionContext
ExecutionEngine
Exporter
Graph
Importer)
HostManager
Importer
GraphOptimizer
Quantization
Runtime)

add_library(PyTorchFileLoader
PyTorchFileLoader.cpp)
target_compile_options(PyTorchFileLoader
PRIVATE
-frtti -fexceptions -DC10_USE_GLOG)
target_link_libraries(PyTorchFileLoader
PRIVATE
PUBLIC
PyTorchModelLoader)

pybind11_add_module(_torch_glow
Expand Down
9 changes: 2 additions & 7 deletions torch_glow/src/training/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ target_compile_options(TorchGlowTraining
PRIVATE
-frtti -fexceptions -DC10_USE_GLOG)
target_link_libraries(TorchGlowTraining
PRIVATE
Backends
PyTorchFileLoader
ExecutionEngine
Exporter
GraphOptimizer
Importer)
PUBLIC
PyTorchFileLoader)

target_include_directories(TorchGlowTraining PUBLIC
${TORCH_GLOW}/src
Expand Down

0 comments on commit 14eb676

Please sign in to comment.