Repository: spack/spack

Issue:
xyce@7.6.0 +pymi +mpi: libopenblas.a(sgesvd.o): undefined reference to symbol '_gfortran_concat_string@@@@GFORTRAN_8'
### Steps to reproduce the issue

I'm having some trouble building `xyce@7.6.0 +pymi +mpi` using:
* `spack@develop` (a771bfadd1564edfd46a2f4f8ffbfad89e557f8a from `Tue Mar 28 14:50:29 2023 -0400`
* Ubuntu 20.04, X86_64
* GCC 11.1.0
* MPICH 4.1

Spack environment: [spack.yaml.txt](https://github.com/spack/spack/files/11102594/spack.yaml.txt)

<details><summary>Concretization</summary><pre>
 -   lq5krw5  xyce@7.6.0%gcc@11.1.0~ipo+mpi~plugin+pymi+pymi_static_tpls~shared build_system=cmake build_type=RelWithDebInfo cxxstd=11 generator=make patches=077f91d arch=linux-ubuntu20.04-x86_64
[+]  owghswz      ^bison@3.8.2%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  j2tlgt4          ^diffutils@3.9%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  5f66p4a              ^libiconv@1.17%gcc@11.1.0 build_system=autotools libs=shared,static arch=linux-ubuntu20.04-x86_64
[+]  t4wviga          ^m4@1.4.19%gcc@11.1.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-ubuntu20.04-x86_64
[+]  b2tzsvo              ^libsigsegv@2.14%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  muafle5          ^perl@5.36.0%gcc@11.1.0+cpanm+open+shared+threads build_system=generic arch=linux-ubuntu20.04-x86_64
[+]  alkzfee              ^berkeley-db@18.1.40%gcc@11.1.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-ubuntu20.04-x86_64
[+]  viujxrb      ^cmake@3.25.2%gcc@11.1.0~doc+ncurses+ownlibs~qt build_system=generic build_type=Release arch=linux-ubuntu20.04-x86_64
[+]  lwdu2k7          ^ncurses@6.3%gcc@11.1.0~symlinks+termlib abi=none build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  chqnfsn          ^openssl@1.1.1t%gcc@11.1.0~docs~shared build_system=generic certs=mozilla arch=linux-ubuntu20.04-x86_64
[+]  w233qs7              ^ca-certificates-mozilla@2023-01-10%gcc@11.1.0 build_system=generic arch=linux-ubuntu20.04-x86_64
[+]  vqxhipm      ^flex@2.6.3%gcc@11.1.0+lex~nls build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  bqre6so          ^findutils@4.9.0%gcc@11.1.0 build_system=autotools patches=440b954 arch=linux-ubuntu20.04-x86_64
[+]  ac6p2ol      ^gmake@4.4.1%gcc@11.1.0~guile build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  46sqcgi      ^mpich@4.1%gcc@11.1.0~argobots~cuda+fortran~hwloc+hydra+libxml2+pci~rocm+romio~slurm~two_level_namespace~vci~verbs~wrapperrpath build_system=autotools datatype-engine=auto device=ch4 netmod=ofi pmi=pmi arch=linux-ubuntu20.04-x86_64
[+]  ieh7e7v          ^libfabric@1.16.1%gcc@11.1.0~debug~kdreg build_system=autotools fabrics=rxm,sockets,tcp,udp arch=linux-ubuntu20.04-x86_64
[+]  stfxkiu          ^libpciaccess@0.17%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  yyuvbzt              ^libtool@2.4.7%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  i5p6x5b              ^util-macros@1.19.3%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  kbnj5jn          ^libxml2@2.10.3%gcc@11.1.0~python build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  uorrjkf          ^pkgconf@1.8.0%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  hjoummv          ^yaksa@0.2%gcc@11.1.0~cuda~rocm build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  vlza2rq              ^autoconf@2.69%gcc@11.1.0 build_system=autotools patches=35c4492,7793209,a49dd5b arch=linux-ubuntu20.04-x86_64
[+]  tflyjjh              ^automake@1.16.5%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  gjep5cm      ^openblas@0.3.21%gcc@11.1.0~bignuma~consistent_fpcsr+fortran~ilp64+locking+pic~shared build_system=makefile patches=114f95f,d3d9b15 symbol_suffix=none threads=none arch=linux-ubuntu20.04-x86_64
[+]  enjwius      ^py-pip@23.0%gcc@11.1.0 build_system=generic arch=linux-ubuntu20.04-x86_64
[+]  twa56v5      ^py-pybind11@2.10.1%gcc@11.1.0~ipo build_system=cmake build_type=RelWithDebInfo generator=ninja arch=linux-ubuntu20.04-x86_64
[+]  3i3zumd          ^ninja@1.11.1%gcc@11.1.0+re2c build_system=generic arch=linux-ubuntu20.04-x86_64
[+]  s4ngkq3              ^re2c@2.2%gcc@11.1.0 build_system=generic arch=linux-ubuntu20.04-x86_64
[+]  nxha4sd          ^py-setuptools@67.6.0%gcc@11.1.0 build_system=generic arch=linux-ubuntu20.04-x86_64
[+]  62cmtfu          ^py-wheel@0.37.1%gcc@11.1.0 build_system=generic arch=linux-ubuntu20.04-x86_64
[+]  37sslx7      ^python@3.7.15%gcc@11.1.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=0d98e93,f2fd060 arch=linux-ubuntu20.04-x86_64
[+]  onsas2b          ^bzip2@1.0.8%gcc@11.1.0~debug~pic+shared build_system=generic arch=linux-ubuntu20.04-x86_64
[+]  ewn4mh2          ^expat@2.5.0%gcc@11.1.0+libbsd build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  bstssvl              ^libbsd@0.11.7%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  cb26zci                  ^libmd@1.0.4%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  qkfi67z          ^gdbm@1.23%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  liqdych          ^gettext@0.21.1%gcc@11.1.0+bzip2+curses+git~libunistring+libxml2+tar+xz build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  qqx54or              ^tar@1.34%gcc@11.1.0 build_system=autotools zip=pigz arch=linux-ubuntu20.04-x86_64
[+]  gojgmg4                  ^pigz@2.7%gcc@11.1.0 build_system=makefile arch=linux-ubuntu20.04-x86_64
[+]  v4yh5vm                  ^zstd@1.5.4%gcc@11.1.0~ipo+programs build_system=cmake build_type=RelWithDebInfo compression=none generator=make libs=shared,static arch=linux-ubuntu20.04-x86_64
[+]  ng3lexd          ^libffi@3.4.4%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  zfoy6sd          ^libxcrypt@4.4.33%gcc@11.1.0~obsolete_api build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  lui3zbo          ^readline@8.2%gcc@11.1.0 build_system=autotools patches=bbf97f1 arch=linux-ubuntu20.04-x86_64
[+]  6dlwhn3          ^sqlite@3.40.1%gcc@11.1.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  i5b6dq6          ^util-linux-uuid@2.38.1%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  vmymil3          ^xz@5.4.1%gcc@11.1.0+pic build_system=autotools libs=shared,static arch=linux-ubuntu20.04-x86_64
[+]  hi2xsgc          ^zlib@1.2.13%gcc@11.1.0+optimize+pic+shared build_system=makefile arch=linux-ubuntu20.04-x86_64
[+]  7xj2mxh      ^trilinos@develop%gcc@11.1.0~adelus~adios2+amesos+amesos2+anasazi+aztec+basker+belos~boost~chaco+complex~cuda~cuda_rdc~debug~dtk+epetra+epetraext+epetraextbtf+epetraextexperimental+epetraextgraphreorderings~exodus+explicit_template_instantiation~float+fortran~gtest~hdf5~hypre+ifpack~ifpack2~intrepid~intrepid2~ipo+isorropia+kokkos~mesquite~minitensor~ml+mpi~muelu~mumps+nox~openmp~panzer~phalanx~piro~python~rocm~rocm_rdc~rol~rythmos+sacado~scorec~shards+shared~shylu~stk+stokhos~stratimikos~strumpack+suite-sparse~superlu~superlu-dist~teko~tempus~thyra+tpetra+trilinoscouplings~wrapper~x11+zoltan~zoltan2 build_system=cmake build_type=RelWithDebInfo cxxstd=17 generator=make gotype=long_long arch=linux-ubuntu20.04-x86_64
[+]  7g6g4gk          ^hwloc@2.9.0%gcc@11.1.0~cairo~cuda~gl~libudev+libxml2~netloc~nvml~oneapi-level-zero~opencl+pci~rocm build_system=autotools libs=shared,static arch=linux-ubuntu20.04-x86_64
[+]  h32qvnm          ^metis@5.1.0%gcc@11.1.0~gdb~int64~ipo~real64+shared build_system=cmake build_type=RelWithDebInfo generator=make patches=4991da9,93a7903,b1225da arch=linux-ubuntu20.04-x86_64
[+]  qonnl7u          ^parmetis@4.0.3%gcc@11.1.0~gdb~int64~ipo+shared build_system=cmake build_type=RelWithDebInfo generator=make patches=4f89253,50ed208,704b84f arch=linux-ubuntu20.04-x86_64
[+]  w5od4o5          ^suite-sparse@5.13.0%gcc@11.1.0~cuda~graphblas~openmp+pic build_system=generic arch=linux-ubuntu20.04-x86_64
[+]  l3pqtzc              ^gmp@6.2.1%gcc@11.1.0+cxx build_system=autotools libs=shared,static arch=linux-ubuntu20.04-x86_64
[+]  6keg57t              ^mpfr@4.2.0%gcc@11.1.0 build_system=autotools libs=shared,static arch=linux-ubuntu20.04-x86_64
[+]  l3nt23x                  ^autoconf-archive@2023.02.20%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
[+]  rmho7zt                  ^texinfo@7.0%gcc@11.1.0 build_system=autotools arch=linux-ubuntu20.04-x86_64
</pre></details>

Build error:
```
$> spack -e . install
...
==> Installing xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa
==> No binary for xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa found: installing from source
==> Fetching https://github.com/Xyce/Xyce/archive/Release-7.6.0.tar.gz
==> Fetching https://github.com/xyce/xyce/commit/fdf457fce1b1511b8a29d134d38e515fb7149246.patch?full_index=1
==> Applied patch https://github.com/xyce/xyce/commit/fdf457fce1b1511b8a29d134d38e515fb7149246.patch?full_index=1
==> xyce: Executing phase: 'cmake'
==> xyce: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    '/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/gmake-4.4.1-ac6p2olddxuoxe5rpnobswgyg24v4e7u/bin/make' '-j96'
...
     1427    cd /tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-lq5krw5/src/test/GenExtTestHarnesses && /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/mpi
             ch-4.1-46sqcgiqewmeufsbphcqsknfqrfhzp6v/bin/mpic++  -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/CircuitPKG -I/tmp/root/spack-stage/spack-st
             age-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/AnalysisPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/DeviceModelPKG/Core -
             I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/DeviceModelPKG/OpenModels -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnyb
             igcongtxa/spack-src/src/DeviceModelPKG/TCADModels -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/DeviceModelPKG/IBISModels -I/tmp/root/spack-s
             tage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/DeviceModelPKG/EXTSC -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src
             /DeviceModelPKG/ADMS -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/DeviceModelPKG/NeuronModels -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0
             -lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/UtilityPKG/ExpressionSrc -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-lq5krw5/src/UtilityPKG/E
             xpressionSrc -I/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/flex-2.6.3-vqxhipmtlavqv5qan6xijr6xvmsujzmf/include -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tny
             bigcongtxa/spack-src/src/UtilityPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-lq5krw5/src/UtilityPKG -I/tmp/root/spack-stage/spack-stage-xy
             ce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/ErrorHandlingPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/IOInterfacePKG/Output
             -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/IOInterfacePKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/
             spack-src/src/LinearAlgebraServicesPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/LinearAlgebraServicesPKG/ksparse -I/tmp/root/spack-stage
             /spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/LoaderServicesPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/Parall
             elDistPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/TopoManagerPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnyb
             igcongtxa/spack-src/src/NonlinearSolverPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/TimeIntegrationPKG -I/tmp/root/spack-stage/spack-sta
             ge-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/DakotaLinkPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/MultiTimePDEPKG -I/t
             mp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-lq5krw5/src -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-7xj2mxhssn
             iytxwg3jxsmz255avipsdf/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/hwloc-2.9.0-7g6g4gkx2wblgkwghytaal4dxzj4inn2/include -isystem /spack/opt/spack/linux-ubuntu20.04
             -x86_64/gcc-11.1.0/openblas-0.3.21-gjep5cmcmlhcd5n6v4szssokqz7oytka/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-w5od4o5aunor26uqur7e3x5kdjqskbr
             y/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/parmetis-4.0.3-qonnl7u5lemw47cqektho522egdnrtdl/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0
             /metis-5.1.0-h32qvnmyrtvipy2jofpga4x6wwm4ml7g/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/zlib-1.2.13-hi2xsgcpyaect4ojyrhzeqj56vg7ldvj/include -O2 -g -DNDEBUG -std
             =c++17 -MD -MT src/test/GenExtTestHarnesses/CMakeFiles/TestIssue29.dir/TestIssue29.C.o -MF CMakeFiles/TestIssue29.dir/TestIssue29.C.o.d -o CMakeFiles/TestIssue29.dir/TestIssue29.C.o -c /tmp
             /root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/test/GenExtTestHarnesses/TestIssue29.C
     1428    /tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/test/MPITest/testBUG967.c: In function 'main':
  >> 1429    /tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-src/src/test/MPITest/testBUG967.c:49:46: error: 'MPI_Status' has no member named '_ucount'
     1430       49 |            my_proc, status.MPI_SOURCE, status._ucount);
     1431          |                                              ^
  >> 1432    make[2]: *** [src/test/MPITest/CMakeFiles/testMPI.dir/build.make:79: src/test/MPITest/CMakeFiles/testMPI.dir/testBUG967.c.o] Error 1
     1433    make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-lq5krw5'
  >> 1434    make[1]: *** [CMakeFiles/Makefile2:751: src/test/MPITest/CMakeFiles/testMPI.dir/all] Error 2
     1435    make[1]: *** Waiting for unfinished jobs....
...
  >> 1468    /usr/bin/ld: /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/openblas-0.3.21-gjep5cmcmlhcd5n6v4szssokqz7oytka/lib/libopenblas.a(sgesvd.o): undefined reference to symbol '_gfortran_conc
             at_string@@@@GFORTRAN_8'
  >> 1469    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/libgfortran.so: error adding symbols: DSO missing from command line
  >> 1470    collect2: error: ld returned 1 exit status
  >> 1471    make[2]: *** [src/test/FFTInterface/CMakeFiles/testFFTInterface.dir/build.make:176: src/test/FFTInterface/testFFTInterface] Error 1
     1472    make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-lq5krw5'
  >> 1473    make[1]: *** [CMakeFiles/Makefile2:777: src/test/FFTInterface/CMakeFiles/testFFTInterface.dir/all] Error 2
...
     1496    [100%] Built target TestGH19
     1497    make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-lq5krw5'
     1498    [100%] Built target DeviceInterfaceTest
     1499    make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-lq5krw5'
     1500    [100%] Built target Xyce-PyMi
     1501    make[1]: Leaving directory '/tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-lq5krw5'
  >> 1502    make: *** [Makefile:159: all] Error 2

See build log for details:
  /tmp/root/spack-stage/spack-stage-xyce-7.6.0-lq5krw5pllg2sqpz2n7tnybigcongtxa/spack-build-out.txt
```




### Error message

<details><summary>Error message</summary><pre>
... see above
</pre></details>


### Information on your system

* **Spack:** 0.20.0.dev0 (a771bfadd1564edfd46a2f4f8ffbfad89e557f8a)
* **Python:** 3.8.10
* **Platform:** linux-ubuntu20.04-cascadelake
* **Concretizer:** clingo

### Additional information

[spack-build-env.txt](https://github.com/spack/spack/files/11102609/spack-build-env.txt)
[spack-build-out.txt](https://github.com/spack/spack/files/11102610/spack-build-out.txt)

@kuberry @tbird2001

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:
This seems to be simply an issue of `-lgfortran` not being added, at least for `src/test/FFTInterface/testFFTInterface`.

For instance, the failing compilation for `testFFTInterface` is:
```
spack build-env /lq5krw \
 sh -c \
 "/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/mpich-4.1-46sqcgiqewmeufsbphcqsknfqrfhzp6v/bin/mpic++ \
 -O2 -g -DNDEBUG \
 CMakeFiles/testFFTInterface.dir/testFFTInterface.C.o -o testFFTInterface \
 -Wl,-rpath,/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib:/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/zlib-1.2.13-hi2xsgcpyaect4ojyrhzeqj56vg7ldvj/lib:/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/parmetis-4.0.3-qonnl7u5lemw47cqektho522egdnrtdl/lib:/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/metis-5.1.0-h32qvnmyrtvipy2jofpga4x6wwm4ml7g/lib:/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib:/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/hwloc-2.9.0-7g6g4gkx2wblgkwghytaal4dxzj4inn2/lib \
 ../../libxyce.a \
 -ldl \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libtrilinoscouplings.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_amesos2.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_amesos2_mp_16_serial.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_tpetra.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_tpetraext_pce_serial.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_tpetra_pce_serial.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_tpetra_sd_pce_serial.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_tpetraext_mp_16_serial.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_tpetra_mp_16_serial.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_tpetra_sd_mp_16_serial.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos_sacado.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libstokhos.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/liblocaepetra.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/liblocalapack.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libloca.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libnoxepetra.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libnoxlapack.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libnox.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libifpack.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libamesos.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libsacado.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libisorropia.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libzoltan.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/zlib-1.2.13-hi2xsgcpyaect4ojyrhzeqj56vg7ldvj/lib/libz.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libamesos2.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libtrilinosss.so.14.1 \
 -lm /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/parmetis-4.0.3-qonnl7u5lemw47cqektho522egdnrtdl/lib/libparmetis.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/metis-5.1.0-h32qvnmyrtvipy2jofpga4x6wwm4ml7g/lib/libmetis.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libkokkossimd.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libanasazitpetra.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libModeLaplace.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libanasaziepetra.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libanasazi.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libepetraext.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libklu.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libbtf.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libumfpack.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libcholmod.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libcolamd.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libamd.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libcamd.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libccolamd.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libcxsparse.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libldl.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/librbio.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libspqr.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-nlzrrnmkma4sobfhr7z5rxxhywbcj5pn/lib/libsuitesparseconfig.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libbelostpetra.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libbelosepetra.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libbelos.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libtriutils.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libaztecoo.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libtpetraext.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libtpetrainout.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libtpetra.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libtpetraclassic.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libepetra.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libkokkostsqr.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libteuchosnumerics.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libteuchosremainder.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libteuchoskokkoscomm.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libteuchoscomm.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libteuchoskokkoscompat.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libteuchosparameterlist.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libteuchosparser.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libteuchoscore.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libkokkoskernels.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/openblas-0.3.21-bwi5kdpdcgmd4gnllykft6zuded25tgz/lib/libopenblas.a \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/openblas-0.3.21-bwi5kdpdcgmd4gnllykft6zuded25tgz/lib/libopenblas.a \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/metis-5.1.0-h32qvnmyrtvipy2jofpga4x6wwm4ml7g/lib/libmetis.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libkokkosalgorithms.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libkokkoscontainers.so.14.1 \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-fe2bjtifkbfjxew4xczb5tywfrkh2mkt/lib/libkokkoscore.so.14.1 \
 /usr/lib/x86_64-linux-gnu/libdl.so \
 /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/hwloc-2.9.0-7g6g4gkx2wblgkwghytaal4dxzj4inn2/lib/libhwloc.so"
```

Simply adding `-lgfortran` allows this to succeed. 
Hi @eugeneswalker. I think the issue here is that `xyce+pymi` uses the default variant `+pymi_static_tpls`. The motivation for doing this is that the Xyce-PyMi executable has to resolve symbols in Xyce and also from imported Python libraries (that the user will/may call later). To reduce the likelihood of symbols being resolved by the wrong libraries, dependencies for Xyce-PyMi are preferred to be static rather than dynamic. This shows up the most in blas/lapack.

Because `openblas` is being built static, the `-lgfortran` flag that it would normally generate is not generated. This is because static libraries do not propagate their dependencies like the dynamic libraries do.

Two possible solutions:
1.) Disable the variant `+pymi_static_tpls` with `~pymi_static_tpls` (dynamic openblas, no issue with -lgfortran)
2.) Add `-lgfortran` to your `compilers.yaml` file.
> Two possible solutions:
> 1.) Disable the variant `+pymi_static_tpls` with `~pymi_static_tpls` (dynamic openblas, no issue with -lgfortran) 
> 2.) Add `-lgfortran` to your `compilers.yaml` file.

