[lua-torch-cutorch] 07/08: debian: update

Zhou Mo cdluminate-guest at moszumanska.debian.org
Tue Feb 7 04:09:16 UTC 2017


This is an automated email from the git hooks/post-receive script.

cdluminate-guest pushed a commit to branch master
in repository lua-torch-cutorch.

commit 962bc67fb593fdfd12da2141f8a180e0c241d3a4
Author: Zhou Mo <cdluminate at gmail.com>
Date:   Mon Feb 6 06:17:37 2017 +0000

    debian: update
---
 debian/control |  5 +++++
 debian/rules   | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 3a36b2b..04906b1 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,11 @@ Maintainer: Zhou Mo <cdluminate at gmail.com>
 Build-Depends: debhelper (>= 10),
                cmake,
                dh-lua,
+               luajit,
                nvidia-cuda-toolkit,
+               clang-3.8,
+               lua-torch-torch7,
+               libtorch-th-dev,
 Standards-Version: 3.9.8
 Homepage: https://github.com/torch/cutorch
 
@@ -13,6 +17,7 @@ Package: lua-torch-cutorch
 Architecture: amd64 ppc64el
 Multi-Arch: same
 Depends: ${misc:Depends}, ${shlibs:Depends},
+         luajit | lua5.1,
          lua-torch-torch7-dev,
          libtorch-th-dev,
          libtorch-luat-dev,
diff --git a/debian/rules b/debian/rules
index 2d33f6a..77bfca5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,4 +1,59 @@
 #!/usr/bin/make -f
+export DEB_BUILD_MAINT_OPTIONS = hardending=+all
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+DEB_HOST_MULTIARCH=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+LUA51=/usr/bin/lua5.1
+LUAJIT=/usr/bin/luajit
+
+# compile CUDA application with clang
+export CC=clang-3.8
+export CXX=clang++-3.8
+
+TORCH_FLAGS_5_1= \
+ -DLUA=/usr/bin/lua5.1 \
+ -DLUA_INCDIR=/usr/include/lua5.1 \
+ -DLUA_LIBDIR=/usr/lib \
+ -DLUA_BINDIR=/usr/bin \
+ -DLIBDIR=/usr/lib \
+ -DLUALIB=lua5.1 \
+ -DTorch_INSTALL_BIN_SUBDIR=bin/ \
+ -DTorch_INSTALL_LIB_SUBDIR=lib/$(DEB_HOST_MULTIARCH)/ \
+ -DTorch_INSTALL_INCLUDE_SUBDIR=include/ \
+ -DCMAKE_VERBOSE_MAKEFILE=ON \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_C_FLAGS="-I/usr/include/TH -g" \
+ -DCMAKE_CXX_FLAGS="-I/usr/include/TH -g" \
+ -DTorch_FOUND=ON
 
 %:
-	dh $@
+	dh $@ --buildsystem=lua --with lua
+
+override_dh_auto_configure:
+	ln -s . cutorch
+	# configure libTHC.so
+	dh_auto_configure --buildsystem=cmake --builddirectory=THC.build -- \
+		../lib/THC ${TORCH_FLAGS_5_1} \
+		-DTorch_INSTALL_CMAKE_SUBDIR=/usr/share/libtorch-thc-dev/
+	# configure the rest lua stuff
+	dh_auto_configure --buildsystem=lua
+	# generate TensorMath.c (equivalent to `ADD_TORCH_WRAP(cudatensormathwrap TensorMath.lua)`)
+	$(LUA51) TensorMath.lua TensorMath.c
+
+override_dh_auto_build:
+	# build libTHC.so
+	dh_auto_build --buildsystem=cmake -B THC.build/ --parallel
+	# build the rest lua stuff
+	dh_auto_build --buildsystem=lua
+
+override_dh_auto_install:
+	# install libTHC.so
+	dh_auto_install --buildsystem=cmake -B THC.build
+	# install the rest lua stuff
+	dh_auto_install --buildsystem=lua
+
+override_dh_auto_clean:
+	-$(RM) -rf THC.build cutorch
+	-$(RM) TensorMath.c
+	dh_auto_clean

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/lua-torch-cutorch.git



More information about the debian-science-commits mailing list