Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339376

Summary: Pb to find .mod file when switching from one build config to another when using a src folder
Product: [Tools] PTP Reporter: Michel DEVEL <michel.devel>
Component: Photran.Managed MakeAssignee: Photran Inbox <photran-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 6.0.3   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Michel DEVEL CLA 2011-03-09 10:46:08 EST
Build Identifier: 20110301-1815

If you have a module file in a source folder (called src in my case) in a standard gfortran Linux executable fortran project and switch Build configuration make will complain not finding the source file in a WRONG directory!

Reproducible: Always

Steps to Reproduce:
1. create a new fortran project of type Executable (GNU fortran on Linux) (I named it reproduce_bug)
2. create a source folder called src using the New... Source folder command
3. create a new source file called kinds.f in the src folder:
      Module kinds
      integer,parameter :: r_=selected_real_kind(15)
      end module kinds
4. create a new source file called main.f in the src folder:
      program main
          use kinds
          implicit none
          real(kind=r_) :: dummy
          dummy=2._r_
          print *, dummy
      end program main
5. Build and execute the default "Debug" Build configuration => OK
6. Switch the Build Configuration to Release and try to build it.
In my case I get 
**** Build of configuration Release for project reproduce_bug ****

make all 
Building file: ../src/kinds.f
Invoking: GNU Fortran Compiler
gfortran -funderscoring -O3 -Wall -c -fmessage-length=0 -o"src/kinds.o" "../src/kinds.f"
Finished building: ../src/kinds.f
 
make: *** Pas de règle pour fabriquer la cible « Debug/src/kinds.o », nécessaire pour « src/main.o ». Arrêt.

You see that it still wants to find kind in the old config directory

7. If you delete both Debug and Release subdirectory and try again to build the Release config, it works, but then if you switch again to Debug it tries to build Release/src/kinds.o instead of Debug/src/kinds.o
Comment 1 Michel DEVEL CLA 2011-03-10 03:50:40 EST

*** This bug has been marked as a duplicate of bug 326333 ***
Comment 2 Michel DEVEL CLA 2011-03-10 03:51:49 EST
(In reply to comment #1)
> 
> *** This bug has been marked as a duplicate of bug 326333 ***

Only difference with the one submitted by Daniel Harenberg is that here both files are in the same subdirectory.