-
Notifications
You must be signed in to change notification settings - Fork 1
/
readme.html
308 lines (303 loc) · 29 KB
/
readme.html
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!DOCTYPE html>
<!-- saved from url=(0016)http://localhost -->
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="file:///D:\Users\csusie\source\repos\Int128\" />
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="file:///D:\Users\csusie\AppData\Local\Markdown Monster\PreviewThemes\Dharkan\..\scripts\fontawesome\css\font-awesome.min.css" rel="stylesheet" />
<link href="file:///D:\Users\csusie\AppData\Local\Markdown Monster\PreviewThemes\Dharkan\Theme.css" rel="stylesheet" />
<script src="file:///D:\Users\csusie\AppData\Local\Markdown Monster\PreviewThemes\Dharkan\..\scripts\jquery.min.js"></script>
<link href="file:///D:\Users\csusie\AppData\Local\Markdown Monster\PreviewThemes\Dharkan\..\scripts\highlightjs\styles\twilight.css" rel="stylesheet" />
<script src="file:///D:\Users\csusie\AppData\Local\Markdown Monster\PreviewThemes\Dharkan\..\scripts\highlightjs\highlight.pack.js"></script>
<script src="file:///D:\Users\csusie\AppData\Local\Markdown Monster\PreviewThemes\Dharkan\..\scripts\preview.js" id="PreviewScript"></script>
</head>
<body>
<div id="MainContent">
<!-- Markdown Monster Content -->
<h1 id="cjm-numerics-a-fixed-precision-numeric-library-for-c20">CJM Numerics: (a fixed precision numeric library for C++20)</h1>
<p>Copyright © 2020-2021, CJM Screws, LLC</p>
<h2 id="summary">Summary</h2>
<p>This <strong>header-only</strong> library for C++ 20 currently provides an <strong>unsigned 128 bit integer</strong> type suitable for direct use or for extending to make other fixed precision types such as signed two's complement integers, larger signed or unsigned integers, rational numbers or flexible units of measure. The unsigned 128-bit integer is currently feature-complete and extensively tested. Planned future features include a two's complement signed version as well as larger fixed precision integers (256, 512, 1024 bit), up to any arbitrary power of 2 greater than 128. The larger values will be defined via templates. Also being considered are rational numbers and units of measure for distance, area and volume. <em>Please note that this library <strong>requires C++ 20</strong>.</em> <strong>No effort will be made to support older versions of the C++ standard.</strong> <em>If a user does not want to benefit specifically from C++20 features, then other extended precision libraries (such as the ones from which we derived our algorithms) may be a better fit.</em></p>
<h2 id="quick-start">Quick Start</h2>
<p>If you want to use this library now in a well-tested, but unreleased state, there are two quick start guides available.</p>
<ol>
<li><a href="https://github.com/cpsusie/cjm-numerics/blob/main/docs/quick_start_visual_studio/quick_start_install_vs2019.md#cjm-numerics-visual-studio-2019-1928--1693-quick-start-installation-guide">Vcpkg or Manual Installation for Windows and Visual Studio 2019 version 16.9.3+.</a></li>
<li><a href="https://github.com/cpsusie/cjm-numerics/blob/main/docs/quick_start_linux_clion/quick_start_install_linux_clion.md">Vcpkg Installation for Linux with CLion 2020.3.3+ and GCC 10.2.0+ and/or Clang 11.0+.</a></li>
</ol>
<p>There is also a dependency-free example code project found <a href="https://github.com/cpsusie/cjm-numerics/tree/main/example_code/src/uint128_example">here</a> for you to review the functionality.</p>
<p>A <a href="https://github.com/microsoft/vcpkg">vcpkg</a> port is available for this library. You can download it from the most recent Release from this projects <a href="https://github.com/cpsusie/cjm-numerics/releases">Releases page</a> on Github (the 7-zip file under assets). Both quick start guides contain directions for copying the contents of the archive to vcpkg's ports folder. Also, I maintain a <a href="https://github.com/cpsusie/vcpkg">fork of vcpkg</a> (regularly updated from Microsoft's repo) that includes the port without requiring downloading for releases. When this project has a stable release, I will submit a pull request to have this project included in <a href="https://github.com/microsoft/vcpkg">Microsoft's vcpkg repo</a>.</p>
<p>If your system differs significantly from the Quick Start guides (but you have a <code>C++20</code> compiler and standard library that meet's this project's <a href="#compiler--architecture-requirements">requirements</a>), it should not be difficult to install this header-only library if you are familiar with your build system. Essentially, copying the entire contents of <a href="https://github.com/cpsusie/cjm-numerics/tree/main/src/include">/src/include</a> into your system's system library include folder should be sufficient.</p>
<h3 id="library-components">Library Components</h3>
<ol>
<li><strong>Present</strong></li>
</ol>
<ul>
<li><p><em>uint128</em> (in <cjm/numerics/uint128>)</p>
<ul>
<li><p>This is the unsigned 128 bit integer provided by the libary. To use it correctly, you will need all the contents presently under <a href="https://github.com/cpsusie/cjm-numerics/tree/main/src/">src/</a>. The only include you should need to use directly is <code><cjm/numerics/uint128.hpp></code>.</p>
</li>
<li><p>The namespaces you may need to use directly are:</p>
<ul>
<li><code>cjm::numerics</code> (for uint128)</li>
<li><code>cjm::numerics::concepts</code> (to use the concepts provided to extend the library with templates)</li>
<li><code>cjm::numerics::literals</code> (to use the _u128 literal)</li>
</ul>
</li>
<li><p>Do not directly used any namespace called "internal".</p>
</li>
<li><p>Also, <em>until release</em>, do not use anything in any namespace other than the three mentioned above (<code>cjm::numerics</code>, <code>cjm::numerics::concepts</code>, <code>cjm::numerics::literals</code>).</p>
</li>
</ul>
</li>
</ul>
<ol start="2">
<li><strong>Future</strong></li>
</ol>
<p>We plan to always segregate uint128 from future additions in our release packages so it may be used independently. It will serve as the primary building block for other types we include later. We strongly plan on including:</p>
<ol>
<li><p><em>int128</em> (a signed, two's complement version of uint128).</p>
</li>
<li><p><em>fixed_uint</em></p>
<p>A template class that can take a uint128 or another fixed_uint as its template argument to serve as its limb type. We will provide aliases for 256, 512 and 1024 bit variants thereof.</p>
</li>
<li><p><em>fixed_int</em></p>
<p>A signed, two's complement version of fixed_uint.</p>
</li>
</ol>
<p>There are less firm plans to provide:</p>
<ul>
<li><p><em>urational<unsigned_integer TRep></em> an unsigned rational type backed by an unsigned integer (64-bit or uint128 or fixed_uint).</p>
</li>
<li><p><em>rational<unsigned_integer TRep></em> a signed (sign and magnitude) version of urational (but it will use an unsigned integer as its internal representation type).</p>
</li>
<li><p><em>distance</em>: a unit of measure type modeled off of the standard library's <code>std::chrono::duration</code> type.</p>
</li>
</ul>
<h2 id="sources">Sources</h2>
<p>This library does not pretend to contain any non-trivial original algorithms, but rather attempts to package well-known algorithms successfully used by others in a new format with different design goals. This project has drawn most heavily from the unsigned and signed 128-bit provided by abseil.io at <a href="https://github.com/abseil/abseil-cpp/blob/master/absl/numeric/int128.h#L100">abseil's github repository.</a> It also has considered and adopted some of the work of other multiprecision numeric libraries such as the one provided by <a href="https://www.boost.org/doc/libs/1_75_0/libs/multiprecision/doc/html/boost_multiprecision/tut/ints/cpp_int.html">Boost</a>, <a href="https://github.com/calccrypto/uint128_t">calccrypto</a>, <a href="https://github.com/ridiculousfish/libdivide">libdivide</a>, and even <a href="https://github.com/llvm/llvm-project/blob/938d05b814c7fe470201d595afefc02e3371244e/compiler-rt/lib/builtins/udivmodti4.c#L84">Clang's Compiler-Rt</a> itself. Its design goals, however, are sufficiently different to make it a more useful option in certain scenarios.</p>
<h2 id="features--design-principles">Features / Design Principles</h2>
<ol>
<li><strong>Constexpr (nearly) All the Things</strong></li>
</ol>
<p>All or nearly all of the operations provided are constexpr-enabled: only floating point conversions and string parsing are runtime only. Construction, destruction, conversions, assignment, comparisons (including the spaceship operator, ⇔) , +,-,*,/,%, all the bitshifts and bitwise operations are constexpr-enabled.</p>
<ol start="2">
<li><strong>Full (constexpr) Support for hexadecimal and decimal literals, including the separator "'"</strong></li>
</ol>
<p>A constexpr literal operator is provided that allows for the full range of values for an unsigned 128 bit integer whether expressed as a decimal or hexadecimal value. Errors in the literals are always caught at compile time.</p>
<ol start="3">
<li><strong>Use of C++20's std::is_constant_evaluated to provide more efficient code where possible at runtime.</strong></li>
</ol>
<p>Before C++ 20, one often had to choose between constexpr support and the use of efficiency promoting tools like compiler intrinsics. With C++ 20's <a href="https://en.cppreference.com/w/cpp/types/is_constant_evaluated">std::is_constant_evaluated</a> feature, one can detect whether a function or operator is being executed at compile time or runtime and choose the constexpr-friendly or runtime efficient version appropriately.</p>
<ol start="4">
<li><strong>Use of C++20 Concepts to simplify templated functions and types and to describe the intended functionality of an unsigned 128 bit integer in code</strong></li>
</ol>
<p>C++20 concepts make it easier to express expected compile-time interfaces in code. They also make using features like SFINAE to properly choose a correct template function far more readable and accessible to programmers who are not template meta-programming gurus. Finally and perhaps most importantly they make error messages easier to read than they were before. This library makes every effort to constrain all template functions and classes intended for external use -- this both documents the nature of the types expected by the templates and makes it easier to understand error messages.</p>
<ol start="5">
<li><p><strong>Makes reasoanble efforts to exactly like a built-in type wherever possible.</strong></p>
</li>
<li><p><strong>If compiled in an environment that supplies a built-in unsigned 128 bit integer, uses that type to perform calculations and is bit-castable to and from that type.</strong></p>
</li>
<li><p><strong>Sane approach to exceptions.</strong></p>
</li>
</ol>
<p>This library's author is solidly in the <em>exceptions are a beautiful thing</em> camp. Most of the (calculation-based) operations provided, however, are marked <em>noexcept</em> not because of opposition to use of exceptions but, in the interest of efficiency, to avoid runtime checks. This will result, in most cases, in undefined behavior under the same circumstances that a built-in integer would exhibit undefined behavior (e.g. shifting left or right by an amount greater than or equal to std::numeric_limits<UnsignedInteger>::digits). One exception lies with division and modulus operations: these operations are expensive enough by themselves that eschewing a runtime check seems absurd.</p>
<p>Nevertheless, alternatives are provided for performing <strong>unchecked</strong> division/modulus as well as <em>checked</em> division/modulus using <code>std::optional</code> and returning <code>std::nullopt</code> instead of throwing an exception where executing the operation would cause undefined behavior. Similarly, checked (both the throwing and <code>std::optional</code> variety) alternatives are provided for other operations that can exhibit undefined behavior for invalid inputs.</p>
<p>Text related code (e.g. stream insertion and extraction) throws exceptions.</p>
<ol start="8">
<li><p><strong>Stream insertion and extraction operators provided for <em>char</em> and <em>wchar_t</em> assuming use of standard English characters. Experimental support is provided for <em>char8_t</em>, <em>char16_t</em> and <em>char32_t</em>.</strong></p>
</li>
<li><p><strong>The uint128 is <a href="https://en.cppreference.com/w/cpp/numeric/bit_cast">bit-castable</a> provided the requirements for bitcastability are met.</strong></p>
</li>
</ol>
<p>Support is currently present for compilers / standard library implementations that do not yet support bitcasting. In those cases, however, bitcasting is not constexpr even if it would be constexpr with compiler support. When these compilers / standard libraries add bitcasting support, it should be a drop-in replacement. (The library-provided bitcast simply delegates to the standard library version if it is available.). Bitcasting allows easy conversion to and from any type that follows the same bit pattern enabling use with other libraries. Bitcastability requies:</p>
<ul>
<li>The source and destination have the same size,</li>
<li>The source and destination both be <a href="https://en.cppreference.com/w/cpp/named_req/TriviallyCopyable">trivially copyable</a>, and</li>
<li>(if compiler support is not present), the destination type must be <a href="https://en.cppreference.com/w/cpp/types/is_default_constructible">trivially default constructible</a>.</li>
</ul>
<ol start="10">
<li><strong>Uses unsigned 128-bit arithmetic provided by the compiler rather than using its own algorithms on compilers that provide an unsigned 128-bit integer for which they have supplied a specialization for std::numeric_limits.</strong></li>
</ol>
<p>This mostly applies to compilation with GCC or Clang targeting a x64 architecture on a Linux or Linux-like system. Rather than use compiler intrinsics or fallback arithmetic (usable on any conforming compiler and always used in constexpr context), the compiler-provided arithmetic is used. In this way, as the compiler becomes better at providing optimizations, users of this library will be able to take advantage of it.</p>
<ol start="11">
<li><strong>Uses x64 compiler intrinsics when compiled for Windows when:</strong></li>
</ol>
<ul>
<li>targeting an x64 Intel / AMD architecture and</li>
<li>using one of the following compilers targetting x64 Windows:
<ul>
<li>The MSVC Compiler,</li>
<li>The clang compiler (currently version 11) that is supplied with Visual Studio, or</li>
<li>Intel's llvm-based compiler.</li>
</ul>
</li>
</ul>
<ol start="12">
<li><strong>Can use the ADX and BMI2 intrinsic versions for add with carry and extended precision multiplication when these are available.</strong></li>
</ol>
<p>When targetting 64-bit Windows using the MSVC, Clang 11 or Intel-LLVM compiler, you can specify use of adx and bmi2 instrinsics for <a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_addcarryx_u64">add with carry</a> and <a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mulx_u64">extended precision multiplication</a>.</p>
<ol start="13">
<li><strong>Do not support standards earlier than C++20.</strong></li>
</ol>
<p>Looking through the source code of other libraries, much complexity results from attempting to take advantage of features from recent revisions of the C++ standard while providing backwards-compatibility with older versions. If this libary is more successful than I imagine it will be, it may end up that we do the same thing. Our cutoff point, however, is far more recent: <strong>now</strong>. There is enough complexity currently in the code from supporting big and little endian systems, using compiler-supplied uint128 types where available, using compiler extensions and intrinsics where possible, etc. This complexity, however, will be limited to the uint128 and core-arithmetic functionality, which all other additions will use. Heavy reliance on std::is_constant_evaluated and a desire to avoid <em>further</em> complexity therefore suggest <strong>now</strong> as a reasonable cutoff point.</p>
<ol start="14">
<li><strong>No external dependencies except for the standard library and optionally-used compiler intrinsics</strong></li>
</ol>
<p>This project depends only on the C++ standard library and, when it detects certain known compilers and feature sets, compiler extensions and intrinsics. There will be no external dependencies required to use this library.</p>
<p>Please note that this library's <em>unit test</em> application <strong>does</strong> have external dependencies. The <em>unit test</em> application, however, is not part of the library and is not required to use the library.</p>
<ol start="15">
<li><strong>Add possible support for C++20 Modules</strong></li>
</ol>
<p>Support for modules will not be attempted until at least GCC, Clang and Microsoft all provide first-class support for this feature. Currently, only Microsoft provides such full support. Modules will be added if it can be done feasibly without breaking the current, header-only, format option. The header-only format option will continue to be supported at least until the next full revision of the C++ standard is published (expected in 2023).</p>
<ol start="16">
<li><strong>The best way to document intended functionality is in code, via Concepts</strong></li>
</ol>
<p>With C++ 20 the best way to document for other programmers the intended functionality of a type (especially one that might be used in a generic context) is via Concepts. To that end, the intended functionality of uint128 is demonstrated by the <a href="https://github.com/cpsusie/cjm-numerics/blob/main/src/cjm/numerics/cjm_numeric_concepts.hpp#L321">cjm_unsigned_interger</a> concept.</p>
<h2 id="compiler--architecture-requirements">Compiler / Architecture Requirements</h2>
<p>Please note that all the requirements listed below are expressed in code and can be found <a href="https://github.com/cpsusie/cjm-numerics/blob/main/src/cjm/numerics/numerics_configuration.hpp">here</a>.</p>
<ol>
<li><a href="https://en.cppreference.com/w/cpp/compiler_support"><strong>C++ 20 compliance</strong></a></li>
</ol>
<p>This software requires a compiler that conforms, at least partially, to the C++ 20 ISO standard. It requires that when you use it, you specify C++ 20 or later as the standard in the arguments you pass to your compiler. More specifically, it requires <em>at least</em> the following C++ 20 features to be supported:</p>
<ul>
<li><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0482r6.html">char8_t (core language feature)</a></li>
<li><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0734r0.pdf">Concepts (core language feature)</a></li>
<li><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0515r3.pdf">Three way comparison "spaceship" operator ⇔ (core language feature)</a></li>
<li><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0732r2.pdf">Classes and Structs as non-type template parameters (core language feature)</a></li>
<li><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html">Bit operations (standard library feature)</a></li>
<li><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0482r6.html">char8_t (standard library feature)</a></li>
<li><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf">Concepts (standard library feature)</a></li>
<li><a href="https://wg21.link/P0463R1">std::endian (standard library feature)</a></li>
<li><a href="https://wg21.link/P0595R2">std::is_constant_evaluated (core language and standard library feature)</a></li>
<li><a href="https://wg21.link/P0758R1">std::is_nothrow_convertible (standard library feature)</a></li>
<li><a href="https://wg21.link/P0550R2">std::remove_cvref (standard library feature)</a></li>
<li><a href="https://wg21.link/P0122R7">std::span<T> (standard library feature)</a></li>
<li><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0758r1.html">starts_with, ends_with for std::string_view (standard library feature)</a></li>
</ul>
<ol start="2">
<li><strong>Other Requirements</strong></li>
</ol>
<ul>
<li><a href="https://en.cppreference.com/w/cpp/header/climits">CHAR_BIT</a> must be 8. That is, a byte must consist of eight bits.</li>
<li><a href="https://en.cppreference.com/w/cpp/types/endian"><code>std::endian::native</code></a> must equal <a href="https://en.cppreference.com/w/cpp/types/endian"><code>std::endian::big</code></a> or <a href="https://en.cppreference.com/w/cpp/types/endian"><code>std::endian::little</code></a>. That is, the system must be big-endian or little endian, excluding mixed-endian or other edge-case platforms.</li>
<li>All of the following integer types must be defined have the matching size and <a href="https://en.cppreference.com/w/cpp/types/numeric_limits/digits"><code>std::numeric_limits<T>::digits</code></a>:
<ol>
<li>std::uint8_t size: 1, digits: 8</li>
<li>std::int8_t size: 1, digits: 7</li>
<li>std::uint16_t size: 2, digits: 16</li>
<li>std::int16_t size: 2, digits: 15</li>
<li>std::uint32_t size: 4, digits: 32</li>
<li>std::int32_t size: 4, digits: 31</li>
<li>std::uint64_t size: 8, digits: 64</li>
<li>std::int64_t size: 8, digits: 63</li>
</ol>
</li>
</ul>
<h2 id="testing">Testing</h2>
<p>This project (given its one-person authorship and the author's fulltime employment as a software engineer working on unrelated proprietary software) has been tested extensively. A unit test application is included in its repository and this test must be run and pass on multiple compilers and operating systems and architectured before changes are merged into its main branch. Also, an example code project is included in this repository: this project must build on even more compilers and run without error before code changes are merged into the main branch.</p>
<h3 id="unit-test-application"><strong>Unit Test Application</strong></h3>
<p>The <a href="https://github.com/cpsusie/cjm-numerics/tree/main/uint128_test_app/src">unit test application</a> is the one application in this repository that has external dependencies. Those dependencies include:</p>
<ol>
<li><a href="https://github.com/abseil/abseil-cpp/tree/master/absl">abseil-C++17</a> (vcpkg: abseil[cxx17])</li>
<li><a href="https://github.com/boostorg/boost">boost</a> version 1.73+ (vcpkg: boost)</li>
<li><a href="https://github.com/HowardHinnant/date">hinnant/date</a> 3.0.0+ (vcpkg: date)</li>
</ol>
<p>The unit test application must be built and run in Visual Studio 2019 with the dependencies installed as static libraries with a static c-runtime via the following vcpkg triplets: <code>x86-windows-static</code> and <code>x64-windows-static</code>.</p>
<p>It also be built and run in a 64-bit Linux environment, Kubuntu 20.1, using the following tripet: <code>x64-linux</code>. It is then built using CMAKE in the Clion IDE and linked against libstdc++. Please note that libc++ (clang's implementation of the C++ standard library) will not currently work with this project because it does not yet provide full standard library support for Concepts. The following compilers are used to build the unit test project and run it:</p>
<ul>
<li>clang++</li>
</ul>
<blockquote>
<p>Ubuntu clang version 11.0.0-2<br />
Target: x86_64-pc-linux-gnu<br />
Thread model: posix<br />
InstalledDir: /usr/bin<br />
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10<br />
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10<br />
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10<br />
Candidate multilib: .;@m64<br />
Selected multilib: .;@m64</p>
</blockquote>
<ul>
<li>g++</li>
</ul>
<blockquote>
<p>Using built-in specs.<br />
COLLECT_GCC=g++<br />
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper<br />
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa<br />
OFFLOAD_TARGET_DEFAULT=1<br />
Target: x86_64-linux-gnu<br />
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10.2.0-13ubuntu1'<br />
--with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs<br />
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2<br />
--prefix=/usr<br />
--with-gcc-major-version-only<br />
--program-suffix=-10<br />
--program-prefix=x86_64-linux-gnu-<br />
--enable-shared<br />
--enable-linker-build-id<br />
--libexecdir=/usr/lib<br />
--without-included-gettext<br />
--enable-threads=posix<br />
--libdir=/usr/lib
--enable-nls<br />
--enable-clocale=gnu<br />
--enable-libstdcxx-debug<br />
--enable-libstdcxx-time=yes<br />
--with-default-libstdcxx-abi=new<br />
--enable-gnu-unique-object<br />
--disable-vtable-verify<br />
--enable-plugin<br />
--enable-default-pie<br />
--with-system-zlib<br />
--enable-libphobos-checking=release<br />
--with-target-system-zlib=auto<br />
--enable-objc-gc=auto<br />
--enable-multiarch<br />
--disable-werror
--with-arch-32=i686<br />
--with-abi=m64<br />
--with-multilib-list=m32,m64,mx32<br />
--enable-multilib
--with-tune=generic<br />
--enable-offload-targets=nvptx-none=/build/gcc-10-JvwpWM/gcc-10-10.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-JvwpWM/gcc-10-10.2.0/debian/tmp-gcn/usr,hsa<br />
--without-cuda-driver<br />
--enable-checking=release<br />
--build=x86_64-linux-gnu<br />
--host=x86_64-linux-gnu<br />
--target=x86_64-linux-gnu<br />
Thread model: posix<br />
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (Ubuntu 10.2.0-13ubuntu1)</p>
</blockquote>
<p>The CMakeLists.txt file used to build the unit test project (and example project) on linux with both g++ and clang can be found <a href="https://github.com/cpsusie/cjm-numerics/blob/main/CMakeLists.txt">here</a>.</p>
<p>If you download the main branch, you can be assured that the unit test project was built successfully and passed in all of the above configurations, summarized:</p>
<ul>
<li>Visual Studio v. 16.9, x64, static linking, static crt (debug and release)</li>
<li>Visual Studio v. 16.9, x86, static linking, static crt (debug and release)</li>
<li>Linux, x64, clang++ v. 11.0.2, libstdc++ (debug and release)</li>
<li>Linux, x64, g++ v. 10.0.2, libstdc++ (debug and release)</li>
</ul>
<h3 id="example-code-application"><strong>Example Code Application</strong></h3>
<p>The <a href="https://github.com/cpsusie/cjm-numerics/blob/main/example_code/src/uint128_example/program.cpp">example code application</a> is designed to demonstrate the functionality of the library using code. Unlike the unit test application, it does not have any external dependencies. In addition to requiring that the unit test application build and passes under all the configurations listed above, it is also required that the example code application build and execute without errors. In addition to the configurations used by the unit test application, the following extra compilers/configurations must be verified to build the example code application such that it runs successfully:</p>
<p>Microsoft Windows 10 Target, (using Microsoft's standard library):</p>
<ul>
<li>Clang v. 11, as supplied by Microsoft with Visual Studio (x86, x64, Debug and Release)</li>
<li>Intel's LLVM-based compiler v. 2021.1.2 (x86, x64, Debug and Release)</li>
</ul>
<p>Currently, Intel's classic C++ compiler does not support C++ 20 at all. If it ever supports C++ 20 sufficiently to be compatible with this library, it will be added to the list immediately above.</p>
<h3 id="note-on-big-endian-systems"><strong>Note on Big Endian Systems</strong></h3>
<p>This library was designed to work equally well on big and little endian systems. The author, however, has no reasonable way to test on a big endian system. If you encounter issues on big endian systems, please report them.</p>
<h2 id="legal">Legal</h2>
<p>Copyright © 2020-2021 CJM Screws, LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<p>CJM Screws, LLC is a Maryland Limited Liability Company.
No copyright claimed to unmodified original work of others. The original, unmodified work of others, to the extent included in this library, is licensed to you under the same terms under which it was licensed to CJM Screws, LLC. For information about copyright and licensing of the original work of others, see <a href="https://github.com/cpsusie/cjm-numerics/blob/main/src/NOTICES.md">Notices</a> file in cjm/ folder.</p>
<!-- End Markdown Monster Content -->
</div>
</body>
</html>