reduce number of architecture files

Issue #2255 resolved
Roland Haas created an issue

The current mechanism in Cactus requires that there are files darwinX.Y for every single OSX release (and also for hpux, freebsd, aix, openbsd, osf, solaris, unicos, unicosmp basically anything that is not GNU/Linux) which is cumbersome as we have to keep track of Apple’s releases and always end up adding a new boilerplate file

#! /bin/sh
# /*@@
#   @file    darwin18.0.0
#   @date    2019-03-17
#   @author  Roland Haas
#   @desc
#            Known architecture stuff for OS X (Darwin) release 18.0.0
#   @enddesc
#   @version $Header$
# @@*/

. $srcdir/known-architectures/darwin

Pull request https://bitbucket.org/cactuscode/cactus/pull-requests/59/cactus-allow-for-globs-in-architecture/diff avoids this by letting the files be named as shell globs and matches those globs against the architecture name.

Kind of ugly but does get the job done. An alternative may be to instead allow a magic comment:

#CCTK ARCHITECTURE=darwin[0-9]*

parse the file and use it if its REGEX matches the architecture.

Comments (12)

  1. Roland Haas reporter

    The current mechanism in Cactus requires that there are files darwinX.Y for every single OSX release (and also for hpux, freebsd, aix, openbsd, osf, solaris, unicos, unicosmp basically anything that is not GNU/Linux) which is cumbersome as we have to keep track of Apple’s releases and always end up adding a new boilerplate file

    #! /bin/sh
    # /*@@
    #   @file    darwin18.0.0
    #   @date    2019-03-17
    #   @author  Roland Haas
    #   @desc
    #            Known architecture stuff for OS X (Darwin) release 18.0.0
    #   @enddesc
    #   @version $Header$
    # @@*/
    
    . $srcdir/known-architectures/darwin
    

    Pull request https://bitbucket.org/cactuscode/cactus/pull-requests/59/cactus-allow-for-globs-in-architecture/diff avoids this by letting the files be named as shell globs and matches those globs against the architecture name.

    Kind of ugly but does get the job done. An alternative may be to instead allow a magic comment:

    #CCTK ARCHITECTURE=darwin[0-9]*
    

    parse the file and use it if its REGEX matches the architecture.

  2. Roland Haas reporter

    This version uses awk which should be present on all POSIX systems. If this causes an issue then the branch rhaas/architecture_globs3 uses perl which we already require for other parts of the build process. Both versions are about equally complex.

  3. Roland Haas reporter
    • changed status to open

    known-architectures actually appears twice in configure and missing the second time (as I did) makes compilation fail on OSX since the second part is the one settings LIBS (to include gfortran when linking).

  4. Log in to comment