error: ‘PETScWrappers’ does not name a type|

332 views
Skip to first unread message

Andrew Somorjai

unread,
Oct 22, 2012, 1:29:54 AM10/22/12
to dea...@googlegroups.com
I'm trying to compile the code for step 18 in the tutorial and I'm getting the following errors with the settings below.

Basically I'm compiling step-18.cc using codeblocks which is an IDE. I've had no problems with steps 1-5 but I skipped to 18 and this happened. I tried installing

the petsc library and linking with the lib file.


My current files for linking are,


../../../../../../usr/lib/petsc/lib/libg/libpetsc.a

../../../../../../usr/lib/petsc/lib/libO_c++/libpetsc.so

libdeal_II.g.so

libdeal_II.so

libtbb.so

libtbb_debug.so

libz.a


and my linker option is, 


-lz


I have petsc installed with the include files in the include directory, the same as stl and deal.ii and I get the errors above. Please help. thanks.


Documents/deal2/deal2.18/step-18/step-18.cc|692|error: ‘PETScWrappers’ does not name a type|

Documents/deal2/deal2.18/step-18/step-18.cc|694|error: ‘PETScWrappers’ does not name a type|

Documents/deal2/deal2.18/step-18/step-18.cc|696|error: ‘PETScWrappers’ does not name a type|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘void Step18::TopLevel<dim>::setup_system()’:|

Documents/deal2/deal2.18/step-18/step-18.cc|1413|error: ‘system_matrix’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1436|error: ‘system_rhs’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1437|error: ‘incremental_displacement’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘void Step18::TopLevel<dim>::assemble_system()’:|

Documents/deal2/deal2.18/step-18/step-18.cc|1471|error: ‘system_rhs’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1472|error: ‘system_matrix’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1700|error: ‘PETScWrappers’ has not been declared|

Documents/deal2/deal2.18/step-18/step-18.cc|1700|error: expected ‘;’ before ‘tmp’|

Documents/deal2/deal2.18/step-18/step-18.cc|1703|error: ‘tmp’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1705|error: ‘incremental_displacement’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘void Step18::TopLevel<dim>::solve_timestep()’:|

Documents/deal2/deal2.18/step-18/step-18.cc|1722|error: ‘system_rhs’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘unsigned int Step18::TopLevel<dim>::solve_linear_problem()’:|

Documents/deal2/deal2.18/step-18/step-18.cc|1768|error: ‘PETScWrappers’ has not been declared|

Documents/deal2/deal2.18/step-18/step-18.cc|1769|error: expected ‘;’ before ‘distributed_incremental_displacement’|

Documents/deal2/deal2.18/step-18/step-18.cc|1772|error: ‘distributed_incremental_displacement’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1772|error: ‘incremental_displacement’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1774|error: ‘SolverControl’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1774|error: expected ‘;’ before ‘solver_control’|

Documents/deal2/deal2.18/step-18/step-18.cc|1776|error: ‘PETScWrappers’ has not been declared|

Documents/deal2/deal2.18/step-18/step-18.cc|1776|error: expected ‘;’ before ‘cg’|

Documents/deal2/deal2.18/step-18/step-18.cc|1779|error: ‘PETScWrappers’ has not been declared|

Documents/deal2/deal2.18/step-18/step-18.cc|1779|error: expected ‘;’ before ‘preconditioner’|

Documents/deal2/deal2.18/step-18/step-18.cc|1781|error: ‘cg’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1781|error: ‘system_matrix’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1781|error: ‘system_rhs’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1782|error: ‘preconditioner’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|1788|error: ‘solver_control’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘void Step18::TopLevel<dim>::output_results() const’:|

Documents/deal2/deal2.18/step-18/step-18.cc|1948|error: ‘incremental_displacement’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘void Step18::TopLevel<dim>::refine_initial_grid()’:|

Documents/deal2/deal2.18/step-18/step-18.cc|2251|error: ‘incremental_displacement’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|2264|error: ‘PETScWrappers’ has not been declared|

Documents/deal2/deal2.18/step-18/step-18.cc|2265|error: expected ‘;’ before ‘distributed_error_per_cell’|

Documents/deal2/deal2.18/step-18/step-18.cc|2271|error: there are no arguments to ‘distributed_error_per_cell’ that depend on a template parameter, so a declaration of ‘distributed_error_per_cell’ must be available [-fpermissive]|

Documents/deal2/deal2.18/step-18/step-18.cc|2271|note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)|

