diff --git a/swig/conda/bld.bat b/swig/conda/bld.bat index 937975e4a..2df3800b1 100644 --- a/swig/conda/bld.bat +++ b/swig/conda/bld.bat @@ -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 \ No newline at end of file diff --git a/swig/conda/conda_build_config.yaml b/swig/conda/conda_build_config.yaml index 544e1f51a..3029f9f24 100644 --- a/swig/conda/conda_build_config.yaml +++ b/swig/conda/conda_build_config.yaml @@ -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? \ No newline at end of file + - cuda-nvcc # [win] # requires -c nvidia + - cuda-nvcc # [linux] # installs/uses cuda-toolkit package? + +c_compiler: # [win] + - vs2022 # [win] +cxx_compiler: # [win] + - vs2022 # [win] \ No newline at end of file