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

I experienced the same problem and would appreciate it very much as well if Photran could handle the dependencies correctly. As a workaround, I removed the check mark next to “Stop on first build error” on the “Behaviour” tab in the “Fortran build properties”. After a few builds, all modules will be compiled so that they can be linked into the executable.

 

Regards,

 

Martien

 

 


From: photran-bounces@xxxxxxxxxxx [mailto:photran-bounces@xxxxxxxxxxx] On Behalf Of David MZ
Sent: woensdag 7 december 2011 23:52
To: photran@xxxxxxxxxxx
Subject: [photran] Managed Build with modules dependencies problem

 

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





The NLR disclaimer is valid for NLR e-mail messages.

This message is only meant for providing information. Nothing in this e-mail message amounts to a contractual or legal commitment on the part of the sender.

This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. Sender accepts no liability for damage of any kind resulting from the risks inherent in the electronic transmission of messages.



Back to the top