Documents/deal2/deal2.18/step-18/step-18.cc|2272|error: ‘distributed_error_per_cell’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘void Step18::TopLevel<dim>::update_quadrature_point_history()’:|

Documents/deal2/deal2.18/step-18/step-18.cc|2713|error: ‘incremental_displacement’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc||In function ‘int main(int, char**)’:|

Documents/deal2/deal2.18/step-18/step-18.cc|2825|error: ‘PetscInitialize’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc|2834|error: ‘PetscFinalize’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘void Step18::TopLevel<dim>::refine_initial_grid() [with int dim = 3]’:|

Documents/deal2/deal2.18/step-18/step-18.cc:2171|4|instantiated from ‘void Step18::TopLevel<dim>::do_initial_timestep() [with int dim = 3]’|

Documents/deal2/deal2.18/step-18/step-18.cc:1068|5|instantiated from ‘void Step18::TopLevel<dim>::run() [with int dim = 3]’|

Documents/deal2/deal2.18/step-18/step-18.cc:2831|30|instantiated from here|

Documents/deal2/deal2.18/step-18/step-18.cc|2271|error: ‘distributed_error_per_cell’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc:2171|4|instantiated from ‘void Step18::TopLevel<dim>::do_initial_timestep() [with int dim = 3]’|

Documents/deal2/deal2.18/step-18/step-18.cc:1068|5|instantiated from ‘void Step18::TopLevel<dim>::run() [with int dim = 3]’|

Documents/deal2/deal2.18/step-18/step-18.cc:2831|30|instantiated from here|

Documents/deal2/deal2.18/step-18/step-18.cc|2261|warning: unused variable ‘n_local_cells’ [-Wunused-variable]|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘void Step18::TopLevel<dim>::move_mesh() [with int dim = 3]’:|

Documents/deal2/deal2.18/step-18/step-18.cc:2196|5|instantiated from ‘void Step18::TopLevel<dim>::do_initial_timestep() [with int dim = 3]’|

Documents/deal2/deal2.18/step-18/step-18.cc:1068|5|instantiated from ‘void Step18::TopLevel<dim>::run() [with int dim = 3]’|

Documents/deal2/deal2.18/step-18/step-18.cc:2831|30|instantiated from here|

Documents/deal2/deal2.18/step-18/step-18.cc|2443|error: ‘incremental_displacement’ was not declared in this scope|

Documents/deal2/deal2.18/step-18/step-18.cc||In member function ‘unsigned int Step18::TopLevel<dim>::solve_linear_problem() [with int dim = 3]’:|

Documents/deal2/deal2.18/step-18/step-18.cc|1789|warning: control reaches end of non-void function [-Wreturn-type]|

||=== Build finished: 40 errors, 2 warnings ===|


Wolfgang Bangerth

unread,
Oct 22, 2012, 9:37:57 AM10/22/12
to dea...@googlegroups.com, Andrew Somorjai

Andrew,

> Basically I'm compiling step-18.cc using codeblocks which is an IDE.
> I've had no problems with steps 1-5 but I skipped to 18 and this
> happened. I tried installing

Are you using the deal.II provided Makefiles or something you set up
through CodeBlocks? You need to do the former for it all to work.

Best
Wolfgang

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

Andrew Somorjai

unread,
Oct 22, 2012, 12:17:10 PM10/22/12
to dea...@googlegroups.com, Andrew Somorjai
Thanks Wolfgang for your quick response, I guess I'll use the makefile for now
although there has to be a way to get the program running without it. I managed
to run steps 1-5 no problem with my settings and I can't imagine why step-18 wouldn't work
without the correct libs and linker settings. Is there something special about a makefile that
cannot be replicated using an IDE?

Wolfgang Bangerth

unread,
Oct 22, 2012, 12:33:32 PM10/22/12
to dea...@googlegroups.com, Andrew Somorjai
On 10/22/2012 11:17 AM, Andrew Somorjai wrote:
> Thanks Wolfgang for your quick response, I guess I'll use the makefile
> for now
> although there has to be a way to get the program running without it. I
> managed
> to run steps 1-5 no problem with my settings and I can't imagine why
> step-18 wouldn't work
> without the correct libs and linker settings. Is there something special
> about a makefile that
> cannot be replicated using an IDE?

It can of course be replicated but you need to set the various -D...
flags that the Makefile makes sure are passed to the compiler. This is
the reason why it doesn't work for you. You can see what flags are
passed in various places of common/Make.global_options.

Best
W.

Andrew Somorjai

unread,
Oct 22, 2012, 3:44:54 PM10/22/12
to dea...@googlegroups.com, Andrew Somorjai
I checked for petsc on my machine and it is in the usr/lib/petsc directory but when I try to configure
deal.ii I get a message that says,

