Skip to content

Commit

Permalink
Switch to using CMake to build & install
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Feb 14, 2024
1 parent cf3179c commit c7ead53
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 22 deletions.
29 changes: 18 additions & 11 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
if not exist %PREFIX% mkdir %PREFIX%
mkdir %LIBRARY_LIB%\cmake
mkdir %LIBRARY_INC%
@echo on

move lib\cmake\cccl %LIBRARY_LIB%\cmake
mkdir build_release
if errorlevel 1 exit 1

move thrust\thrust\cmake %LIBRARY_LIB%\cmake\thrust
move cub\cub\cmake %LIBRARY_LIB%\cmake\cub
move libcudacxx\lib\cmake\libcudacxx %LIBRARY_LIB%\cmake
pushd build_release
if errorlevel 1 exit 1

move thrust\thrust %LIBRARY_INC%
move cub\cub %LIBRARY_INC%
move libcudacxx\include\cuda %LIBRARY_INC%
move libcudacxx\include\nv %LIBRARY_INC%
cmake %CMAKE_ARGS% ^
-G "Ninja" ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DCMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_LIBDIR:PATH=%LIBRARY_LIB% ^
"%SRC_DIR%"
if errorlevel 1 exit 1

cmake --build . --target install
if errorlevel 1 exit 1

popd
if errorlevel 1 exit 1
24 changes: 13 additions & 11 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/bin/bash
#!/usr/bin/env bash

mkdir -p ${PREFIX}/lib/cmake
mkdir -p ${PREFIX}/include
set -xeuo pipefail

cp -rv lib/cmake/cccl ${PREFIX}/lib/cmake
mkdir build_release
pushd build_release

mv -v thrust/thrust/cmake ${PREFIX}/lib/cmake/thrust
mv -v cub/cub/cmake ${PREFIX}/lib/cmake/cub
cp -rv libcudacxx/lib/cmake/libcudacxx ${PREFIX}/lib/cmake
cmake ${CMAKE_ARGS} \
-G "Ninja" \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH="${PREFIX}" \
-DCMAKE_INSTALL_LIBDIR:PATH="${PREFIX}/lib" \
"${SRC_DIR}"

cp -rv thrust/thrust ${PREFIX}/include
cp -rv cub/cub ${PREFIX}/include
cp -rv libcudacxx/include/cuda ${PREFIX}/include
cp -rv libcudacxx/include/nv ${PREFIX}/include
cmake --build . --target install

popd
13 changes: 13 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ source:
build:
number: 0
skip: true # [osx]
skip: true # [cuda_compiler_version != "11.8"]
ignore_run_exports_from:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- {{ compiler("cuda") }}

requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- {{ compiler("cuda") }}
- cmake
- ninja

test:
commands:
Expand Down

0 comments on commit c7ead53

Please sign in to comment.