Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:15:26

0001 # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
0002 # Spack Project Developers. See the top-level COPYRIGHT file for details.
0003 #
0004 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 
0006 from spack.package import *
0007 
0008 
0009 class Milou(MakefilePackage):
0010     """MILOU is a Monte Carlo generator for deeply virtual
0011     Compton scattering (DVCS)."""
0012 
0013     homepage = "https://gitlab.com/eic/mceg/milou"
0014     url = "https://gitlab.com/eic/mceg/milou"
0015     list_url = "https://gitlab.com/eic/mceg/milou/-/tags"
0016     git = "https://gitlab.com/eic/mceg/milou.git"
0017 
0018     tags = ["eic"]
0019 
0020     version("master", branch="master")
0021 
0022     depends_on("fortran", type="build")
0023 
0024     depends_on("cernlib")
0025     depends_on("pythia6")
0026     # depends_on('jetset')
0027 
0028     def setup_build_environment(self, env):
0029         env.set("EICDIRECTORY", self.spec.prefix)
0030 
0031     def edit(self, spec, prefix):
0032         # ./Makefile
0033         makefile = FileFilter("Makefile")
0034         makefile.filter("BITS = 32", "#BITS = 32")
0035         makefile.filter(r"-m\$\(BITS\) ", "")
0036         makefile.filter(
0037             "CERN_LIBS = .*", "CERN_LIBS = {0}/lib".format(spec["cernlib"].prefix)
0038         )
0039         makefile.filter(
0040             "PYTHIA = .*", "PYTHIA = -L{0}/lib -lPythia6".format(spec["pythia6"].prefix)
0041         )
0042         if spec.satisfies("%gcc@10:"):
0043             makefile.filter("F_FLAGS = -g", "F_FLAGS = -g -fallow-argument-mismatch")
0044         # ./bases51/Makefile
0045         makefile = FileFilter("bases51/Makefile")
0046         makefile.filter("BITS = 32", "#BITS = 32")
0047         makefile.filter(r"-m\$\(BITS\) ", "")
0048         if spec.satisfies("%gcc@10:"):
0049             makefile.filter("F_FLAGS = -g", "F_FLAGS = -g -fallow-argument-mismatch")
0050 
0051     def make(self, spec, prefix):
0052         make()
0053 
0054     def install(self, spec, prefix):
0055         mkdirp(join_path(self.spec.prefix.bin))
0056         make("install")