-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with oommf - compile from source on M1/M2 #270
Comments
I am guessing you may have a M1/M2/M3 processor? If so, then the problem is that there is no conda package for OOMMF for the M1/M2/M3 architecture at the moment. Try to follow the instructions in the |
Hello, and thanks for your reply and for your help. As I mentioned above, I firstly tried conda and then the advanced installation using pip, but still I get the error "cannot find OOMMF". Any help would be greatly appreciated |
Did you compile OOMMF? |
yep, I typed cd oommf and then make build |
The compilation of OOMMF looks fine. By the way, you can copy and paste code into these issues (rather than posting screenshots). That's generally better as there is less data to move, and we can search the charactors you post. This is explained here for example. ≈ |
Ok, sorry for that- I will copy and paste code from now onwards. Any suggestions by the way on what to do with the error? Thanks again |
Did you do anything to export the [This is a good occasion to check the instructions work for you and are correct.] Could you (in a Terminal App window) run the command python3 -c "import oommfc; oommfc.runner.runner.status" from https://ubermag.github.io/installation.html#check-the-installation and post the command and output, please. |
Also a echo $OOMMFTCL would be interesting to run in the same shell (i.e. in the Terminal App window). |
mirocafolla@192 oommf % export OOMMFTCL="/Users/mirocafolla/oommf/oommf.tcl" this is what I did after make build |
(base) mirocafolla@192 oommf % python3 -c "import oommfc; oommfc.runner.runner.status" |
(base) mirocafolla@192 oommf % echo $OOMMFTCL |
I think that it says because I have tried to export OOMMF into different directories. Firstly into /Users/mirocafolla/oommf, and then into /Users/mirocafolla/anaconda3/lib/python3.10/site-packages/oommf/oommf.tcl as the former was not working. Neither works though |
Please use
to make your code snippets look nicer. You can use the "Preview" tab to check. This should look like fangohr@MBAM2 docker % echo "Hello world"
Hello world |
(base) mirocafolla@192 oommf % echo "Hello world" |
The OOMMFTCL variable needs to point to the export OOMMFTCL="/Users/mirocafolla/oommf/oommf.tcl" Once you have done that, please run echo $OOMMFTCL so we can double check this has worked. Then please run ls -l $OOMMFTCL and finally python3 -c "import oommfc; oommfc.runner.runner.status" and copy and paste the commands and outputs here (all together in one code block is fine). |
(base) mirocafolla@192 oommf % export OOMMFTCL="/Users/mirocafolla/oommf/oommf.tcl" |
base) mirocafolla@192 oommf % ls -l $OOMMFTCL
ls: /Users/mirocafolla/oommf/oommf.tcl: No such file or directory this means that the file ( Perhaps it is |
Thanks for running that. In particular, I was hoping for this formatting of your output: (base) mirocafolla@192 oommf % echo "Hello world"
Hello world |
Good morning, and thank you very much for all your help with this. I tried this and I think that we are getting there! :) (base) mirocafolla@192 oommf % export OOMMFTCL="/Users/mirocafolla/oommf/oommf/oommf.tcl" (base) mirocafolla@192 oommf % ls -l $OOMMFTCL |
However, when I run it in the console it keeps on returning the same error runfile('/Users/mirocafolla/.spyder-py3/temp.py', wdir='/Users/mirocafolla/.spyder-py3') File ~/anaconda3/lib/python3.10/site-packages/spyder_kernels/py3compat.py:356 in compat_exec File ~/.spyder-py3/temp.py:22 File ~/anaconda3/lib/python3.10/site-packages/oommfc/oommf/oommf.py:572 in autoselect_runner OSError: Cannot find OOMMF. I tried close and relaunch, but still the same error :( |
My bad. I think that it is now working. I slightly modified my Python code adding some extra lines with respect to the demo and it is seems okay import numpy oommfc.runner oommfc.runner.runner = oommfc.oommf.TclOOMMFRunner("/Users/mirocafolla/oommf/oommf/oommf.tcl") import matplotlib.pyplot as plt system = mm.System(name='first_ubermag_simulation') A = 1e-12 # exchange energy constant (J/m) L = 50e-9 # cubic sample edge length (m) Ms = 8e6 # saturation magnetisation (A/m) print (system.energy) print(f'{ubermag.version=}, {oommfc.version=}') md = oommfc.MinDriver() |
and this is the output runfile('/Users/mirocafolla/.spyder-py3/temp.py', wdir='/Users/mirocafolla/.spyder-py3') |
Once again, thank you so much for all your help. I will now get through the other demo examples, and will then simulate my own system. Hopefully, I will not be bothering you again! :) |
(base) mirocafolla@192 oommf % ls -l $OOMMFTCL
-rwxr-xr-x 1 mirocafolla staff 14625 26 Dic 18:43 /Users/mirocafolla/oommf/oommf/oommf.tcl
(base) mirocafolla@192 oommf % python3 -c "import oommfc; oommfc.runner.runner.status"
Running OOMMF (TclOOMMFRunner)[2024/01/07 10:03]... (2.4 s)
OOMMF found and running.
(base) mirocafolla@192 oommf % just to confirm that this is the output we are hoping for. So the OOMMFTCL variable is correct then, and Ubermag can find and execute OOMMF at that location. At least if you call Python from that command line (where the OOMMFTCL environment variable is defined). |
So here you are running inside Spyder. This Python instance presumably doesn't know about the OOMMFTCL variable; perhaps because you started Spyder in a different shell or before you defined the OOMMFTCL variable. One thing you can try to to set the variable as before ( Does it work then? |
Setting the path directly from Python ( |
Thanks! |
This is a different problem. Please open a new issue. |
@MiroCaf - can you please try what I suggested above? (It might be useful info to fix your next problem.) Also, in your home directory, you probably have a file call ls -l -a ~/.profile If it exists, then open it in a text editor (you can use Spyder), and add a line at the end containing |
Thanks again. Shall I open a new issue anyway with the other problem? |
I tried to do what you were suggesting. Maybe I am doing something wrong but this is what I get (base) mirocafolla@192 ~ % ls -l -a ~/.profile |
That's interesting, thank you. Could you run a |
ls: /Users/mirocafolla/.profile: No such file or directory
(base) mirocafolla@192 / % ls -l -a ~/
total 832
drwxr-xr-x+ 41 mirocafolla staff 1312 6 Gen 21:15 .
drwxr-xr-x 5 root admin 160 4 Apr 2020 ..
-rw-r--r--@ 1 mirocafolla staff 14340 31 Dic 10:53 .DS_Store
drwx------@ 2 mirocafolla staff 64 6 Gen 19:18 .Trash
drwxr-xr-x 4 mirocafolla staff 128 26 Dic 20:21 .anaconda
-rw------- 1 mirocafolla staff 539 27 Dic 08:56 .bash_history
-rw-r--r-- 1 mirocafolla staff 503 8 Apr 2023 .bash_profile
drwxr-xr-x 4 mirocafolla staff 128 7 Gen 19:39 .conda
-rw-r--r-- 1 mirocafolla staff 49 29 Dic 15:26 .condarc
drwxr-xr-x 4 mirocafolla staff 128 17 Apr 2023 .config
drwxr-xr-x 3 mirocafolla staff 96 11 Apr 2023 .continuum
drwxr-xr-x 3 mirocafolla staff 96 27 Dic 09:48 .ipynb_checkpoints
drwxr-xr-x 3 mirocafolla staff 96 11 Apr 2023 .ipython
drwxr-xr-x 4 mirocafolla staff 128 27 Dic 09:48 .jupyter
drwxr-xr-x 3 mirocafolla staff 96 11 Apr 2023 .matplotlib
drwxr-xr-x 6 mirocafolla staff 192 29 Dic 19:12 .pytest_cache
drwxr-xr-x 19 mirocafolla staff 608 7 Gen 13:04 .spyder-py3
-rw-r--r-- 1 mirocafolla staff 323 8 Apr 2023 .tcshrc
drwxr-xr-x 3 mirocafolla staff 96 30 Dic 09:25 .virtual_documents
drwx------ 4 mirocafolla staff 128 27 Set 2020 .vnc
-rw-r--r-- 1 mirocafolla staff 691 8 Apr 2023 .xonshrc
-rw-r--r-- 1 mirocafolla staff 243 23 Dic 19:14 .zprofile
-rw------- 1 mirocafolla staff 8706 6 Gen 16:45 .zsh_history
-rw-r--r-- 1 mirocafolla staff 502 8 Apr 2023 .zshrc |
Okay, thanks. I'd like to know if you are using bash or zsh. Please enter echo $SHELL and post the output. |
Can you also edit your |
Good morning and thank you very much once again for all your help :) |
(base) mirocafolla@192 / % ~/.bash_profile |
(base) mirocafolla@192 / % python -c "import ubermag; ubermag.test()" ...... |
(base) mirocafolla@192 oommf % python3 -c "import oommfc; oommfc.runner.runner.status" |
But now python seems to be running okay with just import ubermag without the need for oommfc.runner.runner = oommfc.oommf.TclOOMMFRunner("/Users/mirocafolla/oommf/oommf/oommf.tcl" |
Recently, I found an easier way to install UBERMAG on a Mac (M1/M2 chip). I had to build an osx-64 environment within my M2 Mac in the following way:
Then use |
Hello,
I am working on a MacOs. I have installed anaconda and python 3.10. I followed the instructions which suggested to install Ubermag using conda, but I get the error below.
I thus used pip and everything seemed ok in the terminal. However when running the first simulation, I get the error below
Any help would be greatly appreciated.
Thanks,
Miro
The text was updated successfully, but these errors were encountered: