The problem solved<br><br>THANK YOU SO MUCH :)<br><br>Waad<br><br><b><i>Satish Balay &lt;balay@mcs.anl.gov&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> sorry - forgot the attachment<br><br>satish<br><br>On Sun, 19 Aug 2007, Satish Balay wrote:<br><br>&gt; What do you have for:<br>&gt; <br>&gt; nm -ao mvec.o <br>&gt; <br>&gt; Also - sugest using the attached makefile.<br>&gt; <br>&gt; Satish<br>&gt; <br>&gt; <br>&gt; On Sun, 19 Aug 2007, Waad Subber wrote:<br>&gt; <br>&gt; &gt; Thanks for response<br>&gt; &gt; I removed the lines and I got the following output after executing the make file:<br>&gt; &gt; <br>&gt; &gt; gfortran -c  -fPIC -Wall -Wno-unused-variable -g   -I/home/waad/soft/petsc-2.3.3-p4 -I/home/waad/soft/petsc-2.3.3-p4/bmake/linux-gnu-c-debug -I/home/waad/soft/petsc-2.3.3-p4/include  -I/home/waad/mpich2-install/include        -o pro.o pro.F<br>&gt; &gt; gfortran -fPIC -Wall
 -Wno-unused-variable -g   -o exe pro.o    -Wl,-rpath,/home/waad/soft/petsc-2.3.3-p4/lib/linux-gnu-c-debug -L/home/waad/soft/petsc-2.3.3-p4/lib/linux-gnu-c-debug -lpetscts -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc        -L/usr/lib64 -lX11 -Wl,-rpath,/home/waad/mpich2-install/lib -L/home/waad/mpich2-install/lib -lmpich -lpthread -llapack -lblas -lm -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -Wl,-rpath,/lib/../lib64 -L/lib/../lib64 -Wl,-rpath,/usr/lib/../lib64 -L/usr/lib/../lib64 -ldl -lgcc_s -lgfortranbegin -lgfortran -lm -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -Wl,-rpath,/lib/../lib64 -Wl,-rpath,/usr/lib/../lib64 -lm  -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.1.2<br>&gt; &gt; 
 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -Wl,-rpath,/lib/../lib64 -L/lib/../lib64 -Wl,-rpath,/usr/lib/../lib64 -L/usr/lib/../lib64 -ldl -lgcc_s -ldl <br>&gt; &gt; pro.o: In function `MAIN__':<br>&gt; &gt; /home/waad/petsc_test/example1/solvetest/pro.F:38: undefined reference to `mvec_'<br>&gt; &gt; collect2: ld returned 1 exit status<br>&gt; &gt; make: [exe] Error 1 (ignored)<br>&gt; &gt; /bin/rm -f -f pro.o<br>&gt; &gt; <br>&gt; &gt;  <br>&gt; &gt; <br>&gt; &gt; Barry Smith <bsmith@mcs.anl.gov> wrote: <br>&gt; &gt; <br>&gt; &gt;  Not sure what the problem is, but <br>&gt; &gt; you should remove the lines<br>&gt; &gt; &gt; mvec.o: mvec.F                                                                                                        <br>&gt; &gt; &gt;     mpif90 -c mvec.F  <br>&gt; &gt; you do not need them.<br>&gt; &gt; <br>&gt; &gt;  
 Please send ALL the output when you run make exe after the change.<br>&gt; &gt; <br>&gt; &gt;    Barry<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; On Sun, 19 Aug 2007, Waad Subber wrote:<br>&gt; &gt; <br>&gt; &gt; &gt; Hello everyone<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; I am calling a subroutine from my main program, and when I compile the code I get an error message  (undefined reference to 'mvec_') referring to the call statement in the main program. I have defined the subroutine as external in the main program using (external mvec), but the problem still unsolved ..! <br>&gt; &gt; &gt; <br>&gt; &gt; &gt; The makefile looks like:<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; OBJS= mvec.o<br>&gt; &gt; &gt; CFLAGS        = <br>&gt; &gt; &gt; FFLAGS        = <br>&gt; &gt; &gt; CPPFLAGS        =<br>&gt; &gt; &gt; FPPFLAGS        =<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; <br>&gt; &gt; &gt; include ${PETSC_DIR}/bmake/common/base<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; all:
 $(OBJS)<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; mvec.o: mvec.F<br>&gt; &gt; &gt;     mpif90 -c mvec.F<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; exe: pro.o $(OBJS) <br>&gt; &gt; &gt;     -${FLINKER} -o exe pro.o $(OBJS)  ${PETSC_LIB}<br>&gt; &gt; &gt;      ${RM} -f pro.o<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; include ${PETSC_DIR}/bmake/common/test<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; Can any one help me with this issue please ...!<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; Thanks<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; Waad<br>&gt; &gt; &gt; <br>&gt; &gt; &gt;        <br>&gt; &gt; &gt; ---------------------------------<br>&gt; &gt; &gt; Park yourself in front of a world of choices in alternative vehicles.<br>&gt; &gt; &gt; Visit the Yahoo! Auto Green Center.<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt;        <br>&gt; &gt; ---------------------------------<br>&gt; &gt; Be a better Heartthrob. Get better relationship answers from someone who knows.<br>&gt; &gt; Yahoo! Answers - Check
 it out. <br>&gt; <br>&gt; <br>CFLAGS     = <br>FFLAGS     = <br>CPPFLAGS    =<br>FPPFLAGS    =<br>CLEANFILES  = exe<br><br>include ${PETSC_DIR}/bmake/common/base<br><br>OBJS = pro.o mvec.o<br><br>all: exe<br><br>exe: ${OBJS}<br> -${FLINKER} -o exe ${OBJS}  ${PETSC_LIB}<br><br>include ${PETSC_DIR}/bmake/common/test<br><br></bsmith@mcs.anl.gov></blockquote><br><p>&#32;
      <hr size=1>Yahoo! oneSearch: Finally, <a href="http://us.rd.yahoo.com/evt=48252/*http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC"> mobile search 
that gives answers</a>, not web links.