Skip to content

Commit ec5e4ff

Browse files
authored
Merge pull request #114 from wdconinc/new-package-fluka
[fluka] new package, manual download or mirror reqd
2 parents a8a1851 + a39e479 commit ec5e4ff

File tree

3 files changed

+54
-4
lines changed

3 files changed

+54
-4
lines changed

.github/workflows/build_environments.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
EMPTY=true
1818
JSON="{\"include\":["
1919
for env in ${CHANGED_ENVIRONMENTS} ; do
20-
if [ ! -d $env ] ; then continue ; fi
21-
if [ ! -f $env/spack.yaml ] ; then continue ; fi
20+
if [ ! -d environments/$env ] ; then continue ; fi
21+
if [ ! -f environments/$env/spack.yaml ] ; then continue ; fi
2222
for os in centos7 centos8 ubuntu18.04 ubuntu20.04 ubuntu20.10 ; do
2323
# Add build to the matrix only if it is not already included
2424
JSONline="{\"env\": \"$env\", \"os\": \"$os\"},"

.github/workflows/build_packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
EMPTY=true
1818
JSON="{\"include\":["
1919
for pkg in ${CHANGED_PACKAGES} ; do
20-
if [ ! -d $pkg ] ; then continue ; fi
21-
if [ ! -f $pkg/package.py ] ; then continue ; fi
20+
if [ ! -d packages/$pkg ] ; then continue ; fi
21+
if [ ! -f packages/$pkg/package.py ] ; then continue ; fi
2222
for os in centos7 centos8 ubuntu18.04 ubuntu20.04 ubuntu20.10 ; do
2323
# Add build to the matrix only if it is not already included
2424
JSONline="{\"pkg\": \"$pkg\", \"os\": \"$os\"},"

packages/fluka/package.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from spack import *
2+
import os
3+
import tarfile
4+
5+
6+
class Fluka(Package):
7+
"""FLUKA is a general purpose Monte Carlo code for the interaction
8+
and transport of hadrons, leptons, and photons from keV (with the
9+
exception of neutrons, tracked down to thermal energies) to cosmic
10+
ray energies in any material.
11+
12+
Note: A manual download is required for FLUKA.
13+
Spack will search your current directory for the download file.
14+
Alternatively, add this file to a mirror so that Spack can find it.
15+
For instructions on how to set up a mirror, see
16+
http://spack.readthedocs.io/en/latest/mirrors.html"""
17+
18+
homepage = "https://fluka.cern"
19+
url = "https://flukafiles.web.cern.ch/flukafiles/fluka-4-1.1/fluka-4-1.1.Linux-gfor9.tgz"
20+
21+
maintainers = ['wdconinc']
22+
23+
version('4.1.1',
24+
sha256='68cc4b81c04fe2d37f4e7ebeb0f8dfd452e1d8558cae8a611a9e1d7a93613f71',
25+
url='file://{0}/fluka-4-1.1.Linux-gfor9.tgz'.format(os.getcwd()))
26+
27+
conflicts('%gcc@:7', when='@4.1.1')
28+
29+
gfor_ver = {
30+
'4.1.1': '9',
31+
}
32+
33+
manual_download = True
34+
35+
def url_for_version(self, version):
36+
url = "https://flukafiles.web.cern.ch/flukafiles/fluka-{0}-{1}.fluka-{0}-{1}.Linux-gfor{2}.tgz"
37+
return url.format(version[0], version[1:], gfor_ver[version])
38+
39+
def install(self, spec, prefix):
40+
with working_dir('src'):
41+
make()
42+
install_tree('bin', prefix.bin)
43+
install_tree('lib', prefix.lib)
44+
install_tree('data', prefix.data)
45+
install_tree('include', prefix.include)
46+
install_tree('doc', join_path(prefix.share, 'doc'))
47+
install_tree('examples', join_path(prefix.share, 'examples'))
48+
for file in ['AUTHORS', 'INSTALL', 'LICENSE', 'REFERENCES',
49+
'RELEASE-NOTES', 'README.md', 'Version.tag']:
50+
install(file, prefix.share)

0 commit comments

Comments
 (0)