Problem compiling many Rosetta Code Nim programs: could not load: libgmp.dylib
brian
bholder+macports at gmail.com
Wed Jan 1 10:24:19 UTC 2025
Seems like https://github.com/nim-lang/Nim/issues/16803. One possible way
to make this work is to compile statically. I.E.
➜ nim_test nim --dynlibOverride:gmp --passL:/opt/local/lib/libgmp.a c
arithmetic_geometric_mean_calculate_pi.nim
Hint: used config file '/opt/local/lib/nim/config/nim.cfg' [Conf]
Hint: used config file '/opt/local/lib/nim/config/config.nims' [Conf]
.............................................................................................
Hint: [Link]
ld: warning: ignoring duplicate libraries: '-lm'
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
52558 lines; 0.561s; 75.539MiB peakmem; proj:
/<redact>/nim_test/arithmetic_geometric_mean_calculate_pi.nim; out:
/<redact>/nim_test/arithmetic_geometric_mean_calculate_pi [SuccessX]
➜ nim_test ./arithmetic_geometric_mean_calculate_pi
Computed 25000 digits in 50 ms
π = 3.141592653589793238...81377399510065895288...
Instead of
➜ nim_test nim -d:nimDebugDlOpen c
arithmetic_geometric_mean_calculate_pi.nim
Hint: used config file '/opt/local/lib/nim/config/nim.cfg' [Conf]
Hint: used config file '/opt/local/lib/nim/config/config.nims' [Conf]
.............................................................................................
CC: ../../../../opt/local/lib/nim/lib/system.nim
CC: ../../../../opt/local/lib/nim/lib/pure/parseutils.nim
CC: ../../.nimble/pkgs/gmp-0.2.5/gmp.nim
CC: ../../.nimble/pkgs/bignum-1.0.4/bignum.nim
CC: ../../../../opt/local/lib/nim/lib/pure/os.nim
CC: arithmetic_geometric_mean_calculate_pi.nim
Hint: [Link]
ld: warning: ignoring duplicate libraries: '-lm'
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
52558 lines; 0.590s; 75.625MiB peakmem; proj:
/<redact>/nim_test/arithmetic_geometric_mean_calculate_pi.nim; out:
/<redact>/nim_test/arithmetic_geometric_mean_calculate_pi [SuccessX]
➜ nim_test ./arithmetic_geometric_mean_calculate_pi
dlopen(libgmp.dylib, 0x0002): tried: 'libgmp.dylib' (no such file),
'/System/Volumes/Preboot/Cryptexes/OSlibgmp.dylib' (no such file),
'/usr/lib/libgmp.dylib' (no such file, not in dyld cache), 'libgmp.dylib'
(no such file)
could not load: libgmp.dylib
On Tue, Dec 31, 2024 at 8:06 PM Kenneth Wolcott <kennethwolcott at gmail.com>
wrote:
> Hi Ryan;
>
> Thank you for replying.
>
> Here is more information regarding the problem I am experiencing.
>
> I have attached some Nim source code (from Rosetta Code web site),
> compile log, execution log and the pkg install log.
>
> 1. MacOS 15.2
> 2. M1 chip (arm64, aarch64)
> 3. MacPorts port: nim
> 4. nimble is the Nim package manager which comes with the nim port.
> 4. nimble install bignum (seems to successfully install, but I wonder if
> it is silently installing an x86-64 pre-compiled binary??)
> 5. compile using: nim c ./arithmetic_geometric_mean_calculate_pi
> 6. execute: ./arithmetic_geometric_mean_calculate_pi
>
> Compiling with debug, suggested by the execution failure message, did
> not at all provide and additional information than compiling in default
> mode.
>
> I do not recall specifically which external Nim pkg that I was able to
> install and subsequently compile a Nim source which used it and
> successfully executed, but it as at least one if not several, so I don't
> thikthat this is a general silent Nim pkg installation failure.
>
> Thanks again for the help with this issue.
>
> Ken Wolcott
>
> On Tue, Dec 31, 2024 at 1:56 PM Ryan Carsten Schmidt <
> ryandesign at macports.org> wrote:
>
>> On Dec 31, 2024, at 14:13, Kenneth Wolcott wrote:
>> >
>> > Any hints for me please?
>>
>> I'm not familiar with the software you're using. What ports should I
>> install and what commands should I run to see the problem you're seeing?
>> You're on an Apple Silicon Mac? What macOS version?
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20250101/3e55eda0/attachment.htm>
More information about the macports-users
mailing list