-
Notifications
You must be signed in to change notification settings - Fork 683
/
CMakeLists.txt
34 lines (28 loc) · 1011 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
if(DEFINED ENV{PYTORCH_DIR})
SET(PYTORCH_DIR $ENV{PYTORCH_DIR})
message(STATUS "Using PYTORCH_DIR from env")
endif()
if(NOT EXISTS "${PYTORCH_DIR}")
message(FATAL_ERROR "No PyTorch installation found")
endif()
message(STATUS "Using pytorch dir ${PYTORCH_DIR}")
link_directories(${PYTORCH_DIR}/lib)
pybind11_add_module(_torch_glow
binding.cpp
PyTorchModelLoader.cpp
CachingGraphRunner.cpp)
target_compile_options(_torch_glow PRIVATE -frtti -fexceptions)
target_link_libraries(_torch_glow
PRIVATE
torch
c10
Support
ExecutionEngine
Graph
Importer
Interpreter
Backends
pybind11)
target_include_directories(_torch_glow PUBLIC
${PYTORCH_DIR}/include
)