underworldcode / underworld2

underworld2: A parallel, particle-in-cell, finite element code for Geodynamics.
http://www.underworldcode.org/
Other
177 stars 59 forks source link

Installing procedure on Mac - Apple Silicon #583

Closed antonio-schettino closed 2 years ago

antonio-schettino commented 3 years ago

I tried the procedure described at:

https://www.underworldcode.org/articles/how-to-install-underworld-on-mac-osx-big-sur-apple-silicon-m1/

The command 'pip3 install numpy cython pkgconfig mpi4py' produced the following errors:

  Building wheel for mpi4py (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/antonio/opt/anaconda3/bin/python /Users/antonio/opt/anaconda3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/9t/czvczn8x5dbcyvkwxm1pf85c0000gn/T/tmpiqibn0rp
       cwd: /private/var/folders/9t/czvczn8x5dbcyvkwxm1pf85c0000gn/T/pip-install-ywpqmbvm/mpi4py_d0a084690589426d9be072e34d6804d0
  Complete output (170 lines):
  running bdist_wheel
  running build
  running build_src
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.8
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/run.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/bench.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__main__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_base.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/server.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_core.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/pool.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/aplus.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/__main__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_lib.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/pkl5.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/dtlib.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/py.typed -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__main__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/run.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/bench.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/MPI.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/dl.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/libmpi.pxd -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/MPI.pxd -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/include
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.MPI.h -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.MPI_api.h -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.h -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.i -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi.pxi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/futures/__main__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_core.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/aplus.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/server.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/pool.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_lib.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/util/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/dtlib.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/pkl5.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  running build_clib
  MPI configuration: [mpi] from 'mpi.cfg'
  MPI C compiler:    /opt/homebrew/bin/mpicc
  MPI C++ compiler:  /opt/homebrew/bin/mpicxx
  MPI F compiler:    /opt/homebrew/bin/mpifort
  MPI F90 compiler:  /opt/homebrew/bin/mpif90
  MPI F77 compiler:  /opt/homebrew/bin/mpif77
  checking for library 'lmpe' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -llmpe -o _configtest
  ld: library not found for -llmpe
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  building 'mpe' dylib library
  creating build/temp.macosx-10.9-x86_64-3.8
  creating build/temp.macosx-10.9-x86_64-3.8/src
  creating build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c src/lib-pmpi/mpe.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/mpe.o
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi
  /opt/homebrew/bin/mpicc -shared -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 -install_name libmpe.dylib build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/mpe.o -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi/libmpe.dylib
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  checking for library 'vt-mpi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt-mpi -o _configtest
  ld: library not found for -lvt-mpi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  checking for library 'vt.mpi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt.mpi -o _configtest
  ld: library not found for -lvt.mpi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  building 'vt' dylib library
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c src/lib-pmpi/vt.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt.o
  /opt/homebrew/bin/mpicc -shared -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 -install_name libvt.dylib build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt.o -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi/libvt.dylib
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  checking for library 'vt-mpi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt-mpi -o _configtest
  ld: library not found for -lvt-mpi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  checking for library 'vt.mpi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt.mpi -o _configtest
  ld: library not found for -lvt.mpi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  building 'vt-mpi' dylib library
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c src/lib-pmpi/vt-mpi.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-mpi.o
  /opt/homebrew/bin/mpicc -shared -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 -install_name libvt-mpi.dylib build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-mpi.o -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi/libvt-mpi.dylib
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  checking for library 'vt-hyb' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt-hyb -o _configtest
  ld: library not found for -lvt-hyb
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  checking for library 'vt.ompi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt.ompi -o _configtest
  ld: library not found for -lvt.ompi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  building 'vt-hyb' dylib library
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c src/lib-pmpi/vt-hyb.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-hyb.o
  /opt/homebrew/bin/mpicc -shared -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 -install_name libvt-hyb.dylib build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-hyb.o -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi/libvt-hyb.dylib
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  running build_ext
  MPI configuration: [mpi] from 'mpi.cfg'
  MPI C compiler:    /opt/homebrew/bin/mpicc
  MPI C++ compiler:  /opt/homebrew/bin/mpicxx
  MPI F compiler:    /opt/homebrew/bin/mpifort
  MPI F90 compiler:  /opt/homebrew/bin/mpif90
  MPI F77 compiler:  /opt/homebrew/bin/mpif77
  checking for dlopen() availability ...
  checking for header 'dlfcn.h' ...
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  success!
  removing: _configtest.c _configtest.o
  success!
  checking for library 'dl' ...
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  gcc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -Lbuild/temp.macosx-10.9-x86_64-3.8 -ldl -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for function 'dlopen' ...
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  gcc -arch x86_64 _configtest.o -Lbuild/temp.macosx-10.9-x86_64-3.8 -ldl -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  building 'mpi4py.dl' extension
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -I/Users/antonio/opt/anaconda3/include/python3.8 -c src/dynload.c -o build/temp.macosx-10.9-x86_64-3.8/src/dynload.o
  gcc -bundle -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.9-x86_64-3.8/src/dynload.o -Lbuild/temp.macosx-10.9-x86_64-3.8 -ldl -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/dl.cpython-38-darwin.so
  checking for MPI compile and link ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  success!
  removing: _configtest.c _configtest.o
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -arch x86_64 _configtest.o -Lbuild/temp.macosx-10.9-x86_64-3.8 -o _configtest
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  Undefined symbols for architecture x86_64:
    "_MPI_Finalize", referenced from:
        _main in _configtest.o
    "_MPI_Init", referenced from:
        _main in _configtest.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  error: Cannot link MPI programs. Check your configuration!!!
  ----------------------------------------
  ERROR: Failed building wheel for mpi4py
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py which use PEP 517 and cannot be installed directly

Apart from this issue, I wonder if it will be possible in the future to use the couple Docker/Jupyter Notebook

julesghub commented 3 years ago

@rbeucher Looks like mpi libraries are missing from the compile @antonio-schettino I don't have a mac to try on right now. Can you try: pip3 install numpy cython pkgconfig mpi4py --no-binary :all: and report back. Thanks.

antonio-schettino commented 3 years ago

Unfortunately it does not work:

(base) antonio@Mini-di-Antonio ~ % pip3 install numpy cython pkgconfig mpi4py --no-binary :all:
Requirement already satisfied: numpy in ./opt/anaconda3/lib/python3.8/site-packages (1.20.2)
Requirement already satisfied: cython in ./opt/anaconda3/lib/python3.8/site-packages (0.29.23)
Collecting pkgconfig
  Downloading pkgconfig-1.5.5.tar.gz (6.1 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting mpi4py
  Using cached mpi4py-3.1.1.tar.gz (2.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: pkgconfig, mpi4py
  Building wheel for pkgconfig (PEP 517) ... done
  Created wheel for pkgconfig: filename=pkgconfig-1.5.5-py3-none-any.whl size=6730 sha256=18d1251550f68037cddfc3c61fd55b4f3169f43956c41ffb3f1127603a8a55de
  Stored in directory: /Users/antonio/Library/Caches/pip/wheels/fa/28/9f/855077deba37edaac720d865dec5a5a0095f30f98da62cdc59
  Building wheel for mpi4py (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/antonio/opt/anaconda3/bin/python /Users/antonio/opt/anaconda3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/9t/czvczn8x5dbcyvkwxm1pf85c0000gn/T/tmpjxzp1y_k
       cwd: /private/var/folders/9t/czvczn8x5dbcyvkwxm1pf85c0000gn/T/pip-install-cvwkselw/mpi4py_19816d5ab46a40a1a93663e7b59bb35a
  Complete output (170 lines):
  running bdist_wheel
  running build
  running build_src
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.8
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/run.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/bench.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__main__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_base.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/server.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_core.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/pool.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/aplus.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/__main__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_lib.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/pkl5.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/dtlib.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/py.typed -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__main__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/run.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/bench.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/MPI.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/dl.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/libmpi.pxd -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  copying src/mpi4py/MPI.pxd -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/include
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.MPI.h -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.MPI_api.h -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.h -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.i -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi.pxi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
  copying src/mpi4py/futures/__main__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_core.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/aplus.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/server.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/pool.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/futures/_lib.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
  copying src/mpi4py/util/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/dtlib.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  copying src/mpi4py/util/pkl5.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
  running build_clib
  MPI configuration: [mpi] from 'mpi.cfg'
  MPI C compiler:    /opt/homebrew/bin/mpicc
  MPI C++ compiler:  /opt/homebrew/bin/mpicxx
  MPI F compiler:    /opt/homebrew/bin/mpifort
  MPI F90 compiler:  /opt/homebrew/bin/mpif90
  MPI F77 compiler:  /opt/homebrew/bin/mpif77
  checking for library 'lmpe' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -llmpe -o _configtest
  ld: library not found for -llmpe
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  building 'mpe' dylib library
  creating build/temp.macosx-10.9-x86_64-3.8
  creating build/temp.macosx-10.9-x86_64-3.8/src
  creating build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c src/lib-pmpi/mpe.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/mpe.o
  creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi
  /opt/homebrew/bin/mpicc -shared -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 -install_name libmpe.dylib build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/mpe.o -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi/libmpe.dylib
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  checking for library 'vt-mpi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt-mpi -o _configtest
  ld: library not found for -lvt-mpi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  checking for library 'vt.mpi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt.mpi -o _configtest
  ld: library not found for -lvt.mpi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  building 'vt' dylib library
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c src/lib-pmpi/vt.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt.o
  /opt/homebrew/bin/mpicc -shared -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 -install_name libvt.dylib build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt.o -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi/libvt.dylib
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  checking for library 'vt-mpi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt-mpi -o _configtest
  ld: library not found for -lvt-mpi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  checking for library 'vt.mpi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt.mpi -o _configtest
  ld: library not found for -lvt.mpi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  building 'vt-mpi' dylib library
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c src/lib-pmpi/vt-mpi.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-mpi.o
  /opt/homebrew/bin/mpicc -shared -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 -install_name libvt-mpi.dylib build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-mpi.o -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi/libvt-mpi.dylib
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  checking for library 'vt-hyb' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt-hyb -o _configtest
  ld: library not found for -lvt-hyb
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  checking for library 'vt.ompi' ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -lvt.ompi -o _configtest
  ld: library not found for -lvt.ompi
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  building 'vt-hyb' dylib library
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -c src/lib-pmpi/vt-hyb.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-hyb.o
  /opt/homebrew/bin/mpicc -shared -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 -install_name libvt-hyb.dylib build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-hyb.o -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/lib-pmpi/libvt-hyb.dylib
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  running build_ext
  MPI configuration: [mpi] from 'mpi.cfg'
  MPI C compiler:    /opt/homebrew/bin/mpicc
  MPI C++ compiler:  /opt/homebrew/bin/mpicxx
  MPI F compiler:    /opt/homebrew/bin/mpifort
  MPI F90 compiler:  /opt/homebrew/bin/mpif90
  MPI F77 compiler:  /opt/homebrew/bin/mpif77
  checking for dlopen() availability ...
  checking for header 'dlfcn.h' ...
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  success!
  removing: _configtest.c _configtest.o
  success!
  checking for library 'dl' ...
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  gcc -flat_namespace -undefined suppress -arch x86_64 _configtest.o -Lbuild/temp.macosx-10.9-x86_64-3.8 -ldl -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for function 'dlopen' ...
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  gcc -arch x86_64 _configtest.o -Lbuild/temp.macosx-10.9-x86_64-3.8 -ldl -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  building 'mpi4py.dl' extension
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -I/Users/antonio/opt/anaconda3/include/python3.8 -c src/dynload.c -o build/temp.macosx-10.9-x86_64-3.8/src/dynload.o
  gcc -bundle -undefined dynamic_lookup -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -L/Users/antonio/opt/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.9-x86_64-3.8/src/dynload.o -Lbuild/temp.macosx-10.9-x86_64-3.8 -ldl -o build/lib.macosx-10.9-x86_64-3.8/mpi4py/dl.cpython-38-darwin.so
  checking for MPI compile and link ...
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  success!
  removing: _configtest.c _configtest.o
  /opt/homebrew/bin/mpicc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include -arch x86_64 -I/Users/antonio/opt/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
  /opt/homebrew/bin/mpicc -arch x86_64 _configtest.o -Lbuild/temp.macosx-10.9-x86_64-3.8 -o _configtest
  ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
  Undefined symbols for architecture x86_64:
    "_MPI_Finalize", referenced from:
        _main in _configtest.o
    "_MPI_Init", referenced from:
        _main in _configtest.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  failure.
  removing: _configtest.c _configtest.o
  error: Cannot link MPI programs. Check your configuration!!!
  ----------------------------------------
  ERROR: Failed building wheel for mpi4py
Successfully built pkgconfig
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py which use PEP 517 and cannot be installed directly
rbeucher commented 3 years ago

It's not an Underworld issue per se. I would focus on trying to install mpi4py properly

pip install mpi4py

From what i see, It is trying to use openmpi from your homebrew installation but that is for x86_64 achitectures. The instructions are for installing on an ARM64 (silicon architecture)

see here:

ld: warning: ignoring file /opt/homebrew/Cellar/open-mpi/4.1.1_2/lib/libmpi.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64

You need to unset the MPI env variable so that mpi4py do not attempt to use your existing MPI installation.

That is a common issues with new macs.

rbeucher commented 3 years ago

Are you running your Terminal via Rosetta?

antonio-schettino commented 3 years ago

No, I am not using rosetta, this is an original Apple Silicon M1. Furthermore, the MPI variable has not been assigned in this system.

Antonio

Antonio Schettino School of Science and Technology Geology Division University of Camerino Via Gentile III da Varano 62032 Camerino - Italy Phone : +39.(0)737.402641 Fax. : +39.(0)737.402644 Cell. : 327-3148561

On Tue, 19 Oct 2021 at 22:59, Romain Beucher @.***> wrote:

Are you running your Terminal via Rosetta?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/underworldcode/underworld2/issues/583#issuecomment-947100513, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWHZMW5DJDFBF7F6WURMLLUHXL45ANCNFSM5GEZO6VQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

--

rbeucher commented 2 years ago

Hi @antonio-schettino

Did you manage to install mpi4py?

I'm working on releasing a docker for the apple M1.

antonio-schettino commented 2 years ago

Hi Romain,

No, I didn't succeed to install the software following your instructions. I will remain waiting for a docker/jupyter version.

Best regards,

Antonio

Antonio Schettino School of Science and Technology Geology Division University of Camerino Via Gentile III da Varano 62032 Camerino - Italy Phone : +39.(0)737.402641 Fax. : +39.(0)737.402644 Cell. : 327-3148561

On Thu, 9 Dec 2021 at 21:28, Romain Beucher @.***> wrote:

Hi @antonio-schettino https://github.com/antonio-schettino

Did you manage to install mpi4py?

I'm working on releasing a docker for the apple M1.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/underworldcode/underworld2/issues/583#issuecomment-990222170, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWHZMTBAGWXF5PEDAOPVXTUQEGPXANCNFSM5GEZO6VQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

--