Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions recipes/sofa-app/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
setlocal EnableDelayedExpansion
@echo on

:: SceneChecking application

:: Configure
cmake %CMAKE_ARGS% ^
-B build-scene-checking ^
-S %SRC_DIR%\applications\projects\SceneChecking ^
-G Ninja ^
-DSCENECHECKING_BUILD_TESTS=OFF ^
-DCMAKE_BUILD_TYPE:STRING=Release
if errorlevel 1 exit 1

:: Build.
cmake --build build-scene-checking --parallel "%CPU_COUNT%"
if errorlevel 1 exit 1

:: Install.
cmake --install build-scene-checking
if errorlevel 1 exit 1

:: runSofa application

:: Configure
cmake %CMAKE_ARGS% ^
-B build-sofa-app ^
-S %SRC_DIR%\applications\projects\runSofa ^
-G Ninja ^
-DCMAKE_BUILD_TYPE:STRING=Release
if errorlevel 1 exit 1

:: Build.
cmake --build build-sofa-app --parallel "%CPU_COUNT%"
if errorlevel 1 exit 1

:: Install.
cmake --install build-sofa-app
if errorlevel 1 exit 1

:: runSofa app requires some data ressources, which will
:: be included in this package

:: Configure
cmake %CMAKE_ARGS% ^
-B build-sofa-examples ^
-S %SRC_DIR%\examples ^
-G Ninja ^
-DCMAKE_BUILD_TYPE:STRING=Release
if errorlevel 1 exit 1

:: Build.
cmake --build build-sofa-examples --parallel "%CPU_COUNT%"
if errorlevel 1 exit 1

:: Install.
cmake --install build-sofa-examples
if errorlevel 1 exit 1
72 changes: 72 additions & 0 deletions recipes/sofa-app/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/sh

set -ex

if [[ $target_platform == osx* ]] ; then
# Dealing with modern C++ for Darwin in embedded catch library.
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
fi

# SceneChecking application
# ----------

# We have to manually set the Rpath for other SOFA libs to the lib/ directory using
# the CMAKE_INSTALL_RPATH cmake variable, as SOFA CMakeLists are not designed
# initially for a per-component compilation & installation
cmake ${CMAKE_ARGS} \
-B build-scene-checking \
-S ./applications/projects/SceneChecking/ \
-G Ninja \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DSCENECHECKING_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib

# build
cmake --build build-scene-checking --parallel ${CPU_COUNT}

# install
cmake --install build-scene-checking

# runSofa application
# ----------

# We have to manually set the Rpath for other SOFA libs to the lib/ directory using
# the CMAKE_INSTALL_RPATH cmake variable, as SOFA CMakeLists are not designed
# initially for a per-component compilation & installation
cmake ${CMAKE_ARGS} \
-B build-sofa-app \
-S ./applications/projects/runSofa/ \
-G Ninja \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib

# build
cmake --build build-sofa-app --parallel ${CPU_COUNT}

# install
cmake --install build-sofa-app

# For macOS, we have to provide this additionnal script as an hotfix
# for users who would like to load SofaPython3 plugin in runSofa
# application.
# See hotfix-sofa-run-macos.sh for more details.
if [[ $target_platform == osx* ]] ; then
cp "${RECIPE_DIR}/hotfix-sofa-run-macos.sh" "${PREFIX}/bin/runSofa_with_python"
fi

# runSofa app requires some data ressources, which will
# be included in this package
# ----------

cmake ${CMAKE_ARGS} \
-B build-sofa-examples \
-S ./examples/ \
-G Ninja \
-DCMAKE_BUILD_TYPE:STRING=Release

# build
cmake --build build-sofa-examples --parallel ${CPU_COUNT}

# install
cmake --install build-sofa-examples
33 changes: 33 additions & 0 deletions recipes/sofa-app/hotfix-sofa-run-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

# For macOS, we provide this additionnal script as an hotfix
# for users who would like to load SofaPython3 plugin in runSofa
# application.
# The bug seems to be linked to the fact that python in conda-forge package
# is linked statically with libpython, and thus embeds symbols in the executable.
# On macOS, if a binary which links dynamically with libpython is loaded with
# such python executable, this leads to a segfault. SofaPython3 embeds both
# python bindings and a python interpreter so far, so it needs python symbols.
# This should be fixed in the future where SofaPython3 will split bindings and interpreter
# part. Meanwhile, we chose to remove the dynamic link to libpython on macOS from
# SofaPython3 to make it usable in python with conda (and will use symbols from
# static linkage of python). If a user wants to load SofaPython3 in runSofa (so outside python),
# it has to preload libpython symbols. This scripts is just an helper to so that.
# Initial issue: https://github.com/sofa-framework/SofaPython3/issues/393
# PR: https://github.com/sofa-framework/SofaPython3/pull/394

if ! python --version; then
echo "No python installation found"
exit 1
fi

PYTHON_VERSION_MAJOR_MINOR=`python -c 'import sys; version=sys.version_info[:2]; print("{0}.{1}".format(*version))'`
echo $PYTHON_VERSION_MAJOR_MINOR

PYTHON_LIB=$CONDA_PREFIX/lib/libpython$PYTHON_VERSION_MAJOR_MINOR.dylib
if [[ ! -f "$PYTHON_LIB" ]]; then
echo "Could not find python library $PYTHON_LIB"
exit 1
fi

DYLD_INSERT_LIBRARIES=$PYTHON_LIB ./runSofa
44 changes: 44 additions & 0 deletions recipes/sofa-app/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
context:
name: sofa-app
version: "25.12.00"
major_minor: ${{ (version | split('.'))[:2] | join('.') }}

package:
name: ${{ name }}
version: ${{ version }}

source:
url: https://github.com/sofa-framework/sofa/archive/refs/tags/v${{ version }}.tar.gz
sha256: 79ad3da07cdb968744344a987a75759a193df7473bceebd94fd5eef49485ed83

build:
number: 0

requirements:
build:
- ${{ compiler('cxx') }}
- ${{ stdlib('c') }}
- cmake
- ninja
host:
- sofa-devel ${{ major_minor }}.*
- sofa-glfw ${{ major_minor }}.*
- cxxopts

tests:
- package_contents:
bin:
- runSofa

about:
homepage: https://github.com/sofa-framework/sofa.git
summary: Applications and ressources for the SOFA framework
license: GPL-2.0-or-later
license_file: applications/projects/LICENSE.GPL.txt
repository: https://github.com/sofa-framework/sofa.git

extra:
recipe-maintainers:
- olivier-roussel
- hugtalbot
- bakpaul
18 changes: 18 additions & 0 deletions recipes/sofa-beamadapter/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
setlocal EnableDelayedExpansion

::Configure
cmake %CMAKE_ARGS% ^
-B build ^
-S %SRC_DIR% ^
-G Ninja ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DBEAMADAPTER_BUILD_TESTS:BOOL=OFF
if errorlevel 1 exit 1

:: Build.
cmake --build build --parallel "%CPU_COUNT%"
if errorlevel 1 exit 1

:: Install.
cmake --install build
if errorlevel 1 exit 1
22 changes: 22 additions & 0 deletions recipes/sofa-beamadapter/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

set -ex

if [[ $target_platform == osx* ]] ; then
# Dealing with modern C++ for Darwin in embedded catch library.
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
fi

cmake ${CMAKE_ARGS} \
-B build \
-S . \
-G Ninja \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DBEAMADAPTER_BUILD_TESTS:BOOL=OFF

# build
cmake --build build --parallel ${CPU_COUNT}

# install
cmake --install build
58 changes: 58 additions & 0 deletions recipes/sofa-beamadapter/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
context:
name: sofa-beamadapter
version: "25.12.00"
major_minor: ${{ (version | split('.'))[:2] | join('.') }}

package:
name: ${{ name }}
version: ${{ version }}

source:
url: https://github.com/sofa-framework/BeamAdapter/archive/refs/tags/release-v${{ major_minor }}.tar.gz
sha256: 73a3cd2f20df43860fc0fd40662c39c6b1f4984cc8e3ac9f6dde87e8ebc861c3

build:
number: 0

requirements:
build:
- ${{ compiler('cxx') }}
- ${{ stdlib('c') }}
- cmake
- ninja
host:
- sofa-devel ${{ major_minor }}.*
- eigen
run:
# sofa-beamadapter is a devel library so it needs sofa-devel at runtime
- sofa-devel ${{ major_minor }}.*
run_exports:
- ${{ pin_subpackage(name, upper_bound='x.x') }}

tests:
- package_contents:
include:
- BeamAdapter/BeamAdapter/config.h
lib:
- BeamAdapter
- script:
- cmake-package-check BeamAdapter
requirements:
run:
- cmake-package-check
- ${{ compiler('c') }}
- ${{ compiler('cxx') }}

about:
homepage: https://www.sofa-framework.org/applications/plugins/timoshenko-beam-catheters/
summary: Plugin implementing Kirchhoff rods to simulate any 1D flexible structure.
license: LGPL-2.1-or-later
license_file: LICENSE.md
documentation: https://sofa-framework.github.io/BeamAdapter/
repository: https://github.com/sofa-framework/BeamAdapter

extra:
recipe-maintainers:
- olivier-roussel
- hugtalbot
- bakpaul
20 changes: 20 additions & 0 deletions recipes/sofa-cosserat/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
setlocal EnableDelayedExpansion

::Configure
cmake %CMAKE_ARGS% ^
-B build ^
-S %SRC_DIR% ^
-G Ninja ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DPython_EXECUTABLE:PATH="%PREFIX%\python.exe" ^
-DSP3_PYTHON_PACKAGES_DIRECTORY:PATH="..\..\lib\site-packages" ^
-DCOSSERAT_BUILD_TESTS:BOOL=OFF
if errorlevel 1 exit 1

:: Build.
cmake --build build --parallel "%CPU_COUNT%"
if errorlevel 1 exit 1

:: Install.
cmake --install build
if errorlevel 1 exit 1
24 changes: 24 additions & 0 deletions recipes/sofa-cosserat/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

set -ex

if [[ $target_platform == osx* ]] ; then
# Dealing with modern C++ for Darwin in embedded catch library.
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
fi

cmake ${CMAKE_ARGS} \
-B build \
-S . \
-G Ninja \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \
-DSP3_PYTHON_PACKAGES_DIRECTORY:PATH=python${PY_VER}/site-packages \
-DCOSSERAT_BUILD_TESTS:BOOL=OFF

# build
cmake --build build --parallel ${CPU_COUNT}

# install
cmake --install build
Loading
Loading