Build

Follow the steps below to build PETSc. See the PETSc installation home page for complete installation instructions.

  1. Change the working directory to the petsc directory:

    cd path_to/petsc-x.x.x
    
    	    

  2. Set PETSC_DIR environment variable. For an sh-type shell:

    PETSC_DIR=`pwd`; export PETSC_DIR      
    	    

    for a csh-type shell:

    setenv PETSC_DIR `pwd`
    	    

  3. Choose system type and optimization level:

    make PETSC_ARCH=linux BOPT=O_c++
    
    
    	    

  4. Configure PETSc:

    ./config/configure.py --with-mpi=0 --with-blas-lapack-dir=blas-lapack-lib-path
    	    

    for example:


    ./config/configure.py --with-mpi=0 --with-blas-lapack-dir=/usr/local/lib
        

    Option --with-blas-lapack-dir applies if ATLAS (rather than BLAS) is used.

  5. Build PETSc:

    make all
    make test