Bug 397116

Summary: Build project failed when module name in Fortran program is different from module's source file name (CS427 Fa12) [CQ Approved]
Product: [Tools] PTP Reporter: Ramesh Kolavenu <kolaven2>
Component: Photran.UnknownAssignee: Jeffrey Overbey <com-eclipse-dot-org>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P3 CC: com-eclipse-dot-org, kolaven2, lmorrow2, lozanoh2, michaeltosullivan, m_biglari
Version: 8.0Keywords: usability
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Shows build project failure.
none
Fixed module name dependency on module's source file name.
none
Documentation for the patch.
none
Cumulative patch for bugs 397716 & 397117
none
Cumulative patch for bugs 397116 & 397117
none
Cumulative patch for bugs 397116 & 397117 none

Description Ramesh Kolavenu CLA 2012-12-22 14:24:43 EST
Created attachment 225011 [details]
Shows build project failure.

Following are the repro steps:

1. Create new Fortran project (testBuild) in Photran plug-in.

2. Create main Fortran program as below

	File Name: testProgram.f90
	Source Code:
		program testProgram
    		USE Module0
    		IMPLICIT NONE

    		print *, "SO1 Managed Build - Module1"

   		CALL M1Subroutine2()
		end program
	
3. Create module as below

	File Name: module1.f90
	Source Code:
		MODULE Module0
		IMPLICIT NONE
		CONTAINS
  		SUBROUTINE M1Subroutine1()
  		IMPLICIT NONE
    		PRINT *, " M1 Subroutine 1 "
  		END SUBROUTINE M1Subroutine1

  		SUBROUTINE M1Subroutine2()
  		IMPLICIT NONE
    		PRINT *, " M1 Subroutine 2 "
  		END SUBROUTINE M1Subroutine2

		END MODULE Module0

4.
 Right Click project testBuild in step1 and Select "Build Project"

5. Build project fails with error message as shown below, also see the attachment.
	An internal error occurred during: "Build Project".
	Could not find a file to match the module name: Module0

Expected Result: Build project should succeed.
Comment 1 Ramesh Kolavenu CLA 2012-12-22 17:00:15 EST
Created attachment 225016 [details]
Fixed module name dependency on module's source file name.

Patch includes fixes for following:

1. Module in "Use" statement is different from Module's file name.
   Example: main program > calling a Module Module0, where Module0 source file name is not Module0.fxx

2. Modules reference order in "Use" statement is different than the order in which modules are defined in source file.
   Example: main program > calling modules with Use sequenced as 
   Use Module2
   Use Module1
   and Module1 & Module2 are defined in source file module1.fxx.
   Order defined is Module1 & Module2

3.Module names are unique, but created with identical file names in different subdirectories.
   Example:main program > calling modules with Use statements sequenced as 
   Use Module1
   Use Module2
   and Module1 is defined in folder1\module1.fxx,
       Module2 is defined in folder2\module1.fxx. (module1.fxx here is correct not a typo)

4. Fixed Photran workspace tests to create sub directory for test files when applicable. Case 3, was failing while running test suite.
Note: fxx is any Fortran supported version.
Comment 2 Ramesh Kolavenu CLA 2012-12-22 17:06:02 EST
Created attachment 225017 [details]
Documentation for the patch.

Please refer to section "Managed Build & Module Name".
Comment 3 Ramesh Kolavenu CLA 2012-12-22 18:42:08 EST
Created attachment 225021 [details]
Cumulative patch for bugs 397716 & 397117

Merged bug fixes for module name dependency on module's source file name and new project wizard.
Comment 4 Ramesh Kolavenu CLA 2012-12-22 18:54:57 EST
Created attachment 225024 [details]
Cumulative patch for bugs 397116 & 397117

Cumulative patch for bugs 397116 & 397117
Merged bug fixes for module name dependency on module's source file name and new project wizard.

Patch includes fixes for following:

1. Module in "Use" statement is different from Module's file name.
   Example: main program > calling a Module Module0, where Module0 source file name is not Module0.fxx

2. Modules reference order in "Use" statement is different than the order in which modules are defined in source file.
   Example: main program > calling modules with Use sequenced as 
   Use Module2
   Use Module1
   and Module1 & Module2 are defined in source file module1.fxx.
   Order defined is Module1 & Module2

