Skip to content

Commit

Permalink
misc/pytorch: fix packaging on non-amd64
Browse files Browse the repository at this point in the history
AVX gets built only on amd64.
  • Loading branch information
pkubaj committed Mar 9, 2023
1 parent e00aca7 commit b83abe2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion misc/pytorch/Makefile
Expand Up @@ -51,6 +51,14 @@ PYTHON_BUILD_DEPENDS= ${PYTHON_PY_DEPENDS} \
pybind11>0:devel/pybind11
PYTHON_RUN_DEPENDS= ${PYTHON_PY_DEPENDS}

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64"
PLIST_SUB+= AMD64=""
.else
PLIST_SUB+= AMD64="@comment "
.endif

post-patch:
# replace malloc.h -> stdlib.h in many places
@cd ${WRKSRC} && for f in $$(${GREP} -rl "include <malloc\.h>" * | ${GREP} -E "\.(c|cpp|h|hpp)$$"); do \
Expand All @@ -63,4 +71,4 @@ post-install:
# https://github.com/pytorch/pytorch/issues/24417
@${FIND} ${STAGEDIR} -type d -empty -delete

.include <bsd.port.mk>
.include <bsd.port.post.mk>
6 changes: 3 additions & 3 deletions misc/pytorch/pkg-plist
Expand Up @@ -8899,9 +8899,9 @@ include/torch/custom_class_detail.h
include/torch/extension.h
include/torch/library.h
include/torch/script.h
lib/libCaffe2_perfkernels_avx.a
lib/libCaffe2_perfkernels_avx2.a
lib/libCaffe2_perfkernels_avx512.a
%%AMD64%%lib/libCaffe2_perfkernels_avx.a
%%AMD64%%lib/libCaffe2_perfkernels_avx2.a
%%AMD64%%lib/libCaffe2_perfkernels_avx512.a
lib/libc10.so
lib/libclog.a
lib/libcpuinfo.a
Expand Down

0 comments on commit b83abe2

Please sign in to comment.