Skip to content

geant4: new version 10.6 plus simplifications#15447

Merged
drbenmorgan merged 9 commits intospack:developfrom
drbenmorgan:update-geant4
Mar 31, 2020
Merged

geant4: new version 10.6 plus simplifications#15447
drbenmorgan merged 9 commits intospack:developfrom
drbenmorgan:update-geant4

Conversation

@drbenmorgan
Copy link
Copy Markdown
Member

This is a fairly major refactor and simplification of Geant4 and its associated data packages, and will changes hashes of previous installs. I think this is worthwhile for long term maintenance of the package, so this PR is "Draft" for now to get early eyes on it and discuss with interested parties.

The primary change is the removal of the data variant so the physics model data packages are always installed by the g4XXX packages, then used by Geant4 itself through the geant4-data package. geant4-data is now a BundlePackage whose version maps to that of geant4 and depends on the g4XXX packages at the exact versions the geant4 version supports. It creates a "view" (more on that later) of the data so Geant4's install mechanisms sees a single directory. Each g4XXX package also now sets the appropriate runtime environment.

I believe removal of the data variant is worthwhile as the external data is platform/arch independent, so really benefits reuse and reducing install sizes.

The second breaking change is to move the versioning to "standard" semantic versioning, so 10.6.0 rather than 10.06.p00. This is just to make the packaging cleaner and simple, plus the use of the Geant4 GitLab repo.

The remainder of the updates are pure simplification and cleanup.

One potential issue to look at is the "view" creation in geant4-data. All this does is create a directory <prefix>/share/geant4-data-<version>/ and create symlinks in that to the g4xxx data directories. That works, and Geant4's seems fine with it. However, if a spack environment/view is created and geant4-data installed in this, the symlinks under <viewprefix>/share/geant4-data-<version>/ are created as normal but empty directories.

I'm not sure this is critical as the environment variables needed by Geant4 are set correctly, but feels like I've missed something.

@drbenmorgan
Copy link
Copy Markdown
Member Author

It would also be best to wait for @sethrj 's #14520 on vecgeom to be merged so we can take advantage of it for that dependence.

Copy link
Copy Markdown
Member

@ChristianTackeGSI ChristianTackeGSI left a comment

Choose a reason for hiding this comment

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

Going to look at the geant4/geant4-data part tomorrow.

Comment on lines +27 to +28
def setup_dependent_run_environment(self, env, dependent_spec):
install_path = join_path(prefix.share, 'data', 'G4ABLA{0}'
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.

Does this actually work?
Where is just prefix set?

Could you try this?

Suggested change
def setup_dependent_run_environment(self, env, dependent_spec):
install_path = join_path(prefix.share, 'data', 'G4ABLA{0}'
def setup_dependent_run_environment(self, env, dependent_spec):
install_path = join_path(self.prefix.share.data, 'G4ABLA{0}'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 0d4a05a

Comment on lines +32 to +34
def url_for_version(self, version):
"""Handle version string."""
return ("http://geant4-data.web.cern.ch/geant4-data/datasets/G4INCL.%s.tar.gz" % version) No newline at end of file
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.

Is this really needed? Will the normal version interpolation into url really fail?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Unfortunately yes, due to the use of . between the package name and version, combined with the name including a number. Spack interprets the version as 4INCL.X.Y.

Add new 10.6.0 release, migrating download of source to use Geant4's
public release repo on CERN GitLab. Change versioning scheme to use
clearer and standard semantic scheme.

Update geant4-data and g4XXX data packages with new versions. Migrate
geant4-data as a BundlePackage of the g4XXX packages, installing links
to each under a single directory under share for geant4-data. Ensure
each g4XXX package exports the environment variable pointing to its
location expected by Geant4.

Remove "data" variant from Geant4 package and always use geant4-data.

Simplify cxxstd variant transport to dependencies.
Geant4 major.minor versions have specific dependencies on vecgeom
versions. Add missing vecgeom version for geant4 10.5, and match
version requirements for vecgeom in geant4 depends_on.
@drbenmorgan
Copy link
Copy Markdown
Member Author

Now rebased on develop and added an additional vecgeom version needed by Geant4 10.5. I just need to test locally and tidy up the options, then this'll be ready for final review/test.

@drbenmorgan drbenmorgan marked this pull request as ready for review March 24, 2020 12:32
@drbenmorgan
Copy link
Copy Markdown
Member Author

O.k., I've done basic install tests and defaults seem to work fine. I think this is ready for final review checks and tests.

Copy link
Copy Markdown
Member

@ChristianTackeGSI ChristianTackeGSI left a comment

Choose a reason for hiding this comment

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

Looks good.
I didn't test it yet.

url = url + 'ReleaseNotes4.{0}.{1}.html'.format(version[0], version[1])
return url
for s in spec.dependencies():
for d in glob.glob('{0}/share/data/*'.format(s.prefix)):
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.

Maybe use s.prefix.share to be more consistent with the rest of the patch?


# install the data with geant4
datadir = spec['geant4-data'].prefix.share
dataver = 'geant4-data-{0}'.format(spec['geant4-data'].version)
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.

Maybe to be consistent with the setup in geant4-data?

Suggested change
dataver = 'geant4-data-{0}'.format(spec['geant4-data'].version)
dataver = '{0}-{1}'.format(spec['geant4-data']..name, spec['geant4-data'].version.dotted)

Also I wonder, if geant4-data could have a property/value that could be used here?

@ChristianTackeGSI
Copy link
Copy Markdown
Member

Looking at python's def command(self) maybe this can be done on the geant-data class:

    @property
    def geant4_datadir(self):
        verdir = '{0}-{1}'.format(self.name, self.version.dotted)
        return join_path(self.prefix.share, 'data', verdir)

UNTESTED!

@drbenmorgan
Copy link
Copy Markdown
Member Author

Thanks @ChristianTackeGSI and @sethrj for the review! I think I've addressed these in the latest commits, so barring flake8 errors and any further comments, I think this is good for merge.

@drbenmorgan
Copy link
Copy Markdown
Member Author

Whilst the coverage checks are failing, the changes in this PR aren't (at least obviously) touching Spack's core, which the coverage handles (thanks to @alalazo for the info). I'm going to merge in this case (and I'm maintainer of these packages, so I'll get pinged if there are issues!).

@drbenmorgan drbenmorgan merged commit 77e1384 into spack:develop Mar 31, 2020
jedbrown added a commit that referenced this pull request Mar 31, 2020
* origin/develop:
  packages.yaml: allow virtuals to specify buildable: false (#14934)
  GMT: add 6.0.0 (#15785)
  autoconf-archive: add new package (#15782)
  JasPer: add 2.0.16 (#15781)
  Update link for codecov's browser extensions (#15779)
  geant4: new version 10.6 plus simplifications (#15447)
  ppOpen-APPL/FVM: new package. (#15772)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants