[petsc-users] SNES Shell Problems

Gaetan Kenway kenway at utias.utoronto.ca
Mon Aug 27 11:34:22 CDT 2012


Hi

I am trying to use a PETSc snes shell object (with hopes of using it as the
'preconditioner' in athother snes ngmres object). I've upgraded to petsc3.3
but when I compile my code it complains that
/home/mica/kenway/hg/SUmb/src/NKsolver/setupNKSolver2.F90:47: undefined
reference to `snesshellsetsolve_'

The code is fortran. I tried compiling ex35.c in the snes/examples
directory and that went fine. I then looked at all the linking flags and
split them out, one per line and compared it to the flags I'm using to
compile my code. The two files are attached. (one.txt is my code and two is
from 'make ex35'). A quick diff shows they are precisely identical.

After a little more poking around, I found the snesshellf.c file
in /src/snes/impls/shell/ftn-auto. From looking at that file, it appears
the only function that actually got wrapped was:

/* Definitions of Fortran Wrapper routines */
#if defined(__cplusplus)
extern "C" {
#endif
void PETSC_STDCALL  snesshellsetcontext_(SNES snes,void*ctx, int *__ierr ){
*__ierr = SNESShellSetContext(
(SNES)PetscToPointer((snes) ),ctx);
}
#if defined(__cplusplus)
}
#endif

This function, does in fact work. But all the other shell functions to not.

Is is the snesshell functionality not implemented in fortran? What
determines when bfort includes a file in the wrapper?

Thanks,

Gaetan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120827/73191700/attachment.html>
-------------- next part --------------
-Wl,-rpath,/nfs/mica/home/kenway/Downloads/petsc-3.3-p2/intel-real-debug/lib
-L/nfs/mica/home/kenway/Downloads/petsc-3.3-p2/intel-real-debug/lib 
-lpetsc 
-lX11
-lpthread
-Wl,-rpath,/nfs/mica/home/kenway/Downloads/petsc-3.3-p2/intel-real-debug/lib
-lsuperlu_dist_3.0
-lparmetis 
-lmetis
-llapack
-lblas
-Wl,-rpath,/usr/local/lib 
-L/usr/local/lib 
-Wl,-rpath,/opt/intel/Compiler/11.1/072/ipp/ia32/lib 
-L/opt/intel/Compiler/11.1/072/ipp/ia32/lib
-Wl,-rpath,/opt/intel/Compiler/11.1/072/tbb/ia32/cc4.1.0_libc2.4_kernel2.6.16.21/lib
-L/opt/intel/Compiler/11.1/072/tbb/ia32/cc4.1.0_libc2.4_kernel2.6.16.21/lib 
-Wl,-rpath,/usr/lib/gcc/i686-linux-gnu/4.4.5 
-L/usr/lib/gcc/i686-linux-gnu/4.4.5
-Wl,-rpath,/opt/intel/Compiler/11.1/072/lib/ia32
-L/opt/intel/Compiler/11.1/072/lib/ia32
-Wl,-rpath,/opt/intel/Compiler/11.1/072/mkl/lib/32 
-L/opt/intel/Compiler/11.1/072/mkl/lib/32
-Wl,-rpath,/usr/lib/i686-linux-gnu
-L/usr/lib/i686-linux-gnu
-lmpi_f90
-lmpi_f77 
-lm 
-limf 
-lm 
-lifport
-lifcoremt 
-lsvml 
-lm 
-lipgo 
-lirc 
-lirc_s
-lm 
-lm 
-ldl 
-lmpi 
-lopen-rte 
-lopen-pal
-lnsl
-lutil 
-lgcc_s
-lpthread 
-ldl
-------------- next part --------------
-fPIC 
-Wall
-Wwrite-strings
-Wno-strict-aliasing
-Wno-unknown-pragmas
-g3 
-fno-inline 
-O0  
-o ex35
 ex35.o
-Wl,-rpath,/nfs/mica/home/kenway/Downloads/petsc-3.3-p2/intel-real-debug/lib
-L/nfs/mica/home/kenway/Downloads/petsc-3.3-p2/intel-real-debug/lib 
-lpetsc
-lX11
-lpthread
-Wl,-rpath,/nfs/mica/home/kenway/Downloads/petsc-3.3-p2/intel-real-debug/lib
-lsuperlu_dist_3.0
-lparmetis 
-lmetis
-llapack 
-lblas 
-Wl,-rpath,/usr/local/lib 
-L/usr/local/lib
-Wl,-rpath,/opt/intel/Compiler/11.1/072/ipp/ia32/lib
-L/opt/intel/Compiler/11.1/072/ipp/ia32/lib 
-Wl,-rpath,/opt/intel/Compiler/11.1/072/tbb/ia32/cc4.1.0_libc2.4_kernel2.6.16.21/lib
-L/opt/intel/Compiler/11.1/072/tbb/ia32/cc4.1.0_libc2.4_kernel2.6.16.21/lib 
-Wl,-rpath,/usr/lib/gcc/i686-linux-gnu/4.4.5
-L/usr/lib/gcc/i686-linux-gnu/4.4.5
-Wl,-rpath,/opt/intel/Compiler/11.1/072/lib/ia32 
-L/opt/intel/Compiler/11.1/072/lib/ia32
-Wl,-rpath,/opt/intel/Compiler/11.1/072/mkl/lib/32 
-L/opt/intel/Compiler/11.1/072/mkl/lib/32
-Wl,-rpath,/usr/lib/i686-linux-gnu 
-L/usr/lib/i686-linux-gnu 
-lmpi_f90
-lmpi_f77
-lm 
-limf 
-lm 
-lifport
-lifcoremt
-lsvml 
-lm 
-lipgo 
-lirc 
-lirc_s 
-lm 
-lm 
-ldl 
-lmpi 
-lopen-rte
-lopen-pal
-lnsl 
-lutil
-lgcc_s 
-lpthread
-ldl 


More information about the petsc-users mailing list