I'm trying to build Rosetta-3.13 "rosetta.source.release-334" with the following command:
./scons.py mode=release bin extras=mpi
I have also updated the site.settings file to prepend the mpicxx and mpicc compilers for openmpi installed in my system.
I got the following error:
ld: warning: ignoring file /opt/programs/openmpi/4.1.4/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
.... lots of lines...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/src/release/macos/10.16/64/x86/clang/14.0/mpi/libutility.dylib] Error 1
scons: building terminated because of errors.
I successfully built the same release without extras=mpi. So it looks like the problem is with my openmpi compiler.
I did installed the OpenMPI v.4.1.4 without using homebrew/macports. I downloaded the source binaries from openmpi.org and installed it using the following command:
./configure --prefix=/opt/programs/openmpi/4.1.4
and used the GCC pre-installed with Xcode (which looks to be a Clang version).
I have no clue on how to troubleshoot this. Don't know if the problem is with any kind of compatibility with my instalation of openmpi and the new Apple M1 chip. Any ideas?
Thanks,
Danilo.
An uptade about this.
I recompiled the OpenMPI with the following command, to ensure compatibility with Apple M1:
After make install, I tried to build rosetta-3.13 "rosetta.source.release-334" with the following command, also to try ensuring proc compatibility:
Weirdly I've got the following error:
So it looks like the setup_platforms.py is getting the wrong arch for my system.
Still no success to compile with MPI. Any help?
Just to make sure about the arch of my chip, the output for the command uname -a is as follow:
So, indeed the arch is arm64 and not x86 as the Rosetta setup_platforms.py seems to find.
To some extent, the important thing is what Python thinks the platform is, rather than the command line.
In particular, setup_platforms.py uses whatever `import platform; platform.processor()` returns (either that or `os.uname()[4]`) -- if the python you're running the Rosetta complilation off of thinks the platform is "x86", then that's probably what the setup_platforms.py is going to go with.
You can try using a different python (one which is arm64 native), or you can try monkey-patching the `_get_arch()` function in setup_platforms.py to just return `arm` regardless of what Python thinks the platform is.
Hi Moretti,
Thanks for your response. I will try your suggestions and let you know if worked or not.
Best,
Danilo.
Hi all,
Sorry for the late reply. I had some personal issues but finally I've got time to take a look into this compilation.
What I have found is that in the macOS enviroment there are different Python versions, all of them pre-installed by Apple (I did not install any of them).
The current working version (i.e. the one first defined in the $PATH) is a version of python2/python2.7 which is natively installed in /Library/Frameworks/Python.framework/Versions/2.7/bin and put in my bash env automatically by Apple; my .bash_profile has the following lines, also not included by me:.
This pre-defined is the python that was giving me problem with misleading the actual arch of the chip.
Meanwhile, I also found another python version pre-installed in /usr/bin/python3.
So, I guessed that for some reason the Aple version of python2.7 is not arm64 native, as pointed out by Moretti.
Tried to recompile using python3 and it worked flawlessly.
Thanks for all suport.
Best,
Danilo