creachadair / imath

Arbitrary precision integer and rational arithmetic library
Other
129 stars 20 forks source link

Neither self-contained nor ANSI C #44

Closed awsdert closed 4 years ago

awsdert commented 4 years ago

I've just cloned the respository and ran make in the clone, the result showed a lot of the -std=c99 switch whitch is definitly NOT ANSI C, should be -std=c89 for that (and I think there is a -ansi switch), also the result was multiple shared libraries, at most I expect something like libimath.so, that's it.

creachadair commented 4 years ago

You're right, "ANSI" is no longer accurate. I will update the documentation accordingly.

I'm not sure I follow your question about the build, though: If you simply run make test you'll get multiple libraries, since the test rules also exercise the rational arithmetic code, along with some GMP compatibility stubs, in addition to the basic integer operations.

It should be straightforward to build imath.c alone, however: Either make imath.o or make imath.so should give you what I think you want. But if I've missed some other aspect of your concern, please let me know.

awsdert commented 4 years ago

Sorry for late reply, had to reinstall my OS a number of times while I tried to get vulkan running, gave up in the end and am now waiting for an AMD RX560D graphics card to arrive to see if that'll play ball instead (on nvidia atm) anyway I went and wrote my own library now which served my purposes, probably missing a lot of extra stuff but as basic math it fits the bill, wasn't too bothered by the ansi c thing but my needs were for 1 file (even if rather long) and capable of supporting calculation of raw float/double which I can almost do with mine (__int128 was just not enough to catch overflow/carry to set infinity), if you're interested in why I need that take a look at my mitsy project

creachadair commented 4 years ago

It sounds like the original issues are resolved: I updated the documentation, and it is (still) possible to build the library as a single file. I'm going to go ahead and close this, but feel free to reopen it if I missed something.