Repository: spack/spack

Issue:
Armadillo library has undefined symbols
I'm not sure if anyone else is using Armadillo, but a user discovered that the library I built is missing symbols. I can confirm this by running:

```
$ ldd -r libarmadillo.so
    linux-vdso.so.1 =>  (0x00007ffdd8b61000)
    libopenblas.so.0 => /blues/gpfs/home/software/spack/opt/spack/linux-centos6-x86_64/gcc-6.1.0/openblas-0.2.18-avx2mvh76o62v5a2dr5u6zz2ewer5p7w/lib/libopenblas.so.0 (0x00002b8a88ba1000)
    libstdc++.so.6 => /blues/gpfs/home/software/spack/opt/spack/linux-x86_64/gcc-5.3.0/gcc-6.1.0-q2zosj3igepi3pjnqt74bwazmptr5gpj/lib64/libstdc++.so.6 (0x00002b8a89b7f000)
    libm.so.6 => /lib64/libm.so.6 (0x00002b8a89f16000)
    libgcc_s.so.1 => /blues/gpfs/home/software/spack/opt/spack/linux-x86_64/gcc-5.3.0/gcc-6.1.0-q2zosj3igepi3pjnqt74bwazmptr5gpj/lib64/libgcc_s.so.1 (0x00002b8a8a19a000)
    libc.so.6 => /lib64/libc.so.6 (0x00002b8a8a3b1000)
    /lib64/ld-linux-x86-64.so.2 (0x00002b8a886f1000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b8a8a745000)
    libgfortran.so.3 => /blues/gpfs/home/software/spack/opt/spack/linux-x86_64/gcc-5.3.0/gcc-6.1.0-q2zosj3igepi3pjnqt74bwazmptr5gpj/lib64/libgfortran.so.3 (0x00002b8a8a963000)
    libquadmath.so.0 => /blues/gpfs/home/software/spack/opt/spack/linux-x86_64/gcc-5.3.0/gcc-6.1.0-q2zosj3igepi3pjnqt74bwazmptr5gpj/lib64/../lib64/libquadmath.so.0 (0x00002b8a8ac8a000)
undefined symbol: zvout_    (./libarmadillo.so)
undefined symbol: dvout_    (./libarmadillo.so)
undefined symbol: cvout_    (./libarmadillo.so)
undefined symbol: dmout_    (./libarmadillo.so)
undefined symbol: smout_    (./libarmadillo.so)
undefined symbol: cmout_    (./libarmadillo.so)
undefined symbol: svout_    (./libarmadillo.so)
undefined symbol: zmout_    (./libarmadillo.so)
undefined symbol: ivout_    (./libarmadillo.so)
```

I believe these missing symbols come from the ARPACK library, which should be in the RPATH. The CMake build appears to pick up the correct ARPACK installation so I'm not sure what's up. Does anyone have any ideas/suggestions?



Discussion:
just for the sake of experiment you could try `arpack-ng` instead of `arpack`, that is no longer maintained so if something is wrong on their side AFAIK there is nobody to report bugs to.

@davydden It worked! Thank you very much. I guess there's some bug in the arpack build. I'll submit a PR to depend on arpack-ng instead of arpack.

@adamjstewart cool, glad to hear that!


Resolving patch:
diff --git a/var/spack/repos/builtin/packages/armadillo/package.py b/var/spack/repos/builtin/packages/armadillo/package.py
--- a/var/spack/repos/builtin/packages/armadillo/package.py
+++ b/var/spack/repos/builtin/packages/armadillo/package.py
@@ -33,11 +33,13 @@ class Armadillo(Package):
     homepage = "http://arma.sourceforge.net/"
     url = "http://sourceforge.net/projects/arma/files/armadillo-7.200.1.tar.xz"
 
+    version('7.200.2', 'b21585372d67a8876117fd515d8cf0a2')
     version('7.200.1', 'ed86d6df0058979e107502e1fe3e469e')
 
     variant('hdf5', default=False, description='Include HDF5 support')
 
-    depends_on('arpack')
+    depends_on('cmake@2.8:', type='build')
+    depends_on('arpack-ng')  # old arpack causes undefined symbols
     depends_on('blas')
     depends_on('lapack')
     depends_on('superlu@5.2:')
@@ -46,8 +48,8 @@ class Armadillo(Package):
     def install(self, spec, prefix):
         cmake_args = [
             # ARPACK support
-            '-DARPACK_LIBRARY={0}/libarpack.a'.format(
-                spec['arpack'].prefix.lib),
+            '-DARPACK_LIBRARY={0}/libarpack.{1}'.format(
+                spec['arpack-ng'].prefix.lib, dso_suffix),
             # BLAS support
             '-DBLAS_LIBRARY={0}'.format(spec['blas'].blas_shared_lib),
             # LAPACK support


Test patch: