More recent version of deal.II (9.2) co-installed with previous one (9.0), is not linked with PETSc (and other external libraries)

34 views
Skip to first unread message

Behrooz Karami

unread,
Jan 6, 2021, 5:43:32 AM1/6/21
to dea...@googlegroups.com
Dear everyone,

I already have 9.0 installed via SPACK, through which all the required external libraries are installed and consequently recognized by deal.II. I recently tried to migrate to version 9.2 (while keeping 9.0). It was installed through regular procedures described in the README file. However the new version doesn't recognize libraries that are already available on the machine. It was tested through step-18 and as an instance one particular error I received was "‘PETScWrappers’ does not name a type".
I didn't compile deal.II with PETSc ON during library installation. However in step-18 configuration, I passed following arguments to cmake:
-DDEAL_II_WITH_PETSC=ON  -DPETSC_DIR=/home/behrooz/Spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/petsc-3.10.3-4w55lkacqsfyidojpbouvm6gmadidcnn -DPETSC_ARCH=arch-linux2-c-opt (a Python file!). I received "Manually-specified variables were not used by the project" (Apparently not updated).
Additionally I added the PETSC_DIR to the bashrc file. Besides, though not a proper way, having deal.IIcmake.config files of 9.0, I even manipulated correspondings in  9.2 (were then returned to original state). The compiler was also changed.
But, none of them worked! Can anyone kindly point out the problem/solution?
For more details config.h and detailed.log files are attached.

Thank you very much,
Behrooz
detailed.log
config.h

luca.heltai

unread,
Jan 6, 2021, 7:12:59 AM1/6/21
to Deal.II Users
Dear Behrooz,

> I already have 9.0 installed via SPACK, through which all the required external libraries are installed and consequently recognized by deal.II. I recently tried to migrate to version 9.2 (while keeping 9.0). It was installed through regular procedures described in the README file.

you can do this by simply updating spack itself, and running

spack install dea...@9.2.0

> However the new version doesn't recognize libraries that are already available on the machine. It was tested through step-18 and as an instance one particular error I received was "‘PETScWrappers’ does not name a type".
> I didn't compile deal.II with PETSc ON during library installation.

This is the issue. You have to compile the library with PETSC on. The deal.II library has several wrappers (like the ones in the namespace PETScWrappers) which are compiled once, and included in the library, so that you don’t have to recompile them everytime you compile your application.

This, however, implies that you have to let deal.II discover all the libraries you think you will be using during the compilation of deal.II itself.

It is not enough to specify the external libraries when you compile an example, since in this case you would not have the compiled wrappers, but just the header files, which contain typdef guards around all definitions that require external libraries that were not discovered during the build of deal.II itself.

> However in step-18 configuration, I passed following arguments to cmake:
> -DDEAL_II_WITH_PETSC=ON -DPETSC_DIR=/home/behrooz/Spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/petsc-3.10.3-4w55lkacqsfyidojpbouvm6gmadidcnn -DPETSC_ARCH=arch-linux2-c-opt (a Python file!). I received "Manually-specified variables were not used by the project" (Apparently not updated).
> Additionally I added the PETSC_DIR to the bashrc file. Besides, though not a proper way, having deal.IIcmake.config files of 9.0, I even manipulated correspondings in 9.2 (were then returned to original state). The compiler was also changed.
> But, none of them worked! Can anyone kindly point out the problem/solution?

Rebuild the library, either using spack directly (after updating spack itself, which know knows about 9.2.0), or manually, by specifying -DDEAL_II_WITH_PETSC=ON -DPETSC_DIR=/path/to/petsc.

After this, PETSc will be available.

Best,
Luca.

Behrooz Karami

unread,
Jan 6, 2021, 8:01:16 AM1/6/21
to dea...@googlegroups.com
Dera Luca,

Thanks very much for the guidance.
Just to make sure, since I also need some other libraries such as Trilinos, do I need to rebuild deal.II with all that I anticipate might be needed?
Thank you.

--
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 the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/D1079FEE-8F37-4AC2-989E-397F063F9077%40gmail.com.

Luca Heltai

unread,
Jan 6, 2021, 8:19:03 PM1/6/21
to dea...@googlegroups.com
Yes. That is correct. My suggestion is to keep using spack, also for 9.2.

:-)

Luca.
Reply all
Reply to author
Forward
0 new messages