checking for PETSc library directory... not found

checking for SLEPc include directory... not found

checking for Trilinos directory... not found

checking for Trilinos header directory... not found

checking for Trilinos library directory... not found


I'm trying to configure the deal.ii folder in the desktop directory, could that be why or is there no difference 

where its configured?


Even my synaptic package manager says petsc is installed. I'm also trying to install slepc and trilinos and I'm typing. 

Timo Heister

unread,
Oct 22, 2012, 4:23:13 PM10/22/12
to dea...@googlegroups.com, Andrew Somorjai
> I checked for petsc on my machine and it is in the usr/lib/petsc directory
> but when I try to configure
> deal.ii I get a message that says,
>
> checking for PETSc library directory... not found

Have you checked the following page yet?
http://www.dealii.org/developer/readme-petsc-trilinos.html

> Even my synaptic package manager says petsc is installed.

Are the environment variables set? Do you have the dev packages too?

> I'm also trying to
> install slepc and trilinos and I'm typing.

If you don't need slepc, you better not try to configure it. At least
try to get petsc to work first.

Andrew Somorjai

unread,
Oct 22, 2012, 6:59:22 PM10/22/12
to dea...@googlegroups.com, Andrew Somorjai
I didn't read that page about petsc for configuring it. When I type ./configure do I add
--with-petsc=usr/lib/petsc after it. Is the following correct?
./configure --with-petsc=usr/lib/petsc
but then what about --with-petsc-arch=ARCH, do I need that too and what directory is ARCH by the way?

Martin Steigemann

unread,
Oct 23, 2012, 1:36:47 AM10/23/12
to dea...@googlegroups.com, Andrew Somorjai
Dear Andrew,
 
--with-petsc tells the configure script the directory of your petsc installation you want to use, for example /use/lib/petsc and --with-arch denotes the architecture, this is the directory, where petsc stores the generated libs for your specific system, on my system, this folder in petsc-3.2-p5 is named arch-linux2-c-debug, look for a folder starting with arch in your petsc directory and, as Timo mentioned, set the environment variables PETSC_ARCH and PETSC_DIR.
If this works, you can install slepc if you need it, but choose the same version as petsc!! export SLEPC_DIR and slepc configure (hopefully) should find the petsc installation.
 
Best,
Martin
 
 
--
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
 
 

Andrew Somorjai

unread,
Oct 23, 2012, 4:38:20 PM10/23/12
to dea...@googlegroups.com, Andrew Somorjai
@Martin,

I searched my entire file system for 'petsc arch' and the only folder I found was petscarch1.gz which has one file in it named petscarch.1 so thats not right somehow.
When you installed petsc did you use the synaptic package manager or something similar or did you compile the library yourself. I may need to compile the library myself
because the files available in the petsc directory seem to be short of what you have. 

Martin Steigemann

unread,
Oct 23, 2012, 7:07:23 PM10/23/12
to dea...@googlegroups.com, Andrew Somorjai
Andrew,
I have never used this package manager, I always built all the libraries with the same compiler by myself. But I think petscarch.1.gz is an archive and if you unpack it, you should have petscarch, not?
Do you have a subfolder with the lib your/petsc/folder/lib/libpetsc.so ? Then try to set --with-petsc=/your/petsc/folder but I am not sure if the configure script finds the lib without the architecture.
 
Best,
Martin

Vijay S. Mahadevan

unread,
Oct 23, 2012, 7:30:51 PM10/23/12
to dea...@googlegroups.com, Andrew Somorjai
Andrew,

You probably missed a slash in the path to petsc-directory. So try the
following:

./configure --with-petsc=/usr/lib/petsc

Also, when you installed with synaptic, it should have added the
environment variable PETSC_DIR. Try the following and use the
directory path that is printed out in the above configure command, if
it is different from /usr/lib/petsc.

export | grep 'PETSC_DIR'

Alternately, you can build petsc from source. Here's some simple
instructions to build on Ubuntu:

http://www.data-assimilation.net/mediawiki/index.php/PETSC
http://www.mcs.anl.gov/petsc/documentation/installation.html

Vijay

Andrew Somorjai

unread,
Oct 24, 2012, 10:22:00 PM10/24/12
to dea...@googlegroups.com, Andrew Somorjai, Martin Steigemann
Martin,

I tried this and it got stuck around the part where the architecture isn't setup properyly,

./configure --with-petsc=/usr/lib/petsc 

