-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conda packaging (experimental WIP) #1131
Draft
Robadob
wants to merge
34
commits into
master
Choose a base branch
from
rob_conda
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
9108703
Build flamegpu binaries(and pyflamegpu linking with shared cuda libs.
Robadob b926d94
WIP conda-build.
Robadob e8a193d
Find swig works now
Robadob 086c96e
final changes of the day
Robadob 5bd7a9a
Enable bash output in conda/build.sh for debugging
ptheywood 42b1fc1
Don't use CMAKE_ARGS for now, it breaks find_jitify on my local machi…
ptheywood 5eaec7e
Switch to using the current committed git state, rather than cloning …
ptheywood 3101a2f
Fix forwarding of FLAMEPGU_CONDA_ env vars for cuda arch and parllleism
ptheywood b858422
Remove redundant(?) -v
Robadob 9cc2cdf
Fix find_jitify()
Robadob 4ee709a
Fix compiler CUDA
Robadob c23862b
This now finds setuptools, but wheel is missing at build time.
Robadob 7d9a92f
setupptolls >= 40.8.0, == is 2.7 only via mambasolve?
ptheywood 2cfb245
try no isolation
ptheywood 77d05db
Add comment about --no-isolation should be conda only
ptheywood 8a0cec4
Try packages being in run?
ptheywood e3a7522
wip
ptheywood 283b0b3
Linux conda tenuously now works.
Robadob 3ea87b1
Fix overlinking warnings.
Robadob 395bb94
Supress python/ast pretty warning
Robadob 39af3fb
WIP windows
Robadob 1659fc1
CMake typos
Robadob f0690a8
Windows now works, warnings still to address (and need to test the pa…
Robadob 245820f
bld.bat cleanup
Robadob 5c67dd4
cleanup build.sh
Robadob 989932e
Fix windows warnings.
Robadob a0df6d2
Add note re version, tbd with Pete.
Robadob f38a298
Fix windows run reqs.
Robadob d8977cf
Split conda recipe into vis and not vis
Robadob fbb9762
Linux will require fontconfig for vis build too
Robadob 6e8170a
Direct vis to conda test branch
Robadob 520debc
Now appears to build vis conda properly on Windows.
Robadob d1b63fd
wip linux opengl stuff (it doesn't work)
Robadob a1f34e8
wasn't meant to commit this
Robadob File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
setlocal EnableDelayedExpansion | ||
:: Enable output of commands executed to make script debugging easier. | ||
@echo on | ||
|
||
:: 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 | ||
|
||
:: Configure CMake | ||
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 -DPython3_ROOT_DIR="%BUILD_PREFIX%" -DPython3_EXECUTABLE="%PYTHON%" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Enable output of bash commands executed to make script debugging easier. | ||
set -x | ||
|
||
# Setup user config | ||
build_threads=${FLAMEGPU_CONDA_BUILD_THREADS:-1} | ||
[[ -z "$FLAMEGPU_CONDA_CUDA_ARCHITECTURES" ]] && build_arch="" || build_arch="-DCMAKE_CUDA_ARCHITECTURES=$FLAMEGPU_CONDA_CUDA_ARCHITECTURES" | ||
|
||
# Locate SWIG | ||
# (CMake can't auto find conda installed SWIG) | ||
swig_exe=$(find ${CONDA_PREFIX} -type f -name swig -print -quit) | ||
swig_dir=$(dirname $(find ${CONDA_PREFIX} -type f -name swig.swg -print -quit)) | ||
if [[ ! -z "$swig_exe" ]] && [[ ! -z "$swig_dir" ]]; then | ||
swig_exe="-DSWIG_EXECUTABLE=$swig_exe" | ||
swig_dir="-DSWIG_DIR=$swig_dir" | ||
else | ||
swig_exe="" | ||
swig_dir="" | ||
fi | ||
|
||
mkdir -p build && cd build | ||
|
||
# Configure CMake | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DFLAMEGPU_BUILD_PYTHON=ON -DFLAMEGPU_BUILD_PYTHON_VENV=OFF -DFLAMEGPU_BUILD_ALL_EXAMPLES=OFF -DFLAMEGPU_BUILD_PYTHON_CONDA=ON $build_arch $swig_exe $swig_dir $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" | ||
|
||
# Build Python wheel | ||
cmake --build . --target pyflamegpu --parallel $build_threads | ||
|
||
# Install built wheel | ||
pyfgpu_wheel=$(find "lib/Release/python/dist/" -type f -name "pyflamegpu*.whl" -print -quit) | ||
$PYTHON -m pip install --no-deps $pyfgpu_wheel | ||
|
||
# Cleanup | ||
cd .. | ||
rm -rf build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# https://docs.conda.io/projects/conda-build/en/3.21.x/resources/compiler-tools.html#using-your-customized-compiler-package-with-conda-build-3 | ||
# https://github.com/rapidsai/cuml/blob/branch-23.12/conda/recipes/libcuml/conda_build_config.yaml | ||
# https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/main/recipe/conda_build_config.yaml | ||
cuda_compiler: | ||
- cuda-nvcc # requires 'conda build -c nvidia conda' on Windows | ||
|
||
c_compiler: # [win] | ||
- vs2022 # [win] | ||
cxx_compiler: # [win] | ||
- vs2022 # [win] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package: | ||
name: "pyflamegpu" | ||
version: "2.0.0rc1" | ||
|
||
source: | ||
# Use the current committed state of the repo, to avoid pinning versions or copying the build directory if using path. | ||
git_url: ../../../ | ||
# git_url: https://github.com/FLAMEGPU/FLAMEGPU2.git | ||
# git_rev: v2.0.0-rc | ||
# git_depth: 1 # Shallow | ||
|
||
# requires: conda config --add channels conda-forge | ||
requirements: | ||
build: | ||
- {{ compiler('cxx') }} | ||
- {{ compiler('cuda') }} | ||
- cuda-cudart-dev # [linux] | ||
- cuda-nvrtc-dev # [linux] | ||
- libcurand-dev # [linux] | ||
- swig ==4.0.2 # Have to manually direct swig to find this | ||
- git | ||
- cmake | ||
host: | ||
- python | ||
- astpretty | ||
- python-devtools | ||
- pip | ||
- setuptools >=40.8.0 | ||
- wheel | ||
- build | ||
|
||
run: | ||
- python | ||
- astpretty | ||
- cuda-cudart | ||
- cuda-nvrtc | ||
|
||
build: | ||
# Allow certain env vars to be passed through to build.sh. this seems to set warnings... | ||
# Probably need to add other env vars CMake might expect to this? | ||
script_env: | ||
- FLAMEGPU_CONDA_BUILD_THREADS | ||
- FLAMEGPU_CONDA_CUDA_ARCHITECTURES | ||
missing_dso_whitelist: | ||
- $RPATH/libcuda.so.1 # [linux] Ignore as this comes from CUDA driver | ||
- $RPATH/libnvrtc.so.12 # [linux] Conda-build can't find this in run reqs cuda-cudart?? | ||
- $RPATH/libcudart.so.12 # [linux] Conda-build can't find this in run reqs cuda-nvrtc?? | ||
- $RPATH/nvrtc64_120_0.dll # [win64] Conda-build can't find this in run reqs cuda-cudart?? | ||
- $RPATH/cudart64_12.dll # [win64] Conda-build can't find this in run reqs cuda-nvrtc?? | ||
ignore_run_exports: | ||
- python # [linux] Not clear why conda thinks this isn't used | ||
- astpretty # [linux, win64] Not clear why conda thinks this isn't used | ||
- vc14_runtime # [win64] Not clear why conda thinks this isn't used (we aren't static linking) | ||
- ucrt # [win64] Not clear why conda thinks this isn't used (we aren't static linking) | ||
|
||
test: | ||
imports: | ||
- pyflamegpu | ||
- pyflamegpu.codegen | ||
|
||
about: | ||
home: https://flamegpu.com/ | ||
license: MIT | ||
license_family: MIT | ||
summary: GPU accelerated agent based modelling framework for Python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
setlocal EnableDelayedExpansion | ||
:: Enable output of commands executed to make script debugging easier. | ||
@echo on | ||
|
||
:: 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 | ||
|
||
:: Configure CMake | ||
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 -DPython3_ROOT_DIR="%BUILD_PREFIX%" -DPython3_EXECUTABLE="%PYTHON%" -DFLAMEGPU_VISUALISATION=ON | ||
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just leaving this here as a future reminder for when conda picks back up - astpretty is only a dependency of a test, not actually a pyflamegpu, so conda is correct (see #1164)