Skip to content

Commit 01e90fa

Browse files
committed
pixi: Add pixi.toml
1 parent 53f16d0 commit 01e90fa

9 files changed

+9016
-0
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# GitHub syntax highlighting
2+
pixi.lock linguist-language=YAML
3+

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
*~
22
*build*
3+
# pixi environments
4+
.pixi

.pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ repos:
2121
rev: v0.23.1
2222
hooks:
2323
- id: toml-sort-fix
24+
exclude: pixi.toml
2425
- repo: https://github.com/pre-commit/mirrors-clang-format
2526
rev: v19.1.1
2627
hooks:

pixi.lock

+8,845
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
[project]
2+
name = "eigenpy"
3+
version = "3.10.0"
4+
description = "Bindings between Numpy and Eigen using Boost.Python"
5+
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
6+
channels = ["conda-forge"]
7+
license = "BSD-2-Clause"
8+
license-file = "LICENSE"
9+
10+
[build-dependencies]
11+
ccache = ">=4.9.1"
12+
cmake = ">=3.10"
13+
cxx-compiler = ">=1.7.0"
14+
ninja = ">=1.11"
15+
pkg-config = ">=0.29.2"
16+
git = ">=2.47.0"
17+
18+
[dependencies]
19+
libboost-devel = ">=1.80.0"
20+
libboost-python-devel = ">=1.80.0"
21+
eigen = ">=3.4.0"
22+
numpy = ">=1.22.0"
23+
python = ">=3.9.0"
24+
scipy = ">=1.10.0"
25+
26+
[activation]
27+
scripts = ["scripts/activation.sh"]
28+
29+
[target.win-64.activation]
30+
scripts = ["scripts/activation.bat"]
31+
32+
[tasks]
33+
# We must avoid to set CMAKE_CXX_FLAGS because of WIN32
34+
# https://discourse.cmake.org/t/strictly-appending-to-cmake-lang-flags/6478
35+
configure = { cmd = [
36+
"CXXFLAGS=$EIGENPY_CXX_FLAGS",
37+
"cmake",
38+
"-G",
39+
"Ninja",
40+
"-B",
41+
"build",
42+
"-S",
43+
".",
44+
"-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX",
45+
"-DCMAKE_BUILD_TYPE=$EIGENPY_BUILD_TYPE",
46+
"-DGENERATE_PYTHON_STUBS=$EIGENPY_PYTHON_STUBS",
47+
"-DBUILD_WITH_CHOLMOD_SUPPORT=$EIGENPY_CHOLMOD_SUPPORT",
48+
"-DBUILD_WITH_ACCELERATE_SUPPORT=$EIGENPY_ACCELERATE_SUPPORT",
49+
] }
50+
build = { cmd = "cmake --build build --target all", depends_on = ["configure"] }
51+
clean = { cmd = "rm -rf build" }
52+
test = { cmd = "ctest --test-dir build --output-on-failure", depends_on = [
53+
"build",
54+
] }
55+
56+
[feature.lint]
57+
dependencies = { pre-commit = ">=3.6.2" }
58+
tasks = { lint = { cmd = "pre-commit run --all" } }
59+
60+
# Cholmod support
61+
[feature.cholmod]
62+
dependencies = { suitesparse = ">=5" }
63+
activation = { env = { EIGENPY_CHOLMOD_SUPPORT = "ON" } }
64+
65+
# Accelerate only work on Apple ARM platform
66+
[feature.accelerate]
67+
[feature.accelerate.target.osx-arm64]
68+
activation = { env = { EIGENPY_ACCELERATE_SUPPORT = "ON" } }
69+
70+
[feature.py312.dependencies]
71+
python = "3.12.*"
72+
73+
[feature.py39.dependencies]
74+
python = "3.9.*"
75+
76+
# Use clang-cl on Windows.
77+
# We must use scripts instead of env to setup CC and CXX
78+
# to avoid cxx-compiler to overwrite them.
79+
[feature.clang-cl]
80+
platforms = ["win-64"]
81+
activation = { scripts = ["scripts/activation_clang_cl.bat"] }
82+
83+
# Use clang on GNU/Linux.
84+
# We must use scripts instead of env to setup CC and CXX
85+
# to avoid cxx-compiler to overwrite them.
86+
[feature.clang]
87+
platforms = ["linux-64"]
88+
activation = { scripts = ["scripts/activation_clang.sh"] }
89+
dependencies = { clangxx = "*" }
90+
91+
[environments]
92+
default = { features = ["py312"], solve-group = "py312" }
93+
clang = { features = ["clang", "py312"] }
94+
lint = { features = ["lint"], solve-group = "py312" }
95+
cholmod = { features = ["cholmod", "py312"], solve-group = "py312" }
96+
accelerate = { features = ["accelerate", "py312"], solve-group = "py312" }
97+
py39 = { features = ["py39"], solve-group = "py39" }
98+
# Accelerate will only work in Eigen next release
99+
all = { features = ["cholmod", "py312"], solve-group = "py312" }
100+
all-py39 = { features = ["cholmod", "py39"], solve-group = "py39" }
101+
all-clang-cl = { features = [
102+
"cholmod",
103+
"clang-cl",
104+
"py312",
105+
], solve-group = "py312" }