Hi @kuberry - Thank you for your quick response! I went with #2 and although I no longer hit the gfortran issue, I do still encounter this error:
```
cd /tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-build-elgijpw/src/test/GenExtTestHarnesses && /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/mpich-4.1-46sqcgiqewmeufsbphcqsknfqrfhzp6v/bin/mpic++  -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/CircuitPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/AnalysisPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/DeviceModelPKG/Core -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/DeviceModelPKG/OpenModels -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/DeviceModelPKG/TCADModels -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/DeviceModelPKG/IBISModels -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/DeviceModelPKG/EXTSC -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/DeviceModelPKG/ADMS -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/DeviceModelPKG/NeuronModels -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/UtilityPKG/ExpressionSrc -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-build-elgijpw/src/UtilityPKG/ExpressionSrc -I/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/flex-2.6.3-vqxhipmtlavqv5qan6xijr6xvmsujzmf/include -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/UtilityPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-build-elgijpw/src/UtilityPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/ErrorHandlingPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/IOInterfacePKG/Output -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/IOInterfacePKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/LinearAlgebraServicesPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/LinearAlgebraServicesPKG/ksparse -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/LoaderServicesPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/ParallelDistPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/TopoManagerPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/NonlinearSolverPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/TimeIntegrationPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/DakotaLinkPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/MultiTimePDEPKG -I/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-build-elgijpw/src -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/trilinos-develop-7xj2mxhssniytxwg3jxsmz255avipsdf/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/hwloc-2.9.0-7g6g4gkx2wblgkwghytaal4dxzj4inn2/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/openblas-0.3.21-gjep5cmcmlhcd5n6v4szssokqz7oytka/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/suite-sparse-5.13.0-w5od4o5aunor26uqur7e3x5kdjqskbry/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/parmetis-4.0.3-qonnl7u5lemw47cqektho522egdnrtdl/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/metis-5.1.0-h32qvnmyrtvipy2jofpga4x6wwm4ml7g/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/zlib-1.2.13-hi2xsgcpyaect4ojyrhzeqj56vg7ldvj/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/py-pybind11-2.10.1-twa56v5w5s5odzcr4sjgoqw3f47uj26k/include -isystem /spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-11.1.0/python-3.7.15-37sslx7doykxlgiawovjk4vf6gwfph7e/include/python3.7m -lgfortran -O2 -g -DNDEBUG -fvisibility=hidden -std=c++17 -MD -MT src/test/GenExtTestHarnesses/CMakeFiles/Xyce-PyMi.dir/Xyce-PyMi.C.o -MF CMakeFiles/Xyce-PyMi.dir/Xyce-PyMi.C.o.d -o CMakeFiles/Xyce-PyMi.dir/Xyce-PyMi.C.o -c /tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-build-elgijpw/src/test/GenExtTestHarnesses/Xyce-PyMi.C
/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/test/MPITest/testBUG967.c: In function 'main':
/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/test/MPITest/testBUG967.c:49:46: error: 'MPI_Status' has no member named '_ucount'
   49 |            my_proc, status.MPI_SOURCE, status._ucount);
      |                                              ^
make[2]: *** [src/test/MPITest/CMakeFiles/testMPI.dir/build.make:79: src/test/MPITest/CMakeFiles/testMPI.dir/testBUG967.c.o] Error 1
make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-build-elgijpw'
make[1]: *** [CMakeFiles/Makefile2:751: src/test/MPITest/CMakeFiles/testMPI.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
```

