M2
M2 copied to clipboard
foreign functions
I get this error when compiling on Mac OS 13.4:
../../../../../../../Macaulay2/packages/ForeignFunctions.m2:566:9:(2):[69]: error: dlsym(RTLD_DEFAULT, GC_malloc): symbol not found
../../../../../../../Macaulay2/m2/methods.m2:154:80:(1):[67]: --back trace--
../../../../../../../Macaulay2/m2/option.m2:17:8:(1):[66]: --back trace--
../../../../../../../Macaulay2/packages/ForeignFunctions.m2:563:30:(2):[65]: --back trace--
../../../../../../../Macaulay2/m2/methods.m2:154:80:(1):[64]: --back trace--
../../../../../../../Macaulay2/m2/option.m2:17:8:(1):[63]: --back trace--
../../../../../../../Macaulay2/packages/ForeignFunctions.m2:617:12:(2):[62]: --back trace--
../../../../../../../Macaulay2/m2/startup.m2.in:66:17:(0):[62]: --back trace--
@d-torrance --- any clues for me?
Are you linking against libgc statically or dynamically? If it's the former, then I don't think dlsym would be able to find any of its symbols. If it's the latter, then the only thing I can think of is maybe they #define'd GC_MALLOC to something other than GC_malloc in macOS 13.4 for some reason.
When compiling on autotools on MacOS, apple M1, I get 4 example errors in ForeignFunctions, basically it can't find mpfr or mps, e.g. the code snippet below. In fact, the library is in the /opt/homebrew tree (and that location isn't being checked here).
i1 : openSharedLibrary "mpfr"
stdio:1:1:(3): error: dlopen(libmpfr.dylib, 0x0001): tried: '/Users/mike/src/M2-current-branches/M2-fmoore-refactor-f4/M2/BUILD/mike/builds.tmp/arm64-appleclang/usr-dist/arm-Darwin-macOS-12.6.6/bin/../lib/Macaulay2/lib/libmpfr.dylib' (no such file), '/Users/mike/src/M2-current-branches/M2-fmoore-refactor-f4/M2/BUILD/mike/builds.tmp/arm64-appleclang/usr-dist/arm-Darwin-macOS-12.6.6/bin/../lib/libmpfr.dylib' (no such file), '/Users/mike/src/M2-current-branches/M2-fmoore-refactor-f4/M2/BUILD/mike/builds.tmp/arm64-appleclang/usr-dist/arm-Darwin-macOS-12.6.6/bin/../lib/Macaulay2/lib/libmpfr.dylib' (no such file), '/Users/mike/src/M2-current-branches/M2-fmoore-refactor-f4/M2/BUILD/mike/builds.tmp/arm64-appleclang/usr-dist/arm-Darwin-macOS-12.6.6/bin/../lib/libmpfr.dylib' (no such file), 'libmpfr.dylib' (no such file), '/usr/local/lib/libmpfr.dylib' (no such file), '/usr/lib/libmpfr.dylib' (no such file), '/private/var/folders/wb/8v4mm0j52pq9pf5gkr8f23z40000gr/T/M2-27044-0/24-rundir/libmpfr.dylib' (no such file)
@mikestillman -- what's your version#"operating system" and version#"architecture"? This looks like the problem that #2705 was supposed to solve last release.
i1 : version#"operating system"
o1 = Darwin
i2 : version#"architecture"
o2 = arm
Ah, that explains it! It only knew to check for aarch64 or arm64. It's weird that there are so many variations... I'll open a PR here in a moment that should fix it.
I'm surprised it is arm too, I always thought it was arm64...
These two issues were fixed in e08f5f190e32e077630a40207ce810e88f893656 and #2881.