2024-01-02 16:21:30 +08:00
|
|
|
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2017-12-21 11:10:24 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2022-08-27 04:29:44 +08:00
|
|
|
from os import symlink
|
|
|
|
|
2022-05-29 00:55:44 +08:00
|
|
|
from spack.package import *
|
2017-12-21 11:10:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
class Fasttree(Package):
|
|
|
|
"""FastTree infers approximately-maximum-likelihood phylogenetic
|
2022-04-11 17:39:50 +08:00
|
|
|
trees from alignments of nucleotide or protein sequences.
|
|
|
|
"""
|
2017-12-21 11:10:24 +08:00
|
|
|
|
|
|
|
homepage = "http://www.microbesonline.org/fasttree"
|
2022-04-11 17:39:50 +08:00
|
|
|
url = "http://www.microbesonline.org/fasttree/FastTree-2.1.10.c"
|
2023-02-02 13:07:25 +08:00
|
|
|
maintainers("snehring")
|
2017-12-21 11:10:24 +08:00
|
|
|
|
2022-09-20 02:07:51 +08:00
|
|
|
version(
|
|
|
|
"2.1.11",
|
|
|
|
sha256="9026ae550307374be92913d3098f8d44187d30bea07902b9dcbfb123eaa2050f",
|
|
|
|
expand=False,
|
|
|
|
url="http://www.microbesonline.org/fasttree/FastTree-2.1.11.c",
|
|
|
|
)
|
2019-10-11 13:44:41 +08:00
|
|
|
version(
|
|
|
|
"2.1.10",
|
|
|
|
sha256="54cb89fc1728a974a59eae7a7ee6309cdd3cddda9a4c55b700a71219fc6e926d",
|
|
|
|
expand=False,
|
|
|
|
url="http://www.microbesonline.org/fasttree/FastTree-2.1.10.c",
|
|
|
|
)
|
2017-12-21 11:10:24 +08:00
|
|
|
|
2022-08-27 04:29:44 +08:00
|
|
|
variant("openmp", default=True, description="Add openmp support to Fasttree.")
|
|
|
|
|
2022-04-11 17:39:50 +08:00
|
|
|
def install(self, spec, prefix):
|
2017-12-21 11:10:24 +08:00
|
|
|
cc = Executable(spack_cc)
|
2022-08-27 04:29:44 +08:00
|
|
|
if "+openmp" in self.spec:
|
|
|
|
cc(
|
|
|
|
"-O3",
|
|
|
|
self.compiler.openmp_flag,
|
|
|
|
"-DOPENMP",
|
|
|
|
"-finline-functions",
|
|
|
|
"-funroll-loops",
|
|
|
|
"-Wall",
|
|
|
|
"-oFastTree",
|
|
|
|
"FastTree-" + format(spec.version.dotted) + ".c",
|
|
|
|
"-lm",
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
cc(
|
|
|
|
"-O3",
|
|
|
|
"-finline-functions",
|
|
|
|
"-funroll-loops",
|
|
|
|
"-Wall",
|
|
|
|
"-oFastTree",
|
|
|
|
"FastTree-" + format(spec.version.dotted) + ".c",
|
|
|
|
"-lm",
|
|
|
|
)
|
|
|
|
|
2017-12-21 11:10:24 +08:00
|
|
|
mkdir(prefix.bin)
|
2022-08-27 04:29:44 +08:00
|
|
|
install("FastTree", prefix.bin)
|
|
|
|
|
|
|
|
@run_after("install")
|
|
|
|
def create_fasttree_mp_symlink(self):
|
|
|
|
with working_dir(prefix.bin):
|
|
|
|
if "+openmp" in self.spec:
|
|
|
|
symlink("FastTree", "FastTreeMP")
|