Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-30 07:48:31

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 from spack_repo.builtin.build_systems.makefile import MakefilePackage
0008 
0009 
0010 class Milou(MakefilePackage):
0011     """MILOU is a Monte Carlo generator for deeply virtual
0012     Compton scattering (DVCS)."""
0013 
0014     homepage = "https://gitlab.com/eic/mceg/milou"
0015     url = "https://gitlab.com/eic/mceg/milou"
0016     list_url = "https://gitlab.com/eic/mceg/milou/-/tags"
0017     git = "https://gitlab.com/eic/mceg/milou.git"
0018 
0019     tags = ["eic"]
0020 
0021     version("master", branch="master")
0022 
0023     depends_on("fortran", type="build")
0024 
0025     depends_on("cernlib")
0026     depends_on("pythia6")
0027     # depends_on('jetset')
0028 
0029     def setup_build_environment(self, env):
0030         env.set("EICDIRECTORY", self.spec.prefix)
0031 
0032     def edit(self, spec, prefix):
0033         # ./Makefile
0034         makefile = FileFilter("Makefile")
0035         makefile.filter("BITS = 32", "#BITS = 32")
0036         makefile.filter(r"-m\$\(BITS\) ", "")
0037         makefile.filter(
0038             "CERN_LIBS = .*", "CERN_LIBS = {0}/lib".format(spec["cernlib"].prefix)
0039         )
0040         makefile.filter(
0041             "PYTHIA = .*", "PYTHIA = -L{0}/lib -lPythia6".format(spec["pythia6"].prefix)
0042         )
0043         if spec.satisfies("%gcc@10:"):
0044             makefile.filter("F_FLAGS = -g", "F_FLAGS = -g -fallow-argument-mismatch")
0045         # ./bases51/Makefile
0046         makefile = FileFilter("bases51/Makefile")
0047         makefile.filter("BITS = 32", "#BITS = 32")
0048         makefile.filter(r"-m\$\(BITS\) ", "")
0049         if spec.satisfies("%gcc@10:"):
0050             makefile.filter("F_FLAGS = -g", "F_FLAGS = -g -fallow-argument-mismatch")
0051 
0052     def make(self, spec, prefix):
0053         make()
0054 
0055     def install(self, spec, prefix):
0056         mkdirp(join_path(self.spec.prefix.bin))
0057         make("install")