[petsc-users] Installing petsc4py

Lisandro Dalcin dalcinl at gmail.com
Wed Oct 18 07:06:08 CDT 2017


Dear Nicholas,

The errors you reported where just outdated Fortran code and makefiles
in demo/, these are just examples. I pushed a fix to the maint branch
of the repository.

BTW, do you know that conda-forge provides prebuilt packages for petsc
and petsc4py? Just create a new conda environment, activate, and then
"conda install -c conda-forge petsc4py"

On 18 October 2017 at 07:23, Stegmeier, Nicholas
<Nicholas.Stegmeier at sdstate.edu> wrote:
> Hello all,
>
>
> I was hoping to get some advice on installing petsc4py. Hopefully this is an
> appropriate question as it's my first time emailing the list.
>
>
> I failed numerous times installing petsc4py on my personal laptop, so I
> decided to use a virtual machine with Ubuntu to try installing from a clean
> slate.
>
>
> I followed the steps listed on this webpage:
> https://gist.github.com/mrosemeier/088115b2e34f319b913a
>
> Install openmpi
> Install anaconda-python
> Install petsc
> Install petsc4py
>
>
> After doing all this, I entered the petsc4py/demo folder and used make to
> see if all the tests passed. But several of the tests promptly failed. Below
> are some of the errors I received, but I also attached the full error
> output. Maybe I have forgotten to assign some environment variable?
>
> Thank you,
> Nicholas Stegmeier
>
> inside .bashrc:
> export LD_LIBRARY_PATH=/home/nick/local/openmpi-1.10.5/lib:$LD_LIBRARY_PATH
> export PATH=/home/nick/local/openmpi-1.10.5/bin:$PATH
> export PATH="/home/nick/local/anaconda2/bin:$PATH"
> export PETSC_DIR=/home/nick/local/petsc.git
> export PETSC_ARCH=arch-python-linux-i686
>
> nick at nick-VirtualBox:~/local/petsc.git/bin$ echo $PATH
> /home/nick/local/anaconda2/bin:/home/nick/local/openmpi-1.10.5/bin:/home/nick/local/anaconda2/bin:/home/nick/local/openmpi-1.10.5/bin:/home/nick/bin:/home/nick/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
>
> nick at nick-VirtualBox:~/local/petsc.git/bin$ echo $PATH
> /home/nick/local/anaconda2/bin:/home/nick/local/openmpi-1.10.5/bin:/home/nick/local/anaconda2/bin:/home/nick/local/openmpi-1.10.5/bin:/home/nick/bin:/home/nick/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
>
> sample error output:
>
> make -f makefile.petsc \
>         PETSC_DIR=/home/nick/local/petsc.git
> PETSC_ARCH=arch-python-linux-i686
> make[2]: Entering directory '/home/nick/local/petsc4py.git/demo/perftest'
> c        App.f90
> make[2]: c: Command not found
> makefile.petsc:15: recipe for target 'driver.exe' failed
> make[2]: [driver.exe] Error 127 (ignored)
> /home/nick/local/openmpi-1.10.5/bin/mpicc -c -Wall -Wwrite-strings
> -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector
> -fvisibility=hidden -g -O   -I/home/nick/local/petsc.git/include
> -I/home/nick/local/petsc.git/arch-python-linux-i686/include
> `pwd`/driver.c
> /home/nick/local/openmpi-1.10.5/bin/mpicc -Wall -Wwrite-strings
> -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector
> -fvisibility=hidden -g -O  -o driver.exe
> -Wl,-rpath,/home/nick/local/petsc.git/arch-python-linux-i686/lib
> -L/home/nick/local/petsc.git/arch-python-linux-i686/lib -lpetsc -llapack
> -lblas -lm -ldl  driver.o App.o
> gcc: error: App.o: No such file or directory
> makefile.petsc:15: recipe for target 'driver.exe' failed
> make[2]: [driver.exe] Error 1 (ignored)
>
> ...
>
> ./Bratu2D.F90:20:0:
>
>  #include "petsc/finclude/petscdef.h"
>  ^
> Fatal Error: petsc/finclude/petscdef.h: No such file or directory
> compilation terminated.
> ./Bratu2D.F90:20:0:
>
>  #include "petsc/finclude/petscdef.h"
>  ^
> Fatal Error: petsc/finclude/petscdef.h: No such file or directory
> compilation terminated.
> error: Command "/usr/bin/gfortran -Wall -g -fno-second-underscore
> -DF2PY_REPORT_ON_ARRAY_COPY=1
> -I/home/nick/local/petsc.git/arch-python-linux-i686/include
> -I/home/nick/local/petsc.git/include
> -I/home/nick/local/anaconda2/lib/python2.7/site-packages/petsc4py/include
> -I. -Ibuild/src.linux-i686-2.7/.
> -I/home/nick/local/anaconda2/lib/python2.7/site-packages/numpy/core/include
> -I/home/nick/local/anaconda2/include/python2.7 -c -c ./Bratu2D.F90 -o
> build/temp.linux-i686-2.7/Bratu2D.o -Jbuild/temp.linux-i686-2.7/
> -Ibuild/temp.linux-i686-2.7/" failed with exit status 1
> makefile:20: recipe for target 'Bratu2D.so' failed
> make[1]: *** [Bratu2D.so] Error 1
> make[1]: Leaving directory '/home/nick/local/petsc4py.git/demo/wrap-f2py'
> makefile:3: recipe for target 'all' failed
> make: [all] Error 2 (ignored)
>
>
> Thank you,
> Nicholas Stegmeier



-- 
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 0109
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459


More information about the petsc-users mailing list