← Back to team overview

dolfin team mailing list archive

Re: compile error with petsc

 

Patch is attached.

/Anders


On Wed, Sep 06, 2006 at 05:28:03PM +0200, Anders Logg wrote:
> My fault. I made a last minute fix before the release and forgot to
> test the compilation with --enable-petsc.
> 
> I have attached a simple patch to uBlasVector.h and will commit the
> change shortly. Apply with
> 
>     patch -p1 < dolfin-0.6.2-petscfix.patch
> 
> When you have confirmed this fix does the trick, I'll put up a new
> version 0.6.2-1.
> 
> /Anders
> 
> On Wed, Sep 06, 2006 at 02:42:59PM +0000, Alexander Jarosch wrote:
> > The config works smoothly but make fails like:
> > 
> >  g++ -DPACKAGE_NAME=\"DOLFIN\" -DPACKAGE_TARNAME=\"dolfin\"
> > -DPACKAGE_VERSION=\"0.6.2\" "-DPACKAGE_STRING=\"DOLFIN 0.6.2\""
> > -DPACKAGE_BUGREPORT=\"dolfin@xxxxxxxxxx\" -DSTDC_HEADERS=1
> > -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
> > -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
> > -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
> > -I. -I. -I../../../src/kernel/common -I../../../src/kernel/fem
> > -I../../../src/kernel/form -I../../../src/kernel/function
> > -I../../../src/kernel/io -I../../../src/kernel/la
> > -I../../../src/kernel/main -I../../../src/kernel/math
> > -I../../../src/kernel/mesh -I../../../src/kernel/mf
> > -I../../../src/kernel/nls -I../../../src/kernel/ode
> > -I../../../src/kernel/pde -I../../../src/kernel/quadrature
> > -I../../../src/kernel/parameter -I../../../src/kernel/log
> > -I/home/alex/dolfin/petsc-2.3.2-p0
> > -I/home/alex/dolfin/petsc-2.3.2-p0/bmake/linux-gnu-cxx-real-debug
> > -I/home/alex/dolfin/petsc-2.3.2-p0/include
> > -I/home/alex/dolfin/petsc-2.3.2-p0/include/mpiuni
> > -I/home/alex/dolfin/petsc-2.3.2-p0/externalpackages/UMFPACKv4.3/linux-gnu-cxx-real-debug/UMFPACK/Include
> > -I/usr/include/libxml2 -DHAVE_PETSC_H=1 -g -O2 -DNDEBUG -pedantic
> > -Wno-long-long -std=c++98 -MT uBlasVector.lo -MD -MP -MF
> > .deps/uBlasVector.Tpo -c uBlasVector.cpp  -fPIC -DPIC -o .libs/uBlasVector.o
> > uBlasVector.cpp: In member function `void
> > dolfin::uBlasVector::copy(const dolfin::uBlasVector::PETScVector&)':
> > uBlasVector.cpp:149: error: invalid use of undefined type `const struct
> > dolfin::uBlasVector::PETScVector'
> > ./dolfin/uBlasVector.h:114: error: forward declaration of `const struct
> > dolfin::uBlasVector::PETScVector'
> > uBlasVector.cpp:154: error: invalid use of undefined type `const struct
> > dolfin::uBlasVector::PETScVector'
> > ./dolfin/uBlasVector.h:114: error: forward declaration of `const struct
> > dolfin::uBlasVector::PETScVector'
> > make[4]: *** [uBlasVector.lo] Error 1
> > make[4]: Leaving directory `/home/alex/dolfin/dolfin-0.6.2/src/kernel/la'
> > make[3]: *** [all-recursive] Error 1
> > make[3]: Leaving directory `/home/alex/dolfin/dolfin-0.6.2/src/kernel/la'
> > make[2]: *** [all-recursive] Error 1
> > make[2]: Leaving directory `/home/alex/dolfin/dolfin-0.6.2/src/kernel'
> > make[1]: *** [all-recursive] Error 1
> > make[1]: Leaving directory `/home/alex/dolfin/dolfin-0.6.2/src'
> > make: *** [all-recursive] Error 1
> > 
> > any suggestions, thanks.
> > 
> > Alex
> > 
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev

diff -r ed16e6752628 src/kernel/la/dolfin/uBlasVector.h
--- a/src/kernel/la/dolfin/uBlasVector.h	Tue Sep 05 22:00:27 2006 +0200
+++ b/src/kernel/la/dolfin/uBlasVector.h	Wed Sep 06 17:21:52 2006 +0200
@@ -4,7 +4,7 @@
 // Modified by Anders Logg 2006.
 //
 // First added:  2006-03-04
-// Last changed: 2006-09-05
+// Last changed: 2006-09-06
 
 #ifndef __UBLAS_VECTOR_H
 #define __UBLAS_VECTOR_H
@@ -16,6 +16,10 @@
 
 namespace dolfin
 {
+
+#ifdef HAVE_PETSC_H
+  class PETScVector;
+#endif
 
   namespace ublas = boost::numeric::ublas;
   typedef ublas::vector<double> ublas_vector;
@@ -111,7 +115,6 @@ namespace dolfin
 
     // Copy values between different vector representations
 #ifdef HAVE_PETSC_H
-    class PETScVector;
     void copy(const PETScVector& y);
 #endif
     void copy(const uBlasVector& y);

References