Closed joezuntz closed 8 months ago
On conda-forge, osx-arm64 packages are cross compiled on x86-64 Azure instances. So, when cross-compiling, you also have to add openmpi or any build-time dependencies to the build section.
https://conda-forge.org/docs/maintainer/knowledge_base.html#cross-compilation
Also, make test
can't be run because it's for native builds.
@joezuntz For a specific example of what @leofang explained, see this line.
@leofang @dalcinl We're seeing x86_64 compilers pulled into build here: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=814046&view=logs&jobId=d1321064-f6c3-56b7-0172-6d994d01c836&j=55dcca09-69c4-5f54-9c14-572421a2beca&t=e10c6994-80d2-5627-c9cb-9ef49f0ff282
We see this for mpif90 -show
x86_64-apple-darwin13.4.0-gfortran -I$BUILD_PREFIX/include -Wl,-flat_namespace -Wl...
This doesn't appear to happen with mpich. Any ideas?
Probably helps to link the PR: https://github.com/conda-forge/cosmosis-feedstock/pull/57
Note this PR adds the line requested above
@beckermr After looking at the openmpi package artifacts, everything looks fine, there is no reference to x86_64
stuff.
You are cross-compiling, right? I'm not really sure what's going on, but I think that the x86_64 compiler version does not support the -march=arm8.3-a
flag.
A possible workaround you could try is to add the following line at the beginning of your build script:
export OMPI_FC=$FC
This is cross-compiling, yes.
Under mpich, running mpif90 -show
gives:
arm64-apple-darwin20.0.0-gfortran -I$PREFIX/include -fallow-argument-mismatch -L$PREFIX/lib -Wl,-rpath,$PREFIX/lib -Wl,-commons,use_dylibs -I$PREFIX/include -I$PREFIX/include -L$PREFIX/lib -lmpifort -lmpi -lpmpi
i.e. pulling in the arm64 fortran compiler (this is line 273 of this, whereas under openmpi it gives what Matt posted above, which is line 279 of this
I'll have a go with the env var you suggested - thanks!
if you install (or download manually) Open MPI in Apple Silicon and then run cat $CONDA_PREFIX/share/openmpi/mpifort-wrapper-data.txt
, you should see a line with compiler=arm64-apple-darwin20.0.0-gfortran
. From there on, I have no idea what magic incantation is changing the compiler command under the hood. Maybe it is Open MPI's mpifort/mpif90 using some environment variable, or some other logic. If that's the case, and unless someone can provide evidence we are doing something wrong in this feedstock, you will have to ask Open MPI uptream.
The environment variable change seems to have fixed my issue - thanks so much!
Solution to issue cannot be found in the documentation.
Issue
My conda package, cosmosis, depends on MPI. The MPICH-linked version works fine everywhere, but I haven't been able to get OpenMPI to work with Apple Silicon builds.
When I try to build with OpenMPI for arm64 then the supplied mpif90 executable cannot be run and crashes with the message "Bad CPU type in executable".
I guess an intel executable is being supplied? The regular gfortran compiler works fine.
Installed packages
Environment info