Skip to content

Commit

Permalink
#345 start to investigate system install with Conda
Browse files Browse the repository at this point in the history
  • Loading branch information
sapetnioc committed May 12, 2023
1 parent 6dcb78c commit 0034a3f
Showing 1 changed file with 173 additions and 0 deletions.
173 changes: 173 additions & 0 deletions conda/setup_conda
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
#!/bin/bash

set -e
set -x

casaconda="$1"
if [ -z "$casaconda" ]; then
echo "Missing destination directory"
exit 1
fi

# Install Miniforge

miniforge=$(mktemp --suffix .sh)
wget -O "$miniforge" https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
sh "$miniforge" -b -p "$casaconda"
rm "$miniforge"
conda="$casaconda/bin/conda"

"$conda" update conda -y

build_dependencies=(
# General build dependencies (notably useful for pip-compiled packages)
gcc
gxx
git
cmake
# libc-dev
# libpython3-dev
make
patch
pkg-config

# Build dependencies of MESA's libGL
# #! byacc
# flex
# #! was libxcb-randr0-dev
# libxrandr-devel
# llvmdev #? was llvm-dev
# meson
# mako
mesa

# Build dependencies of MIRCen's fork of openslide
autoconf
automake
libtool
pkg-config # needed for autoreconf
openjpeg #? was libopenjp2-7-dev
libtiff #? was libtiff-dev
cairo-devel-cos6-x86_64 #? was libcairo2-dev
gdk-pixbuf #? was libgdk-pixbuf2.0-dev
glib2-devel-cos6-x86_64 #? was libglib2.0-dev
libxml2-devel-cos6-x86_64 #? was libxml2-dev
jxrlib #? was libjxr-dev


# Build dependencies of SIP/PyQt
# libqt5svg5-dev # qtconsole needs PyQt5.QtSvg
# libqt5opengl5-dev
# qttools5-dev
# qtmultimedia5-dev
# libqt5webchannel5-dev
# libqt5webkit5-dev
# libqt5webview5-dev
# libqt5x11extras5-dev
# libqt5xmlpatterns5-dev
# qtwebengine5-dev # for PyQt

# Build dependencies of libminc
hdf5 #? was libhdf5-dev
libnetcdf #? was libnetcdf-dev

# Build dependencies for draco
draco
# eigen #? was libeigen3-dev

pyqt
)
"$conda" install -y ${build_dependencies[@]}

export PATH="$casaconda/bin:$PATH"
export LD_LIBRARY_PATH="$casaconda/lib:$LD_LIBRARY_PATH"

# MIRCen's fork of openslide with support for CZI format
#
tmp=$(mktemp -d)

cd "$tmp"
wget https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.0.tar.gz
tar xf v2.5.0.tar.gz
cd openjpeg-2.5.0
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$casaconda"
make
make install
cp libopenjp2.pc $casaconda/lib/pkgconfig/

cd "$tmp"
git clone --depth=1 https://github.com/MIRCen/openslide.git
cd openslide
autoreconf --install
./configure --prefix="$casaconda"
make -j$(nproc)
make install

# reinstall libminc 4.0.0 because newer versions can't properly read freesurfer
# .mgz files
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=$casaconda"
make -j$(nproc)
make install
cd ..
rm -rf libminc

rm -Rf "$tmp"


#
# Dev environment
#

# Documentation building
documentation_building_packages=(
doxygen
ghostscript
graphviz
nbconvert #? was jupyter-nbconvert
pandoc
sphinx
sphinx-gallery
#! texlive-latex-base
#! texlive-latex-extra # needed by doxygen to render LaTeX formulas
#! texlive-fonts-recommended
wkhtmltopdf
)

brainvisa_standard_dev_dependencies=(
#! libasound2-dev
libblitz #? was libblitz0-dev
boost-cpp #? was libboost-dev
#! libboost-filesystem-dev
#! libboost-system-dev
dcmtk #? was libdcmtk-dev
libexpat #? was libexpat1-dev
#! libgl1-mesa-dev
libglib #? was libglib2.0-dev
libglu #? was libglu1-mesa-dev
libjpeg-turbo #? was libjpeg-dev
#! libminc-dev
netcdf4 #? was libnetcdf-dev
#! libomp-dev # OpenMP with the clang compiler
#! libopenjp2-7-dev
libpng #? was libpng-dev
#! libqt5x11extras5-dev
#! libqwt-qt5-dev
libsigcpp #? was libsigc++-2.0-dev
#! libspnav-dev
libsvm #? was libsvm-dev
libtiff #? was libtiff-dev
#! libvtk9-dev
#! libvtk9-qt-dev
libxml2 #? was libxml2-dev
#! qttools5-dev
#! qtmultimedia5-dev
#! qttools5-dev-tools
#! zlib1g-dev
)

"$conda" install -y ${documentation_building_packages[@]} ${brainvisa_standard_dev_dependencies[@]}

0 comments on commit 0034a3f

Please sign in to comment.