summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Jonglez <30461003+jonglezb@users.noreply.github.com>2021-01-25 22:09:56 +0100
committerGitHub <noreply@github.com>2021-01-25 22:09:56 +0100
commit7bed6a7077dcaed2b2400e2c437967124cc227ae (patch)
tree484b388575f635e59286c1ea54efec3b8cc72b4e
parentef2e1bc3f7fd13224359fc142032984d3b348c34 (diff)
downloadspack-7bed6a7077dcaed2b2400e2c437967124cc227ae.tar.gz
spack-7bed6a7077dcaed2b2400e2c437967124cc227ae.tar.bz2
spack-7bed6a7077dcaed2b2400e2c437967124cc227ae.tar.xz
spack-7bed6a7077dcaed2b2400e2c437967124cc227ae.zip
mxnet: Fix cuda build (#21267)
-rw-r--r--var/spack/repos/builtin/packages/mxnet/makefile-cuda-stub-1.6.patch13
-rw-r--r--var/spack/repos/builtin/packages/mxnet/makefile-cudnn-path-1.6.patch13
-rw-r--r--var/spack/repos/builtin/packages/mxnet/package.py3
3 files changed, 28 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/mxnet/makefile-cuda-stub-1.6.patch b/var/spack/repos/builtin/packages/mxnet/makefile-cuda-stub-1.6.patch
new file mode 100644
index 0000000000..fd93a244a9
--- /dev/null
+++ b/var/spack/repos/builtin/packages/mxnet/makefile-cuda-stub-1.6.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 4746cc434..335c79b64 100644
+--- a/Makefile
++++ b/Makefile
+@@ -518,7 +518,7 @@ ifeq ($(USE_CUDA), 1)
+ endif
+ # Make sure to add stubs as fallback in order to be able to build
+ # without full CUDA install (especially if run without nvidia-docker)
+- LDFLAGS += -L/usr/local/cuda/lib64/stubs
++ LDFLAGS += -L$(USE_CUDA_PATH)/lib64/stubs
+ ifeq ($(USE_NCCL), 1)
+ ifneq ($(USE_NCCL_PATH), NONE)
+ CFLAGS += -I$(USE_NCCL_PATH)/include
diff --git a/var/spack/repos/builtin/packages/mxnet/makefile-cudnn-path-1.6.patch b/var/spack/repos/builtin/packages/mxnet/makefile-cudnn-path-1.6.patch
new file mode 100644
index 0000000000..8ae19440ad
--- /dev/null
+++ b/var/spack/repos/builtin/packages/mxnet/makefile-cudnn-path-1.6.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 4746cc434..e738fc53f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -509,7 +509,7 @@ LIB_DEP += $(DMLC_CORE)/libdmlc.a $(NNVM_PATH)/lib/libnnvm.a
+ ALL_DEP = $(OBJ) $(EXTRA_OBJ) $(PLUGIN_OBJ) $(LIB_DEP)
+
+ ifeq ($(USE_CUDA), 1)
+- CFLAGS += -I$(ROOTDIR)/3rdparty/nvidia_cub
++ CFLAGS += -I$(CUB_INCLUDE) -I$(CUDNN_PATH)/include
+ ALL_DEP += $(CUOBJ) $(EXTRA_CUOBJ) $(PLUGIN_CUOBJ)
+ LDFLAGS += -lcufft
+ ifeq ($(ENABLE_CUDA_RTC), 1)
diff --git a/var/spack/repos/builtin/packages/mxnet/package.py b/var/spack/repos/builtin/packages/mxnet/package.py
index 2917888e0e..6f42d78f50 100644
--- a/var/spack/repos/builtin/packages/mxnet/package.py
+++ b/var/spack/repos/builtin/packages/mxnet/package.py
@@ -44,8 +44,9 @@ class Mxnet(MakefilePackage):
depends_on('py-numpy@1.16:', type=('build', 'run'), when='@1.6.0 +python')
extends('python', when='+python')
- patch('makefile.patch', when='@0.10:0.11')
patch('makefile.opencv.patch', when='@1.6.0')
+ patch('makefile-cudnn-path-1.6.patch', when='@1.6.0')
+ patch('makefile-cuda-stub-1.6.patch', when='@1.6.0')
patch('parallell_shuffle.patch', when='@1.6.0')
def build(self, spec, prefix):