Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2025-02

gmp

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

What else do I need to add to the compile line to use the gmp unit? I added gmp to the use line and it throws an error in compilation:

ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min ld: warning: ignoring duplicate libraries: '-lc'
ld: library 'gmp.3' not found
—

First two lines are always there. Last two occur when I add gmp to the use line. Seems to be looking for libgmp.3.dylib (or libgmp.3.a?). Is unfortunate that it includes a version number, since the gmplib installed with homebrew provides:

/opt/homebrew/lib/libgmp.10.dylib
/opt/homebrew/lib/libgmp.a
/opt/homebrew/lib/libgmp.dylib

Is there a workaround or is the gmp unit unusable with newer versions of gmplib?

Appreciate any advice.

Regards
Pete

Reply by email

Michael Van Canneyt
to Unknown author
ppadilcdx--- wrote 7 lines
What else do I need to add to the compile line to use the gmp unit? I added gmp to the use line and it throws an error in compilation: ld: warning: -multiply_defined is obsolete -macosx_version_min has been renamed to -macos_version_min ld: warning: ignoring duplicate libraries: '-lc' ld: library 'gmp.3' not found —

looks like the $linklib directive is using a wrong version number.

Show quoted text 11 lines
First two lines are always there. Last two occur when I add gmp to the use line. Seems to be looking for libgmp.3.dylib (or libgmp.3.a?). Is unfortunate that it includes a version number, since the gmplib installed with homebrew provides: /opt/homebrew/lib/libgmp.10.dylib /opt/homebrew/lib/libgmp.a /opt/homebrew/lib/libgmp.dylib Is there a workaround or is the gmp unit unusable with newer versions of gmplib?

Just copy the sources to your project, change the version number and you should be all set.

Of course, if the library changed a lot - 7 versions is a lot, it may well be that the definitions in the unit are no longer correct.

Michael.

Reply by email

Unknown author
to Michael Van Canneyt

I did copy gmp.pas to another folder and named it mygmp.pas, changed "$linklib gmp.3” to "$linklib gmp.dylib” (just plain gmp did not work). Now examples compile and run with the change to “uses mygmp” and adding opt/homebrew/lib to the link search path.

So good to go.

For next release can we change the gmp.pas source to:
{$ifdef darwin}
  {$linklib gmp.dylib}
{$endif}

That way folks can use the installed unit w/o changes (except to their lib path).

Thanks!

Show quoted text 36 lines
On Feb 14, 2025, at 6:48 AM, Michael Van Canneyt via fpc-pascal wrote: On Tue, 11 Feb 2025, ppadilcdx--- via fpc-pascal wrote: > What else do I need to add to the compile line to use the gmp unit? I added gmp to the use line and it throws an error in compilation: > > ld: warning: -multiply_defined is obsolete > -macosx_version_min has been renamed to -macos_version_min > ld: warning: ignoring duplicate libraries: '-lc' > ld: library 'gmp.3' not found > — looks like the $linklib directive is using a wrong version number. > > First two lines are always there. Last two occur when I add gmp to the > use line. Seems to be looking for libgmp.3.dylib (or libgmp.3.a?). Is > unfortunate that it includes a version number, since the gmplib installed > with homebrew provides: > > /opt/homebrew/lib/libgmp.10.dylib > /opt/homebrew/lib/libgmp.a > /opt/homebrew/lib/libgmp.dylib > > Is there a workaround or is the gmp unit unusable with newer versions of gmplib? Just copy the sources to your project, change the version number and you should be all set. Of course, if the library changed a lot - 7 versions is a lot, it may well be that the definitions in the unit are no longer correct. Michael._______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Michael Van Canneyt
to Unknown author
ppadilcdx--- wrote 9 lines
I did copy gmp.pas to another folder and named it mygmp.pas, changed "$linklib gmp.3” to "$linklib gmp.dylib” (just plain gmp did not work). Now examples compile and run with the change to “uses mygmp” and adding opt/homebrew/lib to the link search path. So good to go. For next release can we change the gmp.pas source to: {$ifdef darwin} {$linklib gmp.dylib} {$endif}

Done.

Michael.

Reply by email