Problem compiling deal_ii with PETSc

152 views
Skip to first unread message

Daipayan Sarkar

unread,
Feb 13, 2018, 8:55:34 PM2/13/18
to deal.II User Group
Hello All, 

I am facing difficulty to link PETSc to dealii. Following are the steps that I did:

1. Downloaded PETSc tar file (petsc-3.8.0). 
2. Then compiled PETSc from source using: 
  ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack
3.make all test
4. Download dealii (ver 8.5.1)
5. Make the build directory inside dealii
6. cd build
7. Now for cmake to link to local PETSc installation, I implemented the following:
CC=../../petsc-3.8.3/arch-darwin-c-debug/mpicc CXX=../../petsc-3.8.3/arch-darwin-c-debug/bin/mpic++ cmake -DDEAL_II_WITH_MPI=ON -DDEAL_II_WITH_PETSC=ON -DPETSC_DIR=/Users/dos/petsc-3.8.3/ -DPETSC_ARCH=arch-darwin-c-debug -DCMAKE_INSTALL_PREFIX=./ ../

At ~ 48% I get the following error message: 

error: "PETSc was configured with MPICH but now appears to be compiling using a non-MPICH mpi.h"


Any help or suggestion is much appreciated. Thanks, DS



Bruno Turcksin

unread,
Feb 14, 2018, 8:41:12 AM2/14/18
to deal.II User Group
Hi,


On Tuesday, February 13, 2018 at 8:55:34 PM UTC-5, Daipayan Sarkar wrote:
At ~ 48% I get the following error message: 

error: "PETSc was configured with MPICH but now appears to be compiling using a non-MPICH mpi.h"

The problem is that you are mixing two different versions of MPI and you are not allowed to do that. You have told petsc to install mpich (--download-mpich) but you probably already have another mpi on your system. I would advise you to reinstall petsc without the option --download-mpich.

Best,

Bruno
 
 

Denis Davydov

unread,
Feb 14, 2018, 5:02:49 PM2/14/18
to deal.II User Group
Hi,

You may want to try one of the source-based installers listed here https://www.dealii.org/download.html 

Denis.

Daipayan Sarkar

unread,
Feb 15, 2018, 11:17:56 AM2/15/18
to dea...@googlegroups.com
Hi Bruno,

Thanks for your help. I followed just as you mentioned in your reply and now it works. For future, if I want to build any other external library (e.g. Trillions) do I need to use cmake in the build directly to make a new executable linked to the Trillions external library?

Best, 

Daipayan


--
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/D5SfbrVNizg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruno Turcksin

unread,
Feb 15, 2018, 11:45:27 AM2/15/18
to dea...@googlegroups.com
Daipayan,

2018-02-15 11:17 GMT-05:00 Daipayan Sarkar <sdai...@gmail.com>:
Thanks for your help. I followed just as you mentioned in your reply and now it works. For future, if I want to build any other external library (e.g. Trillions) do I need to use cmake in the build directly to make a new executable linked to the Trillions external library?
Yes, you need to reconfigure deal every time you want to add an external library. The reason is that it is during the configuration phase that you tell deal what libraries are available and which wrappers should be enable.

Best,

Bruno

Thang W Pham

unread,
Sep 3, 2021, 10:58:53 PM9/3/21
to deal.II User Group
Hello Bruno,

I have one problem installing PETSc with deal.ii. I am trying to install petsc-3.13.1 for deal.ii and test it with step-17. I've done this:
1. Compile PETSc with the command
./config/configure.py --with-shared=1  CC=mpicc CXX=mpicxx  --with-x=0 --with-mpi=1 --download-hypre=1
make 
make PETSC_DIR=~/deal.II/petsc/petsc-3.13.0 PETSC_ARCH=x86_64 check

2. Install Trilinos 12.8.1 "successfully" (I guess) since I've got a lot of -FOUND Trilinos library ..... when I installed deal.ii as below

3. Compile deal.ii (inside new and empty build dir) with these configs:
cmake \
-DDEAL_II_WITH_HDF5=ON \
-DHDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/mpich \
-DDEAL_II_WITH_PETSC=ON \
-DPETSC_DIR=~/deal.II/petsc/petsc-3.13.1 \
-DPETSC_ARCH=x86_64 \
-DDEAL_II_WITH_MPI=ON \
-DDEAL_II_WITH_METIS=ON \
-DDEAL_II_WITH_TRILINOS=ON \
-DTRILINOS_DIR=/home/share/trilinos \
-DCMAKE_INSTALL_PREFIX=~/deal.II  ../dealii-9.2.0 \
../

The strange output lines I've got after 
[100%] Built target step-35.release
[100%] Built target step-63.release
Install the project...
is a lot of setting runtime path like this:
-- Set runtime path of "/home/deepceel/deal.II/examples/step-1/step-1.debug" to "/home/deepceel/deal.II/lib:/home/share/trilinos/lib:/usr/lib/x86_64-linux-gnu/openmpi/lib:/home/deepceel/deal.II/petsc/petsc-3.13.1/x86_64/lib:/usr/lib/x86_64-linux-gnu/hdf5/mpich/lib"

And then when I test the library with step-17 tutorial, here is the error:
PETSc Error --- Application was linked against both OpenMPI and MPICH based MPI libraries and will not run correctly .....
The description of the error provided by PETSc is "MPI library at runtime is not compatible with MPI used at compile time".
The numerical value of the original error code is 87.

I think I need some steps to make deal.ii configure MPI properly but I cannot figure it out.

Thanks,
Thang Pham. 
Vào lúc 01:45:27 UTC+9 ngày Thứ Sáu, 16 tháng 2, 2018, bruno.t...@gmail.com đã viết:

Wolfgang Bangerth

unread,
Sep 4, 2021, 8:41:44 AM9/4/21
to dea...@googlegroups.com
On 9/3/21 8:58 PM, Thang W Pham wrote:
>
> And then when I test the library with step-17 tutorial, here is the error:
> PETSc Error --- Application was linked against both OpenMPI and MPICH based
> MPI libraries and will not run correctly .....
> The description of the error provided by PETSc is "MPI library at runtime is
> not compatible with MPI used at compile time".
> The numerical value of the original error code is 87.
>
> I think I need some steps to make deal.ii configure MPI properly but I cannot
> figure it out.

This is the error message that matters: You are compiling PETSc with one MPI
library, but deal.II with another. This can not work. In fact, if you have
both installed on your system, I would suggest removing one before the whole
installation procedure just to avoid this exact situation.

In general, if you can, it's probably worth using a script such as candi
instead of trying to install everything by hand.

Best
Wolfgang

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Message has been deleted

Thang W Pham

unread,
Sep 4, 2021, 9:09:23 AM9/4/21
to deal.II User Group
Dear Prof. Wolfgang,

Actually, I am not familiar with candi at all. I am using WSL on Windows 10 and the lib works perfectly until I have to install Trilinos (for step-17 and later use). Should I uninstall OpenMPI or MPICH instead? According to this link, I am not sure whether candi will help to install the lib with MPI or not since I do not see that on the list. 

Regards, 
Thang Pham. 

Vào lúc 21:41:44 UTC+9 ngày Thứ Bảy, 4 tháng 9, 2021, Wolfgang Bangerth đã viết:

Wolfgang Bangerth

unread,
Sep 6, 2021, 11:29:42 PM9/6/21
to dea...@googlegroups.com
On 9/4/21 7:09 AM, Thang W Pham wrote:
>
> Actually, I am not familiar with candi at all. I am using WSL on Windows 10
> and the lib works perfectly until I have to install Trilinos (for step-17 and
> later use). Should I uninstall OpenMPI or MPICH instead? According to this
> link
> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdealii%2Fcandi%2Ftree%2Fdealii-9.3%2Fdeal.II-toolchain%2Fpackages&data=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7C9cb18e902b1743b8a69308d96fa53928%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637663577691305918%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=MVb3xqmP7AE0gx34gWKx%2FdVMZE7s1QKGcCKGIPqZsTg%3D&reserved=0>,
> I am not sure whether candi will help to install the lib with MPI or not since
> I do not see that on the list.

Yes, candi installs with MPI.

It would probably help to uninstall one of the two. Which one is maybe not
that important. But, since WSL is really just an ubuntu system, you can also
install deal.II via 'apt install dealii', I believe -- take a look at the
Ubuntu installation instructions on our website!

Best
W.

Thang W Pham

unread,
Sep 10, 2021, 3:42:24 AM9/10/21
to deal.II User Group
Thanks for your instructions. I've uninstalled OpenMP and everything now works fine. 

Vào lúc 12:29:42 UTC+9 ngày Thứ Ba, 7 tháng 9, 2021, Wolfgang Bangerth đã viết:
Reply all
Reply to author
Forward
0 new messages