Skip to content

Commit

Permalink
Copied files from sapetnioc/casaconda project
Browse files Browse the repository at this point in the history
  • Loading branch information
sapetnioc committed Jul 11, 2023
1 parent dabf12c commit 9616f04
Show file tree
Hide file tree
Showing 31 changed files with 675 additions and 183 deletions.
87 changes: 87 additions & 0 deletions conda/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Casaconda
Experimental project to test BrainVISA compilation using a build environment setup using Conda.

## Setup of a build environment using Conda

### From scratch

Install OpenGL dev packages
```
sudo apt install libglu1-mesa-dev
```

Select a directory
```
casaconda=/somewhere
```

Download project with config (and source list)
```
git clone https://github.com/sapetnioc/casaconda "$casaconda"
```

Download sources and setup conda directory
```
"$casaconda/setup_dev"
```

Build everything
```
"$casaconda/bv_env" bv_maker
```

At the time of this writing, documentation building is failing.

### Build a repository for Anatomist

It is necessary to have a complete build environment since the packaging scripts only do packages with `make install...` commands.

Install Conda build
```
"$casaconda/conda/bin/mamba" install -y conda-build
```

Run the package creation recipe
```
"$casaconda/conda/bin/mamba" build ~/casaconda/recipe
```

Publish the resulting repository
```
rsync -a --delete "$casaconda/conda/conda-bld/" [email protected]:/var/www/html/brainvisa.info_download/conda/
```

### Install Anatomist from a repository

One can use the repository located in `https://brainvisa.info/download/conda` but it can be replaced by a local directory too, for instance: `file:///home/me/casaconda/conda/conda-bld`.

Install OpenGL libraries (tested on Ubuntu/Windows-WSL2)
```
sudo apt install libgl1-mesa-glx libopengl
```

Select an install directory:
```
conda=/tmp/conda
```

Install Conda. I recommend installing a version that incorporates Mamba (a really much faster C++ implementation for resolving package dependencies) and that defaults to conda-forge (a very well-maintained community package repository with no legal constraints on use).
```
cd /tmp
wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
sh Mambaforge-Linux-x86_64.sh -ubp "$conda"
rm Mambaforge-Linux-x86_64.sh
```

Install Anatomist. It is possible to substitute the repository located in `https://brainvisa.info/download/conda` by a local directory, for instance: `file:///home/me/casaconda/conda/conda-bld`.

```
"$conda/bin/mamba" install -c https://brainvisa.info/download/conda -y anatomist
```


Activate the conda repository and use Anatomist, Aims or whatever:
```
. "$conda/bin/activate"
anatomist
```
29 changes: 0 additions & 29 deletions conda/apptainer.def

This file was deleted.

57 changes: 57 additions & 0 deletions conda/bv_maker.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[ build $CASA_BUILD ]
default_steps = configure build
make_options = -j$NCPU
cmake_options += -DCONDA=$CASA/conda
build_type = Release
packaging_thirdparty = OFF
clean_config = ON
clean_build = ON
test_ref_data_dir = $CASA_TESTS/ref
test_run_data_dir = $CASA_TESTS/test
# directory $CASA_SRC/3dns-private
directory $CASA_SRC/aims-free
directory $CASA_SRC/aims-gpl
directory $CASA_SRC/anatomist-free
directory $CASA_SRC/anatomist-gpl
directory $CASA_SRC/axon
# directory $CASA_SRC/bioprocessing
# directory $CASA_SRC/brainrat-gpl
# directory $CASA_SRC/brainrat-private
# directory $CASA_SRC/brainvisa-cmake
directory $CASA_SRC/brainvisa-disco
directory $CASA_SRC/brainvisa-share
directory $CASA_SRC/brainvisa-spm
directory $CASA_SRC/brainvisa_freesurfer
directory $CASA_SRC/capsul
directory $CASA_SRC/casa-distro
directory $CASA_SRC/catidb-client
directory $CASA_SRC/constellation-gpl
directory $CASA_SRC/constellation-nonfree
directory $CASA_SRC/cortical_surface-gpl
directory $CASA_SRC/cortical_surface-nonfree
directory $CASA_SRC/deidentification
directory $CASA_SRC/highres-cortex
directory $CASA_SRC/longitudinal_pipelines
directory $CASA_SRC/morpho-deepsulci
directory $CASA_SRC/morphologist
directory $CASA_SRC/morphologist-baby
directory $CASA_SRC/morphologist-gpl
directory $CASA_SRC/morphologist-nonfree
directory $CASA_SRC/nuclear_imaging-gpl
directory $CASA_SRC/nuclear_imaging-nonfree
directory $CASA_SRC/populse_db
# directory $CASA_SRC/primatologist-gpl
# QualiCATI install fail
# directory $CASA_SRC/qualicati
# directory $CASA_SRC/rsfmri
# directory $CASA_SRC/sacha-gpl
# directory $CASA_SRC/sacha-nonfree
directory $CASA_SRC/soma-base
directory $CASA_SRC/soma-io
directory $CASA_SRC/soma-workflow
directory $CASA_SRC/sulci-nonfree
# Remove web project because it needs bv_env_host to compile
# directory $CASA_SRC/web
directory $CASA_SRC/whasa-gpl
directory $CASA_SRC/whasa-nonfree

2 changes: 2 additions & 0 deletions conda/recipe/brainvisa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: "5.2.0alpha"
sha256: "38667670abb2063dadcc85b540e9b5ba45d79560a58c2755d0812ea3ab7c2bdc"
1 change: 1 addition & 0 deletions conda/recipe/brainvisa_activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
if [ -e "$CONDA_PREFIX/../"]
Empty file.
9 changes: 9 additions & 0 deletions conda/recipe/casa-distro_activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
for i in "$CONDA_PREFIX/../build/bin/bv_env.sh" "$CONDA_PREFIX/../src/brainvisa-cmake/bin/bv_env.sh" "$CONDA_PREFIX/../src/development/brainvisa-cmake/*/bin/bv_env.sh"; do
if [ -e "$i" ]; then
bv_env_sh="$i"
break
fi
done
if [ -n "$bv_env_sh" ]; then
. "$bv_env_sh"
fi
9 changes: 9 additions & 0 deletions conda/recipe/casa-distro_deactivate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
for i in "$CONDA_PREFIX/../build/bin/bv_unenv.sh" "$CONDA_PREFIX/../src/brainvisa-cmake/bin/bv_unenv.sh" "$CONDA_PREFIX/../src/development/brainvisa-cmake/*/bin/bv_unenv.sh"; do
if [ -e "$i" ]; then
bv_unenv_sh="$i"
break
fi
done
if [ -n "$bv_unenv_sh" ]; then
. "$bv_unenv_sh"
fi
8 changes: 8 additions & 0 deletions conda/recipe/install_anatomist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
components="anatomist-free anatomist-gpl"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
"$CASA/bv_env" make install-$component
done
9 changes: 9 additions & 0 deletions conda/recipe/install_brainrat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
components="brainrat-gpl brainrat-private"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
make install-$component
done

9 changes: 9 additions & 0 deletions conda/recipe/install_brainvisa-base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
components="capsul populse_db soma-base soma-io soma-workflow casa-distro"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
make install-$component
done

9 changes: 9 additions & 0 deletions conda/recipe/install_brainvisa-cortical-surface.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
components="cortical_surface-gpl cortical_surface-nonfree"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
make install-$component
done

9 changes: 9 additions & 0 deletions conda/recipe/install_brainvisa-data-processing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
components="aims-free aims-gpl axon brainvisa-share"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
make install-$component
done

9 changes: 9 additions & 0 deletions conda/recipe/install_brainvisa-disco.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
components="disco"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
make install-$component
done

9 changes: 9 additions & 0 deletions conda/recipe/install_brainvisa-freesurfer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
components="brainvisa_freesurfer"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
make install-$component
done

9 changes: 9 additions & 0 deletions conda/recipe/install_brainvisa-highres-cortex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
components="highres-cortex"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
make install-$component
done

9 changes: 9 additions & 0 deletions conda/recipe/install_brainvisa-spm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
components="brainvisa-spm"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
make install-$component
done

9 changes: 9 additions & 0 deletions conda/recipe/install_morphologist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
components="morpho-deepsulci morphologist-ui morphologist-gpl morphologist-nonfree sulci-nonfree sulci-models-data"

export CASA=$RECIPE_DIR/..
export BRAINVISA_INSTALL_PREFIX="$PREFIX"
cd "$CASA/build"
for component in $components; do
make install-$component
done

Loading

0 comments on commit 9616f04

Please sign in to comment.