Repository: spack/spack

Issue:
openblas fails to build with Intel 18.0.1
The error that I am getting is:
```
/home/certik/repos/spack/lib/spack/env/intel/icc -O2 -DMAX_STACK_ALLOC=2048 -wd981 -DF_INTERFACE_INTEL -fPIC -DNO_WARMUP -DMAX_CPU_NUMBER=32 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -I..  -w -o linktest linktest.c ../libopenblas_sandybridge-r0.2.20.so -L/home/certik/intel18/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64_lin -L/usr/lib/gcc/x86_64-linux-gnu/5/ -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/ -L/lib/x86_64-linux-gnu/ -L/lib/../lib64 -L/lib/../lib/ -L/usr/lib/x86_64-linux-gnu/ -L/usr/lib/../lib/ -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../ -L/lib64 -L/lib/ -L/usr/lib  -lifport -lifcoremt -limf -lsvml -lm -lipgo -lirc -lpthread -lsvml -lc -lirc_s -ldl -lc  -lifcore && echo OK.
/tmp/icc5rLaOl.o: In function `main':
linktest.c:(.text+0x3945): undefined reference to `xerbla_array__'
linktest.c:(.text+0x394c): undefined reference to `chla_transtype__'
linktest.c:(.text+0x3953): undefined reference to `slasyf_rook__'
linktest.c:(.text+0x395a): undefined reference to `ssytf2_rook__'
linktest.c:(.text+0x3961): undefined reference to `ssytrf_rook__'
linktest.c:(.text+0x3968): undefined reference to `ssytrs_rook__'
linktest.c:(.text+0x396f): undefined reference to `ssytri_rook__'
linktest.c:(.text+0x3976): undefined reference to `ssycon_rook__'
linktest.c:(.text+0x397d): undefined reference to `ssysv_rook__'
linktest.c:(.text+0x3984): undefined reference to `chetf2_rook__'
linktest.c:(.text+0x398b): undefined reference to `chetrf_rook__'
linktest.c:(.text+0x3992): undefined reference to `chetri_rook__'
linktest.c:(.text+0x3999): undefined reference to `chetrs_rook__'
linktest.c:(.text+0x39a0): undefined reference to `checon_rook__'
linktest.c:(.text+0x39a7): undefined reference to `chesv_rook__'
linktest.c:(.text+0x39ae): undefined reference to `clahef_rook__'
linktest.c:(.text+0x39b5): undefined reference to `clasyf_rook__'
linktest.c:(.text+0x39bc): undefined reference to `csytf2_rook__'
linktest.c:(.text+0x39c3): undefined reference to `csytrf_rook__'
linktest.c:(.text+0x39ca): undefined reference to `csytrs_rook__'
linktest.c:(.text+0x39d1): undefined reference to `csytri_rook__'
linktest.c:(.text+0x39d8): undefined reference to `csycon_rook__'
linktest.c:(.text+0x39df): undefined reference to `csysv_rook__'
linktest.c:(.text+0x39e6): undefined reference to `dlasyf_rook__'
linktest.c:(.text+0x39ed): undefined reference to `dsytf2_rook__'
linktest.c:(.text+0x39f4): undefined reference to `dsytrf_rook__'
linktest.c:(.text+0x39fb): undefined reference to `dsytrs_rook__'
linktest.c:(.text+0x3a02): undefined reference to `dsytri_rook__'
linktest.c:(.text+0x3a09): undefined reference to `dsycon_rook__'
linktest.c:(.text+0x3a10): undefined reference to `dsysv_rook__'
linktest.c:(.text+0x3a17): undefined reference to `zhetf2_rook__'
linktest.c:(.text+0x3a1e): undefined reference to `zhetrf_rook__'
linktest.c:(.text+0x3a25): undefined reference to `zhetri_rook__'
linktest.c:(.text+0x3a2c): undefined reference to `zhetrs_rook__'
linktest.c:(.text+0x3a33): undefined reference to `zhecon_rook__'
linktest.c:(.text+0x3a3a): undefined reference to `zhesv_rook__'
linktest.c:(.text+0x3a41): undefined reference to `zlahef_rook__'
linktest.c:(.text+0x3a48): undefined reference to `zlasyf_rook__'
linktest.c:(.text+0x3a4f): undefined reference to `zsytf2_rook__'
linktest.c:(.text+0x3a56): undefined reference to `zsytrf_rook__'
linktest.c:(.text+0x3a5d): undefined reference to `zsytrs_rook__'
linktest.c:(.text+0x3a64): undefined reference to `zsytri_rook__'
linktest.c:(.text+0x3a6b): undefined reference to `zsycon_rook__'
linktest.c:(.text+0x3a72): undefined reference to `zsysv_rook__'
```
It builds with Intel 16.0.2.


Discussion:
So there is no `xerbla_array__` symbol, but there is `xerbla_array_` symbol and it links just fine.
```
$ nm ../libopenblas_sandybridge-r0.2.20.so | grep xerbla_array
0000000000a711a0 T xerbla_array_
000000000119e290 b xerbla_array_$SRNAME.0.1
```
So this seems like some platform dependent checks, that fail because I have a different platform.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py
--- a/var/spack/repos/builtin/packages/openblas/package.py
+++ b/var/spack/repos/builtin/packages/openblas/package.py
@@ -79,6 +79,7 @@ class Openblas(MakefilePackage):
     patch('openblas_icc.patch', when='@:0.2.19%intel')
     patch('openblas_icc_openmp.patch', when='%intel@16.0:')
     patch('openblas_icc_fortran.patch', when='%intel@16.0:')
+    patch('openblas_icc_fortran2.patch', when='%intel@18.0:')
 
     # Fixes compilation error on POWER8 with GCC 7
     # https://github.com/xianyi/OpenBLAS/pull/1098


Test patch: