Commit Graph

2873 Commits

Author SHA1 Message Date
Nicolas Boulenguez
bb8de53270 gmp: give example project a separate object directory
The example subdirectory is also installed system-wide as an example.
The user is expected to copy it, and does certainly not expect
gprbuild to write into the parent directory.
2022-08-08 13:33:44 +02:00
Laurent Thévenoux
c3480c42bf GMP: bindings to get or set the numerator or denominator of a rational
This new bindings allow to get or set the numerator or denominator of
a rational. Numerator and denominator are Big_Integer numbers.

This change also adds new tests.

TN: V310-009
Change-Id: I015be345acb03399bfaf54a03aeeda15fc0ad1f1
2022-05-17 15:13:09 +02:00
Laurent Thévenoux
b7455fad40 GMP: add bindings for comparisons
This new bindings allow to compare Rational with Rational or
Big_Integer numbers, using the standard Ada comparison operators.

TN: V310-009
Change-Id: I1e19a3ddc586c375181c67c3aeee6e6dd52c846a
2022-05-13 15:47:48 +02:00
Laurent Thévenoux
ee1d16b9b8 GMP: add bindings for rational arithmetic
Operators "+", "-" (both binary and unary), "*", "/", and "abs" have
been implemented.

Since operands have to be in a canonical form before any arithmetic
operations, a new parameter has been added to the `Set` directives to
handle that automatically. All rational values are canonicalized by
default but the user can still decide to not canonicalize a number if
needed. An exception is raised if an arithmetic operation with
non-canonical operands is performed.

TN: V310-009
Change-Id: If6dac7ed93f1e3042a3db4bdc45a77530664c47f
2022-05-13 15:47:48 +02:00
Laurent Thévenoux
603ecf2474 GMP: add bindings for double conversions
These new bindings allow to set or to get a rational number from a
floating-point value (derived from Interfaces.C.double type).

TN: V310-009
Change-Id: I46374808e223ffa3163774fbaadeb690ae0bf424
2022-05-13 15:47:48 +02:00
Laurent Thévenoux
6e32a4632b GMP: add complete bindings for rational numbers assignments
These new bindings concern the following method:
* Set (Rational, Rational),
* Set (Rational, Big_Integer),
* Set (Rational, Long, Unsigned_Long),
* Swap (Rational, Rational).

More tests for assignments bindings have been added.

TN: V310-009
Change-Id: I914b762464de4c664bf0d56ec596307b504cf633
2022-05-13 15:47:48 +02:00
Laurent Thévenoux
5d0d8892ae GMP: first rational functions bindings
This patch introduces the first rational functions bindings, limited
to set a rational number from a string and to get back its string
representation.

Therefore, a new package GMP.Rational_Numbers contains the following
type:
* Rational: a private type to handle GMP mpq_t C type.

It also contains the following methods:
* Set (Rational, String, Base): to set a rational number from a
string,
* Image (Rational, Base): to get the string representation of a
rational number.

This patch comes also with a minimal set of tests.

TN: V310-009
Change-Id: Ie021bc1a338f836fbac56e4d6274ea3d6a6bae7a
2022-05-13 15:47:37 +02:00
Adrien Boulanger
c62ce3517a S712-022: Over-referrencing when using old arguments as keywords
Change-Id: I91e966aab0b7e4a4cf231e9ecf3656ddb7982a7a
2022-04-07 15:45:09 +02:00
Adrien Boulanger
d7ee0cd71b S712-022: Fix over-referrenced object in the bindings
- PyObject_GetAttrString returns a new ref which must
be decref'd.
- Over-referrenced class when calling internal method

Change-Id: I16170aaa3e8daeaf4ad02dcc4cfee3f53574574e
2022-04-05 11:48:33 +02:00
Pierre-Marie de Rodat
f87287b139 testsuite/support/test.gpr: add -g to build switches
Test programs are already built with no optimization. Add -g so that we
also have debug info, for full debuggability.

Change-Id: Iff5560322f25cde4286a8bca807714c0cd2fd3c9
TN: V310-010
2022-03-31 17:16:26 +02:00
Pierre-Marie de Rodat
c48e9716ab Testsuite: add an option to rebuild gnatcoll in debug mode
--recompile is useful to let the testsuite build and install gnatcoll,
but it forces the PROD build mode. Add --debug to make the tested
library more friendly to debuggers.

Change-Id: I367fc0cbadf7275d1f1c30a43a44e3af5f9cc8e7
TN: V310-010
2022-03-31 17:16:26 +02:00
Pierre-Marie de Rodat
849043b7e9 gmp: add all warnings and GNAT style checks
Enable all warnings and GNAT style checks for both PROD and DEBUG build
modes. Also trigger warnings-as-errors in DEBUG mode.

Change-Id: I0f24bad7460245c31bb61cdd7ab99f46e411d9c6
TN: V310-009
2022-03-16 10:58:03 +01:00
Pierre-Marie de Rodat
ba642a42e3 .gitignore: ignore the "install" directory
The OMP binding setup scripts creates omp/install.

Change-Id: I42520dde753685e4e2166bdb45ef2f0a73b3368a
TN: V310-010
2022-03-10 14:17:23 +01:00
Pierre-Marie de Rodat
377e1cc7be .gitignore: ignore directories generated by the testsuite
Change-Id: I561d31b92ff6cf7510fdfd55c2da7ffd0426e668
TN: V310-010
2022-03-10 14:16:58 +01:00
Pierre-Marie de Rodat
30646e9d4e Testsuite: remove support for "skip" test.yaml entries
This mechanism, currently unused, is obsolete now that e3-testsuite
provides the "control" mechanism.

Change-Id: I641ab9fb04d1c236026a3d38f272e3b21d064455
TN: V310-010
2022-03-10 14:13:09 +01:00
Pierre-Marie de Rodat
6de089707d Testsuite: include zlib and lzma bindings in --recompile
Some tests require these bindings, so rebuild them in --recompile mode.

Change-Id: Ie35c577368dfb0f80a81224a39c4e09bd788d9e7
TN: V310-010
2022-03-10 14:12:03 +01:00
Pierre-Marie de Rodat
ccdecbe808 Testsuite: update for Python3 and modern e3-testsuite APIs
Also black-ify testsuite Python scripts and remove the unused
"data_validation" and "json_validation" test drivers.

Change-Id: I4a333cb689991cac2b3cbffd94b6e4d53e987331
TN: V310-010
2022-03-10 14:11:32 +01:00
Pierre-Marie de Rodat
b8304c86ea omp/setup.py: fix for Python3
Change-Id: I7f5f9ac5d5ed5835b2e1c6b69ef9e38773b286d3
TN: V310-010
2022-03-10 14:09:30 +01:00
Adrien Boulanger
1624f7e808 U914-005: Transition from python 3.7 to 3.9
- Disable the new vectorcall API (the tp_call profile only
supports the old call format).
- Add missing GIL locks
- Manually config python to use utf-8 (this was automatic with
previous versions)

Change-Id: I214b53e1e1b4fbc2a9af1cf1ec8985cff7905a55
2021-12-01 12:08:28 +01:00
Nicolas Setton
1a230fb6c1 U515-001 gracefully handle the absence of a static python lib
Fix a Python error that occurred when the static lib was not
found.

Change-Id: I02096a913e03714a23bf25935cf056e332452dd5
2021-05-26 10:56:34 +01:00
Dmitriy Anisimkov
2fbe0540f2 Merge style improvements in project files
This comes from the GitHub pull request #5
no-tn-check

Change-Id: I74f8cb78832b2a53ff7e9eb18aa1d98b422c14e4
2021-04-06 17:37:43 +06:00
Nicolas Boulenguez
b3961ba4f5 readline: move Linker_Options from Ada source to project
This is consistent with other components.
2021-04-05 15:57:58 +02:00
Nicolas Boulenguez
aeea734354 Use ADAFLAGS CFLAGS CPPFLAGS LDFLAGS if they exist in the environment 2021-04-05 15:56:56 +02:00
Nicolas Boulenguez
1adbba0a53 python.gpr: compute one External_As_List instead of many Split.
This is more efficient and readable.
2021-04-05 15:55:44 +02:00
Nicolas Boulenguez
53d37d3ed4 Removed unused OS_Kind external variable.
The related part of setup.py is still required by the imported
gnatcoll.gpr.
2021-04-05 15:55:13 +02:00