BerkeleyLab / caffeine

A parallel runtime library for Fortran compilers
https://berkeleylab.github.io/caffeine/
Other
37 stars 7 forks source link

Enable `run-fpm.sh` to pass arguments along to the executing program #83

Closed rouson closed 2 weeks ago

rouson commented 5 months ago

The run-fpm.sh script installed by the setup.sh script on the “neural-net” branch of the Berkeley Lab fork of ICAR facilitates passing arguments to the executing program the executing program via a trailing -- ... argument. An example of the resulting script is

#!/bin/sh
#-- DO NOT EDIT -- created by icar/setup.sh
export PKG_CONFIG_PATH

fpm_arguments=""
program_arguments=""
while test $# -gt 0
do
    case "$1" in
        --) program_arguments="$@"
            ;;  
        *) if [ -z "$program_arguments" ];  then
             fpm_arguments="$fpm_arguments $1"
           fi  
            ;;  
    esac
    shift
done
export PKG_CONFIG_PATH
/Users/rouson/.local/bin/fpm $fpm_arguments --verbose \
--profile release \
--c-compiler "/opt/mpich/3.2/gnu/12.3.0/bin/mpicc" \
--compiler "/opt/opencoarrays/2.10.1/gnu/12.3.0/bin/caf" \
--flag "-cpp -DUSE_ASSERTIONS=.false. -I/opt/homebrew/opt/fftw/include -fallow-argument-mismatch -ffree-line-length-none -DVERSION=\'neural-net-0-g2734521-dirty\' -L/opt/homebrew/opt/netcdf/lib -L/opt/homebrew/opt/fftw/lib -L/opt/homebrew/opt/hdf5/lib -L/opt/homebrew/opt/netcdf-fortran/lib" \
$program_arguments

The ICAR setup.sh script copies everything up to and including the done line from a icar/src/run-fpm.sh-header and then appends the rest. Let's do something similar.

everythingfunctional commented 2 weeks ago

I've addressed this with 523a8dd0237d89c559b8742a678857680e317c8a and d4f062e8f811b1e86207f34b5165c1a7cbe09210