0

I built in VS2019 the MPIR and MPFR libs from the provided .sln in the source.

Basic samples are built and run fine. However, the following:

cout << __gmp_bits_per_limb << endl;
cout << gmp_version << endl;

reports missing link symbols.

The first one is important to me for CGAL::Gmpfr.

My current remedy is to define

const int __gmp_bits_per_limb = 64;

But I didn't bother to read what this number means, and what's the default(?).

Arc
  • 412
  • 2
  • 16
Zohar Levi
  • 614
  • 6
  • 16
  • It is the basic "digit" size for GMP multiprecision calculations: 32 on 32-bit machines, and 64 on 64-bit machines. When you use the build system (`./configure && make && make install`) on a Linux machine it detects the platform, and then generates these symbols accordingly in a `.h` file, but I wouldn't know how is it done for Windows. – Arc Jan 11 '22 at 23:21
  • Note that the MPIR [manual](https://mpir.org/mpir-3.0.0.pdf) says that **"MPIR can be built with the professional and higher versions of Visual Studio 2012, 2013, 2015 and 2017. It can also be built with the community editions of Visual Studio 2015 and 2017."** So it seems that you are using a version of VS that might not work. I suggest you download the VS2017 (community edition is said to work), and follow the instructions from manual section 2.4. – Arc Jan 12 '22 at 00:02
  • Also note that if you are missing those symbols, you might be missing many other symbols and it might run transparently, without compile or runtime errors, but still give you wrong numerical results, depending on the symbols missing. – Arc Jan 12 '22 at 00:04
  • The .sln is for convenient, and of course you can compile it with any VS version. The new mpir version has .sln for vs2019 and vs2022. Yes, there are other missing symbols, but I don't believe it has the dramatic effect that you describe. – Zohar Levi Jan 12 '22 at 09:16
  • Well, if you are of that, then go ahead and just use your current remedy. – Arc Jan 12 '22 at 16:53

1 Answers1

0

It is the basic "digit" size for GMP multiprecision calculations: 32 on 32-bit machines, and 64 on 64-bit machines. See here and here for an explanation of what is a limb for GMP (and thus for MPIR).

Note that if the build system worked correctly, you should have those symbols defined already in the .h include file.

Arc
  • 412
  • 2
  • 16
  • Thanks for that, but my main question is why am I missing symbols on windows and need to resort to "remedies." – Zohar Levi Jan 12 '22 at 20:58
  • Then you should edit and clarify your post. There's some information on what you did, then you ask what the default is. So I answered your question. StackOverflow questions are supposed to be very specific, and answers tend to be very strict. – Arc Jan 12 '22 at 21:38