Skip to content

Autoconf: Fortran testing of C bindings#234

Merged
adcroft merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
marshallward:ac_bind_c_tests
Nov 9, 2022
Merged

Autoconf: Fortran testing of C bindings#234
adcroft merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
marshallward:ac_bind_c_tests

Conversation

@marshallward
Copy link
Copy Markdown
Member

This patch fixes some issues with testing of C bindings in Fortran. Specifically, some tests are using a C compiler which may be unconfigured, causing unexpected errors.

The autoconf script now uses the Fortran compiler to test these bindings, rather than using the C compiler to test for their existence. A new macro (AX_FC_CHECK_BIND_C) was added to run these tests.

This achieves the actual goal (test of Fortran binding) on top of the original goal (availability of C function), while ensuring that the actual compiler of interest (FC) is used in the test.

Two C-based tests are still present in the script for testing the size of jmp_buf and sigjmp_buf. The C compiler is now configured with the AX_MPI macro, and is only used to determine the size of these structs.

This patch fixes some issues with testing of C bindings in Fortran.
Specifically, some tests are using a C compiler which may be
unconfigured, causing unexpected errors.

The autoconf script now uses the Fortran compiler to test these
bindings, rather than using the C compiler to test for their existence.
A new macro (AX_FC_CHECK_BIND_C) was added to run these tests.

This achieves the actual goal (test of Fortran binding) on top of the
original goal (availability of C function), while ensuring that the actual
compiler of interest (FC) is used in the test.

Two C-based tests are still present in the script for testing the size
of jmp_buf and sigjmp_buf.  The C compiler is now configured with the
AX_MPI macro, and is only used to determine the size of these structs.
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 9, 2022

Codecov Report

Merging #234 (a60523a) into dev/gfdl (d46de87) will increase coverage by 0.27%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           dev/gfdl     #234      +/-   ##
============================================
+ Coverage     37.23%   37.50%   +0.27%     
============================================
  Files           263      263              
  Lines         73060    72530     -530     
  Branches      13605    13503     -102     
============================================
  Hits          27201    27201              
+ Misses        40841    40311     -530     
  Partials       5018     5018              
Impacted Files Coverage Δ
src/tracer/MOM_offline_main.F90 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Copy Markdown
Member

@adcroft adcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to have fixed the issue we encountered on Gaea (that we'd have caught if I had not skipped a step).

Testing at https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/17405

@adcroft adcroft merged commit 522e7aa into NOAA-GFDL:dev/gfdl Nov 9, 2022
@marshallward marshallward deleted the ac_bind_c_tests branch February 20, 2023 16:22
marshallward pushed a commit that referenced this pull request Apr 4, 2023
Fix NUOPC gnu restart issue by removing leading spaces in restartfiles list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants