These are some cut and paste examples for the usage of Siconos with Guix.
addr=https://raw.githubusercontent.com/siconos/guix-siconos &&
wget -q -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment --ad-hoc --pure \
gcc-toolchain cmake make \
coreutils grep dash \
siconos@4.4 siconos-tutorials@4.4 -- \
dash -c '
tutorials=${GUIX_ENVIRONMENT}/share/siconos/siconos-tutorials
bdir=$tutorials/examples/mechanics/BouncingBall
cp $bdir/BouncingBallTS.ref .
siconos $bdir/BouncingBallTS.cpp'addr=https://raw.githubusercontent.com/siconos/guix-siconos
wget -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment --ad-hoc --pure \
python python-numpy python-matplotlib python-packaging \
siconos@4.4.0.rc3 siconos-tutorials@4.4 dash coreutils sed -- \
dash -c '
tutorials=${GUIX_ENVIRONMENT}/share/siconos/siconos-tutorials
bdir=$tutorials/examples/mechanics/BouncingBall
sed "/matplotlib.use.*/a else:\n matplotlib.use(\"TkAgg\")" \
$bdir/BouncingBallTS.py | python3'addr=https://raw.githubusercontent.com/siconos/guix-siconos
wget -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment --ad-hoc --pure \
siconos@4.5.x siconos-tutorials dash -- \
dash -c '
tutorials=${GUIX_ENVIRONMENT}/share/siconos/siconos-tutorials
siconos $tutorials/examples/mechanics/GeometricPrimitives/cube.py'addr=https://raw.githubusercontent.com/siconos/guix-siconos
wget -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment --pure --ad-hoc \
vtk siconos -- \
siconos_vview cube.hdf5An example of a slider crank with Open Cascade
contactors. The computation is done with a previous version of Siconos
(siconos@4.2) and a specific commit on siconos-tutorials:
addr=https://raw.githubusercontent.com/siconos/guix-siconos &&
wget -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment \
--with-git-url=siconos-tutorials=https://github.com/siconos/siconos-tutorials \
--with-commit=siconos-tutorials=7e1322d1c51224970967e46408b81a84e81b18a8 \
--pure --ad-hoc \
siconos@4.2 siconos-tutorials python pythonocc dash coreutils cmake make gcc-toolchain@7 sed -- \
dash -c '
tutorials=${GUIX_ENVIRONMENT}/share/siconos/siconos-tutorials
cp -r $tutorials/examples/mechanics/OCC_Examples .
cp -r $tutorials/examples/mechanics/Mechanisms .
cd OCC_Examples
sed -i "s/with_timer=True/with_timer=False/" occ_slider_crank.py
siconos occ_slider_crank.py'addr=https://raw.githubusercontent.com/siconos/guix-siconos &&
wget -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment --pure --ad-hoc \
pythonocc vtk siconos@4.2 dash -- dash -c '\
cd OCC_Examples && \
siconos_vview --cf-scale=0.05 occ_slider_crank.hdf5'An example with transformations on siconos-tutorials and siconos
addr=https://raw.githubusercontent.com/siconos/guix-siconos &&
wget -q -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment \
--with-git-url=siconos-tutorials=git@github.com:vacary/siconos-tutorials \
--with-branch=siconos-tutorials=stress_tests \
--with-git-url=siconos=git@github.com:vacary/siconos \
--with-branch=siconos=optimize_2d_granular \
--pure --ad-hoc gcc-toolchain cmake make grep coreutils dash \
siconos siconos-tutorials -- \
dash -c '
tutorials=${GUIX_ENVIRONMENT}/share/siconos/siconos-tutorials
siconos $tutorials/examples/mechanics/2DRigidBodies/Disks_stress_test.cpp'To check code before commit, there is the --with-source option:
git clone --depth 1 git@github.com:siconos/siconos &&
addr=https://raw.githubusercontent.com/siconos/guix-siconos &&
wget -N $addr/channels/siconos-2021-05-05.scm && \
guix time-machine -C siconos-2021-05-05.scm -- \
environment --pure --ad-hoc siconos \
--with-source=siconos=/tmp/siconos -- siconos --helpThis may be needed for debug through gdb and when modifying by hand the installation is convenient. Otherwise, it is preferable to use the transformations on repositories described above as they can be included in scripts.
The siconos package is placed before --ad-hoc option in order to
provide the necessary inputs packages:
git clone --depth 1 git@github.com:siconos/siconos &&
addr=https://raw.githubusercontent.com/siconos/guix-siconos &&
wget -N $addr/channels/siconos-2021-05-05.scm && \
guix time-machine -C siconos-2021-05-05.scm -- \
environment siconos --pure --ad-hoc dash -- \
dash -c 'mkdir -p siconos-build &&
cd siconos-build &&
cmake ../siconos -DWITH_BULLET=1 \
-DCMAKE_INSTALL_PREFIX=/tmp/install-siconos &&
make -j8 &&
make install'With an installation from a direct compilation, the shebang part of
siconos script has not been replaced. It points to local system and
not into the /gnu/store. To avoid the usage of the wrong python
interpreter, it is necessary to call the siconos script with the
python3 executable of the python package:
addr=https://raw.githubusercontent.com/siconos/guix-siconos &&
wget -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment --pure --ad-hoc \
siconos-tutorials@4.4 \
cmake make gcc-toolchain \
python python-packaging \
dash coreutils -- \
dash -c '
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/install-siconos/lib &&
export PYTHONPATH=$PYTHONPATH:/tmp/install-siconos/lib/python3.8/site-packages
tutorials=${GUIX_ENVIRONMENT}/share/siconos/siconos-tutorials
cp $tutorials/examples/mechanics/BouncingBall/BouncingBallTS.ref .
python3 /tmp/install-siconos/bin/siconos \
$tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp'addr=https://raw.githubusercontent.com/siconos/guix-siconos &&
wget -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment --pure --ad-hoc siconos-tutorials@4.4 \
dash python python-numpy python-matplotlib python-packaging -- \
dash -c '
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/install-siconos/lib &&
export PYTHONPATH=$PYTHONPATH:/tmp/install-siconos/lib/python3.8/site-packages
tutorials=${GUIX_ENVIRONMENT}/share/siconos/siconos-tutorials
python3 /tmp/install-siconos/bin/siconos \
$tutorials/examples/mechanics/BouncingBall/BouncingBallTS.py'addr=https://raw.githubusercontent.com/siconos/guix-siconos &&
wget -N $addr/channels/siconos-2021-06-08.scm && \
guix time-machine -C siconos-2021-06-08.scm -- \
environment --pure --ad-hoc siconos-tutorials@4.4 \
dash python python-numpy python-scipy python-h5py python-packaging -- \
dash -c '
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/install-siconos/lib &&
export PYTHONPATH=$PYTHONPATH:/tmp/install-siconos/lib/python3.8/site-packages
tutorials=${GUIX_ENVIRONMENT}/share/siconos/siconos-tutorials
python3 /tmp/install-siconos/bin/siconos \
$tutorials/examples/mechanics/GeometricPrimitives/cube.py'See Guix channels for more information about how to configure guix channels.
- it must include the repository url:
(cons
(channel
(name 'guix-hpc)
(url "https://gitlab.inria.fr/bremond/guix-hpc.git")
(branch "add-siconos"))
%default-channels)- some branch specification may be added:
(list
(channel
(name 'guix-hpc)
(url "https://gitlab.inria.fr/bremond/guix-hpc.git")
(branch "add-siconos"))
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(branch "version-1.4.0")))- for reproducibility commits are necessary:
(list (channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit
"503c2039a280dd52a751a6852b4157fccd1b4195"))
(channel
(name 'guix-siconos)
(url "https://github.com/siconos/guix-siconos")
(commit
"c4c3dcbef8700b98290d5fa5f5b606b32e8096fe")))Some specifications are available in the channel branch of this repository. They are named with this convention:
- without constraints, the channels file is named
siconos-now.scm - with constraints on commits with the same date for Siconos channel
and Guix channel:
siconos-<iso 8601 date of commits>.scm - with different dates for Siconos channel and Guix channel:
siconos-<iso 8601 date of siconos commits>-<iso 8601 date of Guix commits>.scm
addr=https://raw.githubusercontent.com/siconos/guix-siconos
wget -q -N $addr/channels/siconos-now.scmaddr=https://raw.githubusercontent.com/siconos/guix-siconos
wget -q -N $addr/channels/siconos-2021-05-05.scmaddr=https://raw.githubusercontent.com/siconos/guix-siconos
wget -q -N $addr/channels/siconos-now.scm && \
guix time-machine -C siconos-now.scm -- \
describe -f channels 2>/dev/null > \
siconos-$(date --iso-8601).scm