CMake doesn't recognize PETSc

318 views
Skip to first unread message

Josué Barroso

unread,
Jul 7, 2014, 11:58:06 AM7/7/14
to dea...@googlegroups.com
I'm trying to install deal.II on my machine following the installation instructions but when I run the cmake command it doesn't recognize the PETSc library
Since I'm working on Ubuntu 14.04 (Trusty), I install PETSc through the package petsc-dev (3.4.2.dfsg1-6) (http://packages.ubuntu.com/trusty/petsc-dev)
The detailed log is attached.
I'd appreciate any help.

Thanks in advance
detailed.log

Chad Balen

unread,
Jul 7, 2014, 3:48:36 PM7/7/14
to dea...@googlegroups.com
Hi Josué,

From the looks of your log file it's not finding your PETSc build. Try adding the following in terminal when running cmake for deal.II:

$cmake \
$-DDEAL_II_WITH_PETSC=ON \
$-DPETSC_DIR=Path/to/PETSc/dir \
$-DPETSC_ARCH=arch-linux2-c-debug

By using -DDEAL_II_WITH_PETSC=ON it will force deal.ii to use PETSc and if it can't find PETSc it should stop the installation.

Since it couldn't find it, you will also need to give deal.ii a hint of where PETSc is located by using -DPETSC_DIR.

Also you will most likely have to specify a value for -DPETSC_ARCH, I have only installed PETSc from source so PETSc tells me what the architecture is during this. On OpenSUSE (it seems to be either arch-linux2-c-debug for debug mode or arch-linux2-c-opt for optimized mode).

TIP: you may have to do a clean build of deal.ii when changing -DPETSC_ARCH. If I switch between PETSc debug and optimized mode deal.ii doesn't always recognize I changed this value and gives me errors.

Hope that helps,
Chad

Josué Barroso

unread,
Jul 7, 2014, 11:45:58 PM7/7/14
to dea...@googlegroups.com
After trying to build with only the option -DDEAL_II_WITH_PETSC=ON  I've got an error message:

 PETSc has to be configured with the same MPI configuration as deal.II, but
  found:

    DEAL_II_WITH_MPI = OFF
    PETSC_WITH_MPI   = (NOT FALSE)

So I change the parameter of the cmake to include the MPI library:

cmake -DCMAKE_INSTALL_PREFIX=~/bin/deal.II -DDEAL_II_COMPONENT_PARAMETER_GUI=ON -DDEAL_II_WITH_MPI=ON ..

And it worked! It found the MPI, PETSc and SLEPc libraries automatically 

Thank you very much for your help!


--
Josué dos Santos Barroso


--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/1GIte-IgBEU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthias Maier

unread,
Jul 8, 2014, 5:08:05 AM7/8/14
to dea...@googlegroups.com

Am 08. Jul 2014, 05:45 schrieb Josué Barroso <josue.s...@gmail.com>:

> After trying to build with only the option -DDEAL_II_WITH_PETSC=ON
>  I've got an error message:
>
>  PETSc has to be configured with the same MPI configuration as
> deal.II, but
>   found:
>
>     DEAL_II_WITH_MPI = OFF
>     PETSC_WITH_MPI   = (NOT FALSE)

Well, you also want to enable MPI support by setting

-DDEAL_II_WITH_MPI=ON

Best,
Matthias

Uwe Köcher

unread,
Jul 8, 2014, 8:22:58 AM7/8/14
to dea...@googlegroups.com
Josue,

you could try my installer for deal.II. Today, I've updated the ubuntu14 platform support.
Do the following:

$ sudo apt-get install git
$ cd candi
$ ./candi.sh

Abort the installer (or open a new terminal), and do the given install notes from the comment.
It installs also the openmpi compiler from ubuntu.
Afterwards you can let the installer run (if you have multiple cores in your system, you could
speed up the build process by setting the variable PROCS in local.cfg to an appropriate size)

On a freshly installed virtual machine (ubuntu 14.04) it runs without any error. If you encounter
any problem, please let me know.

Best,
  Uwe

Uwe Köcher

unread,
Jul 9, 2014, 3:03:53 AM7/9/14
to dea...@googlegroups.com
Sorry, the link is correctly: https://github.com/koecher/candi

Josué Barroso

unread,
Jul 9, 2014, 12:07:07 PM7/9/14
to dea...@googlegroups.com
Thanks Uwe for the alternative but as I said before, the option -DDEAL_II_WITH_MPI=ON was enough
If someday I need to install deal.II again I'll try that!

Best,
Josué
Reply all
Reply to author
Forward
0 new messages