On Mon, 23 Jul 2012, Adam Stanier wrote:

> Hello,
> 
> I am getting the following error message when linking a code:
> 
> ../solver_3.2/libsel.a(p2_snes.o): In function `__p2_snes_mod__p2_snes_error':
> /home/stanier/hifi/solver_3.2/p2_snes.F:450: undefined reference to 
> `__local_mod__petsc_null_function'
> collect2: ld returned 1 exit status
> 
> I have noticed that src/snes/examples/tests/ex14f.F also gives an error 
> message related to PETSC_NULL_FUNCTION, and make ex14f fails to make
> 
> ex14f.o: In function `MAIN__':
> /home/stanier/soft/petsc-3.2-p7/src/snes/examples/tests/ex14f.F:182: 
> undefined reference to `__petscmod__petsc_null_function'
> collect2: ld returned 1 exit status
> 
> Also, have checked this with another PETSc user with version 3.2-p7 and 
> version 3.3- the same error occurs.

With petsc-3.3 - there is one compile error which the following patch
fixes. But i don't see the error you mention.

diff --git a/src/snes/examples/tests/ex14f.F b/src/snes/examples/tests/ex14f.F
--- a/src/snes/examples/tests/ex14f.F
+++ b/src/snes/examples/tests/ex14f.F
@@ -137,7 +137,7 @@
       call VecDuplicate(x,U,ierr)
       call PetscObjectSetName(U,'Exact Solution',ierr)
 
-      call MatCreateAIJ(PETSC_COMM_WORLD,PETSC_DECIDE,PETSC_DECIDE,N, &
+      call MatCreateAIJ(PETSC_COMM_WORLD,PETSC_DECIDE,PETSC_DECIDE,N,          
 &
      &     N,i3,PETSC_NULL_INTEGER,i0,PETSC_NULL_INTEGER,J,ierr)
 
       call MatGetType(J,matrixname,ierr)

>>>>>>>>>>>>>>>>>
balay at petsc:/sandbox/balay/petsc33 $ ./configure --with-cc=gcc 
--with-fc=gfortran --download-f-blas-lapack --download-mpich --download-blacs 
--download-scalapack --download-parmetis --download-mumps --download-superlu 
--download-hypre PETSC_ARCH=arch-test --download-metis
balay at petsc:/sandbox/balay/petsc33 $    make 
PETSC_DIR=/sandbox/balay/petsc33 PETSC_ARCH=arch-test all
Running test examples to verify correct installation
Using PETSC_DIR=/sandbox/balay/petsc33 and PETSC_ARCH=arch-test
C/C++ example src/snes/examples/tutorials/ex19 run successfully with 1 MPI 
process
C/C++ example src/snes/examples/tutorials/ex19 run successfully with 2 MPI 
processes
Fortran example src/snes/examples/tutorials/ex5f run successfully with 1 MPI 
process
Completed test examples
balay at petsc:/sandbox/balay/petsc33 $ cd src/snes/examples/tests/
balay at petsc:/sandbox/balay/petsc33/src/snes/examples/tests $ make ex14f
/sandbox/balay/petsc33/arch-test/bin/mpif90 -c  -Wall -Wno-unused-variable -g  
-I/sandbox/balay/petsc33/include -I/sandbox/balay/petsc33/arch-test/include    
-o ex14f.o ex14f.F
/sandbox/balay/petsc33/arch-test/bin/mpif90 -Wall -Wno-unused-variable -g  -o 
ex14f ex14f.o -L/sandbox/balay/petsc33/arch-test/lib  -lpetsc -lX11 -lpthread 
-Wl,-rpath,/sandbox/balay/petsc33/arch-test/lib -lcmumps -ldmumps -lsmumps 
-lzmumps -lmumps_common -lpord -lscalapack -lblacs -lparmetis -lmetis -lHYPRE 
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/x86_64-linux-gnu -lmpichcxx 
-lstdc++ -lsuperlu_4.3 -lflapack -lfblas -lmpichf90 -lgfortran -lm -lm 
-lmpichcxx -lstdc++ -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl -lrt -lpthread 
-lgcc_s -ldl 
/bin/rm -f ex14f.o
balay at petsc:/sandbox/balay/petsc33/src/snes/examples/tests $ ./ex14f
    Jacobian is built ...
    Jacobian is built ...
    Jacobian is built ...
    Jacobian is built ...
Number of SNES iterations =     7
balay at petsc:/sandbox/balay/petsc33/src/snes/examples/tests $ 
<<<<<<<<<<<<<<<<<<<<<<<<<

Satish

> 
> My configure options are ./configure --with-cc=gcc --with-fc=gfortran 
> --download-f-blas-lapack --download-mpich --download-blacs 
> --download-scalapack --download-parmetis --download-mumps --download-superlu 
> --download-hypre
> 
> I was wondering if anyone else has had this problem, and knew how to get 
> around it.
> 
> Thanks,
> Adam
> 
> 

Reply via email to