Skip to content

Commit ab3d85c

Browse files
zdevitosoumith
authored andcommitted
add build commands for ATen
1 parent e58e27c commit ab3d85c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ def run(self):
245245
tmp_install_path + "/include/TH",
246246
tmp_install_path + "/include/THPP",
247247
tmp_install_path + "/include/THNN",
248+
tmp_install_path + "/include/ATen",
248249
]
249250

250251
library_dirs.append(lib_path)
@@ -257,6 +258,7 @@ def run(self):
257258
THNN_LIB = os.path.join(lib_path, 'libTHNN.so.1')
258259
THCUNN_LIB = os.path.join(lib_path, 'libTHCUNN.so.1')
259260
THPP_LIB = os.path.join(lib_path, 'libTHPP.so.1')
261+
ATEN_LIB = os.path.join(lib_path, 'libATen.so.1')
260262
THD_LIB = os.path.join(lib_path, 'libTHD.so.1')
261263
NCCL_LIB = os.path.join(lib_path, 'libnccl.so.1')
262264
if platform.system() == 'Darwin':
@@ -267,6 +269,7 @@ def run(self):
267269
THNN_LIB = os.path.join(lib_path, 'libTHNN.1.dylib')
268270
THCUNN_LIB = os.path.join(lib_path, 'libTHCUNN.1.dylib')
269271
THPP_LIB = os.path.join(lib_path, 'libTHPP.1.dylib')
272+
ATEN_LIB = os.path.join(lib_path, 'libATen.1.dylib')
270273
THD_LIB = os.path.join(lib_path, 'libTHD.1.dylib')
271274
NCCL_LIB = os.path.join(lib_path, 'libnccl.1.dylib')
272275

@@ -275,7 +278,7 @@ def run(self):
275278

276279
main_compile_args = ['-D_THP_CORE']
277280
main_libraries = ['shm']
278-
main_link_args = [TH_LIB, THS_LIB, THPP_LIB, THNN_LIB]
281+
main_link_args = [TH_LIB, THS_LIB, THPP_LIB, THNN_LIB, ATEN_LIB]
279282
main_sources = [
280283
"torch/csrc/PtrWrapper.cpp",
281284
"torch/csrc/Module.cpp",

torch/lib/build_all.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ INSTALL_DIR="$(pwd)/tmp_install"
3131
C_FLAGS=" -DTH_INDEX_BASE=0 -I$INSTALL_DIR/include \
3232
-I$INSTALL_DIR/include/TH -I$INSTALL_DIR/include/THC \
3333
-I$INSTALL_DIR/include/THS -I$INSTALL_DIR/include/THCS \
34-
-I$INSTALL_DIR/include/THPP "
34+
-I$INSTALL_DIR/include/THPP -I$INSTALL_DIR/include/THNN \
35+
-I$INSTALL_DIR/include/THCUNN"
3536
LDFLAGS="-L$INSTALL_DIR/lib "
3637
LD_POSTFIX=".so.1"
3738
LD_POSTFIX_UNVERSIONED=".so"
@@ -66,6 +67,9 @@ function build() {
6667
-DTH_LIB_PATH="$INSTALL_DIR/lib" \
6768
-DTH_LIBRARIES="$INSTALL_DIR/lib/libTH$LD_POSTFIX" \
6869
-DTHPP_LIBRARIES="$INSTALL_DIR/lib/libTHPP$LD_POSTFIX" \
70+
-DATEN_LIBRARIES="$INSTALL_DIR/lib/libATen$LD_POSTFIX" \
71+
-DTHNN_LIBRARIES="$INSTALL_DIR/lib/libTHNN$LD_POSTFIX" \
72+
-DTHCUNN_LIBRARIES="$INSTALL_DIR/lib/libTHCUNN$LD_POSTFIX" \
6973
-DTHS_LIBRARIES="$INSTALL_DIR/lib/libTHS$LD_POSTFIX" \
7074
-DTHC_LIBRARIES="$INSTALL_DIR/lib/libTHC$LD_POSTFIX" \
7175
-DTHCS_LIBRARIES="$INSTALL_DIR/lib/libTHCS$LD_POSTFIX" \
@@ -135,6 +139,7 @@ build THPP
135139
# The shared memory manager depends on TH
136140
CPP_FLAGS=" -std=c++11 "
137141
build libshm
142+
build ATen
138143

139144
# THD, gloo have dependencies on Torch, CUDA, NCCL etc.
140145
if [[ $WITH_DISTRIBUTED -eq 1 ]]; then

0 commit comments

Comments
 (0)