scripts/activation.bat

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
:: Setup ccache
2+
set CMAKE_CXX_COMPILER_LAUNCHER=ccache
3+
4+
:: Create compile_commands.json for language server
5+
set CMAKE_EXPORT_COMPILE_COMMANDS=1
6+
7+
:: Activate color output with Ninja
8+
set CMAKE_COLOR_DIAGNOSTICS=1
9+
10+
:: Set default build value only if not previously set
11+
if not defined EIGENPY_BUILD_TYPE (set EIGENPY_BUILD_TYPE=Release)
12+
if not defined EIGENPY_PYTHON_STUBS (set EIGENPY_PYTHON_STUBS=ON)
13+
if not defined EIGENPY_CHOLMOD_SUPPORT (set EIGENPY_CHOLMOD_SUPPORT=OFF)
14+
if not defined EIGENPY_ACCELERATE_SUPPORT (set EIGENPY_ACCELERATE_SUPPORT=OFF)

scripts/activation.sh

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#! /bin/bash
2+
# Activation script
3+
4+
# Remove flags setup from cxx-compiler
5+
unset CFLAGS
6+
unset CPPFLAGS
7+
unset CXXFLAGS
8+
unset DEBUG_CFLAGS
9+
unset DEBUG_CPPFLAGS
10+
unset DEBUG_CXXFLAGS
11+
unset LDFLAGS
12+
13+
if [[ $host_alias == *"apple"* ]];
14+
then
15+
# On OSX setting the rpath and -L it's important to use the conda libc++ instead of the system one.
16+
# If conda-forge use install_name_tool to package some libs, -headerpad_max_install_names is then mandatory
17+
export LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-rpath,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
18+
elif [[ $host_alias == *"linux"* ]];
19+
then
20+
# On GNU/Linux, I don't know if these flags are mandatory with g++ but
21+
# it allow to use clang++ as compiler
22+
export LDFLAGS="-Wl,-rpath,$CONDA_PREFIX/lib -Wl,-rpath-link,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
23+
fi
24+
25+
# Setup ccache
26+
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
27+
28+
# Create compile_commands.json for language server
29+
export CMAKE_EXPORT_COMPILE_COMMANDS=1
30+
31+
# Activate color output with Ninja
32+
export CMAKE_COLOR_DIAGNOSTICS=1
33+
34+
# Set default build value only if not previously set
35+
export EIGENPY_BUILD_TYPE=${EIGENPY_BUILD_TYPE:=Release}
36+
export EIGENPY_PYTHON_STUBS=${EIGENPY_PYTHON_STUBS:=ON}
37+
export EIGENPY_CHOLMOD_SUPPORT=${EIGENPY_CHOLMOD_SUPPORT:=OFF}
38+
export EIGENPY_ACCELERATE_SUPPORT=${EIGENPY_ACCELERATE_SUPPORT:=OFF}

scripts/activation_clang.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /bin/bash
2+
# Clang activation script
3+
4+
export CC="clang"
5+
export CXX="clang++"

scripts/activation_clang_cl.bat

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:: Setup clang-cl compiler
2+
set CC=clang-cl
3+
set CXX=clang-cl

0 commit comments

Comments
 (0)