underworldcode / UWGeodynamics

Underworld Geodynamics
Other
81 stars 32 forks source link

Install UWgeodynamics latest on Macbook with M1 #254

Closed HanyMKhalil closed 2 years ago

HanyMKhalil commented 3 years ago

Dear all, I have tried to install latest version of UWgeodynamics using Docker on my Macbook m1 but it says it is not compatible with ARM as it is amd64. I found a post y romain Buscher on how to install underworld on macbook with m1 but how can I adapt it to install UWgeodynamic and open it on jupyter notebook?

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

julesghub commented 3 years ago

Hi @HanyMKhalil, what docker command did you run when it said it wasn't compatible with ARM?

Romain's post is for installing without using the underworld docker. If you follow this post you can add pip3 install UWGeodynamics notebook at the end. This will install UWGeodynamics python functionality and the core jupyter notebook functionality. Follow https://jupyter.org/installInstall for more info on jupyter notebooks (or lab).

HanyMKhalil commented 3 years ago

Dear Julian,

I use this command on the docker hub to pull the image: docker pull underworldcode/uwgeodynamics

then I go inside the docker and I try to create the image container from inside the docker but then sometimes it create the container and the jupyter notebook crashes (kernel is not working) and the container gives indication that its amd64, othertime it refuses to create any container.

I will try to install it as you suggested but then how can i open its jupyter notebook?

HanyMKhalil commented 3 years ago

I can open the jupyter from anaconda as I use it for my own python codings, but I used to open the jupyter note book from the docker browser after run the coontainer, how can i access the UWgeodynamics on jupyter notebook from outside the docker

julesghub commented 3 years ago

To be clear there are 2 workflows to run UWGeodynamics on M1.

All the instructions above are for the "without docker" case. As long as you have underworld and UWGeodynamics appear in pip list you will be able to use UWGeodynamics model scripts.

If you are asking about the model files - examples, tests, tutorials, all of that can be accessed from this github. clone the repository. Does that clear things up?

We will work on a UWGeodynamics docker solution for M1 soon.

HanyMKhalil commented 3 years ago

Thanks Julian so much yes things are quite clear now

HanyMKhalil commented 2 years ago

Hi Julian, Romain,

I am sorry had to open this again as I am now working on my mac m1 entirely and i use binder to adjust my codes online I upload the script change it, download it, then remove it so that it is not public, is that correct or I can leave my codes on binder workspace?

also I tried to follow Romain guide to install UWgeo on mac M1 but the problem is the brew function that is used to install doesnot exist on my mac terminal gives this error: -bash: brew: command not found

I searche donline and i used many lines to install homebrew and brew on my mac but after it is successfuly installed whe I run brew help gives me same error, so I am not sure how can I proceed now??

any advise?

HanyMKhalil commented 2 years ago

Hi all an update I was able to get the brew run and also installed successfuly the h5py however when i reached the last step which is pip3 install underworld2/

i got this error:

ERROR: Command errored out with exit status 1: command: /Users/hanykhalil/uw2_virtualenv/bin/python3.9 /Users/hanykhalil/uw2_virtualenv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/tmp9mga0b30 cwd: /Users/hanykhalil/underworld2 Complete output (83 lines): /private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/dist.py:493: UserWarning: Normalizing '2.12.0-dev' to '2.12.0.dev0' warnings.warn(tmpl.format(**locals())) running bdist_wheel running build running build_py running build_ext CMake Deprecation Warning at CMakeLists.txt:5 (cmake_policy): The OLD behavior for policy CMP0078 will be removed from a future version of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances.  Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

CMake Error at CMakeLists.txt:7 (project): Running

 '/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-e4aiwpq2/overlay/bin/ninja' '--version'

failed with:

 No such file or directory

-- Configuring incomplete, errors occurred! See also "/Users/hanykhalil/underworld2/build/temp.macosx-12-arm64-3.9_libUnderworld/CMakeFiles/CMakeOutput.log". See also "/Users/hanykhalil/underworld2/build/temp.macosx-12-arm64-3.9_libUnderworld/CMakeFiles/CMakeError.log".

==> Configuring: $ cmake -S /Users/hanykhalil/underworld2/underworld/libUnderworld -B /Users/hanykhalil/underworld2/build/temp.macosx-12-arm64-3.9_libUnderworld -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/Users/hanykhalil/underworld2/build/lib.macosx-12-arm64-3.9/underworld -DPython3_ROOT_DIR=/Users/hanykhalil/uw2_virtualenv -DCALL_FROM_SETUP_PY:BOOL=ON

==> Building: $ cmake --build /Users/hanykhalil/underworld2/build/temp.macosx-12-arm64-3.9_libUnderworld --config Release

==> Installing: $ cmake --install /Users/hanykhalil/underworld2/build/temp.macosx-12-arm64-3.9_libUnderworld

Traceback (most recent call last): File "/Users/hanykhalil/uw2_virtualenv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in main() File "/Users/hanykhalil/uw2_virtualenv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main json_out['return_val'] = hook(hook_input['kwargs']) File "/Users/hanykhalil/uw2_virtualenv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel return _build_backend().build_wheel(wheel_directory, config_settings, File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 230, in build_wheel return self._build_with_temp_dir(['bdist_wheel'], '.whl', File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir self.run_setup() File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 158, in run_setup exec(compile(code, file, 'exec'), locals()) File "setup.py", line 289, in setup(name='underworld', File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/init.py", line 155, in setup return distutils.core.setup(attrs) File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup return run_commands(dist) File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands dist.run_commands() File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands self.run_command(cmd) File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command cmd_obj.run() File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/normal/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run self.run_command('build') File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command cmd_obj.run() File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/private/var/folders/r1/36rhkg716b1g6m75c4sqblmh0000gn/T/pip-build-env-md1q_uit/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command cmd_obj.run() File "setup.py", line 138, in run self.build_extension(ext) File "setup.py", line 244, in build_extension subprocess.check_call(configure_command) File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '-S', '/Users/hanykhalil/underworld2/underworld/libUnderworld', '-B', '/Users/hanykhalil/underworld2/build/temp.macosx-12-arm64-3.9_libUnderworld', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_INSTALL_PREFIX:PATH=/Users/hanykhalil/underworld2/build/lib.macosx-12-arm64-3.9/underworld', '-DPython3_ROOT_DIR=/Users/hanykhalil/uw2_virtualenv', '-DCALL_FROM_SETUP_PY:BOOL=ON']' returned non-zero exit status 1.

ERROR: Failed building wheel for underworld Failed to build underworld ERROR: Could not build wheels for underworld, which is required to install pyproject.toml-based projects

rbeucher commented 2 years ago

I think the new docker ARM64 images should fix this issue. I am closing it.