Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sage
Path: blob/develop/subprojects/packagefiles/singular/factory/meson.build
6381 views
1
# Dependencies
2
gmp = dependency('gmp', required: true)
3
flint = dependency('flint', required: true)
4
ntl = dependency('ntl', required: false)
5
6
# Configuration data
7
fs = import('fs')
8
gen_headers = []
9
conf = configuration_data()
10
# Use no streamio (C++)
11
has_iostream_h = cpp.has_header('iostream.h')
12
conf.set('NOSTREAMIO', not has_iostream_h)#, 'strstream.h', 'fstream.h', 'iostream', 'string', 'fstream', 'ctype.h'))
13
conf.set('HAVE_IOSTREAM_H', has_iostream_h)
14
conf.set('FACTORYVERSION', meson.project_version())
15
factory_configuration = '@0@ in @1@'.format(meson.project_version(), meson.project_source_root())
16
conf.set_quoted('FACTORYCONFIGURATION', factory_configuration)
17
18
gen_headers += fs.copyfile('factory.template', 'factory.h')#, install: true, install_dir: 'factory')
19
gen_headers += fs.copyfile('factoryconf.template', 'factoryconf.h')#, install: true, install_dir: 'factory')
20
21
# https://mesonbuild.com/Wrap-best-practices-and-tips.html#do-not-put-configh-in-external-search-path
22
#subdir('internal')
23
gen_headers += configure_file(
24
output: 'config.h',
25
configuration: conf
26
)
27
28
internal_inc = include_directories('internal')
29
30
# Include directories
31
inc_dirs = [include_directories('include', 'include/factory', '.'), src, internal_inc]
32
33
# Compiler flags
34
cpp_args = [
35
'-DFACTORY_BUILDING_DLL',
36
]
37
38
# Source files
39
sources = files(
40
'canonicalform.cc',
41
'cf_algorithm.cc',
42
'cf_char.cc',
43
'cfCharSets.cc',
44
'cfCharSetsUtil.cc',
45
'cf_chinese.cc',
46
'cf_cyclo.cc',
47
'cf_eval.cc',
48
'cfEzgcd.cc',
49
'cf_factor.cc',
50
'cf_factory.cc',
51
'cf_gcd.cc',
52
'cfGcdAlgExt.cc',
53
'cfGcdUtil.cc',
54
'cf_generator.cc',
55
'cf_globals.cc',
56
'cf_hnf.cc',
57
'cf_inline.cc',
58
'cf_irred.cc',
59
'cf_iter.cc',
60
'cf_iter_inline.cc',
61
'cf_linsys.cc',
62
'cf_map.cc',
63
'cf_map_ext.cc',
64
'cfModGcd.cc',
65
'cfNewtonPolygon.cc',
66
'cfNTLzzpEXGCD.cc',
67
'cfModResultant.cc',
68
'cf_ops.cc',
69
'cf_primes.cc',
70
'cf_random.cc',
71
'cf_resultant.cc',
72
'cf_reval.cc',
73
'cfSubResGcd.cc',
74
'cf_switches.cc',
75
'cf_util.cc',
76
'cf_binom.cc',
77
'cfUnivarGcd.cc',
78
'cf_roots.cc',
79
'debug.cc',
80
'DegreePattern.cc',
81
'ExtensionInfo.cc',
82
'facAbsBiFact.cc',
83
'facAbsFact.cc',
84
'facAlgExt.cc',
85
'facAlgFunc.cc',
86
'facAlgFuncUtil.cc',
87
'facBivar.cc',
88
'facFactorize.cc',
89
'fac_sqrfree.cc',
90
'fac_util.cc',
91
'fac_berlekamp.cc',
92
'fac_cantzass.cc',
93
'fac_univar.cc',
94
'fac_multivar.cc',
95
'fac_multihensel.cc',
96
'fac_iterfor.cc',
97
'fac_distrib.cc',
98
'facFqBivar.cc',
99
'facFqBivarUtil.cc',
100
'facFqFactorize.cc',
101
'facFqFactorizeUtil.cc',
102
'facFqSquarefree.cc',
103
'facHensel.cc',
104
'facIrredTest.cc',
105
'facMul.cc',
106
'facSparseHensel.cc',
107
'ffops.cc',
108
'FLINTconvert.cc',
109
'gf_tabutil.cc',
110
'gfops.cc',
111
'imm.cc',
112
'int_cf.cc',
113
'int_int.cc',
114
'int_intdiv.cc',
115
'int_poly.cc',
116
'int_rat.cc',
117
'int_pp.cc',
118
'variable.cc',
119
'NTLconvert.cc',
120
'singext.cc',
121
'parseutil.cc',
122
'ftmpl_inst.cc',
123
'threadsupport.cc',
124
)
125
126
# Library
127
libfactory = static_library(
128
'factory',
129
sources, gen_headers,
130
include_directories: inc_dirs,
131
dependencies: [gmp, flint, ntl],
132
cpp_args: cpp_args,
133
install: true,
134
)
135
136
# Executable for generating GF(q)-tables
137
# gengftables = executable(
138
# 'gengftables',
139
# 'gengftables-conway.cc',
140
# include_directories: inc_dirs,
141
# dependencies: [gmp, flint, ntl],
142
# install: true,
143
# )
144
145
# # Test program
146
# test_prog = executable(
147
# 'test_prog',
148
# 'test.cc',
149
# include_directories: inc_dirs,
150
# dependencies: [gmp, flint, ntl],
151
# install: false,
152
# )
153
154
# test('factory test', test_prog)
155
156
# Install headers
157
install_headers(
158
[
159
'cf_assert.h',
160
'canonicalform.h',
161
'cf_algorithm.h',
162
'cfCharSets.h',
163
'cfCharSetsUtil.h',
164
'cf_cyclo.h',
165
'cf_defs.h',
166
'cf_eval.h',
167
'cfEzgcd.h',
168
'cf_factory.h',
169
'cf_generator.h',
170
'cf_globals.h',
171
'cfGcdAlgExt.h',
172
'cfGcdUtil.h',
173
'cf_hnf.h',
174
'cf_irred.h',
175
'cf_iter.h',
176
'cf_map.h',
177
'cf_map_ext.h',
178
'cfModGcd.h',
179
'cfNewtonPolygon.h',
180
'cfNTLzzpEXGCD.h',
181
'cfModResultant.h',
182
'cf_primes.h',
183
'cf_primetab.h',
184
'cf_random.h',
185
'cf_reval.h',
186
'cfSubResGcd.h',
187
'cf_switches.h',
188
'cf_util.h',
189
'cf_binom.h',
190
'cfUnivarGcd.h',
191
'cf_roots.h',
192
'debug.h',
193
'DegreePattern.h',
194
'ExtensionInfo.h',
195
'facAbsBiFact.h',
196
'facAbsFact.h',
197
'facAlgExt.h',
198
'facAlgFunc.h',
199
'facAlgFuncUtil.h',
200
'facBivar.h',
201
'facFactorize.h',
202
'fac_sqrfree.h',
203
'fac_util.h',
204
'fac_berlekamp.h',
205
'fac_cantzass.h',
206
'fac_univar.h',
207
'fac_multivar.h',
208
'fac_multihensel.h',
209
'fac_iterfor.h',
210
'fac_distrib.h',
211
'facFqBivar.h',
212
'facFqBivarUtil.h',
213
'facFqFactorize.h',
214
'facFqFactorizeUtil.h',
215
'facFqSquarefree.h',
216
'facHensel.h',
217
'facIrredTest.h',
218
'facMul.h',
219
'facSparseHensel.h',
220
'ffops.h',
221
'FLINTconvert.h',
222
'gf_tabutil.h',
223
'gfops.h',
224
'gmpext.h',
225
'imm.h',
226
'int_cf.h',
227
'int_int.h',
228
'int_poly.h',
229
'int_rat.h',
230
'int_pp.h',
231
'timing.h',
232
'variable.h',
233
'NTLconvert.h',
234
'singext.h',
235
'parseutil.h',
236
],
237
subdir: 'factory',
238
)
239
240
# Install GF(q)-tables
241
gftables = [
242
'gftables/10201', 'gftables/1024', 'gftables/10609', 'gftables/11449',
243
'gftables/11881', 'gftables/121', 'gftables/12167', 'gftables/125',
244
'gftables/12769', 'gftables/128', 'gftables/1331', 'gftables/1369',
245
'gftables/14641', 'gftables/15625', 'gftables/16', 'gftables/16129',
246
'gftables/16384', 'gftables/16807', 'gftables/1681', 'gftables/169',
247
'gftables/17161', 'gftables/1849', 'gftables/18769', 'gftables/19321',
248
'gftables/19683', 'gftables/2048', 'gftables/2187', 'gftables/2197',
249
'gftables/2209', 'gftables/22201', 'gftables/22801', 'gftables/2401',
250
'gftables/243', 'gftables/24389', 'gftables/24649', 'gftables/25',
251
'gftables/256', 'gftables/26569', 'gftables/27', 'gftables/27889',
252
'gftables/2809', 'gftables/28561', 'gftables/289', 'gftables/29791',
253
'gftables/29929', 'gftables/3125', 'gftables/32', 'gftables/32041',
254
'gftables/32761', 'gftables/32768', 'gftables/343', 'gftables/3481',
255
'gftables/361', 'gftables/36481', 'gftables/3721', 'gftables/37249',
256
'gftables/38809', 'gftables/39601', 'gftables/4', 'gftables/4096',
257
'gftables/44521', 'gftables/4489', 'gftables/49', 'gftables/4913',
258
'gftables/49729', 'gftables/5041', 'gftables/50653', 'gftables/512',
259
'gftables/51529', 'gftables/52441', 'gftables/529', 'gftables/5329',
260
'gftables/54289', 'gftables/57121', 'gftables/58081', 'gftables/59049',
261
'gftables/6241', 'gftables/625', 'gftables/63001', 'gftables/64',
262
'gftables/6561', 'gftables/6859', 'gftables/6889', 'gftables/729',
263
'gftables/7921', 'gftables/8', 'gftables/81', 'gftables/8192',
264
'gftables/841', 'gftables/9', 'gftables/9409', 'gftables/961',
265
]
266
267
install_data(gftables, install_dir: join_paths(get_option('datadir'), 'factory/gftables'))
268
269
# Pkg-config file
270
# pkgconfig = import('pkgconfig')
271
# pkgconfig.generate(
272
# name: 'factory',
273
# description: 'Factory library',
274
# version: '0.1.0',
275
# libraries: libfactory,
276
# subdirs: 'factory',
277
# install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
278
# )
279
280
factory_dep = declare_dependency(
281
include_directories: [include_directories('.', 'include'), src],
282
link_with: libfactory,
283
dependencies: [gmp, flint, ntl],
284
sources: gen_headers,
285
)
286
287