From 0df6ee05075c65ba9725de5911bd8c4bc1bacb4c Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 13 Oct 2022 12:44:14 -0500 Subject: [PATCH 01/27] Downlaod all the sources. --- recipe/meta.yaml | 91 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 9 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 2a04aa4..02459cd 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,20 +1,93 @@ -{% set mxnet_version="1.5.1" %} -{% set hash_value="b182c301eb0232aa84440b5b632b4d357a2d6d711f7e7b56133504283d0d19e7" %} +{% set mxnet_version="1.9.1" %} +{% set hash_value="cef85932e2b3caead235008473d29512b99581c07da3d10703ff5b6c1fb5bd50" %} {% set build_number="0" %} +{% set dlpack_git_hash = "3efc489b55385936531a06ff83425b719387ec63" %} +{% set dlpack_sha_hash = "b59586ce69bcf3efdbf3cf4803fadfeaae4948044e2b8d89cf912194cf28f233" %} + +{% set dmlccore_git_hash = "5df8305fe699d3b503d10c60a231ab0223142407" %} +{% set dmlccore_sha_hash = "a8046f752f36005564d2924b4b6f73e1aea3cce7ff10f9e19d99ad6a22a045b2" %} + +{% set googletest_git_hash = "eb9225ce361affe561592e0912320b9db84985d0" %} +{% set googletest_sha_hash = "a4cb4b0c3ebb191b798594aca674ad47eee255dcb4c26885cf7f49777703484f" %} + +{% set intgemm_git_hash = "8f28282c3bd854922da638024d2659be52e892e9" %} +{% set intgemm_sha_hash = "bc8bd8015613a13747eb769876385ec53e8c1ea7ae3f8414521dc53b8fcdfc65" %} + +{% set nvidia_cub_git_hash = "0158fa19f28619886232defd412433974af89611" %} +{% set nvidia_cub_sha_hash = "43424c4c17a997d1d730c89ec14688671245de7941e02b388d7d3df6ea53777a" %} + +{% set onednn_git_hash = "58be3660fb57c4c4a3d306730e849237d1271572" %} +{% set onednn_sha_hash = "0d170c30ea0a35fbe48008e0e7e729d0993720c14f320ce8e73a891ae176eec4" %} + +{% set onnxtensorrt_git_hash = "8b6144a88534e6fd15b6ef5457f1c1a1fc153939" %} +{% set onnxtensorrt_sha_hash = "4b51c2784ff119a4db0baec8f332a1364c6c25360c1c190271aaa20109fd6028" %} + +{% set pslite_git_hash = "34fd45cae457d59850fdcb2066467778d0673f21" %} +{% set pslite_sha_hash = "ec5d5baab8bbf0c3983ad5f18d7f963f15ae7cd4d154ec204b03c1dceccf209b" %} + +{% set tvm_git_hash = "efdac9439506d1de5eec91ecc795982c78e41909" %} +{% set tvm_sha_hash = "656c38d66baeab885b0212602148bb55ad3cf7d22f52ded8ece53f88e103a2f5" %} + + package: name: mxnet-suite version: {{ mxnet_version }} source: - url: https://github.com/apache/incubator-mxnet/releases/download/{{ mxnet_version }}/apache-mxnet-src-{{ mxnet_version }}-incubating.tar.gz - sha256: {{ hash_value }} - patches: - - patches/0001-Relax-constraints-on-requests-make-graphviz-optional.patch - - patches/0001-use-external-mklml-and-mkldnn-libraries.patch # [mxnet_blas_impl == 'mkl'] - - patches/0002-conda-unbundle-libmxnet-DSO.patch - - patches/0002-cpu-fix.patch + - url: https://github.com/apache/incubator-mxnet/archive/refs/tags/{{ mxnet_version }}.tar.gz + sha256: {{ hash_value }} + patches: +# - patches/0001-make-graphviz-optional.patch +# - patches/0002-conda-unbundle-libmxnet-DSO.patch + # - patches/0002-cpu-fix.patch + + - url: https://github.com/dmlc/dlpack/archive/{{ dlpack_git_hash }}.tar.gz + fn: dlpack_{{ dlpack_git_hash }}.tar.gz + sha256: {{ dlpack_sha_hash }} + folder: 3rdparty/dlpack + + - url: https://github.com/dmlc/dmlc-core/archive/{{ dmlccore_git_hash }}.tar.gz + fn: dmlc-core_{{ dmlccore_git_hash }} + sha256: {{ dmlccore_sha_hash }} + folder: 3rdparty/dmlc-core + + - url: https://github.com/google/googletest/archive/{{ googletest_git_hash }}.tar.gz + fn: googletest_{{ googletest_git_hash }} + sha256: {{ googletest_sha_hash }} + folder: 3rdparty/googletest + + - url: https://github.com/kpu/intgemm/archive/{{ intgemm_git_hash }}.tar.gz + fn: intgemm_{{ intgemm_git_hash }} + sha256: {{ intgemm_sha_hash }} + folder: 3rdparty/intgemm + + - url: https://github.com/NVlabs/cub/archive/{{ nvidia_cub_git_hash }}.tar.gz + fn: nvidia_cub_{{ nvidia_cub_git_hash }} + sha256: {{ nvidia_cub_sha_hash }} + folder: 3rdparty/nvidia_cub + + - url: https://github.com/oneapi-src/oneDNN/archive/{{ onednn_git_hash }}.tar.gz + fn: onednn_{{ onednn_git_hash }} + sha256: {{ onednn_sha_hash }} + folder: 3rdparty/onednn + + - url: https://github.com/onnx/onnx-tensorrt/archive/{{ onnxtensorrt_git_hash }}.tar.gz + fn: onnx-tensorrt_{{ onnxtensorrt_git_hash }} + sha256: {{ onnxtensorrt_sha_hash }} + folder: 3rdparty/onnx-tensorrt + + - url: https://github.com/dmlc/ps-lite/archive/{{ pslite_git_hash }}.tar.gz + fn: ps-lite_{{ pslite_git_hash }} + sha256: {{ pslite_sha_hash }} + folder: 3rdparty/ps-lite + + - url: https://github.com/apache/incubator-tvm/archive/{{ tvm_git_hash }}.tar.gz + fn: tvm_{{ tvm_git_hash }} + sha256: {{ tvm_sha_hash }} + folder: 3rdparty/tvm + # Right now there is no valid win-64 configuration (no mkl). So skip it. We are mxnet_blas_impl as a workaround for conda. build: # [mxnet_blas_impl == 'invalid'] From ebf7aad9536848ba75bf463c4847b24917ca6029 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 13 Oct 2022 14:23:24 -0500 Subject: [PATCH 02/27] Fixed extension for --- recipe/meta.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 02459cd..1839a7f 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -39,8 +39,8 @@ source: - url: https://github.com/apache/incubator-mxnet/archive/refs/tags/{{ mxnet_version }}.tar.gz sha256: {{ hash_value }} patches: -# - patches/0001-make-graphviz-optional.patch -# - patches/0002-conda-unbundle-libmxnet-DSO.patch + - patches/0001-make-graphviz-optional.patch + - patches/0002-conda-unbundle-libmxnet-DSO.patch # - patches/0002-cpu-fix.patch - url: https://github.com/dmlc/dlpack/archive/{{ dlpack_git_hash }}.tar.gz @@ -49,42 +49,42 @@ source: folder: 3rdparty/dlpack - url: https://github.com/dmlc/dmlc-core/archive/{{ dmlccore_git_hash }}.tar.gz - fn: dmlc-core_{{ dmlccore_git_hash }} + fn: dmlc-core_{{ dmlccore_git_hash }}.tar.gz sha256: {{ dmlccore_sha_hash }} folder: 3rdparty/dmlc-core - url: https://github.com/google/googletest/archive/{{ googletest_git_hash }}.tar.gz - fn: googletest_{{ googletest_git_hash }} + fn: googletest_{{ googletest_git_hash }}.tar.gz sha256: {{ googletest_sha_hash }} folder: 3rdparty/googletest - url: https://github.com/kpu/intgemm/archive/{{ intgemm_git_hash }}.tar.gz - fn: intgemm_{{ intgemm_git_hash }} + fn: intgemm_{{ intgemm_git_hash }}.tar.gz sha256: {{ intgemm_sha_hash }} folder: 3rdparty/intgemm - url: https://github.com/NVlabs/cub/archive/{{ nvidia_cub_git_hash }}.tar.gz - fn: nvidia_cub_{{ nvidia_cub_git_hash }} + fn: nvidia_cub_{{ nvidia_cub_git_hash }}.tar.gz sha256: {{ nvidia_cub_sha_hash }} folder: 3rdparty/nvidia_cub - url: https://github.com/oneapi-src/oneDNN/archive/{{ onednn_git_hash }}.tar.gz - fn: onednn_{{ onednn_git_hash }} + fn: onednn_{{ onednn_git_hash }}.tar.gz sha256: {{ onednn_sha_hash }} folder: 3rdparty/onednn - url: https://github.com/onnx/onnx-tensorrt/archive/{{ onnxtensorrt_git_hash }}.tar.gz - fn: onnx-tensorrt_{{ onnxtensorrt_git_hash }} + fn: onnx-tensorrt_{{ onnxtensorrt_git_hash }}.tar.gz sha256: {{ onnxtensorrt_sha_hash }} folder: 3rdparty/onnx-tensorrt - url: https://github.com/dmlc/ps-lite/archive/{{ pslite_git_hash }}.tar.gz - fn: ps-lite_{{ pslite_git_hash }} + fn: ps-lite_{{ pslite_git_hash }}.tar.gz sha256: {{ pslite_sha_hash }} folder: 3rdparty/ps-lite - url: https://github.com/apache/incubator-tvm/archive/{{ tvm_git_hash }}.tar.gz - fn: tvm_{{ tvm_git_hash }} + fn: tvm_{{ tvm_git_hash }}.tar.gz sha256: {{ tvm_sha_hash }} folder: 3rdparty/tvm From 4f0fea8ef1707e9809076f65f7823f1cdf8a699c Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 13 Oct 2022 17:08:11 -0500 Subject: [PATCH 03/27] Add 3rdparty as git downlaods with git_hash and sha_hash for each. --- recipe/bld-libmxnet.bat | 4 ++- recipe/build-libmxnet.sh | 1 + recipe/meta.yaml | 33 +++++++++++++------ recipe/patches/0001-cpp-std-14.patch | 22 +++++++++++++ .../patches/0001-make-graphviz-optional.patch | 14 ++++++++ 5 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 recipe/patches/0001-cpp-std-14.patch create mode 100644 recipe/patches/0001-make-graphviz-optional.patch diff --git a/recipe/bld-libmxnet.bat b/recipe/bld-libmxnet.bat index fb9e79c..2b205a2 100644 --- a/recipe/bld-libmxnet.bat +++ b/recipe/bld-libmxnet.bat @@ -43,7 +43,9 @@ cmake .. ${CMAKE_ARGS} ^ -DBUILD_CPP_EXAMPLES=%BUILD_CPP_PACKAGE% ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ - -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% + -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ + -DUSE_CXX14_IF_AVAILABLE=ON + if errorlevel 1 exit 1 diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index 9e8f8e0..b195e09 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -110,6 +110,7 @@ cmake .. ${CMAKE_ARGS} \ -DUSE_JEMALLOC="$JEMALLOC_OPT" \ -DBUILD_CPP_EXAMPLES=OFF \ -DBUILD_TESTING=OFF \ + -DUSE_CXX14_IF_AVAILABLE=ON \ \ "${_blas_opts[@]}" \ "${_gpu_opts[@]}" \ diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 1839a7f..3e07fdd 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,17 +18,17 @@ {% set nvidia_cub_git_hash = "0158fa19f28619886232defd412433974af89611" %} {% set nvidia_cub_sha_hash = "43424c4c17a997d1d730c89ec14688671245de7941e02b388d7d3df6ea53777a" %} -{% set onednn_git_hash = "58be3660fb57c4c4a3d306730e849237d1271572" %} -{% set onednn_sha_hash = "0d170c30ea0a35fbe48008e0e7e729d0993720c14f320ce8e73a891ae176eec4" %} +#{% set onednn_git_hash = "58be3660fb57c4c4a3d306730e849237d1271572" %} +#{% set onednn_sha_hash = "0d170c30ea0a35fbe48008e0e7e729d0993720c14f320ce8e73a891ae176eec4" %} -{% set onnxtensorrt_git_hash = "8b6144a88534e6fd15b6ef5457f1c1a1fc153939" %} -{% set onnxtensorrt_sha_hash = "4b51c2784ff119a4db0baec8f332a1364c6c25360c1c190271aaa20109fd6028" %} +{% set onnxtensorrt_git_hash = "2eb74d933f89e1590fdbfc64971a36e5f72df720" %} +{% set onnxtensorrt_sha_hash = "df99819727445c247fb5c21c2fd825ded3269376867457ae84fa6d6f1c0ae331" %} {% set pslite_git_hash = "34fd45cae457d59850fdcb2066467778d0673f21" %} {% set pslite_sha_hash = "ec5d5baab8bbf0c3983ad5f18d7f963f15ae7cd4d154ec204b03c1dceccf209b" %} -{% set tvm_git_hash = "efdac9439506d1de5eec91ecc795982c78e41909" %} -{% set tvm_sha_hash = "656c38d66baeab885b0212602148bb55ad3cf7d22f52ded8ece53f88e103a2f5" %} +{% set tvm_git_hash = "9bd2c7b44208ed992061f8c2688e1137357f1db1" %} +{% set tvm_sha_hash = "68d0c2f14bd00db2dc90fc1a2ed389a3d04d9176c5f96133dfa44b81c28cdd89" %} package: @@ -39,6 +39,7 @@ source: - url: https://github.com/apache/incubator-mxnet/archive/refs/tags/{{ mxnet_version }}.tar.gz sha256: {{ hash_value }} patches: + - patches/0001-cpp-std-14.patch - patches/0001-make-graphviz-optional.patch - patches/0002-conda-unbundle-libmxnet-DSO.patch # - patches/0002-cpu-fix.patch @@ -47,6 +48,8 @@ source: fn: dlpack_{{ dlpack_git_hash }}.tar.gz sha256: {{ dlpack_sha_hash }} folder: 3rdparty/dlpack +# patches: +# - patches/0011-cpp-std-14.patch - url: https://github.com/dmlc/dmlc-core/archive/{{ dmlccore_git_hash }}.tar.gz fn: dmlc-core_{{ dmlccore_git_hash }}.tar.gz @@ -57,21 +60,27 @@ source: fn: googletest_{{ googletest_git_hash }}.tar.gz sha256: {{ googletest_sha_hash }} folder: 3rdparty/googletest +# patches: +# - patches/0031-cpp-std-14.patch - url: https://github.com/kpu/intgemm/archive/{{ intgemm_git_hash }}.tar.gz fn: intgemm_{{ intgemm_git_hash }}.tar.gz sha256: {{ intgemm_sha_hash }} folder: 3rdparty/intgemm +# patches: +# - patches/0041-cpp-std-14.patch - url: https://github.com/NVlabs/cub/archive/{{ nvidia_cub_git_hash }}.tar.gz fn: nvidia_cub_{{ nvidia_cub_git_hash }}.tar.gz sha256: {{ nvidia_cub_sha_hash }} folder: 3rdparty/nvidia_cub +# patches: +# - patches/0051-cpp-std-14.patch - - url: https://github.com/oneapi-src/oneDNN/archive/{{ onednn_git_hash }}.tar.gz - fn: onednn_{{ onednn_git_hash }}.tar.gz - sha256: {{ onednn_sha_hash }} - folder: 3rdparty/onednn +# - url: https://github.com/oneapi-src/oneDNN/archive/{{ onednn_git_hash }}.tar.gz +# fn: onednn_{{ onednn_git_hash }}.tar.gz +# sha256: {{ onednn_sha_hash }} +# folder: 3rdparty/onednn - url: https://github.com/onnx/onnx-tensorrt/archive/{{ onnxtensorrt_git_hash }}.tar.gz fn: onnx-tensorrt_{{ onnxtensorrt_git_hash }}.tar.gz @@ -82,11 +91,15 @@ source: fn: ps-lite_{{ pslite_git_hash }}.tar.gz sha256: {{ pslite_sha_hash }} folder: 3rdparty/ps-lite +# patches: +# - patches/0081-cpp-std-14.patch - url: https://github.com/apache/incubator-tvm/archive/{{ tvm_git_hash }}.tar.gz fn: tvm_{{ tvm_git_hash }}.tar.gz sha256: {{ tvm_sha_hash }} folder: 3rdparty/tvm +# patches: +# - patches/0091-cpp-std-14.patch # Right now there is no valid win-64 configuration (no mkl). So skip it. We are mxnet_blas_impl as a workaround for conda. diff --git a/recipe/patches/0001-cpp-std-14.patch b/recipe/patches/0001-cpp-std-14.patch new file mode 100644 index 0000000..ce26199 --- /dev/null +++ b/recipe/patches/0001-cpp-std-14.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7b5a12610..e00d318fe 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,7 +7,7 @@ if(CMAKE_CROSSCOMPILING) + endif() + + project(mxnet C CXX) +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS ON) + +@@ -791,7 +791,7 @@ elseif(MSVC) + target_link_libraries(mxnet PUBLIC mshadow) + if(MXNET_FORCE_SHARED_CRT) + target_compile_options( +- mxnet ++ mxnet + PRIVATE "$<$,$>:-Xcompiler=-MDd -Gy /bigobj>") + target_compile_options( + mxnet diff --git a/recipe/patches/0001-make-graphviz-optional.patch b/recipe/patches/0001-make-graphviz-optional.patch new file mode 100644 index 0000000..977321a --- /dev/null +++ b/recipe/patches/0001-make-graphviz-optional.patch @@ -0,0 +1,14 @@ +diff --git a/python/setup.py b/python/setup.py +index dcd84cef1..bf2b7d58a 100644 +--- a/python/setup.py ++++ b/python/setup.py +@@ -30,7 +30,8 @@ if "--inplace" in sys.argv: + else: + from setuptools import setup + from setuptools.extension import Extension +- kwargs = {'install_requires': ['numpy>1.16.0,<2.0.0', 'requests>=2.20.0,<3', 'graphviz<0.9.0,>=0.8.1'], 'zip_safe': False} ++ # Make graphviz optional: ++ kwargs = {'install_requires': ['numpy>1.16.0,<2.0.0', 'requests>=2.20.0,<3'], 'zip_safe': False, 'extras_require': {'graphviz': ['graphviz<0.9.0,>=0.8.1']}} + + with_cython = False + if '--with-cython' in sys.argv: From c111f6afc58b6c02b14807a80b0eba3b4e81a6f3 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 13 Oct 2022 17:26:36 -0500 Subject: [PATCH 04/27] dmlc must use C++14 --- recipe/meta.yaml | 4 ++-- recipe/patches/0011-cpp-std-14.patch | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 recipe/patches/0011-cpp-std-14.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 3e07fdd..969dfa4 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -48,8 +48,8 @@ source: fn: dlpack_{{ dlpack_git_hash }}.tar.gz sha256: {{ dlpack_sha_hash }} folder: 3rdparty/dlpack -# patches: -# - patches/0011-cpp-std-14.patch + patches: + - patches/0011-cpp-std-14.patch - url: https://github.com/dmlc/dmlc-core/archive/{{ dmlccore_git_hash }}.tar.gz fn: dmlc-core_{{ dmlccore_git_hash }}.tar.gz diff --git a/recipe/patches/0011-cpp-std-14.patch b/recipe/patches/0011-cpp-std-14.patch new file mode 100644 index 0000000..908554d --- /dev/null +++ b/recipe/patches/0011-cpp-std-14.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ed6e069..c147535 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -37,9 +37,9 @@ endif(NOT CMAKE_BUILD_TYPE) + # Note: not working on CMake 2.8. We assume that user has + # a compiler with C++11 support. + +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +-message(STATUS "C++11 support has been enabled by default.") ++message(STATUS "C++14 support has been enabled by default.") + + option(BUILD_DOCS "Set to ON to build documentation" OFF) + option(BUILD_MOCK "Build mock executable" ON) From 5b214593ed46655a005b22c47b98372a0e7c4735 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Fri, 14 Oct 2022 16:27:20 -0500 Subject: [PATCH 05/27] osx-64 changes --- recipe/conda_build_config.yaml | 5 +++++ recipe/meta.yaml | 4 ++-- recipe/patches/0041-cpp-std-14.patch | 13 +++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 recipe/patches/0041-cpp-std-14.patch diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index b37c5c9..0f95b41 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -28,3 +28,8 @@ c_compiler_version: # [ppc64le] - 8 # [ppc64le] cxx_compiler_version: # [ppc64le] - 8 # [ppc64le] + + +# Default osx-64 sdk does not support c++14 adequately. +CONDA_BUILD_SYSROOT: # [osx and x86_64] + - /opt/MacOSX10.12.sdk # [osx and x86_64] diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 969dfa4..cbc8ffc 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -67,8 +67,8 @@ source: fn: intgemm_{{ intgemm_git_hash }}.tar.gz sha256: {{ intgemm_sha_hash }} folder: 3rdparty/intgemm -# patches: -# - patches/0041-cpp-std-14.patch + patches: + - patches/0041-cpp-std-14.patch - url: https://github.com/NVlabs/cub/archive/{{ nvidia_cub_git_hash }}.tar.gz fn: nvidia_cub_{{ nvidia_cub_git_hash }}.tar.gz diff --git a/recipe/patches/0041-cpp-std-14.patch b/recipe/patches/0041-cpp-std-14.patch new file mode 100644 index 0000000..2003dad --- /dev/null +++ b/recipe/patches/0041-cpp-std-14.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d1885f5..fb497ad 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,7 +8,7 @@ if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 14) + + if(MSVC) + add_compile_options(/W4 /WX) From c9ce9db163d05a898176188300291f75dfecc68f Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Fri, 14 Oct 2022 16:35:53 -0500 Subject: [PATCH 06/27] osx-64 changes --- recipe/build-libmxnet.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index b195e09..5bb705e 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -43,6 +43,8 @@ case "${target_platform}" in anaconda_build_opts+=(-DUSE_OPENCV=ON) AR=${BUILD_PREFIX}/bin/${AR} RANLIB=${BUILD_PREFIX}/bin/${RANLIB} + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" ;; osx-arm64) anaconda_build_opts+=(-DUSE_OPENCV=ON) From 88577e1cce7d8951c4784c0fb63aadd64a51b696 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Mon, 17 Oct 2022 09:15:57 -0500 Subject: [PATCH 07/27] Debugging messages and comments. --- recipe/build-libmxnet.sh | 9 +++++++++ recipe/build-py-mxnet.sh | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index 5bb705e..0614786 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -87,6 +87,8 @@ mkdir -p Build-${PKG_NAME} cd Build-${PKG_NAME} || exit 1 +# Generate the build files. +echo "Generating the build files..." cmake .. ${CMAKE_ARGS} \ -GNinja \ -LAH \ @@ -119,6 +121,8 @@ cmake .. ${CMAKE_ARGS} \ "${anaconda_build_opts[@]}" \ +# Build. +echo "Building..." ninja -j${CPU_COUNT} ninja install @@ -134,3 +138,8 @@ rm -f ${PREFIX}/lib/libmxnet.a # remove cmake cruft rm -rf ${PREFIX}/lib/cmake/dmlc + + +# Error free exit! +echo "Error free exit!" +exit 0 diff --git a/recipe/build-py-mxnet.sh b/recipe/build-py-mxnet.sh index f4b7a27..a175055 100644 --- a/recipe/build-py-mxnet.sh +++ b/recipe/build-py-mxnet.sh @@ -1,4 +1,7 @@ -set -x +#!/usr/bin/env bash +echo "Building ${PKG_NAME}." + +set -ex ENABLE_CYTHON= if [[ $(uname) == Darwin ]]; then @@ -21,3 +24,8 @@ else find ${PREFIX} | grep libmxnet.so | grep -v $PREFIX/lib/libmxnet.so | xargs rm -f ln -sf ../../../libmxnet.so $SP_DIR/mxnet/libmxnet.so fi + + +# Error free exit! +echo "Error free exit!" +exit 0 From 2c3bf184fac4176abf9dff2245b65fd9a437417f Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Tue, 18 Oct 2022 09:30:48 -0500 Subject: [PATCH 08/27] testing hacks --- recipe/meta.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index cbc8ffc..bdbcfea 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -136,6 +136,7 @@ outputs: string: {{ mxnet_variant_str }}_h{{PKG_HASH}}_{{ build_number }} number: {{ build_number }} skip: True # [win and vc<14] + skip: True # [not osx] <----- do not allow into main! missing_dso_whitelist: # [linux] - libcuda.so.1 # [linux] - '$RPATH/ld64.so.1' # [s390x] This is missing from the activation script. @@ -147,7 +148,8 @@ outputs: - pkg-config # [not win] - ninja-base - cmake - - python + - python # [not osx] + - python 3.10 # [osx] host: # - jemalloc # [linux] - mkl-dnn # [unix and (mxnet_blas_impl == 'mkl')] From 2fa656eea3e827c03e3538ef02646129f224f505 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Tue, 18 Oct 2022 09:36:47 -0500 Subject: [PATCH 09/27] testing hacks --- recipe/meta.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index bdbcfea..e794e25 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -102,9 +102,10 @@ source: # - patches/0091-cpp-std-14.patch -# Right now there is no valid win-64 configuration (no mkl). So skip it. We are mxnet_blas_impl as a workaround for conda. -build: # [mxnet_blas_impl == 'invalid'] - skip: true # [mxnet_blas_impl == 'invalid'] +# THIS IS NOT FOR MAIN!!!!! +build: # [not osx] +skip: True # [not osx] <----- do not allow into main! + requirements: build: @@ -136,7 +137,6 @@ outputs: string: {{ mxnet_variant_str }}_h{{PKG_HASH}}_{{ build_number }} number: {{ build_number }} skip: True # [win and vc<14] - skip: True # [not osx] <----- do not allow into main! missing_dso_whitelist: # [linux] - libcuda.so.1 # [linux] - '$RPATH/ld64.so.1' # [s390x] This is missing from the activation script. From 72e302a5c3d71123348f083e8ec9817f71820b65 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Tue, 18 Oct 2022 09:39:04 -0500 Subject: [PATCH 10/27] testing hacks --- recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e794e25..5af7d29 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -103,8 +103,8 @@ source: # THIS IS NOT FOR MAIN!!!!! -build: # [not osx] -skip: True # [not osx] <----- do not allow into main! +build: # [not osx] + skip: True # [not osx] <----- do not allow into main! requirements: From b4ae017bfe15d2c89f9114e77c8185431bc6986d Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Wed, 19 Oct 2022 11:01:33 -0500 Subject: [PATCH 11/27] Attempting suggested fix? --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5af7d29..f420b0c 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -169,6 +169,7 @@ outputs: - {{ pin_compatible('intel-openmp') }} # [mxnet_blas_impl == 'mkl'] - _openmp_mutex # [linux] - opencv >=4.6 # [not s390x] + - {{ pin_subpackage('libmxnet', exact=True) }} test: commands: From 87a4edde0cc90ef625be469e411139648be544d5 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Wed, 19 Oct 2022 12:59:24 -0500 Subject: [PATCH 12/27] Attempting alternate fix? --- recipe/meta.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f420b0c..23d2ce8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -140,6 +140,8 @@ outputs: missing_dso_whitelist: # [linux] - libcuda.so.1 # [linux] - '$RPATH/ld64.so.1' # [s390x] This is missing from the activation script. + run_exports: # [osx] + - {{ pin_subpackage('libmxnet', exact=True) }} # [osx] requirements: build: @@ -169,7 +171,7 @@ outputs: - {{ pin_compatible('intel-openmp') }} # [mxnet_blas_impl == 'mkl'] - _openmp_mutex # [linux] - opencv >=4.6 # [not s390x] - - {{ pin_subpackage('libmxnet', exact=True) }} +# - {{ pin_subpackage('libmxnet', exact=True) }} <-------------- This did not help. test: commands: From 9bb770cdd30a97bd23cb6853614f8398f0349051 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 20 Oct 2022 15:25:46 -0500 Subject: [PATCH 13/27] Add verbose flag to builds and more debug info. --- recipe/build-libmxnet.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index 0614786..c924a3b 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -123,8 +123,14 @@ cmake .. ${CMAKE_ARGS} \ # Build. echo "Building..." -ninja -j${CPU_COUNT} +echo +echo "=== BUILD ${PKG_NAME} ===" +ninja -v -j${CPU_COUNT} +echo +echo "=== INSTALL ${PKG_NAME} ===" ninja install +echo +echo "=== COMPLETE ${PKG_NAME} ===" # install misses this file if [[ $target_platform != linux-s390x ]]; then From 050ad662ee1731fa24e079386e9c57a0670f8307 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 20 Oct 2022 18:18:43 -0500 Subject: [PATCH 14/27] testing osx rpath fix --- recipe/meta.yaml | 1 + recipe/patches/001-osx-cmake-rpath-fix.patch | 23 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 recipe/patches/001-osx-cmake-rpath-fix.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 23d2ce8..ca9fedb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -39,6 +39,7 @@ source: - url: https://github.com/apache/incubator-mxnet/archive/refs/tags/{{ mxnet_version }}.tar.gz sha256: {{ hash_value }} patches: + - patches/001-osx-cmake-rpath-fix.patch # [osx] - patches/0001-cpp-std-14.patch - patches/0001-make-graphviz-optional.patch - patches/0002-conda-unbundle-libmxnet-DSO.patch diff --git a/recipe/patches/001-osx-cmake-rpath-fix.patch b/recipe/patches/001-osx-cmake-rpath-fix.patch new file mode 100644 index 0000000..06ed462 --- /dev/null +++ b/recipe/patches/001-osx-cmake-rpath-fix.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7b5a12610..15007656d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,6 +11,9 @@ set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS ON) + ++# Set RPATH for OSX ++set(CMAKE_MACOSX_RPATH 1) ++ + if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.cmake) + # Load config.cmake only if mxnet is not compiled as a dependency of another project + include(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake) +@@ -791,7 +794,7 @@ elseif(MSVC) + target_link_libraries(mxnet PUBLIC mshadow) + if(MXNET_FORCE_SHARED_CRT) + target_compile_options( +- mxnet ++ mxnet + PRIVATE "$<$,$>:-Xcompiler=-MDd -Gy /bigobj>") + target_compile_options( + mxnet From 0231a4e1646ebf5cd3ac89462043188410b3e993 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 20 Oct 2022 18:23:49 -0500 Subject: [PATCH 15/27] Corrected patch application order --- recipe/meta.yaml | 2 +- ...rpath-fix.patch => 0003-osx-cmake-rpath-fix.patch} | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) rename recipe/patches/{001-osx-cmake-rpath-fix.patch => 0003-osx-cmake-rpath-fix.patch} (60%) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index ca9fedb..8572dfe 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -39,7 +39,7 @@ source: - url: https://github.com/apache/incubator-mxnet/archive/refs/tags/{{ mxnet_version }}.tar.gz sha256: {{ hash_value }} patches: - - patches/001-osx-cmake-rpath-fix.patch # [osx] + - patches/0003-osx-cmake-rpath-fix.patch # [osx] - patches/0001-cpp-std-14.patch - patches/0001-make-graphviz-optional.patch - patches/0002-conda-unbundle-libmxnet-DSO.patch diff --git a/recipe/patches/001-osx-cmake-rpath-fix.patch b/recipe/patches/0003-osx-cmake-rpath-fix.patch similarity index 60% rename from recipe/patches/001-osx-cmake-rpath-fix.patch rename to recipe/patches/0003-osx-cmake-rpath-fix.patch index 06ed462..3b17787 100644 --- a/recipe/patches/001-osx-cmake-rpath-fix.patch +++ b/recipe/patches/0003-osx-cmake-rpath-fix.patch @@ -5,19 +5,10 @@ index 7b5a12610..15007656d 100644 @@ -11,6 +11,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS ON) - + +# Set RPATH for OSX +set(CMAKE_MACOSX_RPATH 1) + if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.cmake) # Load config.cmake only if mxnet is not compiled as a dependency of another project include(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake) -@@ -791,7 +794,7 @@ elseif(MSVC) - target_link_libraries(mxnet PUBLIC mshadow) - if(MXNET_FORCE_SHARED_CRT) - target_compile_options( -- mxnet -+ mxnet - PRIVATE "$<$,$>:-Xcompiler=-MDd -Gy /bigobj>") - target_compile_options( - mxnet From 834ad6dec7387adbfdb8eff94e3e6a0f36e77a1d Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 20 Oct 2022 18:39:07 -0500 Subject: [PATCH 16/27] one more try... --- recipe/build-libmxnet.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index c924a3b..af4c2dd 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -95,6 +95,7 @@ cmake .. ${CMAKE_ARGS} \ -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DCMAKE_INSTALL_LIBDIR="lib" \ + -DCMAKE_INSTALL_RPATH="${PREFIX}/lib" \ -DCMAKE_AR=${AR} \ -DCMAKE_LINKER=${LD} \ -DCMAKE_NM=${NM} \ From 3af9fac6dc7ff2dd6427cd92555c236f4c597628 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 20 Oct 2022 19:02:57 -0500 Subject: [PATCH 17/27] debugging of 1.9.1 builds. --- recipe/build-libmxnet.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index af4c2dd..a84d813 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -86,6 +86,10 @@ fi mkdir -p Build-${PKG_NAME} cd Build-${PKG_NAME} || exit 1 +echo "==============================================================================" +echo "PREFIX= ${PREFIX} +echo "==============================================================================" +exit -1 # Generate the build files. echo "Generating the build files..." From 3431d451c662e1ff2148962756d911f67e5ee775 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 20 Oct 2022 19:06:59 -0500 Subject: [PATCH 18/27] debugging of 1.9.1 builds. --- recipe/build-libmxnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index a84d813..9d77027 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -87,7 +87,7 @@ mkdir -p Build-${PKG_NAME} cd Build-${PKG_NAME} || exit 1 echo "==============================================================================" -echo "PREFIX= ${PREFIX} +echo "PREFIX= ${PREFIX}" echo "==============================================================================" exit -1 From e88862477b0c2ddf1d5f125c3d63fedc43590f50 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 20 Oct 2022 19:13:44 -0500 Subject: [PATCH 19/27] debugging of 1.9.1 builds. --- recipe/build-libmxnet.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index 9d77027..af4c2dd 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -86,10 +86,6 @@ fi mkdir -p Build-${PKG_NAME} cd Build-${PKG_NAME} || exit 1 -echo "==============================================================================" -echo "PREFIX= ${PREFIX}" -echo "==============================================================================" -exit -1 # Generate the build files. echo "Generating the build files..." From 9d2e10c4daf425b1afd9808e85bc1a5222560eb4 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Thu, 20 Oct 2022 19:18:20 -0500 Subject: [PATCH 20/27] one more try --- recipe/patches/0003-osx-cmake-rpath-fix.patch | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/recipe/patches/0003-osx-cmake-rpath-fix.patch b/recipe/patches/0003-osx-cmake-rpath-fix.patch index 3b17787..7481a73 100644 --- a/recipe/patches/0003-osx-cmake-rpath-fix.patch +++ b/recipe/patches/0003-osx-cmake-rpath-fix.patch @@ -1,14 +1,40 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7b5a12610..15007656d 100644 +index 7b5a12610..69b886ea1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS ON) - + +# Set RPATH for OSX +set(CMAKE_MACOSX_RPATH 1) + if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.cmake) # Load config.cmake only if mxnet is not compiled as a dependency of another project include(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake) +@@ -143,14 +146,14 @@ else() + execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE SYSTEM_ARCHITECTURE) + endif() + +-if(CMAKE_BUILD_TYPE STREQUAL "Distribution" AND UNIX AND NOT APPLE) ++#if(CMAKE_BUILD_TYPE STREQUAL "Distribution" AND UNIX AND NOT APPLE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) + set(CMAKE_INSTALL_RPATH $\{ORIGIN\}) + # Enforce DT_PATH instead of DT_RUNPATH + set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--disable-new-dtags") + set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags") + set(Protobuf_USE_STATIC_LIBS ON) +-endif() ++#endif() + + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/upstream;${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules;${CMAKE_MODULE_PATH}") + +@@ -791,7 +794,7 @@ elseif(MSVC) + target_link_libraries(mxnet PUBLIC mshadow) + if(MXNET_FORCE_SHARED_CRT) + target_compile_options( +- mxnet ++ mxnet + PRIVATE "$<$,$>:-Xcompiler=-MDd -Gy /bigobj>") + target_compile_options( + mxnet From 3bc4d5f16decaaaf8488d6019fbe5f32e54f1be4 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Fri, 21 Oct 2022 11:58:13 -0500 Subject: [PATCH 21/27] surprised that this order matters, but it does, --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8572dfe..3378c66 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -39,10 +39,10 @@ source: - url: https://github.com/apache/incubator-mxnet/archive/refs/tags/{{ mxnet_version }}.tar.gz sha256: {{ hash_value }} patches: - - patches/0003-osx-cmake-rpath-fix.patch # [osx] - patches/0001-cpp-std-14.patch - patches/0001-make-graphviz-optional.patch - patches/0002-conda-unbundle-libmxnet-DSO.patch + - patches/0003-osx-cmake-rpath-fix.patch # [osx] # - patches/0002-cpu-fix.patch - url: https://github.com/dmlc/dlpack/archive/{{ dlpack_git_hash }}.tar.gz From 184eaf7a98142739c938fe84f2cdcd64fb8e2a56 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Fri, 21 Oct 2022 11:58:28 -0500 Subject: [PATCH 22/27] minor changes --- recipe/build-libmxnet.sh | 2 ++ recipe/patches/0003-osx-cmake-rpath-fix.patch | 16 +++------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index af4c2dd..8ab24f1 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -41,6 +41,7 @@ case "${target_platform}" in ;; osx-64) anaconda_build_opts+=(-DUSE_OPENCV=ON) + anaconda_build_opts+=(-DCMAKE_MACOSX_RPATH=1) AR=${BUILD_PREFIX}/bin/${AR} RANLIB=${BUILD_PREFIX}/bin/${RANLIB} # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk @@ -49,6 +50,7 @@ case "${target_platform}" in osx-arm64) anaconda_build_opts+=(-DUSE_OPENCV=ON) anaconda_build_opts+=(-DUSE_SSE=OFF) + anaconda_build_opts+=(-DCMAKE_MACOSX_RPATH=1) AR=${BUILD_PREFIX}/bin/${AR} RANLIB=${BUILD_PREFIX}/bin/${RANLIB} ;; diff --git a/recipe/patches/0003-osx-cmake-rpath-fix.patch b/recipe/patches/0003-osx-cmake-rpath-fix.patch index 7481a73..8ea678e 100644 --- a/recipe/patches/0003-osx-cmake-rpath-fix.patch +++ b/recipe/patches/0003-osx-cmake-rpath-fix.patch @@ -5,7 +5,7 @@ index 7b5a12610..69b886ea1 100644 @@ -11,6 +11,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS ON) - + +# Set RPATH for OSX +set(CMAKE_MACOSX_RPATH 1) + @@ -15,7 +15,7 @@ index 7b5a12610..69b886ea1 100644 @@ -143,14 +146,14 @@ else() execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE SYSTEM_ARCHITECTURE) endif() - + -if(CMAKE_BUILD_TYPE STREQUAL "Distribution" AND UNIX AND NOT APPLE) +#if(CMAKE_BUILD_TYPE STREQUAL "Distribution" AND UNIX AND NOT APPLE) set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) @@ -26,15 +26,5 @@ index 7b5a12610..69b886ea1 100644 set(Protobuf_USE_STATIC_LIBS ON) -endif() +#endif() - + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/upstream;${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules;${CMAKE_MODULE_PATH}") - -@@ -791,7 +794,7 @@ elseif(MSVC) - target_link_libraries(mxnet PUBLIC mshadow) - if(MXNET_FORCE_SHARED_CRT) - target_compile_options( -- mxnet -+ mxnet - PRIVATE "$<$,$>:-Xcompiler=-MDd -Gy /bigobj>") - target_compile_options( - mxnet From 5650285e3840cb7e1f4313842140057b62eecf18 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Fri, 21 Oct 2022 12:01:36 -0500 Subject: [PATCH 23/27] Patch not needed, we can make this fix in the cmake call --- recipe/meta.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 3378c66..23d2ce8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -42,7 +42,6 @@ source: - patches/0001-cpp-std-14.patch - patches/0001-make-graphviz-optional.patch - patches/0002-conda-unbundle-libmxnet-DSO.patch - - patches/0003-osx-cmake-rpath-fix.patch # [osx] # - patches/0002-cpu-fix.patch - url: https://github.com/dmlc/dlpack/archive/{{ dlpack_git_hash }}.tar.gz From ac1a0a7f3514f844d8c40417b7def15b40e62f65 Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Fri, 21 Oct 2022 12:19:00 -0500 Subject: [PATCH 24/27] dump some cmake variables at entry and exit --- recipe/meta.yaml | 1 + recipe/patches/0003-osx-cmake-rpath-fix.patch | 39 +++++++------------ 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 23d2ce8..398372c 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -42,6 +42,7 @@ source: - patches/0001-cpp-std-14.patch - patches/0001-make-graphviz-optional.patch - patches/0002-conda-unbundle-libmxnet-DSO.patch + - patches/0003-osx-cmake-rpath-fix.patch # prints some cmake values and exits. # - patches/0002-cpu-fix.patch - url: https://github.com/dmlc/dlpack/archive/{{ dlpack_git_hash }}.tar.gz diff --git a/recipe/patches/0003-osx-cmake-rpath-fix.patch b/recipe/patches/0003-osx-cmake-rpath-fix.patch index 8ea678e..189d514 100644 --- a/recipe/patches/0003-osx-cmake-rpath-fix.patch +++ b/recipe/patches/0003-osx-cmake-rpath-fix.patch @@ -1,30 +1,21 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7b5a12610..69b886ea1 100644 +index 7b5a12610..50a3c2063 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -11,6 +11,9 @@ set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS ON) +@@ -1,5 +1,9 @@ + cmake_minimum_required(VERSION 3.13) -+# Set RPATH for OSX -+set(CMAKE_MACOSX_RPATH 1) + - if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.cmake) - # Load config.cmake only if mxnet is not compiled as a dependency of another project - include(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake) -@@ -143,14 +146,14 @@ else() - execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE SYSTEM_ARCHITECTURE) ++message( "=========================\n\n CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} \n\n CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \n\n CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} \n\n=================================" ++ ++ + # workaround to store CMAKE_CROSSCOMPILING because is getting reset by the project command + if(CMAKE_CROSSCOMPILING) + set(__CMAKE_CROSSCOMPILING ${CMAKE_CROSSCOMPILING}) +@@ -1023,3 +1027,6 @@ if(BUILD_CYTHON_MODULES) + message(FATAL_ERROR "No python interpreter found to build cython modules") + endif() endif() - --if(CMAKE_BUILD_TYPE STREQUAL "Distribution" AND UNIX AND NOT APPLE) -+#if(CMAKE_BUILD_TYPE STREQUAL "Distribution" AND UNIX AND NOT APPLE) - set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) - set(CMAKE_INSTALL_RPATH $\{ORIGIN\}) - # Enforce DT_PATH instead of DT_RUNPATH - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--disable-new-dtags") - set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags") - set(Protobuf_USE_STATIC_LIBS ON) --endif() -+#endif() - - set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/upstream;${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules;${CMAKE_MODULE_PATH}") ++ ++ ++message(FATAL_ERROR "=========================\n\n CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} \n\n CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \n\n CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} \n\n=================================" From 6884ff86a045b34f49ecda4964256a0d5c0df3cc Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Fri, 21 Oct 2022 12:49:11 -0500 Subject: [PATCH 25/27] typo --- recipe/patches/0003-osx-cmake-rpath-fix.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/patches/0003-osx-cmake-rpath-fix.patch b/recipe/patches/0003-osx-cmake-rpath-fix.patch index 189d514..299ee04 100644 --- a/recipe/patches/0003-osx-cmake-rpath-fix.patch +++ b/recipe/patches/0003-osx-cmake-rpath-fix.patch @@ -6,7 +6,7 @@ index 7b5a12610..50a3c2063 100644 cmake_minimum_required(VERSION 3.13) + -+message( "=========================\n\n CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} \n\n CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \n\n CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} \n\n=================================" ++message( "=========================\n\n CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} \n\n CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \n\n CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} \n\n=================================" ) + + # workaround to store CMAKE_CROSSCOMPILING because is getting reset by the project command @@ -18,4 +18,4 @@ index 7b5a12610..50a3c2063 100644 endif() + + -+message(FATAL_ERROR "=========================\n\n CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} \n\n CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \n\n CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} \n\n=================================" ++message(FATAL_ERROR "=========================\n\n CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} \n\n CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \n\n CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} \n\n=================================" ) From d939802fbaac3505c27d58bd1a49db95308d9f5e Mon Sep 17 00:00:00 2001 From: Scott Bailey Date: Fri, 21 Oct 2022 13:23:09 -0500 Subject: [PATCH 26/27] return to previous state --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 398372c..7986b2d 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -42,7 +42,7 @@ source: - patches/0001-cpp-std-14.patch - patches/0001-make-graphviz-optional.patch - patches/0002-conda-unbundle-libmxnet-DSO.patch - - patches/0003-osx-cmake-rpath-fix.patch # prints some cmake values and exits. +# - patches/0003-osx-cmake-rpath-fix.patch # prints some cmake values and exits. # - patches/0002-cpu-fix.patch - url: https://github.com/dmlc/dlpack/archive/{{ dlpack_git_hash }}.tar.gz From 0b8d643e6258271c8ccdf6996ba3b25d534e3205 Mon Sep 17 00:00:00 2001 From: Marco Esters Date: Fri, 21 Oct 2022 13:07:45 -0700 Subject: [PATCH 27/27] Add cd SRC_DIR to libmxnet build --- recipe/build-libmxnet.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/build-libmxnet.sh b/recipe/build-libmxnet.sh index 8ab24f1..142bf65 100755 --- a/recipe/build-libmxnet.sh +++ b/recipe/build-libmxnet.sh @@ -85,6 +85,7 @@ fi # Isolate the build. # rm -rf Build-${PKG_NAME} # We could clean it up... But there really is no need. +cd ${SRC_DIR} mkdir -p Build-${PKG_NAME} cd Build-${PKG_NAME} || exit 1