Table of Contents
Para instalar PETSc, bem como os demais principais aplicativos empregados em conjunto, segundo a configuração utilizada atualmente pelo grupo de pesquisa, vá mais adiante nesta página clicando aqui.
Pré-Requisitos:
Utilizando o Ubuntu server 18.04, abra o terminal instale os pacotes com a seguinte linha de comando:
sudo apt install mpich valgrind python make cmake bison flex -y
Obs: o build do PETSc foi criado em /opt para facilitar o compartilhamento com demais usuários.
Passos de Instalação:
- Para instalar o PETSc (Portable, Extensible, Toolkit for Scientific Computation), primeiramente faça o download da biblioteca clicando aqui.
- Crie um diretório para o armazenamento dos arquivos da biblioteca PETSc;
- Copie e descompacte o arquivo baixado anteriormente para o diretório criado;
- Acesse a pasta pelo terminal e digite o comando:
sudo ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-debugging=0 --with-X=1 COPTFLAGS='-O3 -march=native -mtune=native' CXXOPTFLAGS='-O3 -march=native -mtune=native' FOPTFLAGS='-O3 -march=native -mtune=native' --download-mpich --download-cmake --download-metis --download-parmetis --download-mumps --download-scalapack --download-ptscotch --with-cxx-dialect=C++11 --download-fblaslapack=1 --download-hdf5
Tais opções são utilizadas de maneira padrão. Para demais opções clique aqui.
- O comando de build é fornecido ao final do configure, assim como o comando de test é fornecido ao final do comando de build. Copie e execute.
- Por fim, adicione os comandos:
export PETSC_DIR="caminho_diretorio" export PETSC_ARCH="arch-linux2-c-opt" export PATH="${PETSC_DIR}/${PETSC_ARCH}/bin:${PATH}"
substituindo caminho_diretorio pelo endereço do diretório de instalação do PETSc no arquivo .bashrc, localizado na pasta raiz.
Configuração usada atualmente Release (sem debug)
incluído no PETSc: METIS + PARMETIS + mumps + FGLASLAPACK + hdf5
instalar antes do PETSc: Valgrind e MPICH
###1. Install Valgrind ###
###2. Install MPICH ###
PETSc uses MPICH to deal with parallelism, so you can decide either install the MPICH and give its path to PETSc or let PETSc download it during the configuration process. The first option is recommended because the path to the *mpiexec* becomes fixed and independent of the PETSc build configuration.
You can download the file [mpich-3.4.2.tar.gz](https://github.com/pmodels/mpich/releases/tag/v3.4.2) and follow the instructions on [github](https://github.com/pmodels/mpich): - Unpack the tar file and go to the top level directory: ```bash tar xzf mpich-3.4.2.tar.gz cd mpich-3.4.2 ``` - Configure MPICH specifying the installation directory (could be either an empty directory or an non existent directory) and device: ```bash ./configure –prefix=/path/to/mpi/installation/directory –with-device=ch4:ofi 2>&1 | tee c.txt ``` - Build MPICH: ```bash make 2>&1 | tee m.txt ``` - Install the MPICH commands: ```bash make install 2>&1 | tee mi.txt ``` - Add the bin subdirectory of the installation directory to your PATH by adding the following line to the file ~/.bashrc: ```bash export PATH=“/path/to/mpi/installation/directory/bin:$PATH” ``` Check that everything is in order at this point by doing: ```bash which mpicc which mpicxx which mpiexec ``` These commands should print the path to the bin subdirectory of the MPICH installation directory.