Skip to content

Update flex package url's and versions#2384

Merged
becker33 merged 3 commits intospack:developfrom
krafczyk:update/flex
Nov 22, 2016
Merged

Update flex package url's and versions#2384
becker33 merged 3 commits intospack:developfrom
krafczyk:update/flex

Conversation

@krafczyk
Copy link
Copy Markdown
Contributor

The old sourceforge page for flex is now defunct. While version 2.6.0
still downloads fine, later versions are no longer hosted there.
Development continues on github. I've adjusted urls to point to this
new location.

In addition, from 2.6.0 onwards, a new naming scheme for releases seems
to have been adopted. I've created a url_for_version function to sort
this out.

The old sourceforge page for flex is now defunct. While version 2.6.0
still downloads fine, later versions are no longer hosted there.
Development continues on github. I've adjusted urls to point to this
new location.

In addition, from 2.6.0 onwards, a new naming scheme for releases seems
to have been adopted. I've created a url_for_version function to sort
this out.
@adamjstewart
Copy link
Copy Markdown
Member

adamjstewart commented Nov 22, 2016

Looks good! Can you move your url_for_version function to just before install? We like to keep class methods at the end of the class. Actually, if you replace:

class Flex(Package):

with

class Flex(AutotoolsPackage):

you should be able to get rid of the install method altogether.

@krafczyk
Copy link
Copy Markdown
Contributor Author

I've done this, but I'm getting the following error from the AutotoolsPackage:

==> Fetching https://github.com/westes/flex/archive/v2.6.2.tar.gz
######################################################################## 100.0%
==> Staging archive: /home/matthew/Software/NCSA/Vertical/spack/spack-dev-2/var/spack/stage/flex-2.6.2-73ae4w64tdnctwhhwkr26s772mpa7ypi/v2.6.2.tar.gz
==> Created stage in /home/matthew/Software/NCSA/Vertical/spack/spack-dev-2/var/spack/stage/flex-2.6.2-73ae4w64tdnctwhhwkr26s772mpa7ypi
==> Ran patch() for flex
==> Building flex [AutotoolsPackage]
==> Executing phase : 'autoreconf'
==> Error: RuntimeError: configure script not found in /tmp/matthew/spack-stage/spack-stage-LxdPUJ/flex-2.6.2
/home/matthew/Software/NCSA/Vertical/spack/spack-dev-2/lib/spack/spack/build_systems/autotools.py:137, in is_configure_or_die:
     131      @PackageBase.sanity_check('autoreconf')
     132      def is_configure_or_die(self):
     133          """Checks the presence of a `configure` file after the
     134          autoreconf phase"""
     135          if not os.path.exists('configure'):
     136              raise RuntimeError(
  >> 137                  'configure script not found in {0}'.format(os.getcwd()))

Also move the url_for_version function to the end of the package
definition.
@davydden
Copy link
Copy Markdown
Member

I've done this, but I'm getting the following error from the AutotoolsPackage:

strange. @alalazo any clues?

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Nov 22, 2016

@davydden I'll try to have a look asap

@adamjstewart
Copy link
Copy Markdown
Member

The problem is that the latest tarball doesn't have a configure script in it. You'll have to generate one if you want to build from GitHub source. I don't think it's related to the switch to AutotoolsPackage.

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Nov 22, 2016

@adamjstewart Well, in that case the error message is right:

Error: RuntimeError: configure script not found in /tmp/matthew/spack-stage/spack-stage-LxdPUJ/flex-2.6.2

@krafczyk see swiftsim for an example on how to override the autoreconf stage to actually do something. You need to depend_on autotools package, type=build.

@krafczyk
Copy link
Copy Markdown
Contributor Author

@alalzo I've implemented the necessary changes and now flex builds properly. I'm a bit confused however why the AutotoolPackage doesn't try this type of autoreconf automatically. In my experience, almost all autotool packages which lack a configure do contain an autogen.sh script. You should be able to override this for the odd package or two, but I feel like a reasonable default action should be attempted.

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Nov 22, 2016

@krafczyk The problem is adding on the fly build dependencies if configure is not found. autogen.sh will most likely do something like autoreconf -ivf and for that you need to:

depends_on('autotools',  type='build')

When we merged build system support the consensus was on minimizing dependencies over providing automation for this case.

An alternative would be to have autotools dependency coded in AutotoolsPackage even for packages that don't need it, but for that we lack support for having depends_on directives in base classes that reside in modules other than the package under install (check the directive module if you want to see the black-magic that powers directive).

@adamjstewart
Copy link
Copy Markdown
Member

@citibeth has also proposed always running autoreconf for Autotools packages. One of the reasons we don't currently do it is because it would mean every Autotools package would need to depend on autoconf/automake/libtool/m4.

##############################################################################
from spack import *


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Flake8 tests are crashing because you deleted this empty line. There should be 2 blank lines after an import statement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the previous commit to correct this. 883d5c5 is now the most recent commit.

@davydden davydden added the ready label Nov 22, 2016
@becker33 becker33 merged commit 1fbe67a into spack:develop Nov 22, 2016
@krafczyk krafczyk deleted the update/flex branch November 22, 2016 22:57
citibeth pushed a commit to citibeth/spack that referenced this pull request Dec 4, 2016
* Update flex package url's and versions

The old sourceforge page for flex is now defunct. While version 2.6.0
still downloads fine, later versions are no longer hosted there.
Development continues on github. I've adjusted urls to point to this
new location.

In addition, from 2.6.0 onwards, a new naming scheme for releases seems
to have been adopted. I've created a url_for_version function to sort
this out.

* Change flex to an AutotoolsPackage

Also move the url_for_version function to the end of the package
definition.

* Implement the autoreconf function for flex
@krafczyk krafczyk mentioned this pull request Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants