From f068d1ba57518d9fcaa0c03ce0f483ec7f2b49f3 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Sat, 26 Sep 2015 10:12:24 +0200 Subject: GCC : added variants for libelf, binutils, isl. gcc@5.0: still has issues --- var/spack/packages/gcc/package.py | 57 ++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index 5e3d1a3efa..925c9d35ce 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -42,15 +42,19 @@ class Gcc(Package): version('4.7.4', '4c696da46297de6ae77a82797d2abe28') version('4.6.4', 'b407a3d1480c11667f293bfb1f17d1a4') version('4.5.4', '27e459c2566b8209ab064570e1b378f7') + + variant('binutils', default=False, description='Add a dependency on binutils') + variant('libelf', default=False, description='Add a dependency on libelf') + variant('isl', default=True, description='Add a dependency on isl') depends_on("mpfr") depends_on("gmp") depends_on("mpc") # when @4.5: - depends_on("libelf") - depends_on("binutils") + depends_on("libelf", when='+libelf') + depends_on("binutils",when="+binutils") # Save these until we can do optional deps. - #depends_on("isl") + depends_on("isl", when='@5.0:+isl') #depends_on("ppl") #depends_on("cloog") @@ -62,23 +66,38 @@ class Gcc(Package): if spec.satisfies("@4.7.1:"): enabled_languages.add('go') + # Generic options to compile GCC + options = ["--prefix=%s" % prefix, + "--libdir=%s/lib64" % prefix, + "--disable-multilib", + "--enable-languages=" + ','.join(enabled_languages), + "--with-mpc=%s" % spec['mpc'].prefix, + "--with-mpfr=%s" % spec['mpfr'].prefix, + "--with-gmp=%s" % spec['gmp'].prefix, + "--enable-lto", + "--with-gnu-ld", + "--with-gnu-as", + "--with-quad"] + # Libelf + if '+libelf' in spec: + libelf_options = ["--with-libelf=%s" % spec['libelf'].prefix] + options.extend(libelf_options) + + # Binutils + if '+binutils' in spec: + binutils_options = ["--with-stage1-ldflags=%s" % self.rpath_args, + "--with-boot-ldflags=%s" % self.rpath_args, + "--with-ld=%s/bin/ld" % spec['binutils'].prefix, + "--with-as=%s/bin/as" % spec['binutils'].prefix] + options.extend(binutils_options) + + # Isl + if spec.satisfies('@5.0:+isl'): + isl_options = ["--with-isl=%s" % spec['isl'].prefix] + options.extend(isl_options) + # Rest of install is straightforward. - configure("--prefix=%s" % prefix, - "--libdir=%s/lib64" % prefix, - "--disable-multilib", - "--enable-languages=" + ','.join(enabled_languages), - "--with-mpc=%s" % spec['mpc'].prefix, - "--with-mpfr=%s" % spec['mpfr'].prefix, - "--with-gmp=%s" % spec['gmp'].prefix, - "--with-libelf=%s" % spec['libelf'].prefix, - "--with-stage1-ldflags=%s" % self.rpath_args, - "--with-boot-ldflags=%s" % self.rpath_args, - "--enable-lto", - "--with-gnu-ld", - "--with-ld=%s/bin/ld" % spec['binutils'].prefix, - "--with-gnu-as", - "--with-as=%s/bin/as" % spec['binutils'].prefix, - "--with-quad") + configure(*options) make() make("install") -- cgit v1.2.3-60-g2f50 From d44571257a6cf4c236d1aad489f8e6202acbb631 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 6 Oct 2015 15:57:17 +0200 Subject: spec file : everything is dumped, only link rule is modified --- var/spack/packages/gcc/package.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index 925c9d35ce..ddc303bfdb 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -36,8 +36,11 @@ class Gcc(Package): list_url = 'http://open-source-box.org/gcc/' list_depth = 2 + version('5.2.0', 'a51bcfeb3da7dd4c623e27207ed43467') + version('4.9.3', '6f831b4d251872736e8e9cc09746f327') version('4.9.2', '4df8ee253b7f3863ad0b86359cd39c43') version('4.9.1', 'fddf71348546af523353bd43d34919c1') + version('4.8.5', '80d2c2982a3392bb0b89673ff136e223') version('4.8.4', '5a84a30839b2aca22a2d723de2a626ec') version('4.7.4', '4c696da46297de6ae77a82797d2abe28') version('4.6.4', 'b407a3d1480c11667f293bfb1f17d1a4') @@ -120,12 +123,11 @@ class Gcc(Package): gcc = Executable(join_path(self.prefix.bin, 'gcc')) lines = gcc('-dumpspecs', return_output=True).split("\n") - for i, line in enumerate(lines): - if line.startswith("*link:"): - specs_file = join_path(self.spec_dir, 'specs') - with closing(open(specs_file, 'w')) as out: - out.write(lines[i] + "\n") - out.write("-rpath %s/lib:%s/lib64 \\\n" - % (self.prefix, self.prefix)) - out.write(lines[i+1] + "\n") - set_install_permissions(specs_file) + specs_file = join_path(self.spec_dir, 'specs') + with closing(open(specs_file, 'w')) as out: + for line in lines: + if line.startswith("*link:"): + out.write(line + "\n") + out.write("-rpath %s/lib:%s/lib64 \\\n"% (self.prefix, self.prefix)) + out.write(line + "\n") + set_install_permissions(specs_file) -- cgit v1.2.3-60-g2f50 From 17de9a37f1d064e18ff61145196b1cb77ae8b64b Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 6 Oct 2015 18:20:48 +0200 Subject: gcc : fixed spec file --- var/spack/packages/gcc/package.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index ddc303bfdb..3d0f2caff5 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -122,12 +122,11 @@ class Gcc(Package): return gcc = Executable(join_path(self.prefix.bin, 'gcc')) - lines = gcc('-dumpspecs', return_output=True).split("\n") + lines = gcc('-dumpspecs', return_output=True).strip().split("\n") specs_file = join_path(self.spec_dir, 'specs') with closing(open(specs_file, 'w')) as out: for line in lines: + out.write(line + "\n") if line.startswith("*link:"): - out.write(line + "\n") out.write("-rpath %s/lib:%s/lib64 \\\n"% (self.prefix, self.prefix)) - out.write(line + "\n") set_install_permissions(specs_file) -- cgit v1.2.3-60-g2f50 From e6a44bd8ac40bfb93e51a99d3bfde476937207e1 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 22 Oct 2015 15:55:43 +0200 Subject: GCC : removed dependency on libelf. Removed isl variant --- var/spack/packages/gcc/package.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index 0e076f58e5..4088b9f9d4 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -36,6 +36,8 @@ class Gcc(Package): list_url = 'http://open-source-box.org/gcc/' list_depth = 2 + DEPENDS_ON_ISL_PREDICATE = '@5.0:' + version('5.2.0', 'a51bcfeb3da7dd4c623e27207ed43467') version('4.9.3', '6f831b4d251872736e8e9cc09746f327') version('4.9.2', '4df8ee253b7f3863ad0b86359cd39c43') @@ -47,15 +49,14 @@ class Gcc(Package): version('4.5.4', '27e459c2566b8209ab064570e1b378f7') variant('binutils', default=False, description='Add a dependency on binutils') - + depends_on("mpfr") depends_on("gmp") depends_on("mpc") # when @4.5: - depends_on("libelf") depends_on("binutils~libiberty", when="+binutils") # Save these until we can do optional deps. - depends_on("isl", when='@5.0:') + depends_on("isl", when=DEPENDS_ON_ISL_PREDICATE) #depends_on("ppl") #depends_on("cloog") @@ -79,11 +80,6 @@ class Gcc(Package): "--with-gnu-ld", "--with-gnu-as", "--with-quad"] - # Libelf - if '+libelf' in spec: - libelf_options = ["--with-libelf=%s" % spec['libelf'].prefix] - options.extend(libelf_options) - # Binutils if '+binutils' in spec: binutils_options = ["--with-stage1-ldflags=%s" % self.rpath_args, @@ -93,7 +89,7 @@ class Gcc(Package): options.extend(binutils_options) # Isl - if spec.satisfies('@5.0:+isl'): + if spec.satisfies(Gcc.DEPENDS_ON_ISL_PREDICATE): isl_options = ["--with-isl=%s" % spec['isl'].prefix] options.extend(isl_options) -- cgit v1.2.3-60-g2f50 From e812c35689c4bc202ee33a14ac7680d87746e34a Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 23 Oct 2015 10:11:38 +0200 Subject: GCC : removed binutils variant --- var/spack/packages/gcc/package.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index 4088b9f9d4..a49a1348aa 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -48,12 +48,10 @@ class Gcc(Package): version('4.6.4', 'b407a3d1480c11667f293bfb1f17d1a4') version('4.5.4', '27e459c2566b8209ab064570e1b378f7') - variant('binutils', default=False, description='Add a dependency on binutils') - depends_on("mpfr") depends_on("gmp") depends_on("mpc") # when @4.5: - depends_on("binutils~libiberty", when="+binutils") + depends_on("binutils~libiberty") # Save these until we can do optional deps. depends_on("isl", when=DEPENDS_ON_ISL_PREDICATE) @@ -81,13 +79,11 @@ class Gcc(Package): "--with-gnu-as", "--with-quad"] # Binutils - if '+binutils' in spec: - binutils_options = ["--with-stage1-ldflags=%s" % self.rpath_args, - "--with-boot-ldflags=%s" % self.rpath_args, - "--with-ld=%s/bin/ld" % spec['binutils'].prefix, - "--with-as=%s/bin/as" % spec['binutils'].prefix] - options.extend(binutils_options) - + binutils_options = ["--with-stage1-ldflags=%s" % self.rpath_args, + "--with-boot-ldflags=%s" % self.rpath_args, + "--with-ld=%s/bin/ld" % spec['binutils'].prefix, + "--with-as=%s/bin/as" % spec['binutils'].prefix] + options.extend(binutils_options) # Isl if spec.satisfies(Gcc.DEPENDS_ON_ISL_PREDICATE): isl_options = ["--with-isl=%s" % spec['isl'].prefix] -- cgit v1.2.3-60-g2f50