Take the 2-minute tour ×
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It's 100% free, no registration required.

I have downloaded and unzipped PETSc from PETSc Website in my home directory (OS is CentOS 6.3 64bit ) and followed given commands on Installation page "./configure --with-cc=gcc --with-fc=gfortran --download-f-blas-lapack --download-mpich" and "make all test". There was no error throughout the process. Is it installed properly? How should I start using these libraries in C programs? Is it possible to install it in "file system"? so that one can access it like "LAPACK" libraries or "CGNS" libraries.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

If "make test" reports something like

Running test examples to verify correct installation
Using PETSC_DIR=/home/nate/src/PETSc-3.3 and PETSC_ARCH=arch-linux2-c-opt
C/C++ example src/snes/examples/tutorials/ex19 run successfully with 1 MPI process
C/C++ example src/snes/examples/tutorials/ex19 run successfully with 2 MPI processes
Fortran example src/snes/examples/tutorials/ex5f run successfully with 1 MPI process
Completed test examples

then indeed the library should be installed properly. I would recommend that you export the values of PETSC_DIR and PETSC_ARCH (the ones that, for example, are shown when you run the tests) in your .bashrc file such that they are always set. With these environment variables set, you can use PETSc from anywhere if you use makefiles which look something like:

MyCode: MyCode.o chkopts
    ${CLINKER} -o $@ $< ${PETSC_LIB}

include ${PETSC_DIR}/conf/variables
include ${PETSC_DIR}/conf/rules

If you need to make PETSc available for all users on your machine (like in /opt) then just go to the PETSc installation page and look for the section labeled:

Installing PETSc in /usr/local or /opt where sudo or root previledges are required

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.