Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65843 closed defect (fixed)

OpenCoarrays: project mixes-and-matches .F90 and .f90 file extensions

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc: mascguy (Christopher Nielsen)
Port: OpenCoarrays

Description (last modified by mascguy (Christopher Nielsen))

Initially was an issue with patching:

can't find file to patch at input line 30
|--- src/tests/integration/pde_solvers/coarrayHeatSimplified/main.F90.orig	2022-05-09 10:53:57.000000000 +0700
|+++ src/tests/integration/pde_solvers/coarrayHeatSimplified/main.F90	2022-09-11 01:29:09.000000000 +0700

Case mismatch: the f in f90 should be lowercase.

Now we're seeing more mixed-case issues, this time during builds:

-- Configuring done
CMake Error at src/tests/integration/pde_solvers/coarrayHeatSimplified/CMakeLists.txt:6 (add_executable):
  Cannot find source file:

    main.F90

CMake Error at src/tests/integration/pde_solvers/coarrayHeatSimplified/CMakeLists.txt:6 (add_executable):
  No SOURCES given to target: co_heat

Change History (9)

comment:1 Changed 2 years ago by mascguy (Christopher Nielsen)

Oh, this is easy enough to fix. I'll take care of ASAP.

comment:2 Changed 2 years ago by Christopher Nielsen <mascguy@…>

Owner: set to Christopher Nielsen <mascguy@…>
Resolution: fixed
Status: newclosed

comment:3 Changed 2 years ago by Christopher Nielsen <mascguy@…>

In af366c77d9d0f50df8e91b4cbd0a9d8723241e16/macports-ports (master):

OpenCoarrays: patch: fix fileext case, take 2

  • Project apparently mixes-and-matches extensions .f90 and .F90

See: https://github.com/macports/macports-ports/pull/16075
Fixes: #65843

comment:4 Changed 2 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: closedreopened
Summary: OpenCoarrays: patch failsOpenCoarrays: project mixes-and-matches .F90 and f90 file extensions

comment:5 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: barracuda156 removed
Description: modified (diff)
Owner: changed from Christopher Nielsen <mascguy@…> to barracuda156
Status: reopenedassigned

Sergey, can you double-check the filename case within CMake files, etc, vis-a-vis the actual project source?

comment:6 Changed 2 years ago by mascguy (Christopher Nielsen)

Summary: OpenCoarrays: project mixes-and-matches .F90 and f90 file extensionsOpenCoarrays: project mixes-and-matches .F90 and .f90 file extensions

comment:7 in reply to:  5 Changed 2 years ago by barracuda156

Replying to mascguy:

Sergey, can you double-check the filename case within CMake files, etc, vis-a-vis the actual project source?

The file extension must be changed to capitalized version, otherwise preprocessing fails. Fortran differentiates between sources to be preprocessed or not that way. See the link in the patch.

What I did not consider is case-sensitive MacOS case.

I am not on my laptop now, but a fix will be changing the extension either pre-patch or post-patch.

UPD. So here is why it should be changed to .F90:

First and simplest, the source file in which you attempt to employ it apparently has the extension .f90. What this extension signifies to gfortran (and to the GCC compiler driver, by any other name) is: Free form Fortran source code that should not be preprocessed. Similarly .f95, .f03 and .f08. If you want gfortran to infer that a source file contains free form Fortran code that must be preprocessed, give it one of the extensions .F90, .F95, .F03 or .F08.

https://stackoverflow.com/questions/31649691/stringify-macro-with-gnu-gfortran

However file rename fails on non-case-sensitive MacOS:

Error: Failed to patch OpenCoarrays: error renaming "/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_OpenCoarrays/OpenCoarrays/work/OpenCoarrays-2.10.0/src/tests/integration/pde_solvers/coarrayHeatSimplified/main.f90" to "/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_OpenCoarrays/OpenCoarrays/work/OpenCoarrays-2.10.0/src/tests/integration/pde_solvers/coarrayHeatSimplified/main.F90": file already exists

https://github.com/macports/macports-ports/pull/16075#issuecomment-1249183960

How to solve this?

Last edited 2 years ago by barracuda156 (previous) (diff)

comment:8 Changed 2 years ago by barracuda156

Resolution: fixed
Status: assignedclosed

In 9cbe7e3d989b5bf8387f22b3f4b15534926ec043/macports-ports (master):

OpenCoarrays: fix for case-sensitive MacOS
Fixes: #65843

comment:9 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Don't forget to report the problem to the developers so they can fix it properly.

Note: See TracTickets for help on using tickets.