Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] Managed Build with modules dependencies problem

Dear David,

If you have a complex program with several files with module, you can use your own makefile.


See the documentation : Starting a Project with a Hand-Written Makefile
http://wiki.eclipse.org/PTP/photran/documentation/photran7#Starting_a_Project_with_a_Hand-Written_Makefile

Best luck

David
Le 7 déc. 2011 à 23:51, David MZ a écrit :

> I have installed the new Phortran 7 as part of the PTP.
> 
> I want to develop my code using an OOP approach which requires me to have many modules
> I have found that the managed build system doesn't understand dependencies in my .f90 files.
> 
> I was working on this problem for a day now. I will explain my problem using a "fake" project
> 
> My project have 2 files
> 
> main.f90, module1.f90
> 
> main.f90 : 
> 
> program main
>   use module1
>   implicit none
>   .....
>   code...
>   .....
> end program main
> 
> module1.f90:
> 
> module module1
>   implicit none
>   contains
>    .....
>   code...
>   .....
> end module module1
> 
> When I compile this code using the managed make and build command in the IDE I get the following error:
> 
> Fatal Error: Can't open module file 'module1.mod' for reading at (1): No such file or directory
> make: *** [main.o] Error 1
> 
> It seems like that makefile goes in the alphabet order 
> 
> taken from the subdir file:
> 
> F90_SRCS += \
> ../main.f90 \
> ../module1.f90 
> 
> OBJS += \
> ./main.o \
> ./module1.o 
> 
> I did checked this and if the I compile the project in the order of modul1.f90 before main.f90 everything works great.
> 
> But I was under the impression that the IDE can automaticly take care of this problem, the USE keyword in Fortran needs to tell the IDE what order to link the files.
> 
> Can someone help me with this, I have read in other threads that the managed make should understand dependencies.
> 
> Thank you very much.
> 
> David
> 
> 
> _______________________________________________
> photran mailing list
> photran@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/photran



Back to the top