Skip to content

Commit

Permalink
Merge pull request #30 from adibbley/add-activation
Browse files Browse the repository at this point in the history
Add windows activation scripts
  • Loading branch information
adibbley authored Nov 8, 2023
2 parents cbf8f7c + 3c74590 commit 394f381
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
9 changes: 9 additions & 0 deletions recipe/activate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@echo on

:: Backup environment variables (only if the variables are set)
if defined INCLUDE (
set "INCLUDE_CONDA_NVCC_BACKUP=%INCLUDE%"
)

:: Append `targets` to search path to give exist includes preference
set "INCLUDE=%INCLUDE%;%LIBRARY_INC%\targets\x64"
16 changes: 16 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo on
setlocal enableextensions enabledelayedexpansion || goto :error

:: Activation script
mkdir %PREFIX%\etc\conda\activate.d
copy %RECIPE_DIR%\activate.bat %PREFIX%\etc\conda\activate.d\~cuda-nvcc_activate.bat || goto :error

:: Deactivation script
mkdir %PREFIX%\etc\conda\deactivate.d
copy %RECIPE_DIR%\deactivate.bat %PREFIX%\etc\conda\deactivate.d\~cuda-nvcc_deactivate.bat || goto :error

goto :EOF

:error
echo Failed with error %errorlevel%
exit /b %errorlevel%
7 changes: 7 additions & 0 deletions recipe/deactivate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo on

:: Restore environment variables (if there is anything to restore)
if defined INCLUDE_CONDA_NVCC_BACKUP (
set "INCLUDE=%INCLUDE_CONDA_NVCC_BACKUP%"
set "INCLUDE_CONDA_NVCC_BACKUP="
)
10 changes: 6 additions & 4 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ source:
sha256: 5db25d4fd138013b563f9a3d1d87f7de7df1dac014fd4cccdfbb3435a5cff761

build:
number: 11
number: 12
skip: true # [osx]
skip: true # [target_platform != "linux-64" and target_platform != cross_target_platform]

Expand Down Expand Up @@ -43,9 +43,11 @@ outputs:
run_exports:
strong:
- cuda-version >={{ cuda_version }},<{{ cuda_version.split(".")[0]|int + 1 }}
files: # [linux]
- etc/conda/activate.d/~cuda-nvcc_activate.sh # [linux]
- etc/conda/deactivate.d/~cuda-nvcc_deactivate.sh # [linux]
files:
- etc/conda/activate.d/~cuda-nvcc_activate.sh # [linux]
- etc/conda/deactivate.d/~cuda-nvcc_deactivate.sh # [linux]
- etc/conda/activate.d/~cuda-nvcc_activate.bat # [win]
- etc/conda/deactivate.d/~cuda-nvcc_deactivate.bat # [win]
requirements:
host:
- sysroot_{{ cross_target_platform }} 2.17.* # [linux]
Expand Down
1 change: 1 addition & 0 deletions recipe/test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <cuda_runtime.h>
#include <thrust/version.h>

int main() {
return 0;
Expand Down

0 comments on commit 394f381

Please sign in to comment.