[petsc-users] Installing petsc4py

Stegmeier, Nicholas Nicholas.Stegmeier at sdstate.edu
Tue Oct 17 23:23:26 CDT 2017


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

  1.  Install openmpi
  2.  Install anaconda-python
  3.  Install petsc
  4.  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171018/972e8242/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: demo_output.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171018/972e8242/attachment-0001.txt>


More information about the petsc-users mailing list