Linking IOAPI 3-2 large fails with errors like m3combo.f90:(.text+0x5c2): relocation truncated to fit: R_X86_64_PC32 against `.bss'

We’ve been using IOAPI 3.2 and are now compiling IOAPI 3.2 large. One of the problems we ran into was there is no top-level Makefile, so I use the top-level Makefile from the original tarball of IOAPI 3.2.

However, m3tools then fails to compile with:

m3combo.f90:(.text+0x5c2): relocation truncated to fit: R_X86_64_PC32 against `.bss'

The full trace is:

cd /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64; gfortran -fPIC m3combo.o -L/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64 -lioapi -lnetcdff -lnetcdf -fopenmp -dynamic -L/usr/lib64 -lm -lpthread -lc  -o m3combo
m3combo.o: In function `MAIN__':
m3combo.f90:(.text+0x5c2): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0x620): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0x668): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0x874): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0xa31): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0xb04): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0xbd7): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0xca5): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0xcf1): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0xd12): relocation truncated to fit: R_X86_64_PC32 against `.bss'
m3combo.f90:(.text+0xdf7): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
make[1]: *** [m3combo] Error 1
make[1]: Leaving directory `/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/m3tools'
make: *** [all] Error 2
==> Error: ProcessError: Command exited with status 2:
    'make' '-j12'

3 errors found in build log:
     587    m3combo.f90:(.text+0xb04): relocation truncated to fit: R_X86_64_PC
            32 against `.bss'
     588    m3combo.f90:(.text+0xbd7): relocation truncated to fit: R_X86_64_PC
            32 against `.bss'
     589    m3combo.f90:(.text+0xca5): relocation truncated to fit: R_X86_64_PC
            32 against `.bss'
     590    m3combo.f90:(.text+0xcf1): relocation truncated to fit: R_X86_64_PC
            32 against `.bss'
     591    m3combo.f90:(.text+0xd12): relocation truncated to fit: R_X86_64_PC
            32 against `.bss'
     592    m3combo.f90:(.text+0xdf7): additional relocation overflows omitted 
            from the output
  >> 593    collect2: error: ld returned 1 exit status
  >> 594    make[1]: *** [m3combo] Error 1
     595    make[1]: Leaving directory `/tmp/spack-stage/yul18051/ioapi-3.2-lar
            ge-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/m3tools'
  >> 596    make: *** [all] Error 2

See build log for details:
  /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-build-out.txt

My past experience with similar errors is that the offending files need to be compiled with position independent code enabled using the -fPIC flag, but compiling both IOAPI (by adding -fPIC to COPTFLAGS and FOPTFLAGS) and m3tools (by adding -fPIC to LFLAGS) does not help.

The full output files are here -

Environment log: spack-build-env.txt (18.4 KB)
Build log: spack-build-out.txt (147.0 KB)

Input file used to compile ioapi@3-2large

# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import glob
import os

from spack import *


class Ioapi(MakefilePackage):
    """Models-3/EDSS Input/Output Applications Programming Interface."""

    homepage = "https://www.cmascenter.org/ioapi/"
    url      = "https://www.cmascenter.org/ioapi/download/ioapi-3.2.tar.gz"
    version('3.2', sha256='4858415e265d017b45d8b2d661286d8db8f6e70a5736f7a0d06ca275fab84c47')
    version('3.2-large', sha256='1a92a8399261b4a500b0dd5c546ce6ec21c3310054fe17e15bcfeb9b77872c59')
    resource(
        # IOAPI 3.2-large is missing the root Makefile.template file.
        when='@3.2-large',
        name='root_makefile',
        extension='template',
        placement='patches',
        expand=False,
        url='https://raw.githubusercontent.com/cjcoats/ioapi-3.2/d01616e33ddc82be46ddf70cd4d7d381946b1e9b/Makefile.template',
        sha256='6aff255459e2e7ff1d9b9aeb6df7438e38f9ee6975d1531a6f1e300d41bfc575',
        )
    depends_on('mpi')
    depends_on('netcdf@4:')
    depends_on('netcdf-fortran@4:')
    depends_on('sed', type='build')

    def edit(self, spec, prefix):
        # Workaround not being able to copy resource files into the root directory.
        if os.path.exists('patches'):
            os.symlink(os.path.join('patches', 'Makefile.template'),
                       'Makefile.template')
        # No default Makefile bundled; edit the template.
        os.symlink('Makefile.template', 'Makefile')
        # The makefile uses stubborn assignments of = instead of ?= so
        # edit the makefile instead of using environmental variables.
        makefile = FileFilter('Makefile')
        makefile.filter('^BASEDIR.*', 'BASEDIR = ' + self.build_directory)
        makefile.filter('^INSTALL.*', 'INSTALL = ' + prefix)
        makefile.filter('^BININST.*', 'BININST = ' + prefix.bin)
        makefile.filter('^LIBINST.*', 'LIBINST = ' + prefix.lib)
        # Compile m3tools with PIC, otherwise linking airs2m3 fails.
        env['LFLAGS'] = self.compiler.pic_flag
        # Compile ioapi with PIC, otherwise linking airs2m3 fails.
        #
        # Find the name of the appropriate Makeinclude.* file from the
        # top-directory Makefile.
        bin = None
        with open('Makefile') as f:
            for line in f:
                if line.startswith('BIN'):
                    bin = line.split()[-1]
                    break
        if bin is None:
            raise IOError('Could not find BIN file to patch with -fPIC!')
        makeinclude = FileFilter(os.path.join('ioapi', 'Makeinclude.' + bin))
        makeinclude.filter('^(COPTFLAGS.*)', r'\1 ' + self.compiler.pic_flag)
        makeinclude.filter('^(FOPTFLAGS.*)', r'\1 ' + self.compiler.pic_flag)

    def install(self, spec, prefix):
        make('install')
        # Install the header files.
        mkdirp(prefix.include.fixed132)
        headers = glob.glob('ioapi/*.EXT')
        for header in headers:
            install(header, prefix.include)
        # Install the header files for CMAQ and SMOKE in the
        # non-standard -ffixed-line-length-132 format.
        headers_fixed132 = glob.glob('ioapi/fixed_src/*.EXT')
        for header in headers_fixed132:
            install(header, prefix.include.fixed132)

What compiler, by the way?

The usual reason for this (in Fortran) is static data (i.e., COMMON blocks) larger than 2 GB, together with compiling for the “small” Linux2_x86_64 memory model, and the usual fix is to compile for “medium” memory model (see https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#medium.

On the other hand, the “ioapi-large” STATE3+FDESC3 COMMON blocks total only a little over 300 MB, so that should not be the problem…

What happens when you build with one of the “*medium” BIN-types?

1 Like

Thanks for the link to the memory model page. I’ll try -mcmodel=medium and let you know how that goes.

The compiler is gcc 9.1.0:

[yul18051@cn01 master]$ spack spec -I ioapi@3.2-large ^netcdf+parallel-netcdf
Input spec                                                                                                                                                                                     --------------------------------
 -   ioapi@3.2-large                                                            
 -       ^netcdf+parallel-netcdf                                                                                                                                       
                                                                            
Concretized                                                                      
--------------------------------                                                                     
 -   ioapi@3.2-large%gcc@9.1.0 arch=linux-rhel6-x86_64                                    
[+]      ^netcdf@4.7.0%gcc@9.1.0~dap~hdf4 maxdims=1024 maxvars=8192 +mpi+parallel-netcdf patches=10a1c3f7fa05e2c82457482e272bbe04d66d0047b237ad0a73e87d63d848b16c +pic+shared arch=linux-rhel6-
x86_64                                                                                                                                                                                         [+]          ^autoconf@2.69%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]              ^m4@1.4.18%gcc@9.1.0 patches=3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00,fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 +sigsegv arch=l
inux-rhel6-x86_64                                                                                                   
[+]                  ^libsigsegv@2.11%gcc@9.1.0 arch=linux-rhel6-x86_64                 
[+]              ^perl@5.26.2%gcc@9.1.0+cpanm patches=0eac10ed90aeb0459ad8851f88081d439a4e41978e586ec743069e8b059370ac +shared+threads arch=linux-rhel6-x86_64
[+]                  ^gdbm@1.18.1%gcc@9.1.0 arch=linux-rhel6-x86_64                        
[+]                      ^readline@7.0%gcc@9.1.0 arch=linux-rhel6-x86_64                 
[+]                          ^ncurses@6.1%gcc@9.1.0~symlinks~termlib arch=linux-rhel6-x86_64
[+]                              ^pkgconf@1.6.1%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]          ^automake@1.16.1%gcc@9.1.0 arch=linux-rhel6-x86_64                                         
[+]          ^hdf5@1.10.5%gcc@9.1.0~cxx~debug~fortran+hl+mpi patches=b61e2f058964ad85be6ee5ecea10080bf79e73f83ff88d1fa4b602d00209da9c +pic+shared~szip~threadsafe arch=linux-rhel6-x86_64
[+]              ^openmpi@3.1.4%gcc@9.1.0~cuda+cxx_exceptions fabrics=none ~java~legacylaunchers~memchecker~pmi schedulers=none ~sqlite3~thread_multiple+vt arch=linux-rhel6-x86_64
[+]                  ^hwloc@1.11.11%gcc@9.1.0~cairo~cuda~gl+libxml2~nvml+pci+shared arch=linux-rhel6-x86_64
[+]                      ^libpciaccess@0.13.5%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                          ^libtool@2.4.6%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                          ^util-macros@1.19.1%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                      ^libxml2@2.9.9%gcc@9.1.0~python arch=linux-rhel6-x86_64
[+]                          ^libiconv@1.15%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                          ^xz@5.2.4%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                          ^zlib@1.2.11%gcc@9.1.0+optimize+pic+shared arch=linux-rhel6-x86_64
[+]                      ^numactl@2.0.12%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]          ^parallel-netcdf@1.11.2%gcc@9.1.0+cxx+fortran+pic arch=linux-rhel6-x86_64
[+]      ^netcdf-fortran@4.4.5%gcc@9.1.0+pic arch=linux-rhel6-x86_64
[+]      ^sed@4.2.2%gcc@9.1.0 arch=linux-rhel6-x86_64

[yul18051@cn01 master]$

The error persists using BIN = Linux2_x86_64gfort_medium though now it the error includes references to specific functions:

cd /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium; gfortran  m3combo.o -L/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6x
xhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium -lioapi -lnetcdff -lnetcdf -fopenmp -dynamic -L/usr/lib64 -lm -lpthread -lc  -o m3combo
m3combo.o: In function `MAIN__':                                               
m3combo.f90:(.text+0xdfa): relocation truncated to fit: R_X86_64_32S against `.bss'
m3combo.f90:(.text+0xf6c): relocation truncated to fit: R_X86_64_32S against `.bss'
m3combo.f90:(.text+0x129b): relocation truncated to fit: R_X86_64_32S against `.bss'
m3combo.f90:(.text+0x1d53): relocation truncated to fit: R_X86_64_32S against `.bss'
m3combo.f90:(.text+0x33c3): relocation truncated to fit: R_X86_64_32S against `.bss'
/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o): In function `__modatts3_MOD_endcf':
modatts3.F90:(.text+0x6aa2): relocation truncated to fit: R_X86_64_PC32 against symbol `__modatts3_MOD_cfmeta' defined in .bss section in /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6
xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o)
/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o): In function `__modatts3_MOD_setcf1':
modatts3.F90:(.text+0x6f03): relocation truncated to fit: R_X86_64_PC32 against symbol `__modatts3_MOD_cfmeta' defined in .bss section in /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6
xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o)                
/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o): In function `__modatts3_MOD_initcf':
modatts3.F90:(.text+0x9f42): relocation truncated to fit: R_X86_64_PC32 against symbol `__modatts3_MOD_cfmeta' defined in .bss section in /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6
xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o)
/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o): In function `__modatts3_MOD_endmtext':
modatts3.F90:(.text+0x9f57): relocation truncated to fit: R_X86_64_PC32 against symbol `__modatts3_MOD_text_mdata' defined in .bss section in /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gu
eys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o)
modatts3.F90:(.text+0x9f68): relocation truncated to fit: R_X86_64_PC32 against symbol `__modatts3_MOD_text_mdata' defined in .bss section in /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gu
eys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o)
modatts3.F90:(.text+0x9f72): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
make[1]: *** [m3combo] Error 1
make[1]: Leaving directory `/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/m3tools'
make: *** [all] Error 2
==> Error: ProcessError: Command exited with status 2:
    'make' '-j12'

3 errors found in build log:
     590    /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupb
            tu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o):
             In function `__modatts3_MOD_initcf':
     591    modatts3.F90:(.text+0x9f42): relocation truncated to fit: R_X86_64_
            PC32 against symbol `__modatts3_MOD_cfmeta' defined in .bss section
             in /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkr
            eupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3
            .o)
     592    /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupb
            tu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(modatts3.o):
             In function `__modatts3_MOD_endmtext':
     593    modatts3.F90:(.text+0x9f57): relocation truncated to fit: R_X86_64_
            PC32 against symbol `__modatts3_MOD_text_mdata' defined in .bss sec
            tion in /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcp
            wpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(moda
            tts3.o)
     594    modatts3.F90:(.text+0x9f68): relocation truncated to fit: R_X86_64_
            PC32 against symbol `__modatts3_MOD_text_mdata' defined in .bss sec
            tion in /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcp
            wpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium/libioapi.a(moda
            tts3.o)
     595    modatts3.F90:(.text+0x9f72): additional relocation overflows omitte
            d from the output
  >> 596    collect2: error: ld returned 1 exit status
  >> 597    make[1]: *** [m3combo] Error 1
     598    make[1]: Leaving directory `/tmp/spack-stage/yul18051/ioapi-3.2-lar
            ge-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/m3tools'
  >> 599    make: *** [all] Error 2

See build log for details:
  /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-build-out.txt

[yul18051@cn01 master]$

Same output adding -mcmodel=medium to FOPTFLAGS, MFLAGS and LFLAGS to the default BIN = Linux2_x86_64.

Upon further examination, the problem may well be with the module-variables in MODULE MODMPASFIO: since the interest in ioapi-large was for CMAQ-DDM, the MPAS I/O facilities were not tested, and did not catch the fact that ioapi-large MODULE MODMPASFIO has about 8.8GB of (static) module-variables.

This module is now dimensioned with additional parameters specifying a max of 64 MPAS-files and 2048 MPAS-file variables per invocation, reducing the size down to about 300 MB. Try re-downloading and re-building, using this new version of the module (downloads have been updated on both GitHub and the CMAS web-site).

1 Like

Using the tarball autogenerated from your GitHub commit 3490a48 I get me further along, but the install phase fails now.

==> Executing phase: 'install'
==> [2019-12-02-12:47:42.054466] 'make' '-j12' 'install'
cd /home/yul18051/CMAQ/master/spack/opt/spack/linux-rhel6-x86_64/gcc-9.1.0/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq; mkdir -p /home/yul18051/CMAQ/master/spack/opt/spack/linux-rhel6-x86_64/gcc-9.1.0/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/lib
echo "Installing I/O API and M3TOOLS in /home/yul18051/CMAQ/master/spack/opt/spack/linux-rhel6-x86_64/gcc-9.1.0/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/lib and "
Installing I/O API and M3TOOLS in /home/yul18051/CMAQ/master/spack/opt/spack/linux-rhel6-x86_64/gcc-9.1.0/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/lib and 
(cd /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/ioapi   ; make BIN=Linux2_x86_64gfort_medium INSTDIR=/home/yul18051/CMAQ/master/spack/opt/spack/linux-rhel6-x86_64/gcc-9.1.0/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/lib install)
make[1]: Entering directory `/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/ioapi'
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
echo "Installing in /home/yul18051/CMAQ/master/spack/opt/spack/linux-rhel6-x86_64/gcc-9.1.0/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/lib" ; cd /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium; cp libioapi.a m3utilio.mod modgctp.mod modwrfio.mod modmpasfio.mod modatts3.mod modncfio.mod modpdata.mod /home/yul18051/CMAQ/master/spack/opt/spack/linux-rhel6-x86_64/gcc-9.1.0/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/lib
Installing in /home/yul18051/CMAQ/master/spack/opt/spack/linux-rhel6-x86_64/gcc-9.1.0/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/lib
make[1]: Leaving directory `/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/ioapi'
(cd /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/m3tools ; make BIN=Linux2_x86_64gfort_medium INSTDIR= install)
make[1]: Entering directory `/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/m3tools'
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
echo "Installing M3TOOLS in "
Installing M3TOOLS in 
cd /tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/Linux2_x86_64gfort_medium; cp airs2m3         bcwndw          camxtom3        datshift        dayagg factor          findwndw        greg2jul        gregdate        gridprobe insertgrid      jul2greg        juldate         juldiff         julshift kfxtract        latlon          m3agmax         m3agmask        m3cple m3combo         m3diff          m3edhdr         m3fake          m3hdr m3interp        m3mask          m3merge         m3pair          m3probe m3stat          m3totxt         m3tproc         m3tshift        m3wndw m3xtract        mtxblend        mtxbuild        mtxcalc         mtxcple presterp        presz           projtool        selmrg2d        timeshift vertot          vertimeproc     vertintegral    wrfgriddesc     wrftom3 mpasdiff        mpasstat        mpastom3 
cp: target `mpastom3' is not a directory
make[1]: *** [install] Error 1
make[1]: Leaving directory `/tmp/spack-stage/yul18051/ioapi-3.2-large-z6yl2gueys6xxhwcpwpkreupbtu7cswq/spack-src/m3tools'
make: *** [install] Error 2