Any idea what is going on here? Is `_ucount` only a member of `MPI_Status` in OpenMPI, not MPICH as I'm using here?

You can build Xyce without `+pymi` in tandem with MPICH, right? That makes me think this is somehow related to the static build of many dependencies with the `+pymi_static_tpls` variant.

Do you think you could try approach `#1` and see if that works?
> You can build Xyce without `+pymi` in tandem with MPICH, right?

Actually, no! At least not with `xyce@7.6.0`.

Trying to build:
* `xyce +mpi ~shared ~pymi ^mpich`
* `xyce +mpi +shared ~pymi ^mpich`

Both fail with:
```
     1415    /tmp/root/spack-stage/spack-stage-xyce-7.6.0-daz3dg5ybnskb3dg3524mw7fd7kzz7a5/spack-src/src/test/MPITest/testBUG967.c: In function 'main':
  >> 1416    /tmp/root/spack-stage/spack-stage-xyce-7.6.0-daz3dg5ybnskb3dg3524mw7fd7kzz7a5/spack-src/src/test/MPITest/testBUG967.c:49:46: error: 'MPI_Status' has no member named '_ucount'
     1417       49 |            my_proc, status.MPI_SOURCE, status._ucount);
     1418          |                                              ^
  >> 1419    make[2]: *** [src/test/MPITest/CMakeFiles/testMPI.dir/build.make:79: src/test/MPITest/CMakeFiles/testMPI.dir/testBUG967.c.o] Error 1
     1420    make[2]: Leaving directory '/tmp/root/spack-stage/spack-stage-xyce-7.6.0-daz3dg5ybnskb3dg3524mw7fd7kzz7a5/spack-build-daz3dg5'
  >> 1421    make[1]: *** [CMakeFiles/Makefile2:749: src/test/MPITest/CMakeFiles/testMPI.dir/all] Error 2
     1422    make[1]: *** Waiting for unfinished jobs....
```

