Skip to content

Instantly share code, notes, and snippets.

@fepegar
Last active January 30, 2019 14:13
Show Gist options
  • Save fepegar/5ec4af4a7c00fad11ab8498e8ad8aae8 to your computer and use it in GitHub Desktop.
Save fepegar/5ec4af4a7c00fad11ab8498e8ad8aae8 to your computer and use it in GitHub Desktop.
Blockmatching INRIA
# Last modified on the 14th of May, 2018
mkdir -p ~/git
cd ~/git
# Replace fepegar by your username on Inria Forge. You’ll be asked your password
user="fepegar"
# To clone the master branch:
git clone https://[email protected]/authscm/$user/git/morpheme-privat/morpheme-privat.git --depth 1
# Install zlib1g-dev if Linux
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
if [ $machine "==" "Linux" ]; then
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' zlib1g-dev|grep "install ok installed")
echo Checking for zlib1g-dev: $PKG_OK
if [ "" "==" "$PKG_OK" ]; then
echo "No zlib1g-dev. Setting up zlib1g-dev."
sudo apt --yes install zlib1g-dev
fi
fi
cd morpheme-privat/external/NIFTICLIB/
mkdir -p build-2.0.0
cd build-2.0.0
cmake -DCMAKE_C_FLAGS:STRING=-fPIC ../nifticlib-2.0.0 # zlib1g-dev needed here
make -j8
cd ../../LEMON
mkdir -p build-1.3.1
cd build-1.3.1
cmake ../lemon-1.3.1
make -j8
cd ../../../vt/
# this comments the line that looks for VTK:
sed -i 's/find_package (VTK QUIET)/# find_package (VTK QUIET)/g' cmake/vtDependencies.cmake
mkdir build
cd build
# realpath is available on Mac after running brew install coreutils
lemondir=$(realpath ../../external/LEMON/build-1.3.1)
niftidir=$(realpath ../../external/NIFTICLIB/build-2.0.0)
cmake -DLEMON_DIR:STRING=$lemondir -DNIFTI_DIR:STRING=$niftidir ..
make -j8
cd ../..
mv vt/src/blockmatching/documentation/doc-blockmatching.pdf .
# The executable:
vt/build/bin/blockmatching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment