Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 222484 - Problems with Modules
Summary: Problems with Modules
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Photran.Managed Make (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Timofey Yuvashev CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 200798 236414 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-12 17:28 EDT by Jeffrey Overbey CLA
Modified: 2011-01-31 07:52 EST (History)
2 users (show)

See Also:


Attachments
Path that solves problems with modules in makefiles and subdirectories (8.19 KB, patch)
2009-06-17 15:24 EDT, Timofey Yuvashev CLA
g.watson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Overbey CLA 2008-03-12 17:28:03 EDT
From mailing list (2/27/08):

I have several problems with fortran project that use module. i posted this problem before but the problem still exists.
suppose a fortran project including 4 files as follows:
file: fmain.f90
program mixed_test
    use VarDef
    implicit none
    integer:: i

    print *, "input the array size:"
    read *, ni

    call SetArray
    call calInit
    print "('a(',i2,')=',f6.2)",(i,a(i),i=1,ni)
end program mixed_test

file: vardef.f90
module vardef
    integer::ni
    real,allocatable,save::a(:)
end module vardef

file: calinit.f90
subroutine calInit
    use VarDef
    implicit none
    integer::i
    a = (/(i+0.5,i=1,ni)/)
end subroutine calInit

file: setarray.f90
subroutine SetArray
    use VarDef
    allocate(a(ni))
end subroutine SetArray

1. when you create a fortran project and insert the files in project folder, it compile, build and run it successfully. but you can not view the array defined by module while you are debugging the code. i added the "global variable" __vardef_MOD_a but i could not see the elements.

2. in vardef.f90 file, if you change the name of module from vardef to Vardef, the code will not be compiled while fortran is not case sensitive. in other word, the module name and the name file containing module should be exactly the same!!!

3. if you create a project and a source folder and then insert the files in source folder, the project fails to build. however, there is no problem if you do not use module in project.
Comment 1 Timofey Yuvashev CLA 2009-06-17 15:19:09 EDT
*** Bug 200798 has been marked as a duplicate of this bug. ***
Comment 2 Timofey Yuvashev CLA 2009-06-17 15:24:05 EDT
Created attachment 139470 [details]
Path that solves problems with modules in makefiles and subdirectories

Now Photran projects create correct makefiles for modules and files contained in
sub-directories. It does not adress the first point mentioned (not being able to see variabled defined in modules in debug view)
Comment 3 Jeffrey Overbey CLA 2009-06-17 17:31:12 EDT
Patch applied to CVS HEAD
Comment 4 Timofey Yuvashev CLA 2009-07-27 17:21:57 EDT
*** Bug 236414 has been marked as a duplicate of this bug. ***