2

To my understanding from the Photran documentation, if a Fortran source code has an extension with capital letters, such as F90 or F95, this file will be automatically preprocessed when building. But it didn't work for me... If I try to build a project with only one file main.F90:

program main
#ifdef __linux__
    print *,"Hello, world!"
#endif
end program

Then Photran would say "Nothing to build for project xxx". I have tried with Photran 8 (Eclipse Juno) and GNU compilers on both Windows and Linux, I have also tried Intel Fortran compiler on Linux so they all failed. So I guess this is related to Eclipse. Also I can confirm that the "Source Form" was set correctly, that is, *.F90 was set to "Free Form - C Preprocessed". Any help would be much appreciated.

1 Answers1

0

For me it seems that Photran doesn't understand the difference between f90 and F90. You can't even rename main.f90 to main.F90 without having Photran to complain that main.F90 already exists.

If you now have a look into the Workspace Preferences
under General -> Content Types | Text -> Fortran Source File
you can see that there are only lowercase File extensions listed and you can't even add an uppercase one if its lowercase counterpart is already there. However, when it comes to building after all, Photran do distinct between lower and uppercase and so ignores F90-files.

My first guess was to configure f90-Files to be "Free Form - C Preprocessed" in the Project settings
under Fortran General -> Source Files,
but that seems to have no effect.

In the end, I added the -cpp option to the gfortran command in the Project Settings
under Fortran Build -> Settings | GNU Fortran Compiler -> Miscellaneus.
That tells gfortran to run the preprocessor every time. Now your example works like a charm - as main.f90.

It seems to be a combination of several bugs that come together.

PS: I'm running Eclipse for Parallel Application Developers, Juno Service Release 2 @ Ubuntu 12.04 LTS with GNU Fortran Compiler 4.6.3

nasezoll
  • 101
  • 1
  • 5