Using own PETSc with --honour-petsc-dir
Dear all, I compiled Firedrake with --honour-petsc-dir. Although I set PETSC_DIR to the correct path, I get an Error: Could not find PETSc library. Set the environment variable PETSC_DIR to your local PETSc base directory or install PETSc from PyPI: pip install petsc when executing. Any ideas how I can use my own PETSc version? I would like to make changes in the PETSc code and then use this changed PETSc version with Firedrake. I thought --honour-petsc-dir was the right thing to do. Thank you! Henrik -- Dipl.-Math. Henrik Büsing Institute for Applied Geophysics and Geothermal Energy E.ON Energy Research Center RWTH Aachen University ------------------------------------------------------ Mathieustr. 10 | Tel +49 (0)241 80 49907 52074 Aachen, Germany | Fax +49 (0)241 80 49889 ------------------------------------------------------ http://www.eonerc.rwth-aachen.de/GGE hbuesing@eonerc.rwth-aachen.de ------------------------------------------------------
Did you set PETSC_ARCH as well? Also, make sure your PETSc builds contains all the components that Firedrake needs (see firedrake-install to sniff the default options), and make sure that your PETSc version is recent enough (released versions are too old), and compatible with your petsc4py version (which sometimes breaks). ________________________________ From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of Buesing, Henrik <HBuesing@eonerc.rwth-aachen.de> Sent: 05 April 2017 11:59:31 To: firedrake Subject: [firedrake] Using own PETSc with --honour-petsc-dir Dear all, I compiled Firedrake with --honour-petsc-dir. Although I set PETSC_DIR to the correct path, I get an Error: Could not find PETSc library. Set the environment variable PETSC_DIR to your local PETSc base directory or install PETSc from PyPI: pip install petsc when executing. Any ideas how I can use my own PETSc version? I would like to make changes in the PETSc code and then use this changed PETSc version with Firedrake. I thought --honour-petsc-dir was the right thing to do. Thank you! Henrik -- Dipl.-Math. Henrik Büsing Institute for Applied Geophysics and Geothermal Energy E.ON Energy Research Center RWTH Aachen University ------------------------------------------------------ Mathieustr. 10 | Tel +49 (0)241 80 49907 52074 Aachen, Germany | Fax +49 (0)241 80 49889 ------------------------------------------------------ http://www.eonerc.rwth-aachen.de/GGE hbuesing@eonerc.rwth-aachen.de ------------------------------------------------------
Did you set PETSC_ARCH as well? [Buesing, Henrik] Yes! Also, make sure your PETSc builds contains all the components that Firedrake needs (see firedrake-install to sniff the default options), [Buesing, Henrik] I have Chaco, Metis, Parmetis, Scalapack, Hypre, Mumps, NetCDF, HDF5, Exodusii and eigen: --with-shared-libraries=1 --with-debugging=0 --with-c2html=0 --download-chaco --download-metis --download-parmetis --download-scalapack --download-hypre --download-mumps --download-netcdf --download-hdf5 --download-exodusii --download-eigen --download-fblaslapack --with-cc=mpicc --with-fc=mpif90 --with-cxx=mpicxx --download-ml --download-superlu_dist --download-suitesparse --download-scalapack --download-blacs --download-ptscotch --download-ctetgen --download-triangle I was hoping that this is enough... and make sure that your PETSc version is recent enough (released versions are too old), and compatible with your petsc4py version (which sometimes breaks). [Buesing, Henrik] I used https://github.com/firedrakeproject/petsc to avoid any incompatibilities. It's just that I want to be able to modify PETSc, recompile and use the new version with Firedrake. ________________________________ From: firedrake-bounces@imperial.ac.uk<mailto:firedrake-bounces@imperial.ac.uk> <firedrake-bounces@imperial.ac.uk<mailto:firedrake-bounces@imperial.ac.uk>> on behalf of Buesing, Henrik <HBuesing@eonerc.rwth-aachen.de<mailto:HBuesing@eonerc.rwth-aachen.de>> Sent: 05 April 2017 11:59:31 To: firedrake Subject: [firedrake] Using own PETSc with --honour-petsc-dir Dear all, I compiled Firedrake with --honour-petsc-dir. Although I set PETSC_DIR to the correct path, I get an Error: Could not find PETSc library. Set the environment variable PETSC_DIR to your local PETSc base directory or install PETSc from PyPI: pip install petsc when executing. Any ideas how I can use my own PETSc version? I would like to make changes in the PETSc code and then use this changed PETSc version with Firedrake. I thought --honour-petsc-dir was the right thing to do. Thank you! Henrik -- Dipl.-Math. Henrik Büsing Institute for Applied Geophysics and Geothermal Energy E.ON Energy Research Center RWTH Aachen University ------------------------------------------------------ Mathieustr. 10 | Tel +49 (0)241 80 49907 52074 Aachen, Germany | Fax +49 (0)241 80 49889 ------------------------------------------------------ http://www.eonerc.rwth-aachen.de/GGE hbuesing@eonerc.rwth-aachen.de<mailto:hbuesing@eonerc.rwth-aachen.de> ------------------------------------------------------
On 05/04/17 14:42, Buesing, Henrik wrote:
Did you set PETSC_ARCH as well?
[Buesing, Henrik] Yes!
Also, make sure your PETSc builds contains all the components that Firedrake needs (see firedrake-install to sniff the default options),
[Buesing, Henrik] I have Chaco, Metis, Parmetis, Scalapack, Hypre, Mumps, NetCDF, HDF5, Exodusii and eigen:
--with-shared-libraries=1 --with-debugging=0 --with-c2html=0 --download-chaco --download-metis --download-parmetis --download-scalapack --download-hypre --download-mumps --download-netcdf --download-hdf5 --download-exodusii --download-eigen --download-fblaslapack --with-cc=mpicc --with-fc=mpif90 --with-cxx=mpicxx --download-ml --download-superlu_dist --download-suitesparse --download-scalapack --download-blacs --download-ptscotch --download-ctetgen --download-triangle
I was hoping that this is enough…
and make sure that your PETSc version is recent enough (released versions are too old), and compatible with your petsc4py version (which sometimes breaks).
[Buesing, Henrik] I used https://github.com/firedrakeproject/petsc to avoid any incompatibilities. It’s just that I want to be able to modify PETSc, recompile and use the new version with Firedrake.
Great, this looks fine.
/Error: Could not find PETSc library./
/ /
/Set the environment variable PETSC/_/DIR to your local PETSc base/
/directory or install PETSc from PyPI: pip install petsc/
/ /
when executing. Any ideas how I can use my own PETSc version?
This error comes from PyOP2. Assuming the installation worked fine, did you remember to set PETSC_DIR and PETSC_ARCH in the shell that is executing your firedrake job? Thanks, Lawrence
/Error: Could not find PETSc library./
/ /
/Set the environment variable PETSC/_/DIR to your local PETSc base/
/directory or install PETSc from PyPI: pip install petsc/
/ /
when executing. Any ideas how I can use my own PETSc version?
This error comes from PyOP2. Assuming the installation worked fine, did you remember to set PETSC_DIR and PETSC_ARCH in the shell that is executing your firedrake job?
Yes, I'm setting PETSC_DIR and PETSC_ARCH. Then I execute mpiexec -n 16 python 2pinjection.py (-all the petsc options). I checked with echo $PETSC_DIR and $PETSC_ARCH. Thank you! Henrik
Thanks,
Lawrence
On 05/04/17 15:16, Buesing, Henrik wrote:
Yes, I'm setting PETSC_DIR and PETSC_ARCH. Then I execute
mpiexec -n 16 python 2pinjection.py (-all the petsc options). I checked with echo $PETSC_DIR and $PETSC_ARCH.
Hmmm, the code that raises this error is just: import os def get_petsc_dir(): try: arch = '/' + os.environ.get('PETSC_ARCH', '') dir = os.environ['PETSC_DIR'] return (dir, dir + arch) except KeyError: try: import petsc return (petsc.get_petsc_dir(), ) except ImportError: sys.exit("""Error: Could not find PETSc library. Set the environment variable PETSC_DIR to your local PETSc base directory or install PETSc from PyPI: pip install petsc""") So let's check that we can actually do that: Can you do: $ export PETSC_DIR=/path/to/petsc/dir $ expect PETSC_ARCH=your-petsc-arch $ mpiexec -n 16 python -c "import os; print os.environ['PETSC_DIR'],os.environ.get('PETSC_ARCH', 'not found')" Thanks, Lawrence
-----Ursprüngliche Nachricht----- Von: firedrake-bounces@imperial.ac.uk [mailto:firedrake- bounces@imperial.ac.uk] Im Auftrag von Lawrence Mitchell Gesendet: 05 April 2017 16:19 An: firedrake@imperial.ac.uk Betreff: Re: [firedrake] Using own PETSc with --honour-petsc-dir
On 05/04/17 15:16, Buesing, Henrik wrote:
Yes, I'm setting PETSC_DIR and PETSC_ARCH. Then I execute
mpiexec -n 16 python 2pinjection.py (-all the petsc options). I checked with echo $PETSC_DIR and $PETSC_ARCH.
Hmmm, the code that raises this error is just:
import os def get_petsc_dir(): try: arch = '/' + os.environ.get('PETSC_ARCH', '') dir = os.environ['PETSC_DIR'] return (dir, dir + arch) except KeyError: try: import petsc return (petsc.get_petsc_dir(), ) except ImportError: sys.exit("""Error: Could not find PETSc library.
Set the environment variable PETSC_DIR to your local PETSc base directory or install PETSc from PyPI: pip install petsc""")
So let's check that we can actually do that:
Can you do:
$ export PETSC_DIR=/path/to/petsc/dir $ expect PETSC_ARCH=your-petsc-arch
$ mpiexec -n 16 python -c "import os; print os.environ['PETSC_DIR'],os.environ.get('PETSC_ARCH', 'not found')"
Yes, I am getting: Traceback (most recent call last): File "<string>", line 1, in <module> File "/rwthfs/rz/cluster/work/hb111949/Firedrake/firedrake-own-petsc/firedrake/lib64/python2.7/UserDict.py", line 23, in __getitem__ raise KeyError(key) KeyError: 'PETSC_DIR'
So let's check that we can actually do that:
Can you do:
$ export PETSC_DIR=/path/to/petsc/dir $ expect PETSC_ARCH=your-petsc-arch
$ mpiexec -n 16 python -c "import os; print os.environ['PETSC_DIR'],os.environ.get('PETSC_ARCH', 'not found')"
Yes, I am getting:
Traceback (most recent call last): File "<string>", line 1, in <module> File "/rwthfs/rz/cluster/work/hb111949/Firedrake/firedrake-own- petsc/firedrake/lib64/python2.7/UserDict.py", line 23, in __getitem__ raise KeyError(key) KeyError: 'PETSC_DIR'
Ok. I defined PETSC_DIR and PETSC_ARCH only as shell variables and not as environment variables, i.e. I did not export them. When exporting the variables everything works as it should. Henrik
participants (3)
- 
                
                Buesing, Henrik
- 
                
                Homolya, Miklós
- 
                
                Lawrence Mitchell