With OpenMPI it works:
* `xyce +mpi ~shared ~pymi ^openmpi`
* `xyce +mpi +shared ~pymi ^openmpi`

Is it possible MPI_Status is setup different in MPICH vs OpenMPI?

MPICH 4.1's mpi.h (Notice no member named `_ucount`):
```
$> cat $(spack location -i mpich)/include/mpi.h
...
typedef struct MPI_Status {
    int count_lo;
    int count_hi_and_cancelled;
    int MPI_SOURCE;
    int MPI_TAG;
    int MPI_ERROR;
} MPI_Status;
...
```

OpenMPI's 4.1.5 mpi.h:
```
$> cat $(spack location -i openmpi)/include/mpi.h
...
typedef struct ompi_status_public_t MPI_Status;
...
/*
 * MPI_Status
 */
struct ompi_status_public_t {
    /* These fields are publicly defined in the MPI specification.
       User applications may freely read from these fields. */
    int MPI_SOURCE;
    int MPI_TAG;
    int MPI_ERROR;
    /* The following two fields are internal to the Open MPI
       implementation and should not be accessed by MPI applications.
       They are subject to change at any time.  These are not the
       droids you're looking for. */
    int _cancelled;
    size_t _ucount;
};
```






Ok, thanks for the update on Xyce without PyMi. I was trying to find reasons why the `+pymi `variant would cause issues with MPICH but `~pymi` wouldn't. The errors show up when building a test 