"checking for PETSc library architecture... configure: error: If PETSc is used, you must specify the architecture either through the PETSC_ARCH environment variable, or through the --with-petsc-arch flag"

"Do you have a subfolder with the lib your/petsc/folder/lib/libpetsc.so ? "

Nope, if you mean "your" as in my home directory then I haven't even compiled petsc yet. I'm still trying to work with what synaptic installed for me
and hope its the best for the system I'm on.

Andrew Somorjai

unread,
Oct 24, 2012, 10:22:44 PM10/24/12
to dea...@googlegroups.com, Andrew Somorjai
Vijay,

I did find a file called petscarch in /usr/bin which is a "link to shell script"? If thats not the correct file then its obvious now that
synaptic did a terrible job installing petsc. I did try using,

export | grep /usr/lib/petsc 

and then ran,

./configure --with-petsc=/usr/lib/petsc 

and again ended up with that last quote posted above.

I tried specifying that 'link to shell script' file using,

./configure --with-petsc=/usr/lib/petsc --with-petsc=/usr/bin

and it gave me this error,

"checking for PETSc library directory... /usr/bin
configure: error: Path to PETSc specified with --with-petsc does not point to a complete PETSc installation"

The files might be on my machine but I just need to check more thoroughly. What extension would the file have actually?
The file called petscarch.1.gz is in the '/usr/lib/petscdir/3.1/bin/' directory. Might that be it, maybe I'm using an incorrect
command, was my last ./configure correct, the last command is supposed to be the arch directory?

./configure --with-petsc=/usr/lib/petsc --with-petsc=/usr/bin

Vijay S. Mahadevan

unread,
Oct 25, 2012, 3:24:38 PM10/25/12
to dea...@googlegroups.com, Andrew Somorjai
> export | grep /usr/lib/petsc

I did not ask you to do this. Do

export | grep 'PETSC_DIR' or echo $PETSC_DIR

If both those command print nothing, then you need to set them first.

export PETSC_DIR="/usr/lib/petsc"
export PETSC_ARCH=""

And then reconfigure with
./configure --with-petsc=$PETSC_DIR --with-petsc-arch=$PETSC_ARCH

Btw, what version of petsc did you install ? If its 3.1, I suggest you
upgrade to 3.3. I believe the latest ubuntu packages should have this
in the official repository. Petsc-3.1 is couple of years old and the
way the configuration is performed/directories are arranged have
changed considerably now. It would be easier for us to help you setup
with the latest version.

Vijay

Martin Steigemann

unread,
Oct 25, 2012, 3:38:43 PM10/25/12
to dea...@googlegroups.com, Andrew Somorjai
Andrew,

I absolutely agree with Vijay, and if you have a folder
/usr/lib/petsc/3.1/... the petsc-folder for the configure script should be

--with-petsc=/usr/lib/petsc/3.1

but you should update to petsc-3.3 and, if you want, built the library with
the same compiler as deal.II.

Best,
Martin

Andrew Somorjai

unread,
Oct 27, 2012, 1:26:13 AM10/27/12
to dea...@googlegroups.com, Andrew Somorjai
I decided to just uninstall the synaptic download after all since it was outdated and I tried installing 3.3 but so far I'm having no luck.
The error tells me to check the configure.log and I think the export command also screwed up something but its probably not related. 
This is what I typed in below using that site you sent me, the configure.log file is a monster and I can't make heads or tails from it.

This is from the terminal.

x@x:~/petsc$ ./configure --with-cc=gcc --with-fc=gfortran --download-f-blas-lapack --download-mpich
===============================================================================
             Configuring PETSc to compile on your system                       
===============================================================================
TESTING: configureDirectories from PETSc.utilities.petscdir(config/PETSc/utilities/petscdir.py:28) *******************************************************************************
         UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for details):
-------------------------------------------------------------------------------
The environmental variable PETSC_DIR /usr/lib/petsc is not a directory
*******************************************************************************

Wolfgang Bangerth

unread,
Oct 27, 2012, 7:25:11 AM10/27/12
to dea...@googlegroups.com, Andrew Somorjai
On 10/27/2012 12:26 AM, Andrew Somorjai wrote:
> I decided to just uninstall the synaptic download after all since it was
> outdated and I tried installing 3.3 but so far I'm having no luck.
> The error tells me to check the configure.log and I think the export
> command also screwed up something but its probably not related.
> This is what I typed in below using that site you sent me, the
> configure.log file is a monster and I can't make heads or tails from it.

Andrew,
there are detailed instructions here:

http://dealii.sourceforge.net/index.php/Deal.II_Questions_and_Answers#Is_there_a_sure-fire_way_to_compile_deal.II_with_PETSc.3F

Please follow the steps outlined there.

Timo Heister

unread,
Oct 27, 2012, 10:28:16 PM10/27/12
to dea...@googlegroups.com, Andrew Somorjai
> The environmental variable PETSC_DIR /usr/lib/petsc is not a directory

This is the error message you need to pay attention to. You need to
remove PETSC_DIR from your environment.


--
Timo Heister
http://www.math.tamu.edu/~heister/

Andrew Somorjai

unread,
Oct 27, 2012, 11:37:10 PM10/27/12
to dea...@googlegroups.com, Andrew Somorjai
Timo,

I have no idea how though, what command do I use. Is there a way to edit some file in directory btw?

Andrew Somorjai

unread,
Oct 27, 2012, 11:42:37 PM10/27/12
to dea...@googlegroups.com, Andrew Somorjai
Wolfgang,

What does it mean that its for MPI compilers though,

"Note, that we are using the MPI compilers for this. (Note that the correct flag for PETSc 3.2.0 and later is --with-shared-libraries=1 instead of --with-shared=1.) Finally build the libraries with"

I'm using gcc... is that not correct?

Timo Heister

unread,
Oct 28, 2012, 3:39:07 PM10/28/12
to dea...@googlegroups.com, Andrew Somorjai
>I have no idea how though, what command do I use.

You have an exported environment variable that is called PETSC_DIR
that you need to remove because it points to a directory where PETSc
is no longer installed at. You can see all exports with "export"
(depends on your shell though). You might want to read up about the
shell you are using (maybe it is bash). I am not sure who set this
variable, it might be from your earlier experiments (just reboot) or
set in something like ~/.bashrc or ~/.bash_aliases.

> Is there a way to edit some file in directory btw?

What?

> What does it mean that its for MPI compilers though,
> I'm using gcc... is that not correct?

Do you want to use PETSc with parallel computing? If yes you need to
compile with an mpi compiler (install openmpi for example, the
compiler is then mpicxx). If no, then why do you want to use PETSc?

Matthias Maier

unread,
Oct 29, 2012, 5:11:13 AM10/29/12
to dea...@googlegroups.com

Am 28. Okt 2012, 04:37 schrieb Andrew Somorjai <pando...@gmail.com>:

> Timo,
>
> I have no idea how though, what command do I use. Is there a way to edit some
> file in directory btw?

Try to configure with:

$ unset PETSC_DIR; unset PETSC_ARCH; ./configure

Does this work?

Usually, exports such as PETSC_DIR, PETSC_ARCH are set in a shell
specific login/configuration file. For bash it is most likely .bashrc .

Best,
Matthias

Andrew Somorjai

unread,
Oct 30, 2012, 2:22:05 AM10/30/12
to dea...@googlegroups.com, Andrew Somorjai
Timo,

"Do you want to use PETSc with parallel computing? If yes you need to 
compile with an mpi compiler (install openmpi for example, the 
compiler is then mpicxx). If no, then why do you want to use PETSc? "

Because of example 18 (or whatever its called, can't remember at the moment).

Andrew Somorjai

unread,
Oct 30, 2012, 2:28:54 AM10/30/12
to dea...@googlegroups.com
Matthias,

Thanks! I got it to work although I'm not sure if I should configure with the site Wolfgang showed or just a regular ./configure.
I want mpi support with petsc so I want to make sure I install it correctly, so far petsc has been configured, this was the output 
(its not too long).

x@x:~/petsc$ unset PETSC_DIR; unset PETSC_ARCH; ./configure
===============================================================================
             Configuring PETSc to compile on your system                       
===============================================================================
TESTING: alternateConfigureLibrary from PETSc.packages.mpi4py(config/PETSc/packaCompilers:
  C Compiler:         mpicc  -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -fno-inline -O0 
  Fortran Compiler:   mpif90  -Wall -Wno-unused-variable -Wno-unused-dummy-argument -g  
Linkers:
  Static linker:   /usr/bin/ar cr
  Dynamic linker:   /usr/bin/ar  
MPI:
  Includes: -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi
X:
  Includes: 
  Library:  -lX11
BLAS/LAPACK: -llapack -lblas
cmake:
pthread:
  Library:  -lpthread
  Arch:     
valgrind:
PETSc:
  PETSC_ARCH: arch-linux2-c-debug
  PETSC_DIR: /home/x/petsc
  Clanguage: C
  Scalar type: real
  Precision: double
  Memory alignment: 16
  shared libraries: disabled
  dynamic loading: disabled
xxx=========================================================================xxx
 Configure stage complete. Now build PETSc libraries with (cmake build):
   make PETSC_DIR=/home/x/petsc PETSC_ARCH=arch-linux2-c-debug all
 or (experimental with python):
   PETSC_DIR=/home/x/petsc PETSC_ARCH=arch-linux2-c-debug ./config/builder.py
xxx=========================================================================xxx
x@x:~/petsc$ 

Vijay S. Mahadevan

unread,
Oct 30, 2012, 2:30:07 AM10/30/12
to dea...@googlegroups.com, Andrew Somorjai
Andrew,

If your petsc synaptic install looks like
http://packages.ubuntu.com/precise/i386/libpetsc3.1-dev/filelist, then
I would suggest using PETSC_DIR=/usr/lib/petscdir/3.1. Again, check if
such a directory exists and if /usr/lib/petscdir/3.1/conf has a file
named petscvariables.

Once you verify these, it will be easier to get you started with
deal.II configure options.

Vijay

Matthias Maier

unread,
Oct 30, 2012, 5:38:29 AM10/30/12
to dea...@googlegroups.com

Am 30. Okt 2012, 07:28 schrieb Andrew Somorjai <pando...@gmail.com>:

> [...]
>
> xxx=========================================================================xxx
> Configure stage complete. Now build PETSc libraries with (cmake build):
> make PETSC_DIR=/home/x/petsc PETSC_ARCH=arch-linux2-c-debug all
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

to configure deal.II with petsc and mpi support, you can specify:

$ PETSC_DIR=/home/x/petsc PETSC_ARCH=arch-linux2-c-debug ./configure --enable-mpi

Best,
Matthias

Andrew Somorjai

unread,
Nov 3, 2012, 12:54:11 AM11/3/12
to dea...@googlegroups.com
Matthias,

I tried this below, basically using what Wolfgang posted using this site.


Below is the terminal output... it told me the directory I exported was incorrect. Now I'm not sure what my home directory is but it seems I exported the wrong directory.

x@x:~$ ls
C:\nppdf32Log\debuglog.txt  Public
Desktop                     Music                
Documents                   petsc                
Downloads                   petsc-3.3-p3.tar.gz  Templates
examples.desktop            Pictures             Videos
x@x:~$ cd petsc
x@x:~/petsc$ export PETSC_DIR=$petsc
x@x:~/petsc$ export PETSC_ARCH=$petsc/arch-linux2-c-debug
x@x:~/petsc$ ./config/configure.py --with-shared=1 --with-x=0 --with-fc=0 --with-mpi=1 --with-mpi-dir=/usr
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The version of PETSc you are using is out-of-date, we recommend updating to the new release
 Available Version: 3.3.4   Installed Version: 3.3.3
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
===============================================================================
             Configuring PETSc to compile on your system                       
===============================================================================
TESTING: configureDirectories from PETSc.utilities.petscdir(config/PETSc/utiliti*******************************************************************************
         UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for details):
-------------------------------------------------------------------------------
The environmental variable PETSC_DIR  is not a directory
*******************************************************************************

x@x:~/petsc$ 

Wolfgang Bangerth

unread,
Nov 3, 2012, 7:18:31 AM11/3/12
to dea...@googlegroups.com

Andrew,

> x@x:~/petsc$ export PETSC_DIR=$petsc
> x@x:~/petsc$ export PETSC_ARCH=$petsc/arch-linux2-c-debug

These commands do not make much sense as given here.

I believe that more than anything else your problems are caused by the
fact that you do not have a lot of experience with working on the
command line. We can keep going around in circles here on the mailing
list for a long time but it is not going to solve this underlying problem.

My suggestion is to find someone who has experience with linux and the
command line and let them help you in installing petsc and deal.II. Do
you have a system administrator you can ask?

Andrew Somorjai

unread,
Nov 4, 2012, 4:20:25 PM11/4/12
to dea...@googlegroups.com
Dear Wolfgang,

I got past that point and ended up compiling petsc and metis. For petsc I used

export PETSC_DIR=/home/x/petsc
export PETSC_ARCH=arch-linux2-c-debug

./config/configure.py --with-shared-libraries --with-x=0 --with-fc=0 --with-mpi=1 --with-mpi-dir=/us

and for metis,

make config shared=1 cc=gcc

The petsc test ran fine for the 2 mpi processes
and metis installed perfectly although someone should note that the page in the wiki no longer requires configuring metis and 
it only needs make. I also used sudo to install metis because it was complaining about copying the metis.h file to the usr/lib directory.

 The next part about configuring deal.ii with metis and petsc also worked fine 

./configure --enable-mpi --disable-threads  CC=mpicc CXX=mpicxx --with-petsc=/home/x/petsc --with-petsc-arch=arch-linux2-c-debug --with-metis=/home/x/metis-5.0.2

but when I tried to use 'make all' I ended up with errors, here they are...

x@x:~/deal.II$ make all
make[1]: Entering directory `/home/x/deal.II/common/scripts'
===================================== Compiling make_dependencies
===================================== Compiling expand_instantiations
===================================== Compiling report_features
make[1]: Leaving directory `/home/x/deal.II/common/scripts'
make[1]: Entering directory `/home/x/deal.II/source'
Makefile:213: Makefile.dep: No such file or directory
Makefile:236: numerics/Makefile.dep: No such file or directory
Makefile:236: fe/Makefile.dep: No such file or directory
Makefile:236: dofs/Makefile.dep: No such file or directory
Makefile:236: lac/Makefile.dep: No such file or directory
Makefile:236: base/Makefile.dep: No such file or directory
Makefile:236: grid/Makefile.dep: No such file or directory
Makefile:236: hp/Makefile.dep: No such file or directory
Makefile:236: multigrid/Makefile.dep: No such file or directory
Makefile:236: distributed/Makefile.dep: No such file or directory
===================================== Remaking distributed/Makefile.dep
===================================== Remaking multigrid/Makefile.dep
===================================== Remaking hp/Makefile.dep
===================================== Remaking grid/Makefile.dep
===================================== Remaking base/Makefile.dep
===================================== Remaking lac/Makefile.dep
===================================== Remaking dofs/Makefile.dep
===================================== Remaking fe/Makefile.dep
===================================== Remaking numerics/Makefile.dep
===================================== Remaking ../include/deal.II/lac/lapack_templates.h
===================================== Remaking Makefile.dep
make[1]: Leaving directory `/home/x/deal.II/source'
make[1]: Entering directory `/home/x/deal.II/source'
make[1]: `Makefile.dep' is up to date.
make[1]: Leaving directory `/home/x/deal.II/source'
make[1]: Entering directory `/home/x/deal.II/lib'
make[1]: *** No rule to make target `/home/x/petsc/arch-linux2-c-debug/lib/libpetsc.so', needed by `libpetscall.g.so'.  Stop.
make[1]: Leaving directory `/home/x/deal.II/lib'
make: *** [deps] Error 2

Wolfgang Bangerth

unread,
Nov 4, 2012, 5:31:00 PM11/4/12
to dea...@googlegroups.com

> make[1]: *** No rule to make target
> `/home/x/petsc/arch-linux2-c-debug/lib/libpetsc.so', needed by

Well, does this library exist somewhere? If it doesn't exist in this
directory, why not?

Best
WB

Andrew Somorjai

unread,
Nov 5, 2012, 7:45:41 PM11/5/12
to dea...@googlegroups.com
Wolfgang,

Yes it exists but instead of having a libpetsc.so file I have a libpetsc.a? 
I thought '.a' extensions were for windows not linux. I did not cross compile. 
I really have no idea what to make of this error. I did everything accordingly with petsc
per the instructions on the wiki so nothing should be unusual about this part of building 
deal.ii. 

I also ran the 2 mpi processes after building and those were fine, so the library is
'complete' but why the .a file instead of .so? Could I just change the extension manually; but then
I would probably run into more errors building the rest of deal.ii with presumably other .a petsc lib
files in other folders. HELP!

Andrew

Daniel Brauss

unread,
Nov 5, 2012, 9:15:21 PM11/5/12
to dea...@googlegroups.com
Hi Andrew,

You may already be familiar with some of this, but to try to help...
The .a file is for a static library file.  You can look up "static" versus "dynamic" and "shared"
along with "linux" with a google search and you will be able to get some more information on
this.  Basically, the libraries containing the code (say PETSc or deal.ii code that you want to use)
are attached (linked) to your code by way of these files ( I think that is okay to say).  A .so file is a
shared library file object.  These two types of library files link the code you want to
use (say PETSc or deal.ii tools) to your code differently depending on which one you choose
during configuration of the library (say deal.ii or PETSc).
They both have advantages and disadvantages and some architectures
only allow you to use one type.  For example, the NERSC computers like Franklin only allow
you to install .a files.

You can choose which way you want the PETSc libraries and deal.ii libraries installed.  This
is done by using the flags --enable-shared (or --disable-shared) for deal.ii and using --with-shared-libraries
(or leaving this flag off for a static .a library) during configuration for PETSc.  But you will
want to have both PETSc and deal.ii (and probably p4est) all static or all shared.  Otherwise,
you will probably run into trouble.

I have found the installation process to be a bit of a learning curve, and it takes some time
to get somewhat comfortable.  But it looks like you are almost there.  Take a look at the flags that you
are setting during configuration of deal.ii and petsc to make sure that you use both dynamic
.so or static .a libraries.  A question for the experts: Can we configure p4est to be both static as well as shared?

Hope this helps.

Dan
 


Wolfgang Bangerth

unread,
Nov 5, 2012, 10:21:12 PM11/5/12
to dea...@googlegroups.com

> .so or static .a libraries. A question for the experts: Can we
> configure p4est to be both static as well as shared?

No. You need to compile files with different flags to produce static or
shared libs. So you'd have to compile all of PETSc twice.

W.

Martin Steigemann

unread,
Nov 6, 2012, 1:04:16 AM11/6/12
to dea...@googlegroups.com
Andrew,
 
I am not sure about the PETSc version you are using, but the flag for shared libraries should be
 
--with-shared-libraries=1
 
 
Best,
Martin
 
 

Andrew Somorjai

unread,
Nov 7, 2012, 11:26:20 PM11/7/12
to dea...@googlegroups.com
Martin,

Thanks, the last part worked but a 1/4 of the way into compiling deal.ii I got a metis library error.

=====deal.II==========debug========== Linking library:   libdeal_II.g.so
g++: error: /home/x/metis-5.0.2/libmetis/libmetis.so: No such file or directory
make[1]: *** [/home/x/deal.II/lib/libdeal_II.g.so] Error 1
make[1]: Leaving directory `/home/x/deal.II/source'
make: *** [debug] Error 2

I used the following to build metis, there were no configure options but I did use shared = 1.

make config shared=1 cc=gcc

I checked the directory /home/x/metis-5.0.2/libmetis/ and it exists but for some reason the libmetis.so isn't there. 
I did install metis to the default location usr/local/lib and libmetis.so was inside the lib folder but I'm not sure
if copying it into the home directory would void a warranty and cause a massive headache later in life. Any 
suggestions???

Martin Steigemann

unread,
Nov 8, 2012, 1:38:22 AM11/8/12
to dea...@googlegroups.com
Andrew,
 
have you typed "make install" ? Then you should find the lib in "/path/to/metis/libmetis" as specified in "make config ... prefix=/path/to/metis/", default is "/usr/local/", but then you have to give the flag
 
--use-metis=/path/to/metis
 
to configure dealii
 
Best,
Martin
 
 
----- Original Message -----
Sent: Thursday, November 08, 2012 5:26 AM
Subject: Re: [deal.II] error: 'PETScWrappers' does not name a type|

Andrew Somorjai

unread,
Nov 8, 2012, 4:41:52 PM11/8/12
to dea...@googlegroups.com
Martin,

Well now I'm assuming that deal.ii only needs libmetis.so to build and nothing else so then configuring deal.ii using 

--use-metis=/path/to/metis

 should be instead,

--use-metis=/usr/local/    

which is the location of my libmetis.so file; or does deal.ii also need the headers from metis as well?

Martin Steigemann

unread,
Nov 10, 2012, 9:27:38 AM11/10/12
to dea...@googlegroups.com
Andrew,
 
as far as I know, deal.ii does not need the headers, but I do not use metis today, I only found a very old installation on my system using metis 4. ?? and deal.ii 6.?? where example 17 runs very well and this was configured with --use-metis=/path/to/metis/ only, so this should do it.
 
Best,
Martin
 
 
----- Original Message -----
Sent: Thursday, November 08, 2012 10:41 PM
Subject: Re: [deal.II] error: 'PETScWrappers' does not name a type|

Andrew Somorjai

unread,
Nov 10, 2012, 10:41:04 PM11/10/12
to dea...@googlegroups.com
To all of you,

Thanks, 

I got it work finally (I ended up copying libmetis.so into the directory I used to configure deal.ii,  /home/x/metis-5.0.2/libmetis/) and I built step-18 using make (received 3 new errors with step-1 in codeblocks so I gave up on it, let me know if you want to see the errors). It only took my amd-8150 processor about 20 minutes to run step-18. I'm not sure if multicore processors take advantage of anything that petsc or mpi has to offer.

Andrew

Reply all
Reply to author
Forward
0 new messages