Skip to content

Commit

Permalink
WIP windows
Browse files Browse the repository at this point in the history
CUDA can be found, however build is failing because multiple CUDA include paths from diff versions being used at build time
  • Loading branch information
Robadob committed Oct 30, 2023
1 parent 48ebe63 commit 7049a14
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
38 changes: 37 additions & 1 deletion swig/conda/bld.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
"%PYTHON%" -m pip install "pyflamegpu-2.0.0rc1+cuda122-cp38-cp38-linux_x86_64.whl"
:: Enable output of commands executed to make script debugging easier.
@echo on
setlocal enabledelayedexpansion

:: Setup user config
set "build_threads=%FLAMEGPU_CONDA_BUILD_THREADS%"
if "%build_threads%" == "" set "build_threads=1"

set "build_arch="
if not "%FLAMEGPU_CONDA_CUDA_ARCHITECTURES%" == "" (
set "build_arch=-DCMAKE_CUDA_ARCHITECTURES=%FLAMEGPU_CONDA_CUDA_ARCHITECTURES%"
)

mkdir build 2>nul
cd build

cmake .. -DFLAMEGPU_BUILD_PYTHON=ON -DFLAMEGPU_BUILD_PYTHON_VENV=OFF -DFLAMEGPU_BUILD_ALL_EXAMPLES=OFF -DFLAMEGPU_BUILD_PYTHON_CONDA=ON %build_arch% %CMAKE_ARGS% -DPython3_FIND_VIRTUALENV=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DPython3_ROOT_DIR="%BUILD_PREFIX%" -DPython3_EXECUTABLE="%PYTHON%"
:: -DCUDAToolkit_ROOT="%CUDA_PATH%"
if errorlevel 1 exit /b 1

:: Build Python wheel
cmake --build . --config Release --target pyflamegpu --parallel %build_threads%
if errorlevel 1 exit /b 1

:: Install built wheel
for /r "lib\Release\python\dist" %%f in (pyflamegpu*.whl) do (
set "pyfgpu_wheel=%%~f"
goto :found_pyfgpu_wheel
)

:found_pyfgpu_wheel
%PYTHON% -m pip install --no-deps %pyfgpu_wheel%

:: Cleanup
cd ..
rmdir /s /q build

if errorlevel 1 exit 1
8 changes: 7 additions & 1 deletion swig/conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
# https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/main/recipe/conda_build_config.yaml
cuda_compiler:
#- nvcc # [win] # installs/uses cudatoolkit package?
- cuda-nvcc # [linux] # installs/uses cuda-toolkit package?
- cuda-nvcc # [win] # requires -c nvidia
- cuda-nvcc # [linux] # installs/uses cuda-toolkit package?

c_compiler: # [win]
- vs2022 # [win]
cxx_compiler: # [win]
- vs2022 # [win]

0 comments on commit 7049a14

Please sign in to comment.