aboutsummaryrefslogtreecommitdiff
path: root/libraries/pytorch
diff options
context:
space:
mode:
authorJohannes Schoepfer <slackbuilds@schoepfer.info>2024-06-08 00:46:19 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-06-08 08:00:20 +0700
commit54f0df6951ac9a1cab0b6e39061d0a9bdae0e131 (patch)
treed268acb670041b49eb49caf2f8a29b64d46ed0cc /libraries/pytorch
parenta367bdb02d55139e034647471c8fb826c176dc7e (diff)
libraries/pytorch: Update script.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries/pytorch')
-rw-r--r--libraries/pytorch/README6
-rw-r--r--libraries/pytorch/pytorch.SlackBuild9
-rw-r--r--libraries/pytorch/pytorch.info2
3 files changed, 12 insertions, 5 deletions
diff --git a/libraries/pytorch/README b/libraries/pytorch/README
index a27962167abdd..34bcd6aac5e7e 100644
--- a/libraries/pytorch/README
+++ b/libraries/pytorch/README
@@ -1,3 +1,7 @@
Deep neural networks built on a tape-based autograd system.
-This package is a library build, supporting CPU(not GPU).
+CUDA(nvidia GPU) support is untested, but might be picked up
+at buildtime if the environment is present.
+
+Optional autodetected dependencies:
+OpenBLAS || blas
diff --git a/libraries/pytorch/pytorch.SlackBuild b/libraries/pytorch/pytorch.SlackBuild
index c0bffe556f3d8..d44919ffa282d 100644
--- a/libraries/pytorch/pytorch.SlackBuild
+++ b/libraries/pytorch/pytorch.SlackBuild
@@ -90,15 +90,13 @@ sed -i "/Werror=return-type/d" CMakeLists.txt
# This seems harmless as these get recompiled again locally, but it slows down the building process.
# See https://github.com/icecc/icecream/issues/336
-unshare -n python3 setup.py build --cmake-only
-
cd build
unshare -n cmake \
-G Ninja \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_CXX_STANDARD=17 \
+ -DCMAKE_INSTALL_PREFIX="/usr" \
-DLIBSHM_INSTALL_LIB_SUBDIR="lib$LIBDIRSUFFIX" \
-DTORCH_INSTALL_LIB_DIR="lib$LIBDIRSUFFIX" \
-DPYTHON_EXECUTABLE=$(which python3) \
@@ -120,6 +118,11 @@ cd build
cd ..
python3 setup.py install --root=$PKG
+SITE="$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')"
+mkdir -p $PKG/$SITE/torch/{bin,lib}
+BIN=torch_shm_manager; ln -s /usr/bin/$BIN $PKG/$SITE/torch/bin/$BIN
+LIB=libtorch_global_deps.so; ln -s /usr/lib$LIBDIRSUFFIX/$LIB $PKG/$SITE/torch/lib/$LIB
+
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
diff --git a/libraries/pytorch/pytorch.info b/libraries/pytorch/pytorch.info
index 0b01b9255a896..60d772b991231 100644
--- a/libraries/pytorch/pytorch.info
+++ b/libraries/pytorch/pytorch.info
@@ -7,6 +7,6 @@ DOWNLOAD_x86_64="https://github.com/pytorch/pytorch/releases/download/v2.3.0/pyt
https://pypi.io/packages/source/s/six/six-1.11.0.tar.gz"
MD5SUM_x86_64="786047d07da744410eb41493a1cd0687 \
d12789f9baf7e9fb2524c0c64f1773f8"
-REQUIRES="oneTBB protobuf3 OpenBLAS typing-extensions"
+REQUIRES="protobuf3 typing-extensions"
MAINTAINER="Johannes Schoepfer"
EMAIL="slackbuilds@schoepfer.info"