This fixed it: gcc test.c -lgmp. I just put -lgmp last. This seems to be something particular to Cygwin, I tried it with both Clang and gcc-4.9 on OS X and they don't care about the order. As for the strange behavior with the dll.a file, this is because some...

Passing an array to a function let's the array decay to a pointer to it's 1st element. One can achieve the same effect by applying the Address-Of operator & to a simple variable of the same type as the array's elements. Examples: struct S { int i; float f; };...

For most use cases I believe that option 2 is just as good as option 1. However, I can see a few situations in which one would want to do it manually. A package maintainer wants to build separately as they want separate packages for mpfr et al. Someone who...

It appears that there are no 64bit or 32bit static library types. After performing some assertions on the library using objdump and dumpbin, both were reporting correct information. objdump reported some of the object files to be 64bit and the others 32bits. dumpbin did the same thing. The problem boils...

I'm the maintainer for gmpy2. I don't have access to a Mac so I can't test OSX builds. I assume you've also installed mpfr since it is a prerequisite of mpc. Where are the development files (i.e. gmp.h, mpfr.h, and mpc.h) located? Instead of installing via pip, can you try...

I was trying to debug your code using gdb and it gave me a segfault at line mpz_inits(l, rand). Then I modified that line and now it does not give a segfault. I will see if I can find a reason for the segfault. #include <iostream> #include "gmp.h" void makeprime...

Use a std::string instead of number literal. Any value of the format aaa.bbb is treated as a double (limited precision) and with f suffix as float (limited precision again). In your case it is probably treated as double. const std::string number = "3.141592653589793238462643383279502884197169399375105820974944592307816406286"; mpz_class pi2(number); ...

From the manual page: Function: void mpf_init (mpf_t x) Initialize x to 0. Normally, a variable should be initialized once only or at least be cleared, using mpf_clear, between initializations. The precision of x is undefined unless a default precision has already been established by a call to mpf_set_default_prec. There's...

private variables are not initialised, so they can have any value after the start of the parallel section. Initialising a value inside the parallel block can work, but often isn't efficient. Usually a better way is to use firstprivate instead of private, which will initialise variables with the value they...

mpf_t uses several pointers, so you should serialize mpf_t (and other GMP types) before sending via MPI. There were some letters about MPI in GMP mailing list: https://gmplib.org/list-archives/gmp-discuss/2008-March/003091.html There is article about MPI wrapper library for GMP (MPIGMP + MPIBNCpack): http://na-inet.jp/na/bnc/brief_intro_mpibncpack.pdf Also there were solution of mpf_t serialization into file,...

Play ping-pong. You have two variables a and b and a temporary t. You add and put the result into t, then you copy b to a and t to b. Instead alternate between adding b to a and adding a to b. The final result is either in a...

The problem is that "gmp" is missing on your system. You have two options: Install the gmp library Compile SoPlex without gmp. For doing this call: make soplex GMP=false A similar issue might come up with the zlib. If this library is not installed on your system. If this is...

The gmp_printf() function (thus subsequently gmp_fprintf() as well) requires special format specifier for mpz_t object (which I guess xyz is). You should use %Zd instead of plain %d, that does not work. To be pedantic it's undefined behavior to use inadequate f.s. in C. If you don't need "full-featured" formatted...

From the PHP GMP documentation page: These functions allow you to work with arbitrary-length INTEGERS using the GNU MP library. In other words, no floating point allowed. GMP itself can do floating point but it appears that the PHP interface to it doesn't use its full power. You can use...

This page explains that to use the repository, you need to run .bootstrap. However, it is much easier to download an official release from one of the GNU mirrors. Also, please make sure you cannot use a more recent release, there were few incompatible changes.