From be2be8c70e2a2ec4932810b7144d45bdc8e81699 Mon Sep 17 00:00:00 2001 From: Stephen McDowell Date: Sun, 10 Sep 2017 22:04:02 -0400 Subject: fix armadillo macro expansions (#5268) * fix armadillo macro expansions - most compilers `#define linux 1` - armadillo does raw pasting of include directories in code - this means macro expansion of `linux-x86_64` -> `1-x86_64` - new version, previous download url seems broken - lib64 instead of lib? - needs verification, was required for intel, works for others * flake8: two spaces is modules, one for classes * add some explanation of how the patch works * use p1 patch file with -U0 to prepend undef linux * armadillo v8.100.1 --- var/spack/repos/builtin/packages/armadillo/package.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'var/spack/repos/builtin/packages/armadillo/package.py') diff --git a/var/spack/repos/builtin/packages/armadillo/package.py b/var/spack/repos/builtin/packages/armadillo/package.py index 2658171925..71f72ac7e6 100644 --- a/var/spack/repos/builtin/packages/armadillo/package.py +++ b/var/spack/repos/builtin/packages/armadillo/package.py @@ -33,6 +33,9 @@ class Armadillo(CMakePackage): homepage = "http://arma.sourceforge.net/" url = "http://sourceforge.net/projects/arma/files/armadillo-7.200.1.tar.xz" + version('8.100.1', 'd9762d6f097e0451d0cfadfbda295e7c') + version('7.950.1', 'c06eb38b12cae49cab0ce05f96147147') + # NOTE: v7.900.1 download url seems broken is no v7.950.1? version('7.900.1', '5ef71763bd429a3d481499878351f3be') version('7.500.0', '7d316fdf3c3c7ea92b64704180ae315d') version('7.200.2', 'b21585372d67a8876117fd515d8cf0a2') @@ -47,11 +50,17 @@ class Armadillo(CMakePackage): depends_on('superlu@5.2:') depends_on('hdf5', when='+hdf5') + # Adds an `#undef linux` to prevent preprocessor expansion of include + # directories with `linux` in them getting transformed into a 1. + # E.g. `/path/linux-x86_64/dir` -> `/path/1-x86_64/dir` if/when a linux + # platform's compiler is adding `#define linux 1`. + patch('undef_linux.patch', when='platform=linux') + def cmake_args(self): spec = self.spec arpack = find_libraries('libarpack', root=spec[ - 'arpack-ng'].prefix.lib, shared=True) + 'arpack-ng'].prefix.lib64, shared=True) superlu = find_libraries('libsuperlu', root=spec[ 'superlu'].prefix, shared=False, recurse=True) return [ -- cgit v1.2.3-60-g2f50