[PB5.31] GMP 6.0.0a

Share your advanced PureBasic knowledge/code with the community.
jack
Addict
Addict
Posts: 1336
Joined: Fri Apr 25, 2003 11:10 pm

Re: [PB5.31] GMP 6.0.0a

Post by jack »

to complement bbanelli's GMP include, here's the one for MPFR.
it comes with a couple of examples, included in the archive is a Windows x64 dll in case you need it, download http://www.mediafire.com/download/bltf0 ... pfr-pb.zip
Last edited by jack on Wed Mar 09, 2016 7:31 pm, edited 3 times in total.
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 543
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: [PB5.31] GMP 6.0.0a

Post by bbanelli »

jack wrote:to complement bbanelli's GMP include, here's the one for MPFR.
it comes with a couple of examples, included in the archive is a Windows x64 dll in case you need it, download http://www.mediafire.com/download/hcr5a ... pfr-pb.zip
Jack, what did you use to compile that DLL?
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
jack
Addict
Addict
Posts: 1336
Joined: Fri Apr 25, 2003 11:10 pm

Re: [PB5.31] GMP 6.0.0a

Post by jack »

I am not sure but I think I used TDM-gcc it' been a while, but I have to say that the way I did it was a hack, could not get the dll to pass the tests but the static build passed OK
so I extracted the objects from the static lib and did something like this: gcc -shared -static -o libmpfr-4.dll *.o -lgmp
btw I think the mpfr structures should be as follows

Code: Select all

 Structure mpz Align #PB_Structure_AlignC ; multiprecision integer 
    mp_alloc.l 
    mp_size.l 
    mp_limb.i 
  EndStructure 
  
  Structure mpq Align #PB_Structure_AlignC ; multiprecision rational 
    mp_num.mpz 
    mp_den.mpz 
  EndStructure 
  
  Structure mpf Align #PB_Structure_AlignC ; multiprecision floating point 
    mp_prec.l 
    mp_size.l 
    mp_expt.i 
    mp_limb.i 
  EndStructure 
  
  Structure mpfr Align #PB_Structure_AlignC ; multiprecision floating point
    prec.i
    sign.l
    exp.i
    d.i
  EndStructure


Structure gmp_randata_lc_t Align #PB_Structure_AlignC
   mp_a.i
   mp_c.i
   mp_m.i
   mp_m2exp.i
EndStructure

Structure mp_algdata_t Align #PB_Structure_AlignC
  StructureUnion
     *_mp_lc.gmp_randata_lc_t
   EndStructureUnion
EndStructure

Structure gmp_randstate_t Align #PB_Structure_AlignC
   mp_seed.mpz
   mp_alg.i
   mp_algdata.mp_algdata_t
EndStructure
jack
Addict
Addict
Posts: 1336
Joined: Fri Apr 25, 2003 11:10 pm

Re: [PB5.31] GMP 6.0.0a

Post by jack »

davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: [PB5.31] GMP 6.0.0a

Post by davido »

@jack,

Thank you for taking the trouble to do this update.
It is very much appreciated. :D
DE AA EB
AZJIO
Addict
Addict
Posts: 1360
Joined: Sun May 14, 2017 1:48 am

Re: [PB5.31] GMP 6.0.0a

Post by AZJIO »

DLL/so/dylib

Windows
libgmp-10.dll (GMP x86)
libgmp-10x64.dll (GMP x64)
msys-1.0.dll (required!)

Linux
libgmp.so.10.2.0 (GMP x86)
libgmp.so.10.2.x64.0 (GMP x64)

Mac OS X
libgmp.10.dylib (GMP x86)
libgmp.10.x64.dylib (GMP x64)
Can you update the links?
Post Reply