[petsc-users] Error with file linking

Wee-Beng TAY zonexo at gmail.com
Wed May 12 11:41:32 CDT 2010


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?
>>
>>      
>    
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: makefile_atlas5
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100513/237c4448/attachment.diff>


More information about the petsc-users mailing list