3.Module names are unique, but created with identical file names in different subdirectories.
   Example:main program > calling modules with Use statements sequenced as 
   Use Module1
   Use Module2
   and Module1 is defined in folder1\module1.fxx,
       Module2 is defined in folder2\module1.fxx. (module1.fxx here is correct not a typo)

Note: fxx is any Fortran supported version.
Comment 5 Jeffrey Overbey CLA 2012-12-24 12:49:08 EST
Thanks for the contribution!  I have two favors to ask:

1. For legal purposes, I will need you to resubmit the patch with a couple of minor changes:

   - Please add an EPL copyright header at the top of each Java source file with copyright attribution to your group members.  There are instructions in the Photran Developer's Guide, Part I, Appendix F, which contain the full text of the copyright header.  Please make sure your names are listed individually, e.g., "Copyright 2012 John Doe, Jane Doe, Bob Smith, and others." etc.

   - Please add the individual names of your group members to the list of contributors in the copyright header and/or the @author tags.

2. After you resubmit the patch, please ask *every* member of your group to add a comment to this bug confirming that:

(a) you wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of others,
(b) you have the right to contribute the code to Eclipse, and
(c) you have included the EPL license header in all source files.
Comment 6 Ramesh Kolavenu CLA 2012-12-24 23:42:01 EST
Created attachment 225044 [details]
Cumulative patch for bugs 397116 & 397117

Cumulative patch for bugs 397116 & 397117
Merged bug fixes for module name dependency on module's source file name and new project wizard. Made changes based on Jeff's feedback and re-generated the patch.

Fixed module name dependency on module's source file name.

Patch includes fixes for following:

1. Module in "Use" statement is different from Module's file name.
   Example: main program > calling a Module Module0, where Module0 source file name is not Module0.fxx

2. Modules reference order in "Use" statement is different than the order in which modules are defined in source file.
   Example: main program > calling modules with Use sequenced as 
   Use Module2
   Use Module1
   and Module1 & Module2 are defined in source file module1.fxx.
   Order defined is Module1 & Module2

3.Module names are unique, but created with identical file names in different subdirectories.
   Example:main program > calling modules with Use statements sequenced as 
   Use Module1
   Use Module2
   and Module1 is defined in folder1\module1.fxx,
       Module2 is defined in folder2\module1.fxx. (module1.fxx here is correct not a typo)

4. Fixed Photran workspace tests to create sub directory for test files when applicable. Case 3, was failing while running test suite.
Note: fxx is any Fortran supported version.
Comment 7 Ramesh Kolavenu CLA 2012-12-24 23:42:40 EST
I confirm that
(a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of
others,
(b) I have the right to contribute the code to Eclipse, and
(c) I have included the EPL license header in all source files.
Comment 8 Mehrdad Biglari CLA 2012-12-25 00:04:57 EST
I confirm that
(a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of
others,
(b) I have the right to contribute the code to Eclipse, and
(c) I have included the EPL license header in all source files.
Comment 9 Lorentz Morrow CLA 2012-12-25 09:37:30 EST
I confirm that
(a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of
others,
(b) I have the right to contribute the code to Eclipse, and
(c) I have included the EPL license header in all source files.
Comment 10 Michael O\\\'Sullivan CLA 2012-12-26 17:35:54 EST
I confirm that
(a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of
others,
(b) I have the right to contribute the code to Eclipse, and
(c) I have included the EPL license header in all source files.
Comment 11 Jose Lozano CLA 2013-01-08 13:37:46 EST
I confirm that
(a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of
others,
(b) I have the right to contribute the code to Eclipse, and
(c) I have included the EPL license header in all source files.
Comment 12 Jose Lozano CLA 2013-01-08 13:38:00 EST
I confirm that
(a) I wrote 100% of the code without incorporating content from elsewhere or relying on the intellectual property of
others,
(b) I have the right to contribute the code to Eclipse, and
(c) I have included the EPL license header in all source files.
Comment 13 Jeffrey Overbey CLA 2013-01-09 12:25:51 EST
Thanks.  I'll send this to the IP team when possible.
Comment 14 Jeffrey Overbey CLA 2013-02-08 14:09:31 EST
CQ 7078 submitted - https://dev.eclipse.org/ipzilla/show_bug.cgi?id=7078
Comment 15 Jeffrey Overbey CLA 2013-02-11 13:30:37 EST
The CQ has been approved.  Check-in pending.