/
Portfile
99 lines (84 loc) · 3.86 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup github 1.0
PortGroup cmake 1.1
PortGroup legacysupport 1.1
github.setup symengine symengine 0.9.0 v
revision 0
categories math science
license MIT
maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description a fast symbolic manipulation library
long_description ${name} is {*}${description}, written in C++.
checksums rmd160 2f7dcd8cc26281ccefcff1cdce9958fba24992f8 \
sha256 4d5237fd10a95655ea58a1fdb8d90a85fbf4f76562020d662109f8d5445c8418 \
size 878683
# LLVM_MINIMUM_REQUIRED_VERSION is set to 3.8
# see https://github.com/symengine/symengine/blob/master/CMakeLists.txt
# mimic LLVM requirements uses by MacPorts base
# see https://github.com/macports/macports-ports/blob/master/_resources/port1.0/compilers/clang_compilers.tcl
if {${os.major} >= 11 || ${os.platform} ne "darwin"} {
set llvm_version 15
} elseif {${os.major} >= 10} {
set llvm_version 11
} elseif {${os.major} >= 9} {
set llvm_version 7.0
} else {
set llvm_version none
}
if {${configure.build_arch} in [list ppc ppc64]} {
# PowerPC systems prefer GCC compilers
set llvm_version none
}
compiler.cxx_standard 2014
depends_lib-append port:gmp \
port:mpfr \
port:libmpc \
port:flint
if {${llvm_version} ne "none"} {
depends_lib-append port:llvm-${llvm_version}
}
if {[variant_isset debug]} {
cmake.build_type Debug
} else {
cmake.build_type Release
}
# symengine sets its own optimization flags
configure.optflags
configure.args-append -DBUILD_SHARED_LIBS=ON \
-DBUILD_FOR_DISTRIBUTION=ON \
-DBUILD_TESTS=OFF \
-DBUILD_BENCHMARKS=OFF
# see https://github.com/symengine/symengine/blob/master/README.md#recommended-options-to-build
configure.args-append -DWITH_GMP=ON \
-DWITH_MPFR=ON \
-DWITH_MPC=ON \
-DINTEGER_CLASS=flint
if {${llvm_version} ne "none"} {
configure.args-append -DWITH_LLVM=ON
} else {
configure.args-append -DWITH_LLVM=OFF
}
configure.args-append -DWITH_SYMENGINE_THREAD_SAFE=ON
# see https://github.com/symengine/symengine/issues/1671
configure.args-append -DWITH_COTIRE=OFF
# use MP's clang based on above LLVM version for consistency with used includes/libs
if {${llvm_version} ne "none"} {
compiler.blacklist clang *gcc*
compiler.fallback macports-clang-${llvm_version}
compiler.whitelist macports-clang-${llvm_version}
cmake.module_path-append ${prefix}/libexec/llvm-${llvm_version}/lib/cmake/llvm
}
# mirrors setings in llvm-11
legacysupport.use_static yes
legacysupport.newest_darwin_requires_legacy 13
if {${configure.build_arch} in [list i386 ppc] && [string match *gcc* ${configure.compiler}]} {
# ___atomic_store_8
configure.ldflags-append -latomic
}
variant tests description {Enable tests} {
test.run yes
configure.args-replace -DBUILD_TESTS=OFF \
-DBUILD_TESTS=ON
test.args-append DYLD_LIBRARY_PATH=${cmake.build_dir}/symengine
}