macosunixmakefilepetsc

Installing Petsc from source, Specified destDir same as current PETSC_DIR/PETSC_ARCH


I'm doing my best to install petsc from source. Here's what I did:

$ git clone -b maint https://bitbucket.org/petsc/petsc petsc
$ cd petsc/
$ pwd
/Users/kilojoules/install_petsc/petsc
$ export PETSC_DIR=/Users/kilojoules/install_petsc/petsc
$ make 
   # everything runs fine
$ make install
*** Using PETSC_DIR=/Users/kilojoules/install_petsc/petsc PETSC_ARCH=arch-darwin-c-debug ***
********************************************************************
Incorrect prefix usage. Specified destDir same as current PETSC_DIR/PETSC_ARCH
********************************************************************
make: *** [install] Error 1

I don't understand what I'm doing wrong. The Petsc documentation says nothing about specifying a destination directory. When I do make all, it promps me to do a make test, which prompts me to do a make streams, which doesn't prompt me to do anything else. How can I finish installing this package from source? Is there a way to specify the install destination?


Solution

  • If you want to set a destination directory, use a prefix. Otherwise, mae install doesn't make sense because you already installed it in the destination directory.

    ./configure --prefix=/usr/local/petsc
    make all
    make install