Thanks for response<br>I removed the lines and I got the following output after executing the make file:<br><br>gfortran -c&nbsp; -fPIC -Wall -Wno-unused-variable -g&nbsp;&nbsp; -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&nbsp; -I/home/waad/mpich2-install/include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -o pro.o pro.F<br>gfortran -fPIC -Wall -Wno-unused-variable -g&nbsp;&nbsp; -o exe pro.o&nbsp;&nbsp;&nbsp; -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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -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&nbsp; -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 -ldl <br>pro.o: In function `MAIN__':<br>/home/waad/petsc_test/example1/solvetest/pro.F:38: undefined reference to `mvec_'<br>collect2: ld returned 1 exit status<br>make: [exe] Error 1 (ignored)<br>/bin/rm -f -f
 pro.o<br><br>&nbsp;<br><br><b><i>Barry Smith &lt;bsmith@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;"> <br><br> Not sure what the problem is, but <br>you should remove the lines<br>&gt; mvec.o: mvec.F                                                                                                        <br>&gt;     mpif90 -c mvec.F  <br>you do not need them.<br><br>  Please send ALL the output when you run make exe after the change.<br><br>   Barry<br><br><br><br>On Sun, 19 Aug 2007, Waad Subber wrote:<br><br>&gt; Hello everyone<br>&gt; <br>&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; <br>&gt; The makefile
 looks like:<br>&gt; <br>&gt; OBJS= mvec.o<br>&gt; CFLAGS        = <br>&gt; FFLAGS        = <br>&gt; CPPFLAGS        =<br>&gt; FPPFLAGS        =<br>&gt; <br>&gt; <br>&gt; include ${PETSC_DIR}/bmake/common/base<br>&gt; <br>&gt; all: $(OBJS)<br>&gt; <br>&gt; mvec.o: mvec.F<br>&gt;     mpif90 -c mvec.F<br>&gt; <br>&gt; exe: pro.o $(OBJS) <br>&gt;     -${FLINKER} -o exe pro.o $(OBJS)  ${PETSC_LIB}<br>&gt;      ${RM} -f pro.o<br>&gt; <br>&gt; include ${PETSC_DIR}/bmake/common/test<br>&gt; <br>&gt; Can any one help me with this issue please ...!<br>&gt; <br>&gt; Thanks<br>&gt; <br>&gt; Waad<br>&gt; <br>&gt;        <br>&gt; ---------------------------------<br>&gt; Park yourself in front of a world of choices in alternative vehicles.<br>&gt; Visit the Yahoo! Auto Green Center.<br><br></blockquote><br><p>&#32;
      <hr size=1>Be a better Heartthrob. <a href="http://us.rd.yahoo.com/evt=48255/*http://answers.yahoo.com/dir/_ylc=X3oDMTI5MGx2aThyBF9TAzIxMTU1MDAzNTIEX3MDMzk2NTQ1MTAzBHNlYwNCQUJwaWxsYXJfTklfMzYwBHNsawNQcm9kdWN0X3F1ZXN0aW9uX3BhZ2U-?link=list&sid=396545433">Get better relationship answers </a>from someone who knows.<br>Yahoo! Answers - Check it out.