Skip to content

Pre-built configure script#1131

Open
marshallward wants to merge 3 commits into
NOAA-GFDL:dev/gfdlfrom
marshallward:ac-make-config-v3
Open

Pre-built configure script#1131
marshallward wants to merge 3 commits into
NOAA-GFDL:dev/gfdlfrom
marshallward:ac-make-config-v3

Conversation

@marshallward

@marshallward marshallward commented Jun 12, 2026

Copy link
Copy Markdown
Member

This PR makes several changes to normalize the autoconf build:

  • A prebuilt ./configure script has been added to the top-level.

    This script is now more general-purpose, and can be shared across all MOM6 builds, including .testing/ and parent repositories like MOM6-examples/. No more need to copy configure.ac and m4/ into build directories and calling autoconf.

    ./configure contains checks to prevent build in both the top directory and .testing/. This is primarily to prevent clobbering of the existing Makefiles.

  • Much of the ac/ "strangeness" of the older layout has been fixed: We still keep all supporting autoconf content in ac/ but no longer need to do elaborate directory-hopping to normalize our working directory.

  • Makefile.in was still using $SRC_DIRS to test Makefile.dep rebuilds, even though this has been replaced with MAKEDEP_FLAGS. To fix this, source directories have been separated from MAKEDEP_FLAGS and moved to MAKEDEP_DIRS. (SRC_DIRS was also replaced.)

  • A top-level Makefile has been added to execute ./configure and execute ac/deps/Makefile if necessary.

  • The mom6_fc_check_lib.m4 macro now uses m4_normalize to correctly display more exotic paths. The legacy ax_fc_check_lib.m4 has also been removed.

  • .gitignore cleanups: More targeted output, removal of vague generic targets.

  • A missing siglongjmp was incorrectly set to SETJMP. This is now fixed.

@marshallward

marshallward commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

I was unable to achieve my true goal of completely eliminating autoconf/automake as a dependency. Although configure is pre-built and fully featured, we still use autoconf in a few other places.

  • tc4/configure inputs
  • ac/deps/{fms/cvmix/gsw}

These could be solved in a few ways:

  • add four more configure scripts (at >100kB each)
  • use pre-built tc4/ inputs
  • drop the independent CVMix and GSW builds

but I wasn't happy with any of those solutions and it was preventing submission of this work, which is completed and in the right direction.

@marshallward

marshallward commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

I'm having second thoughts about some of the decisions here. It seems more common for a repository codebase to provide a "bootstrap" or "autogen" script to generate ./configure. So I will probably make an amendment to this which removes the prebuilt ./configure, but keep the structural changes.

* A top-level convenience `Makefile` has been added.

* `configure.ac` was updated to find `Makefile.in` related to the root
  directory, rather than some rando path.
The .testing/ Makefile was reworked to use the top-level configure.
This prevents  much of the redundant copying of configure.ac and m4/
macros.
* The siglongjmp() function name was incorrectly assigned to SETJMP when
  missing.  This patch corrects sets it to SIGLONGJMP.

* Restore MAKEDEP_DIRS (formerly SRC_DIRS) so that it can be used to
  detect file changes, as detected by rwildcard.

* Fix path of ac-clean targets

* Remove legacy bin/ and mkmf/ dirs from ac/deps/

* Remove top-level .gitignore (`build/` is not a defined output)

* Remove legacy ac/m4/ax_fc_check_lib.m4
  (previously replaced by mom6_fc_check_lib)

* Fix erratic indenting of in MOM6_FC_CHECK_LIB macro

* Add license header to MOM6_FC_CHECK_LIB

* .gitignore updated to ignore configure, and *not* ignore `build/` or
  any other hypothetical build directory.
@marshallward

Copy link
Copy Markdown
Member Author

I updated this to remove the prebuilt configure, but for all MOM6 build to use the (generated) top-configure. I think that is the right design here.

BTW any project assuming the old format will probably need to be modified (e.g. MOM6-examples Makefile builds). Probably won't affect existing regression testing though.

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.

1 participant