Docs: Installation |
![]() |
Example Usages:
Several variables control the configuration and build process of PETSc. They can either be given as arguments to make or be set as environment variables. In particular, the are: PETSC_DIR: - this environment/make variable should point to the location of the PETSc installation that is used. You can add export PETSC_DIR=value in your .profile or .sh file or setenv PETSC_DIR value in your .cshrc or .tcshrc file. Multiple PETSc versions can coexist on the same file-system. By changing PETSC_DIR one can switch between the versions PETSC_ARCH: this environment/make variable is used to specify the configuration that should currently be used. It corresponds to the configuration files in bmake/${PETSC_ARCH}. Multiple variants of PETSc libraries can be installed - each variant corresponding to a different PETSC_ARCH. One can switch between using these variants - by changing the value of PETSC_ARCH. If PETSC_ARCH is not set, the configuration from the last time you ran ./config/configure.py will be used. BOPT: this environment/make variable is used to distinguish debug/optimized or c/c++/complex versions of PETSc libraries. One can install, any/all variants of the libraries, and switch between them by changing the value of BOPT. If BOPT is not set then the value of g will be used. The table below explains the most common BOPT values.
example usage - assuming ex1.c is user code, and a makefile
with a target to compile ex1 exists: Return to Installation Instructions Return to Manual Installation Instructions bmake/${PETSC_ARCH}/packages: this configuration file, corresponding to the PETSC_ARCH used, contains the configuration for all external software packages that PETSc is installed with. The specification is in the compiler notation for include paths, library paths, library names.
bmake/${PETSC_ARCH}/variables: this file contains the configuration for the C, C++, fortran compilers - that are associated with the PETSC_ARCH used. Return to Installation Instructions Return to Manual Installation Instructions Cygwin provides UNIX tools on Microsoft Windows. When installing Cygwin make sure you install the following additional packages
Cygwin also has GNU compilers ( gcc, g++, g77) which can be used if Microsoft, Intel, or Borland Group compilers are not availableNote: To insure success of rebaseall - make sure there are no other cygwin processes (except bash) are running like ssh or sshd etc.
Return to Installation Instructions Return to Manual Installation Instructions BLAS/LAPACK: these packages provide some basic numeric kernels used by PETSc.
Return to Installation Instructions Return to Manual Installation Instructions MPI: This software provides the parallel functionality for PETSc.
Return to Installation Instructions Return to Manual Installation Instructions I don't want to use MPI: You can build (sequential) PETSc without an MPI.
Return to Installation Instructions Return to Manual Installation Instructions Optional Packages: PETSc can be installed with various optional packages - including SuperLU, Spooles, Matlab etc.. The optional package information is specified in bmake/${PETSC_ARCH}/packages file. An example specification is as follows: PARMETIS_INCLUDE = -I/home/petsc/soft/solaris-9/ParMetis-3.0 Notice that the include, library paths, library files are specified, and a flag is set - to enable the package within PETSc. For more example usage for any other package, check out the default bmake/*/packages files in the distribution Return to Installation Instructions Return to Manual Installation Instructions Aditional Microsoft Windows Notes:Compilers: Support Microsoft (win32_ms*), Intel (win32_intel), Borland (win32_borland), Gnu compilers (win32_gnu) Project Files: We provide default project files that work with PETSC_ARCH=win32_ms_mpich. They are located at ${PETSC_DIR}/projects. Be sure to build the libraries that correspond to the project configuration you are using. To use a C++ project with Debug configuration, BOPT=g_c++ libraries are required. Debugger: Running PETSc probrams with -start_in_debugger is not supported on this platform, so debuggers will need to be initiated manually. Make sure your environment is properly configured to use the appropriate debugger for your compiler. The debuggers can be initiated using Microsoft Visual Studio 6: msdev ex1.exe, Microsoft Visual Studio .NET: devenv ex1.exe, Intel Enhanced Debugger: edb ex1.exe, or GNU Debugger gdb ex1.exe. PETSc Win32 front end - win32fe: This tool is used as a wrapper to Microsoft/ Borland/ Intel compilers and associated tools - to enable building PETSc libraries using make and other UNIX tools. For additional info, run ${PETSC_DIR}/bin/win32/win32fe without any options. Return to Installation Instructions Return to Manual Installation Instructions Manual Installation:
cd petsc-2.2.1 patch -Np1 < petsc_patches_all_2.2.1 csh/tcsh shell setenv PETSC_DIR `pwd` PETSC_ARCH=chosen name; export PETSC_DIR csh/tcsh shell setenv PETSC_ARCH chosen name export PETSC_DIR=/home/petsc/petsc-2.2.1 cd $PETSC_DIR bin/petscarch -suggest PETSC_ARCH=solaris_local; export PETSC_ARCH mkdir bmake/solaris_local cp bmake/solaris/* bmake/solaris_local edit bmake/solaris_local/packages - and update the location of BLAS, LAPACK, MPI make BOPT=g make BOPT=g test install cygwin package and use 'bash' from cygwin as the working shell export PETSC_DIR=/home/petsc/petsc-2.2.1 cd $PETSC_DIR bin/petscarch -suggest export PETSC_ARCH=win32_ms_mpich_local mkdir bmake/win32_ms_mpich_local cp bmake/win32_ms_mpich/* bmake/win32_ms_mpich_local edit bmake/win32_ms_mpich_local/packages and make sure the paths to MPICH-NT, Intel MKL (BLAS,LAPACK) are correct make BOPT=g make BOPT=g test |