Skip to content

Install.sh overhaul - #367

Open
bonachea wants to merge 24 commits into
BerkeleyLab:mainfrom
bonachea:install-overhaul
Open

Install.sh overhaul#367
bonachea wants to merge 24 commits into
BerkeleyLab:mainfrom
bonachea:install-overhaul

Conversation

@bonachea

@bonachea bonachea commented Sep 9, 2026

Copy link
Copy Markdown
Member

Performs some overdue cleanup on the ./install.sh script to improve robustness and maintainability, in preparation for future feature expansion.

Highlights:

  1. Adds --{enable,disable}-debug option, mirroring the GASNet option, to control production vs debugging mode
  2. Converts the default install behavior to disable assertions. Use --enable-debug to restore assertion checking.
  3. Clean up and expand the Caffeine pkg-config file output (i.e. caffeine*.pc files)
  4. Updates bash-isms throughout to be more concise and maintainable
  5. CI updates for install.sh invocation and coverage
  6. Updates documentation

See individual commit messages for more details.

Fixes #241

c_sizeof only allows interoperable types
Due to copy-pasta we were printing the wrong value for CFLAGS
Add a new section for library dependencies, and add the version and source
Realpath is not available by default on macOS, but perl is and we
already require perl (through GASNet) so use perl instead.

This usually eliminates the need for Homebrew coreutils package,
because suitable GNU Make is also available by default.

run-fpm.sh was already relying on bash-isms, so be explicit that
it requires bash.
Homebrew provides GNU Make in the `make` package (not `coreutils`,
as previously claimed), and the provided binary is called `gmake`,
not `make`.

This has probably never been encountered because modern distros of
both Linux and macOS already include a `/usr/bin/make` by default.
However when probing for make, check for `gmake` first, because it's
more likely to give us a newer version when available on macOS.
GASNet is a required dependency, and we prefer the install script to
install its own copy (or re-use one in the prefix); asking just
encourages users to try and manually install GASNet themselves,
which basically saves nothing and they are likely to get it wrong.

fpm doesn't ask permission to download required dependencies (e.g. Assert),
so stop asking permission to download GASNet.
This GASNet configure option is now also recognized by Caffeine install
with the following behaviors:

* Defaults to --disable-debug (i.e. optimized mode)
* Controls the default setting for ASSERTIONS, unless explicitly overridden in
  CPPFLAGS/FFLAGS. As a result, **Caffeine ASSERTIONS now default to disabled**,
  which is a change in behavior.
* Default Fortran optimization to -O0 in debug mode, otherwise -O3 as before.
Add jobs to cover --disable-debug builds

Add command to check ident strings
The previous logic didn't generate the intended error message
when an expected compiler wasn't found, it just exited without a
message due to set -e
Ensure we pass CC to GASNet via full canonical path, and update
the mismatch error message to be more informative.

Also expand C++ compiler detection to handle Macports clang++,
which can have a name like clang++-mp-23
Only rewrite flang(-[1-9][0-9])? to flang-new when the resulting
file exists and shares a real path.
Excise most uses of `realpath`: canonical pathnames are only necessary when we
need to compare two executables for equality. Some compiler wrappers (and
possibly other tools) can change behavior when you unwrap a basename symlink,
so stop doing that: we should no longer invoke the result of `realpath`.

New function `abspath` returns a non-canonical absolute pathname for a
(possibly relative) pathname, without removing symlinks.

Don't use `command -v` because it will pick up shell functions and
we're always looking for on-disk executables. Use `type -P` instead
to check for executables in $PATH.

Both `type -P` and `which` can return relative paths (when there are relative
paths in $PATH), so don't rely on either to retrieve absolute paths,
new function `abswhich` does that.

Remove unnecessary/redundant variables FPM_FC and FPM_CC
Setting FC=flang-new for the benefit of fpm should now always be handled by the
install script as appropriate.

The only exception is flang versions before 20, where the only
executable was named flang-new
* Relocate and simplify pkg-config file generation
* Additional new pkg-config fields to provide more information
* Generate threadmode-codemode variant of the .pc file
* Add the gasnet pkg-config dependency, and remove the redundant
  flags that will be inherited from the gasnet.pc file
This was previously defaulting to empty when neither CAF_IMAGES nor
GASNET_PSHM_NODES was set, leading to a warning from GASNet at run time.
Also prohibit `run-fpm.sh install`, which does not complete a full install
@bonachea
bonachea requested a review from rouson September 9, 2026 00:53
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.

Add explicit control of assertions

1 participant