diff --git a/conda/README.md b/conda/README.md new file mode 100644 index 00000000..fb9740fd --- /dev/null +++ b/conda/README.md @@ -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/" brainvisa@brainvisa.info:/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 +``` diff --git a/conda/apptainer.def b/conda/apptainer.def deleted file mode 100644 index a4f61d96..00000000 --- a/conda/apptainer.def +++ /dev/null @@ -1,29 +0,0 @@ -Bootstrap: docker -From: centos:7 - -%environment - export CASA=/casa - export CASA_CONF=$CASA/conf - export HOME=$CASA/home - export CASA_SRC=$CASA/src - export CASA_BUILD=$CASA/build - export CASA_INSTALL=$CASA/install - export CASA_TESTS=$CASA/tests - -%post - mkdir /casa - #apt update - #apt install distro-info-data # to get lsb_release - -%runscript - if [ "$UID" != "0" ]; then - export BRAINVISA_BVMAKER_CFG=$CASA_SRC/bv_maker.cfg - for f in "$CASA_SRC/environment.sh" "$CASA_CONF/environment.sh" "$CASA/environment.sh"; do - if [ -e "$f" ]; then - source "$f" - fi - done - export PATH=/casa/conda/bin:$PATH - export LD_LIBRARY_PATH=/casa/conda/lib:$LD_LIBRARY_PATH - fi - exec "$@" diff --git a/conda/bv_maker.cfg b/conda/bv_maker.cfg new file mode 100644 index 00000000..04b46dd0 --- /dev/null +++ b/conda/bv_maker.cfg @@ -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 + diff --git a/conda/recipe/brainvisa.yaml b/conda/recipe/brainvisa.yaml new file mode 100644 index 00000000..73c691f8 --- /dev/null +++ b/conda/recipe/brainvisa.yaml @@ -0,0 +1,2 @@ +version: "5.2.0alpha" +sha256: "38667670abb2063dadcc85b540e9b5ba45d79560a58c2755d0812ea3ab7c2bdc" diff --git a/conda/recipe/brainvisa_activate.sh b/conda/recipe/brainvisa_activate.sh new file mode 100644 index 00000000..08d17297 --- /dev/null +++ b/conda/recipe/brainvisa_activate.sh @@ -0,0 +1 @@ +if [ -e "$CONDA_PREFIX/../"] \ No newline at end of file diff --git a/conda/recipe/brainvisa_deactivate.sh b/conda/recipe/brainvisa_deactivate.sh new file mode 100644 index 00000000..e69de29b diff --git a/conda/recipe/casa-distro_activate.sh b/conda/recipe/casa-distro_activate.sh new file mode 100644 index 00000000..f78a3eef --- /dev/null +++ b/conda/recipe/casa-distro_activate.sh @@ -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 diff --git a/conda/recipe/casa-distro_deactivate.sh b/conda/recipe/casa-distro_deactivate.sh new file mode 100644 index 00000000..cc502a4f --- /dev/null +++ b/conda/recipe/casa-distro_deactivate.sh @@ -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 diff --git a/conda/recipe/install_anatomist.sh b/conda/recipe/install_anatomist.sh new file mode 100644 index 00000000..e3bf47de --- /dev/null +++ b/conda/recipe/install_anatomist.sh @@ -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 diff --git a/conda/recipe/install_brainrat.sh b/conda/recipe/install_brainrat.sh new file mode 100755 index 00000000..3d9cbebe --- /dev/null +++ b/conda/recipe/install_brainrat.sh @@ -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 + diff --git a/conda/recipe/install_brainvisa-base.sh b/conda/recipe/install_brainvisa-base.sh new file mode 100755 index 00000000..f7da6099 --- /dev/null +++ b/conda/recipe/install_brainvisa-base.sh @@ -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 + diff --git a/conda/recipe/install_brainvisa-cortical-surface.sh b/conda/recipe/install_brainvisa-cortical-surface.sh new file mode 100755 index 00000000..d83fd693 --- /dev/null +++ b/conda/recipe/install_brainvisa-cortical-surface.sh @@ -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 + diff --git a/conda/recipe/install_brainvisa-data-processing.sh b/conda/recipe/install_brainvisa-data-processing.sh new file mode 100755 index 00000000..7dd2bcd0 --- /dev/null +++ b/conda/recipe/install_brainvisa-data-processing.sh @@ -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 + diff --git a/conda/recipe/install_brainvisa-disco.sh b/conda/recipe/install_brainvisa-disco.sh new file mode 100755 index 00000000..bb4e53dc --- /dev/null +++ b/conda/recipe/install_brainvisa-disco.sh @@ -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 + diff --git a/conda/recipe/install_brainvisa-freesurfer.sh b/conda/recipe/install_brainvisa-freesurfer.sh new file mode 100755 index 00000000..061447ba --- /dev/null +++ b/conda/recipe/install_brainvisa-freesurfer.sh @@ -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 + diff --git a/conda/recipe/install_brainvisa-highres-cortex.sh b/conda/recipe/install_brainvisa-highres-cortex.sh new file mode 100755 index 00000000..d21bc177 --- /dev/null +++ b/conda/recipe/install_brainvisa-highres-cortex.sh @@ -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 + diff --git a/conda/recipe/install_brainvisa-spm.sh b/conda/recipe/install_brainvisa-spm.sh new file mode 100755 index 00000000..5953486c --- /dev/null +++ b/conda/recipe/install_brainvisa-spm.sh @@ -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 + diff --git a/conda/recipe/install_morphologist.sh b/conda/recipe/install_morphologist.sh new file mode 100755 index 00000000..bfbc5dbd --- /dev/null +++ b/conda/recipe/install_morphologist.sh @@ -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 + diff --git a/conda/recipe/meta.yaml b/conda/recipe/meta.yaml new file mode 100644 index 00000000..5730068f --- /dev/null +++ b/conda/recipe/meta.yaml @@ -0,0 +1,259 @@ +{% set brainvisa = load_file_data(os.path.join(RECIPE_DIR, 'brainvisa.yaml')) %} + +package: + name: brainvisa + version: {{ brainvisa.version }} + +source: + # url: https://brainvisa.info/download/conda/brainvisa-{{ brainvisa.version }}.tar.xz + # url: file:///home/yann/casaconda/repository/brainvisa-{{ brainvisa.version }}.tar.xz + # sha256: {{ brainvisa.sha256 }} + path: ../src + +build: + number: 0 + # Build only on linux with Python >= 3.9 + skip: True # [not linux] + skip: True # [py<39] + + +outputs: + - name: brainvisa-base + script: install_brainvisa-base.sh + + requirements: + build: + - sysroot-conda_2_28-x86_64 + - cmake + - make + - pkg-config + + run: + - sysroot-conda_2_28-x86_64 + - {{ pin_compatible('sysroot_linux-64', max_pin='x.x') }} + - {{ pin_compatible('libstdcxx-ng', min_pin='x.x', max_pin='x') }} + - {{ pin_compatible('libgcc-ng', min_pin='x.x', max_pin='x') }} + - font-ttf-noto-emoji + - lsb-release + - matplotlib 3.4.3 + - mesa + - pyqt + - qtconsole + - xorg-libx11 + - pydantic >=1.9 + - redis-py >=4.2 + - nipype + - dipy + - pycryptodome + - cryptography # needed by populse_mia + - html2text + - openpyxl + - paramiko + - pillow + - requests + - six + - sqlalchemy + - traits + - xmltodict + - yaml + - joblib + - configobj + - mpi4py + - nibabel + - pyparsing + - pydot + - pydicom + - cython + - xlrd + - xlwt + - pandas + - lark + - pyzmq + - ipython + - nbsphinx + - sphinx-gallery + - numpy + - fastcluster + - h5py + - scipy + - scikit-image + - pyopengl + - plotly + - pcl + - celery # used by Capsul v3 + - pycryptodome + - gdk-pixbuf + - libgfortran5 + - cairo + - dcmtk + - libgfortran5 + - mesalib + - libglib + - libglu + - libgomp + - hdf5 + - libjpeg-turbo + - jxrlib + - libllvm14 + - netcdf4 + - openjpeg + - libpng + - qwt + - 'libsigcpp<3' + - libsvm + - libtiff + - libxml2 + - zstd + - libnetcdf + - draco + about: + summary: Software base infrastructure for BrainVISA tools + license: GPL + + - name: brainvisa-data-processing + script: install_brainvisa-data-processing.sh + requirements: + build: + - cmake + - make + - pkg-config + run: + - {{ pin_subpackage('brainvisa-base', exact=True) }} + about: + summary: Data readers/writers and processing tools in C++ and Python + license: GPL + + - name: anatomist + script: install_anatomist.sh + requirements: + build: + - cmake + - make + - pkg-config + + run: + - {{ pin_subpackage('brainvisa-data-processing', exact=True) }} + + about: + summary: Neuroimaging visualization tool for the BrainVISA project + license: CeCILL + + - name: brainvisa-disco + script: install_brainvisa-disco.sh + requirements: + build: + - cmake + - make + - pkg-config + run: + - {{ pin_subpackage('anatomist', exact=True) }} + - {{ pin_subpackage('brainvisa-spm', exact=True) }} + about: + summary: Neuroimaging method for cross-subject brain alignment. + license: GPL + + - name: brainvisa-spm + script: install_brainvisa-spm.sh + requirements: + build: + - cmake + - make + - pkg-config + run: + - {{ pin_subpackage('anatomist', exact=True) }} + about: + summary: Links between SPM and BrainVISA. + license: GPL + + - name: brainvisa-freesurfer + script: install_brainvisa-freesurfer.sh + requirements: + build: + - cmake + - make + - pkg-config + run: + - {{ pin_subpackage('anatomist', exact=True) }} + about: + summary: Links between Freesurfer and BrainVISA. + license: GPL + + - name: brainvisa-cortical-surface + script: install_brainvisa-cortical-surface.sh + requirements: + build: + - cmake + - make + - pkg-config + run: + - {{ pin_subpackage('anatomist', exact=True) }} + about: + summary: BrainVISA toolbox providing surface-based generation and processing methods for MR brain data. + license: GPL + + - name: brainvisa-highres-cortex + script: install_brainvisa-highres-cortex.sh + requirements: + build: + - cmake + - make + - pkg-config + run: + - {{ pin_subpackage('anatomist', exact=True) }} + about: + summary: Analysis of the laminar structure of the cortex in high resolution MRI. + license: GPL + + - name: morphologist + script: install_morphologist.sh + requirements: + build: + - cmake + - make + - pkg-config + run: + - {{ pin_subpackage('anatomist', exact=True) }} + about: + summary: Brain segmentation and sulcal analysis. + license: GPL + + # - name: brainrat + # script: install_brainrat.sh + # requirements: + # build: + # - cmake + # - make + # - pkg-config + # run: + # - {{ pin_subpackage('anatomist', exact=True) }} + # about: + # summary: 3D histology, reconstruction and analysis. + # license: GPL + + - name: brainvisa + script: noop.sh + requirements: + run: + - {{ pin_subpackage('brainvisa-base', exact=True) }} + - {{ pin_subpackage('brainvisa-data-processing', exact=True) }} + - {{ pin_subpackage('brainvisa-disco', exact=True) }} + - {{ pin_subpackage('brainvisa-spm', exact=True) }} + - {{ pin_subpackage('brainvisa-freesurfer', exact=True) }} + - {{ pin_subpackage('brainvisa-highres-cortex', exact=True) }} + - {{ pin_subpackage('morphologist', exact=True) }} + # - {{ pin_subpackage('brainrat', exact=True) }} + + about: + summary: All BrainVISA software + license: CeCILL + +about: + home: https://brainvisa.info + license: GPL + summary: Neuroimaging software platform for mass data analysis + description: | + BrainVISA provides a complete, modular, infrastructure for neuroimaging + software. It helps organizing heterogeneous software and data and + provides a common general graphical interface for users. + BrainVISA is thus a set of tools rather than a single software. + diff --git a/conda/recipe/noop.sh b/conda/recipe/noop.sh new file mode 100644 index 00000000..e69de29b diff --git a/conda/setup_conda b/conda/setup_conda index 7962996e..57a66158 100755 --- a/conda/setup_conda +++ b/conda/setup_conda @@ -1,70 +1,26 @@ -#!/bin/bash +#!/bin/sh -set -e -set -x -casaconda="$1" -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -if [ -z "$casaconda" ]; then - echo "Missing destination directory" - exit 1 -fi - -if [ ! -e "$casaconda" ]; then - mkdir "$casaconda" +installer_url=https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh +# installer_url=https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh +# installer_url=https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh +installer=$(echo $installer_url | awk '{split($0, s, "/"); print(s[length(s)])}') +if [ ! -e "$CASA/$installer" ]; then + wget -O "$CASA/$installer" $installer_url fi -if [ ! -e "$casaconda/home" ]; then - mkdir "$casaconda/home" - for f in .gitconfig .git-credentials; do - if [ -e "$HOME/$f" ]; then - cp "$HOME/$f" "$casaconda/home" - fi - done +mkdir "$CONDA" +sh "$CASA/$installer" -u -b -p "$CONDA" +if [ -e "$CONDA/bin/mamba" ]; then + # If mamba is installed, we use conda-forge + export conda="$CONDA/bin/mamba" + export conda_install="-y" + # Use most recent glibc ABI (the one used by conda-forge to compile Qt) + "$conda" install -y sysroot-conda_2_28-x86_64 +else + # mamba is not installed, we use anaconda + export conda="$CONDA/bin/conda" + export conda_install="-y --solver=libmamba" + # Install packages to use mamba to find packages + "$conda" install -y -n base conda-libmamba-solver fi - -system_image="$casaconda/system" -apptainer="apptainer -s run --containall -B $casaconda:/casa -B /tmp $system_image" -root_apptainer="apptainer run --writable --fakeroot --containall -B $casaconda:/casa -B /tmp $system_image" - -if [ ! -e "$system_image" ]; then - apptainer build --sandbox "$casaconda/system" "$script_dir/apptainer.def" - $root_apptainer /casa/src/casa-distro/conda/setup_run_apt - $root_apptainer /casa/src/casa-distro/conda/setup_dev_apt -fi - -if [ ! -e "$casaconda/Miniforge3-Linux-x86_64.sh" ]; then - wget -O "$casaconda/Miniforge3-Linux-x86_64.sh" https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -fi - - -conda="$apptainer /casa/conda/bin/conda" -if [ ! -e "$casaconda/conda" ]; then - mkdir "$casaconda/conda" - $apptainer sh "/casa/Miniforge3-Linux-x86_64.sh" -u -b -p "/casa/conda" -# $conda update conda -y - $conda install -y mamba - $apptainer /casa/src/casa-distro/conda/setup_run_conda - $apptainer /casa/src/casa-distro/conda/setup_dev_conda -fi - -$root_apptainer /casa/src/casa-distro/conda/setup_run_compiled - -if [ ! -e "$casaconda/src" ]; then - $apptainer git clone https://github.com/sapetnioc/brainvisa-submodules /casa/src - $apptainer git -C /casa/src submodule update --init --recursive - cd $casaconda/src - for d in *; do - if [ -d "$d" ]; then - main_branch=$( $apptainer git -C /casa/src/$d branch -r --contains HEAD --format '%(refname)' | grep --invert-match HEAD | python -c 'import sys; print(sys.stdin.read().split("/")[-1])' ) - $apptainer git -C "/casa/src/$d" checkout $main_branch - fi - done -fi - - -# Update all sources -# $apptainer git -C /casa/src submodule foreach git pull - -$apptainer /casa/src/brainvisa-cmake/bin/bv_env bash diff --git a/conda/setup_dev b/conda/setup_dev new file mode 100755 index 00000000..2c93f4e5 --- /dev/null +++ b/conda/setup_dev @@ -0,0 +1,24 @@ +#!/bin/sh + +export CASA=$( dirname $(readlink -f "$0") ) +export CONDA="$CASA/conda" +export CASA_SRC="$CASA/src" + +set -e +set -x + +if [ ! -e "$CASA_SRC" ]; then + mkdir "$CASA_SRC" + "$CASA/setup_src" +fi + + + +if [ ! -e "$CONDA" ]; then + . "$CASA/setup_conda" + ln -s ../../../../recipe/casa-distro_activate.sh "$CONDA/etc/conda/activate.d" + ln -s ../../../../recipe/casa-distro_deactivate.sh "$CONDA/etc/conda/deactivate.d" + "$CASA/setup_run_conda" + "$CASA/setup_run_compiled" + "$CASA/setup_dev_conda" +fi diff --git a/conda/setup_dev_apt b/conda/setup_dev_apt deleted file mode 100755 index 0f055797..00000000 --- a/conda/setup_dev_apt +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/bash - -# -# Setup run dependencies with apt -# - -set -x -set -e - -#apt install -y libgl1-mesa-dev -yum install -y mesa-libGL diff --git a/conda/setup_dev_conda b/conda/setup_dev_conda index a26dcef9..d0fe103f 100755 --- a/conda/setup_dev_conda +++ b/conda/setup_dev_conda @@ -7,9 +7,7 @@ set -x set -e -conda=/casa/conda/bin/mamba - -if [ -e /casa/conda/bin/gdb ]; then +if [ -e "$CASA/conda/bin/gdb" ]; then # if gdb is installed, we assume that this script has already been # executed. echo "setup_dev_conda already executed => execution canceled" @@ -121,4 +119,4 @@ brainvisa_standard_dev_dependencies=( #! zlib1g-dev ) -$conda install -y ${version_control_packages[@]} ${toolchain_packages[@]} ${documentation_building_packages[@]} ${brainvisa_standard_dev_dependencies[@]} +$conda install $conda_install ${version_control_packages[@]} ${toolchain_packages[@]} ${documentation_building_packages[@]} ${brainvisa_standard_dev_dependencies[@]} diff --git a/conda/setup_repository b/conda/setup_repository new file mode 100755 index 00000000..221dd029 --- /dev/null +++ b/conda/setup_repository @@ -0,0 +1,28 @@ +#!/bin/sh + +export CASA=$( dirname $(readlink -f "$0") ) +export CONDA="$CASA/conda" +SRC="$CASA/src" +REPOSITORY="$CASA/repository" + +set -e +set -x + +if [ ! -e "$REPOSITORY" ]; then + mkdir "$REPOSITORY" +fi + +version=5.2.alpha + +cd "$SRC" +components=$( echo * ) +components="soma-base soma-workflow soma-io" +tar Jcf "$REPOSITORY/brainvisa-$version.tar.xz" $components +cd "$REPOSITORY" +sha256=$( sha256sum "$REPOSITORY/brainvisa-$version.tar.xz" | awk '{print $1}' ) +cat > "$CASA/recipe/brainvisa.yaml" << EOF +version: "$version" +sha256: "$sha256" +EOF + +$CASA/conda/bin/mamba build -b--no-anaconda-upload \ No newline at end of file diff --git a/conda/setup_run b/conda/setup_run new file mode 100755 index 00000000..39fc10bc --- /dev/null +++ b/conda/setup_run @@ -0,0 +1,18 @@ +#!/bin/sh + +export CASA=$( dirname $(readlink -f "$0") ) +!/bin/sh + +export CASA=$( dirname $(readlink -f "$0") ) +export CONDA="$CASA/install" + +set -e +set -x + +if [ ! -e "$CONDA" ]; then + . "$CASA/setup_conda" + $CASA/setup_run_conda + export BRAINVISA_INSTALL_PREFIX="$CONDA" + cd "$CASA/build" + "$CASA/bv_env" make install-runtime +fi diff --git a/conda/setup_run_apt b/conda/setup_run_apt deleted file mode 100755 index ae6c1e80..00000000 --- a/conda/setup_run_apt +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/bash - -# -# Setup run dependencies with apt -# - -set -x -set -e - -# apt install -y wget # build-essential -# yum install wget \ No newline at end of file diff --git a/conda/setup_run_compiled b/conda/setup_run_compiled index 815c314c..74325e08 100755 --- a/conda/setup_run_compiled +++ b/conda/setup_run_compiled @@ -7,7 +7,7 @@ set -x set -e -if [ -e /casa/conda/lib/pkgconfig/libopenjp2.pc ]; then +if [ -e "$CASA/conda/lib/pkgconfig/libopenjp2.pc" ]; then # if libopenjp2.pc is installed, we assume that this script has already been # executed. echo "setup_run_compiled already executed => execution canceled" @@ -24,16 +24,16 @@ tar xf v2.5.0.tar.gz cd openjpeg-2.5.0 mkdir build cd build -cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=/casa/conda" +cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$CASA/conda" make make install -cp libopenjp2.pc /casa/conda/lib/pkgconfig/ +cp libopenjp2.pc $CASA/conda/lib/pkgconfig/ cd "$tmp" git clone --depth=1 https://github.com/MIRCen/openslide.git cd openslide autoreconf --install -./configure --prefix="/casa/conda" +./configure --prefix="$CASA/conda" make -j$(nproc) make install @@ -42,7 +42,7 @@ make install cd "$tmp" git clone https://github.com/BIC-MNI/libminc.git --single-branch --branch libminc-2-3-00 cd libminc -cmake . -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DLIBMINC_BUILD_SHARED_LIBS=ON -DLIBMINC_MINC1_SUPPORT=ON "-DCMAKE_INSTALL_PREFIX=/casa/conda" +cmake . -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DLIBMINC_BUILD_SHARED_LIBS=ON -DLIBMINC_MINC1_SUPPORT=ON "-DCMAKE_INSTALL_PREFIX=$CASA/conda" make -j$(nproc) make install cd .. diff --git a/conda/setup_run_conda b/conda/setup_run_conda index d23893bc..758c2228 100755 --- a/conda/setup_run_conda +++ b/conda/setup_run_conda @@ -7,15 +7,13 @@ set -x set -e -if [ -e /casa/conda/bin/git ]; then +if [ -e $CONDA/bin/git ]; then # if git is installed, we assume that this script has already been # executed. echo "setup_run_conda already executed => execution canceled" exit 0 fi -conda=/casa/conda/bin/mamba - build_dependencies=( # General build dependencies (notably useful for pip-compiled packages) gcc @@ -76,7 +74,6 @@ build_dependencies=( # is only installed with sip package version 4.* but sip # package depends on sip 6.* pyqt - 'sysroot_linux-64=2.17' qtconsole #? was python3-qtconsole 'matplotlib==3.4.3' #pyqt5-sip @@ -104,7 +101,6 @@ matlab_runtime_dependencies=( # Generally useful packages generally_useful_packages=( - bash-completion ca-certificates curl file @@ -140,7 +136,7 @@ headless_anatomist_dependencies=( # xvfb ) -$conda install -y ${build_dependencies[@]} ${fsl_runtime_dependencies[@]} ${matlab_runtime_dependencies[@]} ${generally_useful_packages[@]} ${headless_anatomist_dependencies[@]} +"$conda" install $conda_install ${build_dependencies[@]} ${fsl_runtime_dependencies[@]} ${matlab_runtime_dependencies[@]} ${generally_useful_packages[@]} ${headless_anatomist_dependencies[@]} pip_installed_dependencies=( @@ -236,58 +232,26 @@ brainvisa_python_runtime_dependencies=( ) brainvisa_shared_library_dependencies=( - cairo-devel-cos6-x86_64 #? was libcairo2 - #! libdcmtk16 - gdk-pixbuf2-devel-cos6-x86_64 #? was libgdk-pixbuf-2.0-0 + cairo + dcmtk libgfortran5 - libglapi-mesa - libgl1 - libglib2.0-0 - libglu1-mesa - libgomp1 - libhdf5-103-1 - libjpeg-turbo8 - libjxr0 + mesalib + libglib + libglu + libgomp + hdf5 + libjpeg-turbo + jxrlib libllvm14 - libnetcdf19 - libopenjp2-7 - libpng16-16 - libpython3.10 - libqt5core5a - libqt5dbus5 - libqt5designer5 - libqt5gui5 - libqt5help5 - libqt5multimedia5 - libqt5multimediawidgets5 - libqt5network5 - libqt5opengl5 - libqt5positioning5 - libqt5printsupport5 - libqt5qml5 - libqt5quick5 - libqt5quickwidgets5 - libqt5sql5 - libqt5svg5 - libqt5test5 - libqt5webchannel5 - libqt5webengine5 - libqt5webenginecore5 - libqt5webenginewidgets5 - libqt5webkit5 - libqt5widgets5 - libqt5x11extras5 - libqt5xml5 - libqt5xmlpatterns5 - libqwt-qt5-6 - libsigc++-2.0-0v5 - libstdc++6 - libsvm3 - libtiff5 - libx11-6 - libxext6 + netcdf4 + openjpeg + libpng + qwt + 'libsigcpp<3' + libsvm + libtiff libxml2 - libzstd1 + zstd ) -"$conda" install -y ${pip_installed_dependencies[@]} ${pip_packages_runtime_dependencies[@]} ${brainvisa_python_runtime_dependencies[@]} +"$conda" install $conda_install ${pip_installed_dependencies[@]} ${pip_packages_runtime_dependencies[@]} ${brainvisa_python_runtime_dependencies[@]} ${brainvisa_shared_library_dependencies[@]} diff --git a/conda/setup_src b/conda/setup_src new file mode 100755 index 00000000..ac72c200 --- /dev/null +++ b/conda/setup_src @@ -0,0 +1,42 @@ +# git clone -b master https://bioproj.extra.cea.fr/git/3dns-private "$CASA_SRC/3dns-private" +git clone -b master https://github.com/brainvisa/aims-free.git "$CASA_SRC/aims-free" +git clone -b master https://github.com/brainvisa/aims-gpl.git "$CASA_SRC/aims-gpl" +git clone -b master https://github.com/brainvisa/anatomist-free.git "$CASA_SRC/anatomist-free" +git clone -b master https://github.com/brainvisa/anatomist-gpl.git "$CASA_SRC/anatomist-gpl" +git clone -b master https://github.com/brainvisa/axon.git "$CASA_SRC/axon" +# git clone -b master https://bioproj.extra.cea.fr/git/bioprocessing "$CASA_SRC/bioprocessing" +# git clone -b master https://bioproj.extra.cea.fr/git/brainrat-gpl "$CASA_SRC/brainrat-gpl" +# git clone -b master https://bioproj.extra.cea.fr/git/brainrat-private "$CASA_SRC/brainrat-private" +git clone -b conda https://github.com/brainvisa/brainvisa-cmake.git "$CASA_SRC/brainvisa-cmake" +git clone -b master https://bioproj.extra.cea.fr/git/brainvisa-disco "$CASA_SRC/brainvisa-disco" +git clone -b master https://github.com/brainvisa/brainvisa-share.git "$CASA_SRC/brainvisa-share" +git clone -b master https://github.com/brainvisa/brainvisa-spm.git "$CASA_SRC/brainvisa-spm" +git clone -b master https://github.com/brainvisa/brainvisa_freesurfer.git "$CASA_SRC/brainvisa_freesurfer" +git clone -b master https://github.com/populse/capsul.git "$CASA_SRC/capsul" +git clone -b master https://github.com/brainvisa/casa-distro.git "$CASA_SRC/casa-distro" +git clone -b main https://github.com/cati-neuroimaging/catidb-client.git "$CASA_SRC/catidb-client" +git clone -b master https://github.com/brainvisa/constellation-gpl.git "$CASA_SRC/constellation-gpl" +git clone -b master https://github.com/brainvisa/constellation-nonfree.git "$CASA_SRC/constellation-nonfree" +git clone -b master https://github.com/brainvisa/cortical_surface-gpl.git "$CASA_SRC/cortical_surface-gpl" +git clone -b master https://github.com/brainvisa/cortical_surface-nonfree.git "$CASA_SRC/cortical_surface-nonfree" +git clone -b master https://github.com/cati-neuroimaging/deidentification.git "$CASA_SRC/deidentification" +git clone -b master https://github.com/neurospin/highres-cortex.git "$CASA_SRC/highres-cortex" +git clone -b master https://github.com/cati-neuroimaging/longitudinal_pipelines.git "$CASA_SRC/longitudinal_pipelines" +git clone -b master https://github.com/brainvisa/morpho-deepsulci.git "$CASA_SRC/morpho-deepsulci" +git clone -b master https://github.com/brainvisa/morphologist.git "$CASA_SRC/morphologist" +git clone -b master https://bioproj.extra.cea.fr/git/brainvisa-t1mri/morphologist-baby.git "$CASA_SRC/morphologist-baby" +git clone -b master https://github.com/brainvisa/morphologist-gpl.git "$CASA_SRC/morphologist-gpl" +git clone -b master https://github.com/brainvisa/morphologist-nonfree.git "$CASA_SRC/morphologist-nonfree" +git clone -b master https://github.com/cati-neuroimaging/nuclear_imaging-gpl.git "$CASA_SRC/nuclear_imaging-gpl" +git clone -b master https://github.com/cati-neuroimaging/nuclear_imaging-nonfree.git "$CASA_SRC/nuclear_imaging-nonfree" +git clone -b master https://github.com/populse/populse_db.git "$CASA_SRC/populse_db" +# git clone -b master https://bioproj.extra.cea.fr/git/primatologist-gpl "$CASA_SRC/primatologist-gpl" +# git clone -b master https://github.com/cati-neuroimaging/rsfmri.git "$CASA_SRC/rsfmri" +# git clone -b master https://github.com/cati-neuroimaging/sacha-gpl.git "$CASA_SRC/sacha-gpl" +# git clone -b master https://github.com/cati-neuroimaging/sacha-nonfree.git "$CASA_SRC/sacha-nonfree" +git clone -b master https://github.com/populse/soma-base.git "$CASA_SRC/soma-base" +git clone -b master https://github.com/brainvisa/soma-io.git "$CASA_SRC/soma-io" +git clone -b master https://github.com/populse/soma-workflow.git "$CASA_SRC/soma-workflow" +git clone -b master https://github.com/brainvisa/sulci-nonfree.git "$CASA_SRC/sulci-nonfree" +git clone -b master https://github.com/cati-neuroimaging/whasa-gpl.git "$CASA_SRC/whasa-gpl" +git clone -b master https://github.com/cati-neuroimaging/whasa-nonfree.git "$CASA_SRC/whasa-nonfree" diff --git a/python/casa_distro/info.py b/python/casa_distro/info.py index cc2f8e6e..5c0332f3 100644 --- a/python/casa_distro/info.py +++ b/python/casa_distro/info.py @@ -4,8 +4,8 @@ # casa-distro version -version_major = 3 -version_minor = 2 +version_major = 4 +version_minor = 0 version_micro = 0 version_extra = ""