diff --git a/conda/cross-linux.cmake b/conda/cross-linux.cmake new file mode 100644 index 00000000..bb837eea --- /dev/null +++ b/conda/cross-linux.cmake @@ -0,0 +1,20 @@ +# this one is important +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_PLATFORM Linux) +#this one not so much +set(CMAKE_SYSTEM_VERSION 1) + +# specify the cross compiler +set(CMAKE_C_COMPILER $ENV{CC}) + +# where is the target environment +set(CMAKE_FIND_ROOT_PATH $ENV{PREFIX} $ENV{BUILD_PREFIX}/$ENV{HOST}/sysroot) + +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# god-awful hack because it seems to not run correct tests to determine this: +set(__CHAR_UNSIGNED___EXITCODE 1) diff --git a/conda/nnvm/meta.yaml b/conda/nnvm/meta.yaml index 7a8b4aab..bae06740 100644 --- a/conda/nnvm/meta.yaml +++ b/conda/nnvm/meta.yaml @@ -8,7 +8,7 @@ source: path: ../.. build: - number: 1 + number: 0 skip: True # [win] requirements: diff --git a/conda/topi/meta.yaml b/conda/topi/meta.yaml index a3133b6c..f13c95ac 100644 --- a/conda/topi/meta.yaml +++ b/conda/topi/meta.yaml @@ -8,7 +8,7 @@ source: path: ../.. build: - number: 1 + number: 0 requirements: host: diff --git a/conda/tvm-libs/build.sh b/conda/tvm-libs/build.sh index 1ea99fb3..772838e6 100644 --- a/conda/tvm-libs/build.sh +++ b/conda/tvm-libs/build.sh @@ -1,5 +1,9 @@ #!/bin/bash +# Fix for OSX build to hide the clang LLVM +rm -f ${BUILD_PREFIX}/bin/llvm-config +rm -rf ${BUILD_PREFIX}/lib/cmake + set -e if [ -z "$PREFIX" ]; then @@ -9,13 +13,29 @@ fi if [ -z "$cuda" ] || [ "$cuda" == "False" ]; then CUDA_OPT="" else - CUDA_OPT="-DUSE_CUDA=ON" + CUDA_OPT="-DUSE_CUDA=ON -DUSE_CUBLAS=ON" +fi + +if [ "$target_platform" == "osx-64" ]; then + # macOS 64 bits + METAL_OPT="" # Conda can only target 10.9 for now + TOOLCHAIN_OPT="" +else + METAL_OPT="" + if [ "$target_platform" == "linux-64" ]; then + # Linux 64 bits + TOOLCHAIN_OPT="-DCMAKE_TOOLCHAIN_FILE=${RECIPE_DIR}/../cross-linux.cmake" + else + # Windows (or 32 bits, which we don't support) + METAL_OPT="" + TOOLCHAIN_OPT="" + fi fi rm -rf build || true mkdir -p build cd build -cmake $CUDA_OPT -DUSE_LLVM=ON -DINSTALL_DEV=ON -DCMAKE_INSTALL_PREFIX="$PREFIX" .. -make -j4 VERBOSE=1 +cmake $METAL_OPT $CUDA_OPT -DUSE_LLVM=ON -DINSTALL_DEV=ON -DCMAKE_INSTALL_PREFIX="$PREFIX" $TOOLCHAIN_OPT .. +make -j${CPU_COUNT} VERBOSE=1 make install cd .. diff --git a/conda/tvm-libs/meta.yaml b/conda/tvm-libs/meta.yaml index 15c7de95..fcb8f22c 100644 --- a/conda/tvm-libs/meta.yaml +++ b/conda/tvm-libs/meta.yaml @@ -8,21 +8,17 @@ source: path: ../.. build: - number: 1 + number: 0 string: cuda{{ cuda_version }}_{{ PKG_BUILDNUM }} # [cuda] requirements: build: - - {{ compiler('cxx') }} # [linux] - - llvmdev ==6.0.0 # [osx] - host: # The OS X build will require some manual setup or it will break - # See https://conda.io/docs/user-guide/tasks/build-packages/compiler-tools.html#macos-sdk - # It is also ass-backward because of llvm brokeness when mixed with the - # conda OS X compiler - - {{ compiler('cxx') }} # [osx] + # See https://docs.conda.io/projects/conda-build/en/latest/source/resources/compiler-tools.html#macos-sdk + - {{ compiler('cxx') }} + host: - cmake - - llvmdev ==6.0.0 # [linux] + - llvmdev ==6.0.0 - zlib # [linux] run: - {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, max_pin='x.x') }} # [cuda] diff --git a/conda/tvm/meta.yaml b/conda/tvm/meta.yaml index d60c743b..37adf5b4 100644 --- a/conda/tvm/meta.yaml +++ b/conda/tvm/meta.yaml @@ -8,7 +8,7 @@ source: path: ../.. build: - number: 1 + number: 0 requirements: build: