Thanks for response<br>I removed the lines and I got the following output after executing the make file:<br><br>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>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 -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> <br><br><b><i>Barry Smith <bsmith@mcs.anl.gov></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>> mvec.o: mvec.F <br>> 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>> Hello everyone<br>> <br>> 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>> <br>> The makefile
looks like:<br>> <br>> OBJS= mvec.o<br>> CFLAGS = <br>> FFLAGS = <br>> CPPFLAGS =<br>> FPPFLAGS =<br>> <br>> <br>> include ${PETSC_DIR}/bmake/common/base<br>> <br>> all: $(OBJS)<br>> <br>> mvec.o: mvec.F<br>> mpif90 -c mvec.F<br>> <br>> exe: pro.o $(OBJS) <br>> -${FLINKER} -o exe pro.o $(OBJS) ${PETSC_LIB}<br>> ${RM} -f pro.o<br>> <br>> include ${PETSC_DIR}/bmake/common/test<br>> <br>> Can any one help me with this issue please ...!<br>> <br>> Thanks<br>> <br>> Waad<br>> <br>> <br>> ---------------------------------<br>> Park yourself in front of a world of choices in alternative vehicles.<br>> Visit the Yahoo! Auto Green Center.<br><br></blockquote><br><p> 
<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.