Hi Satish, It finally worked!
Thank you very much and have a nice day! Yours sincerely, Wee-Beng Tay On 13/5/2010 1:56 AM, Satish Balay wrote: > try the attached makefile. If you have problems copy/paste the > *complete* make session from your terminal. > > Satish > > On Thu, 13 May 2010, Wee-Beng TAY wrote: > > >> Hi Satish, >> >> I tried to run it, with the -c present and absent. However, nothing happened. >> I run using "make". I also specified "export >> PETSC_DIR=/home/svu/g0306332/codes/petsc-3.1-p0/" and "export >> PETSC_ARCH=atlas5-mpi-nodebug" before that. >> >> Did I miss out something? >> >> Also supposed that I have the same flag for all sources. In that case, how >> can >> I build them? >> >> Thank you very much and have a nice day! >> >> Yours sincerely, >> >> Wee-Beng Tay >> >> >> On 13/5/2010 1:27 AM, Satish Balay wrote: >> >>> Attaching the modified makefile. It might need a couple of iterations >>> of fixing. >>> >>> Hopefully its clear why it would work. Note - if not for different >>> flags required for different sources (opt/opt2/opt3) - you can build >>> all petsc/non-petsc sources with petsc makefile targets. >>> >>> >>> >>>> In my fortran files, do I simply use petsc.h or I have to use specific *.h >>>> depending on what petsc commands are used? >>>> >>>> >>> With petsc-3.1 you just have to use petsc.h for all F77 interface stuff, and >>> petsc.h90 for all f90 interface stuff [like VecGetArrayF90()] >>> >>> Satish >>> >>> On Thu, 13 May 2010, Wee-Beng TAY wrote: >>> >>> >>> >>>> Hi Satish, >>>> >>>> Sorry for the confusion. >>>> >>>> I have attached my makefile. This was used to compile and link my code >>>> before >>>> I used PETSc 3.1. >>>> >>>> I have several fortran files. Some contain PETSc commands and need to use >>>> PETSc include files. Other do not. In the end, they all have to be linked >>>> to >>>> form my final code. I used to copy part of the compiling and linking >>>> command >>>> from "make ex1f" to compile my code: >>>> >>>> /app1/mvapich2/current/bin/mpif90 -c -O3 >>>> -I/home/svu/g0306332/codes/petsc-3.1-p0/atlas5-mpi-nodebug/include >>>> -I/home/svu/g0306332/codes/petsc-3.1-p0/include >>>> -I/home/svu/g0306332/lib/hypre-2.6.0b_atlas5/include >>>> -I/app1/mvapich2/1.4/include -I/app1/mvapich2/current/include >>>> -I/home/svu/g0306332/codes/petsc-3.1-p0/atlas5-mpi-nodebug/include >>>> -I/home/svu/g0306332/lib/hypre-2.6.0b_atlas5/include >>>> -I/app1/mvapich2/1.4/include -I/app1/mvapich2/current/include -o ex1f.o >>>> ex1f.F >>>> >>>> /app1/mvapich2/current/bin/mpif90 -O3 -o ex1f ex1f.o >>>> -Wl,-rpath,/home/svu/g0306332/codes/petsc-3.1-p0/atlas5-mpi-nodebug/lib >>>> -L/home/svu/g0306332/codes/petsc-3.1-p0/atlas5-mpi-nodebug/lib -lpetsc >>>> -Wl,-rpath,/home/svu/g0306332/lib/hypre-2.6.0b_atlas5/lib >>>> -L/home/svu/g0306332/lib/hypre-2.6.0b_atlas5/lib -lHYPRE -lmpichcxx >>>> -lstdc++ >>>> -Wl,-rpath,/app1/intel/mkl/10.0.5.025/lib/em64t >>>> -L/app1/intel/mkl/10.0.5.025/lib/em64t -lmkl_lapack -lmkl -lguide >>>> -lpthread >>>> -L/app1/mvapich2/1.4/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -ldl >>>> -lmpich >>>> -lpthread -lrdmacm -libverbs -libumad -lrt -lgcc_s -lmpichf90 >>>> -L/app1/intel/Compiler/11.0/074/lib/intel64 -lifport -lifcore -limf -lsvml >>>> -lm >>>> -lipgo -lirc -lirc_s -lm -lmpichcxx -lstdc++ -lmpichcxx -lstdc++ -ldl >>>> -lmpich >>>> -lpthread -lrdmacm -libverbs -libumad -lrt -lgcc_s -ldl >>>> >>>> However, it doesn't seem to work now. I tried to look at chapter 14 but I >>>> don't really understand since I know very little about makefiles. >>>> >>>> Can you give a rough guide for my case? I will try to read up on the >>>> manual to >>>> get more info. >>>> >>>> Moreover, I am confused by the use of: >>>> >>>> #include "finclude/petsc.h" etc. >>>> >>>> In my fortran files, do I simply use petsc.h or I have to use specific *.h >>>> depending on what petsc commands are used? >>>> >>>> Thank you very much and have a nice day! >>>> >>>> Yours sincerely, >>>> >>>> Wee-Beng Tay >>>> >>>> >>>> On 12/5/2010 9:55 AM, Satish Balay wrote: >>>> >>>> >>>>> Lets step back and deal with this primary issue. >>>>> >>>>> Have you attempted to use makefiles in petsc format? What problems >>>>> have you encountered? Perhaps they are fixable. >>>>> >>>>> The reason to use this format is to make your makefile as portable as >>>>> possible [and avoid such issues]. >>>>> >>>>> Satish >>>>> >>>>> On Tue, 11 May 2010, Satish Balay wrote: >>>>> >>>>> >>>>> >>>>> >>>>>> Why not use petsc makefiles - and avoid these hasseles? >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>>