Reputation: 5540
My question is simple... How could I check the version of GMP installed on my machine? What about MPFR? And What about CamlIDL?
Thank you very much
Upvotes: 5
Views: 12592
Reputation: 1
On Windows 10 I found files C:\dev\vcpkg\installed\x64-windows\lib\pkgconfig\gmp.pc and gmpxx.pc with version information. The location will differ based on where you install the VC package.
Upvotes: 0
Reputation: 41
To check for GMP(MPIR) version, access string __gmp_version(__mpir_version) in dynamic library called libgmp.so.X.Y.Z(libmpir.so.X.Y.Z). Your standard library directory might contain more than one such file (this happens if you install newer version of GMP or MPIR but your package manager chooses to keep old version because it is still needed).
Cutting off a small Python code fragment from benchmark_det_Dixon.py:
import ctypes
so_name='/usr/lib/libgmp.so' # or /usr/lib64/libgmp.so, etc
var_name='__gmp_version'
L=ctypes.cdll.LoadLibrary(so_name)
v=ctypes.c_char_p.in_dll(L,var_name)
print(v.value)
The code above only works under Linux/Unix; it should be possible to port it to other OS supported by ctypes Python package.
To get MPFR version, call mpfr_get_version():
M=ctypes.cdll.LoadLibrary('/usr/lib/libmpfr.so') # or /usr/lib64, etc
M.mpfr_get_version.restype=ctypes.c_char_p
print(M.mpfr_get_version())
Upvotes: 4
Reputation: 56019
The standard Autoconf way to do this is to pick some library function that's in required minimum version X and not in version X-1, then see if you can successfully compile a tiny program that calls that function. It's not as elegant as querying some oracle for a version string, but it has the advantage of demonstrating that the build environment is actually correct.
Upvotes: 0