Full logs and installation script:

Build: spack-build-out.txt (199.4 KB)
Package: package.py (2.6 KB)
Dependency tree:

$ spack spec -I ioapi@3.2-large ^netcdf+parallel-netcdf
Input spec
--------------------------------
 -   ioapi@3.2-large
 -       ^netcdf+parallel-netcdf

Concretized
--------------------------------
 -   ioapi@3.2-large%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]      ^netcdf@4.7.0%gcc@9.1.0~dap~hdf4 maxdims=1024 maxvars=8192 +mpi+parallel-netcdf patches=10a1c3f7fa05e2c82457482e272bbe04d66d0047b237ad0a73e87d63d848b16c +pic+shared arch=linux-rhel6-x86_64
[+]          ^autoconf@2.69%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]              ^m4@1.4.18%gcc@9.1.0 patches=3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00,fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 +sigsegv arch=linux-rhel6-x86_64
[+]                  ^libsigsegv@2.11%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]              ^perl@5.26.2%gcc@9.1.0+cpanm patches=0eac10ed90aeb0459ad8851f88081d439a4e41978e586ec743069e8b059370ac +shared+threads arch=linux-rhel6-x86_64
[+]                  ^gdbm@1.18.1%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                      ^readline@7.0%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                          ^ncurses@6.1%gcc@9.1.0~symlinks~termlib arch=linux-rhel6-x86_64
[+]                              ^pkgconf@1.6.1%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]          ^automake@1.16.1%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]          ^hdf5@1.10.5%gcc@9.1.0~cxx~debug~fortran+hl+mpi patches=b61e2f058964ad85be6ee5ecea10080bf79e73f83ff88d1fa4b602d00209da9c +pic+shared~szip~threadsafe arch=linux-rhel6-x86_64
[+]              ^openmpi@3.1.4%gcc@9.1.0~cuda+cxx_exceptions fabrics=none ~java~legacylaunchers~memchecker~pmi schedulers=none ~sqlite3~thread_multiple+vt arch=linux-rhel6-x86_64
[+]                  ^hwloc@1.11.11%gcc@9.1.0~cairo~cuda~gl+libxml2~nvml+pci+shared arch=linux-rhel6-x86_64
[+]                      ^libpciaccess@0.13.5%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                          ^libtool@2.4.6%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                          ^util-macros@1.19.1%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                      ^libxml2@2.9.9%gcc@9.1.0~python arch=linux-rhel6-x86_64
[+]                          ^libiconv@1.15%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                          ^xz@5.2.4%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]                          ^zlib@1.2.11%gcc@9.1.0+optimize+pic+shared arch=linux-rhel6-x86_64
[+]                      ^numactl@2.0.12%gcc@9.1.0 arch=linux-rhel6-x86_64
[+]          ^parallel-netcdf@1.11.2%gcc@9.1.0+cxx+fortran+pic arch=linux-rhel6-x86_64
[+]      ^netcdf-fortran@4.4.5%gcc@9.1.0+pic arch=linux-rhel6-x86_64
[+]      ^sed@4.2.2%gcc@9.1.0 arch=linux-rhel6-x86_64

Nevermind, I see this is because of unset environmental variables in the m3tools Makefile. I’ll play with it.

The install issue was due to BININST being commented out by default in in the root Makefile.template.