JuliaFEM / Gmsh.jl

Gmsh.jl contains API for Gmsh: a three-dimensional finite element mesh generator. With the help of Gmsh.jl, it is possible add parametric model construction and/or automatic mesh generation to a FEM pipeline.
MIT License
52 stars 13 forks source link

Gmsh fails on initial build in macOS (but not unsupported platform error) #1

Closed CrashBurnRepeat closed 5 years ago

CrashBurnRepeat commented 5 years ago

When trying to build Gmsh for the first time on macOS, I get the following error:

(v1.1) pkg> add https://github.com/JuliaFEM/Gmsh.jl.git
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Cloning git-repo `https://github.com/JuliaFEM/Gmsh.jl.git`
  Updating git-repo `https://github.com/JuliaFEM/Gmsh.jl.git`
 Resolving package versions...
  Updating `~/.julia/environments/v1.1/Project.toml`
  [705231aa] + Gmsh v0.1.0 #master (https://github.com/JuliaFEM/Gmsh.jl.git)
  Updating `~/.julia/environments/v1.1/Manifest.toml`
  [705231aa] + Gmsh v0.1.0 #master (https://github.com/JuliaFEM/Gmsh.jl.git)
  Building Gmsh → `~/.julia/packages/Gmsh/9J8He/deps/build.log`
┌ Error: Error building `Gmsh`: 
│ ERROR: LoadError: MethodError: no method matching iterate(::Nothing)
│ Closest candidates are:
│   iterate(!Matched::Core.SimpleVector) at essentials.jl:568
│   iterate(!Matched::Core.SimpleVector, !Matched::Any) at essentials.jl:568
│   iterate(!Matched::ExponentialBackOff) at error.jl:199
│   ...
│ Stacktrace:
│  [1] indexed_iterate(::Nothing, ::Int64) at ./tuple.jl:66
│  [2] top-level scope at /Users/crashburnrepeat/.julia/packages/Gmsh/9J8He/deps/build.jl:24
│  [3] include at ./boot.jl:326 [inlined]
│  [4] include_relative(::Module, ::String) at ./loading.jl:1038
│  [5] include(::Module, ::String) at ./sysimg.jl:29
│  [6] include(::String) at ./client.jl:403
│  [7] top-level scope at none:0
│ in expression starting at /Users/crashburnrepeat/.julia/packages/Gmsh/9J8He/deps/build.jl:21
└ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075

Looking through the source code, it seems only Linux is supported at the moment, and there is logic for catching build errors on unsupported platforms, but it seems that this error is a different type than the one anticipated. Does this logic need to be revised to show the correct error, assuming this is an unsupported platform problem? Even better, is there a chance that binaries can be built for OSs other than Linux?

If there's more information that I can provide, please let me know.

ahojukka5 commented 5 years ago

What Julia version are you using? That build.jl template is taken from BinaryProvider.jl, I think. I make binaries only for Linux at first because I wanted to have something working soon. Creating binaries for other operating systems should be trivial, as long as Gmsh is compiling. We also should disable unnecessary parts (at least GUI) in the build process to reduce the size of the binary, it's over 100 MB now.

CrashBurnRepeat commented 5 years ago

I knew there would be something obvious I'd miss; I'm using version 1.1.0 (2019-01-21). Since I have the Mac to validate on, is this something I could assist with? I'm trying to do a port of some electromagnetic code to Julia, so this would be a big help.

ahojukka5 commented 5 years ago

Everything should work with the newest versions. It seems that the problem is this line:

url, tarball_hash = choose_download(download_info)

choose_download is returning nothing and unpacking to two variables is trying to iterate on that. Usually the function should return the tuple shown in download_info, i.e.

("$bin_prefix/gmsh.v4.1.5.x86_64-linux-gnu.tar.gz", "b037e5376bbe9a381f5938936cbea4f99feafa7f3f1705357d1a5950cfe54061")

for Linux binaries. I think the problem finally is that there is no compiled binaries for OSX at the moment.

ahojukka5 commented 5 years ago

I copied the template from a mock package LibFoo.jl, https://github.com/JuliaPackaging/BinaryProvider.jl/blob/master/test/LibFoo.jl/deps/build.jl#L37. Maybe @staticfloat knows is there any internal changes how choose_download works or is it just me.

ahojukka5 commented 5 years ago

I'm anyway compiling the OSX binaries now so if everything goes like in movies soon this issue should vanish.

ahojukka5 commented 5 years ago

Ok, it looks that the structure of build.jl has been changing. After PR #2 everything should be fine, also for OSX.

ahojukka5 commented 5 years ago

Also, it looks that 4.2.2 version has been released a couple of days ago, I also update binaries to that.

ahojukka5 commented 5 years ago

This package should be tagged so that it can be found from metadata as usual. Any ideas should this follow what version number, Gmsh or...? cc: @TeroFrondelius

ahojukka5 commented 5 years ago

Ok, now we should have support for OSX also. Have you considered doing electromagnetism using JuliaFEM? I would be happy to help with that. After all, we are aiming to be multiphysics and I'm interested to see what new challenges is electromagnetism is giving.

staticfloat commented 5 years ago

Yep, looks like you've figured it out. :)

CrashBurnRepeat commented 5 years ago

I just got the chance to pull these updates on my Mac, and things seem to be good (at least I was able to pull the update and precompile). I also have access to a Windows machine and the correct error was shown when I pull the new code, although I don't need a Windows binary at this point.

@ahojukka5, much thanks for the speedy response, and I'll write you separately about the EM work I'm hoping to do.