Skip to content

Conversation

@rem1776
Copy link
Contributor

@rem1776 rem1776 commented Oct 22, 2025

Description
Fixes errors that come up when building using the 32 or 64 bit build options. Now it will link in whatever's built so it won't fail when it gets to the unit test executables.

Also includes a few small changes to get the unit tests from cmake running in the CI. Skips two tests (#1786) until we can get them working since they have cmake/arm specific bugs.

Fixes #1783

How Has This Been Tested?
tested on amd box with gcc 13/14 + mpich

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

target_compile_definitions(${libTgt}_f PRIVATE "${fms_defs}")
target_compile_definitions(${libTgt}_f PRIVATE "${${kind}_defs}")
set_target_properties(${libTgt}_f PROPERTIES COMPILE_FLAGS ${${kind}_flags})
set_target_properties(${libTgt}_f PROPERTIES COMPILE_FLAGS "${${kind}_flags}")
Copy link
Contributor

@mlee03 mlee03 Oct 23, 2025

Choose a reason for hiding this comment

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

comments not for this line, but just looking at line 76 - 79, the messages seem misleading. Could they be changed to something like "building select modules and procedures in 32bit precision"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, line 278 - 278, I don't think the OVERLOAD macros are there anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, line 278 - 278, I don't think the OVERLOAD macros are there anymore

nice catch! should be removed now

set(USING_CMAKE "true")
# set the fms library to link tests with based on whats built
if(NOT kinds)
set(fmsLibraryName FMS::fms)
Copy link
Contributor

Choose a reason for hiding this comment

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

line 439, isn't kind always defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

line 439 uses kind as opposed to kinds which is only set if one of the 32/64bit options is enabled.

CMakeLists.txt Outdated
set(fmsLibraryName FMS::fms)
elseif(64BIT)
set(fmsLibraryName FMS::fms_r8)
else()
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this should explicitly be elseif(32BIT)

use time_interp_external2_mod, only: init_external_field, time_interp_external_init, time_interp_external

use time_manager_mod, only: JULIAN, time_type, set_date, set_calendar_type, time_manager_init
use platform_mod, only: r4_kind, r8_kind
Copy link
Contributor

Choose a reason for hiding this comment

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

ah this probably worked because DTEST_FMS_KIND_ is set to 4 or 8 in Makefile.am
Is this use statement needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

unless cmake substitutes them as r4_kind and r8_kind somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unless cmake substitutes them as r4_kind and r8_kind somewhere?

Yeah cmake uses r4/r8_kind so that its uniform across all the different unit tests.

runs-on: ubuntu-latest
strategy:
matrix:
omp-flags: [ -DOPENMP=on, -DOPENMP=off ]
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious, why was this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was mainly to make the amount of jobs smaller. It'll just compile with openmp everytime.

I was thinking as we move away from autotools we can add more options to this one, just didn't want to make the CI too bloated.

endforeach()

# skip parallel netcdf tests if its not enabled in given install
IF(NOT NetCDF_PARALLEL)
Copy link
Contributor

Choose a reason for hiding this comment

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

Leaving what @J-Lentz pointed out, line 290 should say "parallel netcdf io" instead of "collective netcdf io"

@rem1776
Copy link
Contributor Author

rem1776 commented Oct 23, 2025

@mlee03 any comments i didn't respond to should be fixed now with 985d6e7

Copy link
Contributor

@mlee03 mlee03 left a comment

Choose a reason for hiding this comment

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

All comments addressed :)


if(32BIT)
list(APPEND kinds "r4")
message(STATUS "Building library with 4-byte real defaults (with mixed precision real support for most modules).")
Copy link
Contributor

Choose a reason for hiding this comment

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

one more request, line 68 needs to be removed

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.

Are 32BIT and 64BIT CMake options still supported?

3 participants