You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simulacion-permeabilidad/script_install.sh

81 lines
1.8 KiB
Bash

#!/bin/bash
export WORKSPACE=$(pwd)
# gfortran
sudo apt install build-essential
sudo apt install gfortran
gsettings set org.gnome.nautilus.preferences default-folder-viewer 'list-view'
# install open mpi 2.1.1
curl https://download.open-mpi.org/release/open-mpi/v2.1/openmpi-2.1.1.tar.bz2 --output openmpi-2.1.1.tar.bz2
tar -jxf openmpi-2.1.1.tar.bz2
cd openmpi-2.1.1
./configure --prefix=$HOME/opt/openmpi
make all
make install
echo "export PATH=\$PATH:\$HOME/opt/openmpi/bin" >> $HOME/.bashrc
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$HOME/opt/openmpi/lib" >> $HOME/.bashrc
source ~/.$1rc
cd ..
rm openmpi-2.1.1.tar.bz2
# install miniconda
curl https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh --output Miniconda3-py39_4.10.3-Linux-x86_64.sh
$1 Miniconda3-py39_4.10.3-Linux-x86_64.sh -b
source ~/.$1rc
# create python 2.7 environment
conda init $1
source ~/.$1rc
rm Miniconda3-py39_4.10.3-Linux-x86_64.sh
conda create -n py2_7 python=2.7
source ~/miniconda3/etc/profile.d/conda.sh
conda activate py2_7
python --version
pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
# setup petsc
git clone https://gitlab.com/petsc/petsc
cd petsc
git checkout maint-3.8
./configure --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 --download-fblaslapack --with-debugging=0 COPTFLAGS='-O3 -march=native -mtune=native' CXXOPTFLAGS='-O3 -march=native -mtune=native' FOPTFLAGS='-O3 -march=native -mtune=native'
make PETSC_DIR=$WORKSPACE/petsc PETSC_ARCH=arch-linux2-c-opt all
make PETSC_DIR=$WORKSPACE/petsc PETSC_ARCH=arch-linux-c-opt check
cd ..
# setup petsc4py
git clone https://Icolecchio@bitbucket.org/petsc/petsc4py.git
cd petsc4py
git checkout maint-3.8
export PETSC_DIR=$WORKSPACE/petsc
python setup.py build
python setup.py install --user
python setup.py test
cd ..