```c
/tmp/root/spack-stage/spack-stage-xyce-7.6.0-elgijpwol7bjygqlpfwzbw4iab42zqw3/spack-src/src/test/MPITest/testBUG967.c:49:46: error: 'MPI_Status' has no member named '_ucount'
```
and I couldn't see how this test could be getting built with `+pymi` and not with out.

Ok, so this is a general Xyce w/ MPICH issue because of that call in that test. I'll look into it and get back to you.

This issue affects all Xyce releases >= 7.0.

The solution was to replace the use of `_ucount` with:
```cpp
    int count;
    MPI_Get_count(&status, MPI_INT, &count);
    printf("%d wait source %d count %d \n",
           my_proc, status.MPI_SOURCE, count);
```
in src/test/MPITest/testBUG967.c 

This fix is now on the `develop` branch of the Sandia internal Xyce repo and will show up in the next release. I'd prefer to create a patch for Xyce based on the commit that was just merged, but this may not be possible for a while (I'm not sure how often the develop branch is being merged to the github.com master branch).

In the meantime, I'll work on creating a patch file and committing it to the Spack repo.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/xyce/package.py b/var/spack/repos/builtin/packages/xyce/package.py
--- a/var/spack/repos/builtin/packages/xyce/package.py
+++ b/var/spack/repos/builtin/packages/xyce/package.py
@@ -127,6 +127,13 @@ class Xyce(CMakePackage):
         # HDF5
         depends_on("hdf5~shared", when="^hdf5")
 
+    # fix MPI issue
+    patch(
+        "450-mpich-xyce.patch",
+        sha256="e91063d22afeeff01e6c572cef2ac2e3abea27b2fcb5a7e6ac5f41e4734a556d",
+        when="@:7.6,master",
+    )
+
     # fix RPATH issue on mac
     patch(
         "https://github.com/xyce/xyce/commit/40dbc0e0341a5cf9a7fa82a87313869dc284fdd9.patch?full_index=1",


Test patch: