Commit 57381b60 by abergeron Committed by Tianqi Chen

Improvements to the conda build (#2742)

parent 3929424b
# 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)
...@@ -8,7 +8,7 @@ source: ...@@ -8,7 +8,7 @@ source:
path: ../.. path: ../..
build: build:
number: 1 number: 0
skip: True # [win] skip: True # [win]
requirements: requirements:
......
...@@ -8,7 +8,7 @@ source: ...@@ -8,7 +8,7 @@ source:
path: ../.. path: ../..
build: build:
number: 1 number: 0
requirements: requirements:
host: host:
......
#!/bin/bash #!/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 set -e
if [ -z "$PREFIX" ]; then if [ -z "$PREFIX" ]; then
...@@ -9,13 +13,29 @@ fi ...@@ -9,13 +13,29 @@ fi
if [ -z "$cuda" ] || [ "$cuda" == "False" ]; then if [ -z "$cuda" ] || [ "$cuda" == "False" ]; then
CUDA_OPT="" CUDA_OPT=""
else 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 fi
rm -rf build || true rm -rf build || true
mkdir -p build mkdir -p build
cd build cd build
cmake $CUDA_OPT -DUSE_LLVM=ON -DINSTALL_DEV=ON -DCMAKE_INSTALL_PREFIX="$PREFIX" .. cmake $METAL_OPT $CUDA_OPT -DUSE_LLVM=ON -DINSTALL_DEV=ON -DCMAKE_INSTALL_PREFIX="$PREFIX" $TOOLCHAIN_OPT ..
make -j4 VERBOSE=1 make -j${CPU_COUNT} VERBOSE=1
make install make install
cd .. cd ..
...@@ -8,21 +8,17 @@ source: ...@@ -8,21 +8,17 @@ source:
path: ../.. path: ../..
build: build:
number: 1 number: 0
string: cuda{{ cuda_version }}_{{ PKG_BUILDNUM }} # [cuda] string: cuda{{ cuda_version }}_{{ PKG_BUILDNUM }} # [cuda]
requirements: requirements:
build: build:
- {{ compiler('cxx') }} # [linux]
- llvmdev ==6.0.0 # [osx]
host:
# The OS X build will require some manual setup or it will break # 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 # See https://docs.conda.io/projects/conda-build/en/latest/source/resources/compiler-tools.html#macos-sdk
# It is also ass-backward because of llvm brokeness when mixed with the - {{ compiler('cxx') }}
# conda OS X compiler host:
- {{ compiler('cxx') }} # [osx]
- cmake - cmake
- llvmdev ==6.0.0 # [linux] - llvmdev ==6.0.0
- zlib # [linux] - zlib # [linux]
run: run:
- {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, max_pin='x.x') }} # [cuda] - {{ pin_compatible('cudatoolkit', lower_bound=cuda_version, max_pin='x.x') }} # [cuda]
......
...@@ -8,7 +8,7 @@ source: ...@@ -8,7 +8,7 @@ source:
path: ../.. path: ../..
build: build:
number: 1 number: 0
requirements: requirements:
build: build:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment