Hi!
I’m moving a Julia project from an old MacBook Pro (2017) with an Intel Core i7 chip to a brand new one (2023) with the M2 Max.
My project requires a C shared library which is not yet available on this new platform, so I copied the x86 version to the standard location on the M2 computer.
When I call a function that uses that library, I get the following error message complaining about “incompatible architecture”:
julia> include(JMtk15_test * "src/jMtkVersion_tst.jl")
jMtkVersion_tst
julia> version = jMtkVersion_tst();
ERROR: could not load library "/Applications/Mtk-1.5.0/lib/libMisrToolkit.so.1.5.0"
dlopen(/Applications/Mtk-1.5.0/lib/libMisrToolkit.so.1.5.0, 0x0001): tried: '/Applications/Mtk-1.5.0/lib/libMisrToolkit.so.1.5.0' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Mtk-1.5.0/lib/libMisrToolkit.so.1.5.0' (no such file), '/Applications/Mtk-1.5.0/lib/libMisrToolkit.so.1.5.0' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
Stacktrace:
[1] jMtkVersion
@ ~/Projects/MISR/MISR_Toolkit/JMtk15/src/jMtkVersion.jl:26 [inlined]
[2] jMtkVersion_tst()
@ Main ~/Projects/MISR/MISR_Toolkit/JMtk15/test/src/jMtkVersion_tst.jl:39
[3] top-level scope
@ REPL[6]:1
Since Rosetta has been previously installed, I was expecting this to work. This library is correctly found, but cannot be loaded. What do I need to do to enable Julia on the M2 chip to recognize and use that shared library compiled for the x86 chip? Thanks for your help.