[petsc-users] error linking

Satish Balay balay at mcs.anl.gov
Mon Jul 29 17:18:51 CDT 2013


changes to Parms looks trivial. You can try the attached patch..

cd externalpackages/pARMS_3.2
patch -Np1 < parms.patch

and then:

rm -f /home/hbui/sw/petsc-3.4.2-build1/arch-linux2-cxx-opt/conf/pARMS

and rerun PETSc configure as before..

Satish

On Mon, 29 Jul 2013, Matthew Knepley wrote:

> On Mon, Jul 29, 2013 at 5:08 PM, Hoang Giang Bui <hgbk2008 at gmail.com> wrote:
> 
> >
> > The fact is that I compiled petsc with both metis and parms (I like to use
> > preconditioner from parms) and I think there are no conflict since no
> > compilation error is thrown. Now I want to link my program to petsc I have
> > to link to both. If not it causes more error.
> >
> 
> Unfortunately, compiling does not find link conflicts. PARMs and Metis has
> chosen the same name for a routine. We cannot fix that.
> 
>    Matt
> 
> 
> > Ciao
> > Bui
> >
> >
> >
> > On Tue, Jul 30, 2013 at 12:02 AM, Matthew Knepley <knepley at gmail.com>wrote:
> >
> >> On Mon, Jul 29, 2013 at 4:41 PM, Hoang Giang Bui <hgbk2008 at gmail.com>wrote:
> >>
> >>>
> >>> Hi
> >>>
> >>> When I link my program to petsc. I have this linking error:
> >>>
> >>> /opt/petsc/petsc-3.4.2-build1/lib/libmetis.a(error.c.o): In function
> >>> `errexit':
> >>> error.c:(.text+0x80): multiple definition of `errexit'
> >>> /opt/petsc/petsc-3.4.2-build1/lib/libparms.a(sets.o):sets.c:(.text+0x0):
> >>> first defined here
> >>>
> >>
> >> This looks like a conflict between PARMs and and Metis. Do you need both?
> >>
> >>   Thanks,
> >>
> >>      Matt
> >>
> >>
> >>> I have linked to the libraries as the sequence in
> >>> $PETSC_WITH_EXTERNAL_LIB. I also sent my configure.log (to
> >>> petsc-maint at mcs.anl.gov<http://www.mcs.anl.gov/petsc/documentation/bugreporting.html>)
> >>> for your information
> >>>
> >>> Ciao
> >>> Bui
> >>>
> >>>
> >>
> >>
> >> --
> >> What most experimenters take for granted before they begin their
> >> experiments is infinitely more interesting than any results to which their
> >> experiments lead.
> >> -- Norbert Wiener
> >>
> >
> >
> >
> > --
> > With Best Regards !
> > Giang Bui
> > To learn and to excel
> >
> 
> 
> 
> 
-------------- next part --------------
diff --git a/src/DDPQ/protos.h b/src/DDPQ/protos.h
index 8b675af..7cb4885 100644
--- a/src/DDPQ/protos.h
+++ b/src/DDPQ/protos.h
@@ -33,7 +33,7 @@
 #endif
 
 /* sets */
-extern void errexit(char *f_str, ...);
+extern void parms_errexit(char *f_str, ...);
 extern void *Malloc(int nbytes, char *msg); 
 extern int setupP4 (p4ptr amat, int Bn, int Cn,  csptr F,  csptr E);
 extern int cleanP4(p4ptr amat);
diff --git a/src/DDPQ/sets.c b/src/DDPQ/sets.c
index 49067e6..1cfb68b 100644
--- a/src/DDPQ/sets.c
+++ b/src/DDPQ/sets.c
@@ -8,7 +8,7 @@
 #endif 
 #include "protos.h"
 
-void errexit( char *f_str, ... )
+void parms_errexit( char *f_str, ... )
 {
   va_list argp;
   char out1[256], out2[256];
@@ -34,7 +34,7 @@ void *Malloc( int nbytes, char *msg )
 
   ptr = (void *)malloc(nbytes);
   if (ptr == NULL)
-    errexit( "Not enough mem for %s. Requested size: %d bytes", msg, nbytes );
+    parms_errexit( "Not enough mem for %s. Requested size: %d bytes", msg, nbytes );
 
   return ptr;
 }


More information about the petsc-users mailing list