-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_curvelops.sh
executable file
·65 lines (53 loc) · 1.81 KB
/
install_curvelops.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Installer for Curvelops
#
# Run: ./install_curvelops.sh
#
# M. Ravasi, 04/02/2021
echo 'Installing Curvelops'
# install gcc-4 and g++4
#sudo add-apt-repository ppa:ubuntu-toolchain-r/test
#sudo apt-get install gcc-4.8
#sudo apt-get install g++-4.8
export CC=/usr/bin/gcc-4.8
export CXX=/usr/bin/g++-4.8
# install FFTW
wget http://www.fftw.org/fftw-2.1.5.tar.gz
tar -xvf fftw-2.1.5.tar.gz
cd fftw-2.1.5
make clean
./configure --with-pic --prefix=${PWD} --with-gcc=/usr/bin/gcc-4.8
make
make install
cd ..
# install CurveLab (do steps 1 and 2 before running this script!)
# 1. Download it from http://www.curvelet.org/ (needs to register...)
# 2. Change CC, CXX and FFTW_DIR in makefile.opt
cd CurveLab-2.1.3
make clean
make lib
make test
cd ..
# install Python env
conda env create -f environment_pylops_37.yml
source ~/miniconda3/etc/profile.d/conda.sh
source activate pylops_37
echo 'Created and activated environment:' $(which python)
# install pylops=1.15.0 (last version supporting python 3.7)
conda install -c conda-forge pylops=1.15.0
# option1: install curvelops from github
export FFTW=${PWD}/fftw-2.1.5
export FDCT=${PWD}/CurveLab-2.1.3
python3 -m pip install git+https://github.com/PyLops/curvelops@main
# option2: clone install curvelop (doesnt work)
# git clone https://github.com/PyLops/curvelops.git
# cd curvelops
# rm -rf curvelops.egg-info/ build/ dist/
# rm -rf /home/ravasim/miniconda3/envs/pylops_37/lib/python3.7/site-packages/curvelops*
# python3 setup.py clean
# python3 setup.py build_ext --inplace
# python3 setup.py install # --user
# check curvelops works as expected
echo 'Checking pylops version and running a command...'
python -c 'import numpy as np; import curvelops as cl; x = np.random.normal(0., 1., (100, 50)); FDCT = cl.FDCT2D(dims=(100, 50)); c = FDCT * x.ravel(); print(c)'
echo 'Done!'