Hello,
I was able to get it working, with some slight modifications to the above procedure. I will try to describe the issue, and my fix (which is a messy kludge). If you just want the binary, I uploaded it
here . It was compiled with go version 1.10.8, and cuda 11.3. You will need a matching cuda version to be compatible with running it.
There are two major issues:
1- the paths in all the .go files needed to be updated. When you run 'go get', it downloads both the ME version, and normal mumax, and the paths inside the ME files point to normal mumax. That's why it defaults to building without the ME extension, despite downloading the files. For example, if you look inside main.go for the ME version, it imports "
github.com/mumax/3/engine" when it really should look to "
github.com/Fredericvdv/Magnetoelasticity_MuMax3/engine"
To get around this, i downloaded a local copy, and built it using "go install" instead of "go get" command. In principle, if you update all the paths yourself in the .go files (there are not many, maybe 10 or so, most of which are similar to "
github.com/mumax/3/engine"), this should be sufficient. I was not able to get the paths to format correctly (I am not sure why, i tried both windows/linux syntax, however I am not very familiar with Go/git). For example, naively replacing "
github.com/mumax/3/engine" -> "
github.com/Fredericvdv/Magnetoelasticity_MuMax3/engine" in the .go files did not work.
As a workaround, what i did was delete the normal mumax files, and renamed the ME folder to the normal mumax folder names (this renaming should be done inside git using mv command, not just using windows). This requires only 2 folder name changes "Fredericvdv"->"mumax" and "Magnetoelasticity_Mumax"->"3". So now when it looks to import "
github.com/mumax/3/engine", it is tricked to looking to the ME engine.
If you do this properly, inside git you should be able to cd to a path that looks like "~\go\src\
github.com\mumax\3\cmd\mumax3" , where ~ is your GOPATH (by default, something like "C:\Users\Josh"). In this directory, run "go mod init", and then "go install".
2- The second major issue is the go version. In addition to the above, you need an updated version of go, but not the most recent versions. The version mykola lists (1.4.2) does not work for the ME version. However, it also needs to be before version 1.11, as there was a change in go convention for path variables, where it switched to modules. This also breaks the compile. There is an environment variable called GO111MODULE you can set =off that is supposed to disable the modules and revert to the old GOPATH method for versions of go >1.11 , but I couldn't get it to work. I ended up using version 1.10.8 .
The full procedure is thus:
(a) install CUDA into default location; (for windows, default is "C:\cuda\")
(c) make sure GOROOT and GOPATH environment variable are set according to your needs (see more at
https://golang.org/doc/code.html, the installer should set GOROOT automatically);
(e) open msysgit command prompt;
(f) type "go env" (it will show your GOROOT and GOPATH. GOROOT by default should be "C:\Go". My GOPATH was "C:\Users\Josh\go")
(f) type 'go version'
(g) if it says 'go version go1.10.8 ...' then type 'go get -u -v
github.com/Fredericvdv/Magnetoelasticity_MuMax3/...' ; ( this will fail, but it will download the files to the appropriate place for you. alternatively you can just download the files off github and place them in "C:\Users\Josh\go\src\
github.com" , where "C:\Users\Josh\" is replaced by your GOPATH )
(i) type 'ls' (there should be 2 folders. one named mumax, and one named Fredericvdv)
(j) type 'rm -r mumax'
(k) type 'mv Fredericvdv mumax'
(l) type 'cd mumax'
(m) type 'mv Magnetoelasticity_MuMax3 3'
(n) type 'cd 3/cmd/mumax3/'
(o) type "go mod init"
(p) type "go install"
(q) if (p) is successful, then type 'mumax3 -i' and the interactive session should emerge in your default web browser;
Let me know if you have any questions, or run into trouble. It took me a few days to finally troubleshoot each step, the error messages are not intuitive, and the above is the result of several days of trial and error. It's also possible some steps are redundant/unnecessary.
Best,
Josh L.