Failure to add package Gmsh

I fail to install package Gmsh. After Pkg.add(“Gmsh”), using Gmsh and Pkg.build(“Gmsh”) produce the errors below. I am an administrator on my Windows 10 environment running Julia 1.2 yet Pkg.build command seems to think otherwise: “On Windows, creating file symlinks requires Administrator privileges”. Any help appreciated. -Eric

ERROR: LoadError: Gmsh not installed properly, run Pkg.build(“Gmsh”), restart Julia and try again
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] top-level scope at C:\Users\emichiel.julia\packages\Gmsh\eZVOZ\src\Gmsh.jl:6
[3] include at .\boot.jl:328 [inlined]
[4] include_relative(::Module, ::String) at .\loading.jl:1094
[5] include(::Module, ::String) at .\Base.jl:31
[6] top-level scope at none:2
[7] eval at .\boot.jl:330 [inlined]
[8] eval(::Expr) at .\client.jl:432
[9] top-level scope at .\none:3
in expression starting at C:\Users\emichiel.julia\packages\Gmsh\eZVOZ\src\Gmsh.jl:5

julia> Pkg.build(“Gmsh”)
Building Gmsh → C:\Users\emichiel\.julia\packages\Gmsh\eZVOZ\deps\build.log
┌ Error: Error building Gmsh:
│ ┌ Warning: On Windows, creating file symlinks requires Administrator privileges
│ └ @ Base.Filesystem file.jl:797
│ ERROR: LoadError: Your platform (“x86_64-w64-mingw32”, parsed as “x86_64-w64-mingw32-gcc7-cxx11”) is not supported by this package!
│ Stacktrace:
│ [1] error(::String) at .\error.jl:33
│ [2] top-level scope at C:\Users\emichiel.julia\packages\Gmsh\eZVOZ\deps\build.jl:26
│ [3] include at .\boot.jl:328 [inlined]
│ [4] include_relative(::Module, ::String) at .\loading.jl:1094
│ [5] include(::Module, ::String) at .\Base.jl:31
│ [6] include(::String) at .\client.jl:431
│ [7] top-level scope at none:5
│ in expression starting at C:\Users\emichiel.julia\packages\Gmsh\eZVOZ\deps\build.jl:22
│ caused by [exception 1]
│ IOError: symlink: operation not permitted (EPERM)
│ Stacktrace:
│ [1] uv_error at .\libuv.jl:90 [inlined]
│ [2] symlink(::String, ::String) at .\file.jl:800
│ [3] probe_symlink_creation(::String) at C:\Users\emichiel.julia\packages\BinaryProvider\gnxnM\src\PlatformEngines.jl:121
│ [4] #probe_platform_engines!#30(::Bool, ::typeof(BinaryProvider.probe_platform_engines!)) at C:\Users\emichiel.julia\packages\BinaryProvider\gnxnM\src\PlatformEngines.jl:175
│ [5] probe_platform_engines! at C:\Users\emichiel.julia\packages\BinaryProvider\gnxnM\src\PlatformEngines.jl:169 [inlined]
│ [6] init() at C:\Users\emichiel.julia\packages\BinaryProvider\gnxnM\src\BinaryProvider.jl:28
│ [7] _include_from_serialized(::String, ::Array{Any,1}) at .\loading.jl:685
│ [8] _require_search_from_serialized(::Base.PkgId, ::String) at .\loading.jl:765
│ [9] _require(::Base.PkgId) at .\loading.jl:990
│ [10] require(::Base.PkgId) at .\loading.jl:911
│ [11] require(::Module, ::Symbol) at .\loading.jl:906
│ [12] include at .\boot.jl:328 [inlined]
│ [13] include_relative(::Module, ::String) at .\loading.jl:1094
│ [14] include(::Module, ::String) at .\Base.jl:31
│ [15] include(::String) at .\client.jl:431
│ [16] top-level scope at none:5
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\Pkg\src\backwards_compatible_isolation.jl:647
false

There seems to be an issue with your C/C++ environment. Look at ERROR: LoadError: Your platform (“x86_64-w64-mingw32”, parsed as “x86_64-w64-mingw32-gcc7-cxx11”) is not supported by this package!

Thanks. I would like to create fairly simple 2D triangular meshes for a finite element code. Are there other Julia packages that you recommend?

Check out FinEtools. It can do a bit. Targe2.jl might also be helpful.

It seems that the Gmsh package for Julia does not support a windows version:
….julia\packages\Gmsh\eZVOZ\deps\build.jl

download_info = Dict(
    MacOS(:x86_64) => ("$bin_prefix/gmsh.v4.4.1.x86_64-apple-darwin14.tar.gz", "a29d761a6826bbca16e500b195c1ddd22487fd62ae8be99930e3755a1e170c33"),
    Linux(:x86_64, libc=:glibc) => ("$bin_prefix/gmsh.v4.4.1.x86_64-linux-gnu.tar.gz", "f9bb150e70877ad1c2da1edae697f5275776ffcff9c682f666d58f032c87ae89"),
)

But you can download the gmsh SDK:
http://gmsh.info/bin/Windows/gmsh-4.4.1-Windows64-sdk.zip
Unpack the Zip file to some folder and open the Julia REPL:

julia> include(raw"d:\YOUR_PATH_TO\gmsh-git-Windows64-sdk\lib\gmsh.jl")
Main.gmsh

julia> gmsh.initialize(ARGS)

julia> gmsh.model.add("sphere_cut")

julia> R = 1
1

julia> R1 = 0.95
0.95

julia> sph = gmsh.model.occ.addSphere(0,0,0, R, -1, 0, pi/2, pi/2)
1

julia> b1 = gmsh.model.occ.addBox(R1,0,0, R,R,R)
2

julia> b2 = gmsh.model.occ.addBox(0,R1,0, R,R,R)
3

julia> b3 = gmsh.model.occ.addBox(0,0,R1, R,R,R)
4

julia> gmsh.model.occ.cut([(3,sph)], [(3,b1), (3,b2), (3,b3)])
(Tuple{Int32,Int32}[(3, 1)], Array{Tuple{Int32,Int32},1}[[(3, 1)], [], [], []])

julia> gmsh.model.occ.synchronize()

julia>

julia> gmsh.model.removeEntities([(3,sph)])

julia> gmsh.model.removeEntities([(2,2), (2,4), (2,6)], true)

julia> gmsh.fltk.run()

The last command opens the gmsh GUI with the 3D sphere model.
The commands are taken from file
d:\YOUR_PATH_TO\gmsh-git-Windows64-sdk\share\doc\gmsh\demos\api\spherical_surf.jl

2 Likes

And there is something which may also help:
https://github.com/JuliaFEM/Gmsh.jl/issues/4

1 Like

THANKS. This worked.
I’m afraid the “directly download Gmsh SDK” route is beyond my grasp…

1 Like

Has a new method for handling this issue on windows come about in the past year? I was able to bypass the issue by using the “include…” method, but it would be nice if something like “] add Gmsh” just worked.

I’m considering using Julia and gmsh for some small projects, but I would like my colleagues to be able easily reproduce code.

Any help is appreciated.

Now Gmsh 4.10 was compiled with BinaryBuilder.jl on all supported platforms (windows included), with open cascade and FLTK, and is available in the gmsh_jll package. So :

]add gmsh_jll
using gmsh_jll
include(gmsh_jll.gmsh_api)

should do what you wanted.

I am currently unable to install simultaneously Gmsh.jl version 0.3 and MUMPS.jl version 1.4.

The problem is the dependency on SCOTCH_jll.jl:

  • MUMPS@1.4 requires SCOTCH_jll@7.0.4 (this is specified in the compat section of the file project.toml of MUMPS_jll.jl)
  • Gmsh@0.3 requires MMG_jll.jl version 5.6 and, when installing MMG_jll@5.6, Pkg downgrades SCOTCH_jll to version 6.1.3 (I don’t understand why since the version of SCOTCH_jll is not specified in the project.toml file of MGG_jll).

Does anyone have a solution?

1 Like