JuliaFEM failed to precompile

Hi Guys

I am new to Julia, I have tried to install the JuliaFEM package however there seems to be some issues, please refer to the below errors when running the test. I have seen a post about this with the solution requiring one to revert back to an older version of Julia, noting that this was in 2021(I think). Has there been any resolution to the given problem?

I couldn’t paste everything due to the size limitation, however I have pasted a typical error which is being outputted.

ERROR: LoadError: Failed to precompile FEMBasis [353fb843-c566-51e6-ba49-78b3e3d5ebb5] to “C:\Users\mishal.mohanlal\.julia\compiled\v1.9\FEMBasis\jl_91FA.tmp”.
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:2300
[3] compilecache
@ .\loading.jl:2167 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
[9] include
@ .\Base.jl:457 [inlined]
[10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
@ Base .\loading.jl:2049
[11] top-level scope
@ stdin:3
in expression starting at C:\Users\mishal.mohanlal.julia\packages\FEMBase\qGDOl\src\FEMBase.jl:4
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile FEMBase [fbcbbc08-f1bf-5204-9233-b69f5d396135] to “C:\Users\mishal.mohanlal\.julia\compiled\v1.9\FEMBase\jl_8F0C.tmp”.
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:2300
[3] compilecache
@ .\loading.jl:2167 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
[9] include
@ .\Base.jl:457 [inlined]
[10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
@ Base .\loading.jl:2049
[11] top-level scope
@ stdin:3
in expression starting at C:\Users\mishal.mohanlal.julia\packages\MortarContact2DAD\Rq4yL\src\MortarContact2DAD.jl:4
in expression starting at stdin:3

FEMBase [fbcbbc08-f1bf-5204-9233-b69f5d396135]

Failed to precompile FEMBase [fbcbbc08-f1bf-5204-9233-b69f5d396135] to “C:\Users\mishal.mohanlal\.julia\compiled\v1.9\FEMBase\jl_8367.tmp”.

Hi
Try some other FEM packages, like Gridap.jl. Here is a more complete list of choices: GitHub - JuliaPDE/SurveyofPDEPackages: Survey of the packages of the Julia ecosystem for solving partial differential equations

Thanks, I was specifically looking to use JuliaFEM.

May I ask why? Do you try to reproduce some old research results?

1 Like

It appears that precompilation has always been a problem for this package. Apparently many warnings were ignored until a Julia version outright errors, so precompilation was disabled for a dependency, and that also gets in the way of precompilation of packages that load it. I don’t know the lines that well myself, but basically precompilation occurs ahead of time for each package in isolation (“incremental”), so it can’t run any code with effects that can’t persist properly or interferes between packages. It’s fixable, but evidently JuliaFEM hasn’t had the resources for a few years. Ideally you can find a more staffed alternative.

I don’t have any experience working with unprecompilable packages, I’m not even sure if the JuliaFEM package was properly installed. But the docs mention starting the process as julia compiled-modules=no to disable precompilation, so maybe installing and importing would work there?

1 Like

I was looking into using the package to perform automated structural analysis on repetitive components.

I believe Gridap.jl is the answer for your task. We haven’t developed JuliaFEM.jl package in years. I lost all the doers meanwhile the other packages like Gridap revolutionized FEM ecosystem of Julia.

1 Like

Gridap looks amazing!!!

I am having an installation issue though. please refer to the below error.

julia> Pkg.add(“Gridap”)
Resolving package versions…
ERROR: Unsatisfiable requirements detected for package Gridap [56d4f2e9]:
Gridap [56d4f2e9] log:
├─possible versions are: 0.1.0-0.17.23 or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions: 0.1.0-0.17.23
├─restricted by compatibility requirements with StaticArrays [90137ffa] to versions: 0.7.0-0.17.23 or uninstalled, leaving only versions: 0.7.0-0.17.23
│ └─StaticArrays [90137ffa] log:
│ ├─possible versions are: 0.8.0-1.9.2 or uninstalled
│ ├─restricted by compatibility requirements with GXBeam [974624c9] to versions: 0.12.0-1.9.2
│ │ └─GXBeam [974624c9] log:
│ │ ├─possible versions are: 0.1.0-0.5.1 or uninstalled
│ │ └─restricted to versions * by an explicit requirement, leaving only versions: 0.1.0-0.5.1
│ └─restricted by compatibility requirements with Gridap [56d4f2e9] to versions: [0.10.0-0.10.3, 0.12.1-1.9.2], leaving only versions: 0.12.1-1.9.2
│ └─Gridap [56d4f2e9] log: see above
└─restricted by compatibility requirements with JLD2 [033835bb] to versions: 0.1.0-0.6.0 or uninstalled — no versions left
└─JLD2 [033835bb] log:
├─possible versions are: 0.1.0-0.4.45 or uninstalled
├─restricted by compatibility requirements with Reexport [189a3867] to versions: 0.1.0-0.4.3 or uninstalled
│ └─Reexport [189a3867] log:
│ ├─possible versions are: 0.2.0-1.2.2 or uninstalled
│ ├─restricted to versions * by an explicit requirement, leaving only versions: 0.2.0-1.2.2
│ └─restricted by compatibility requirements with JuliaFEM [f80590ac] to versions: 0.2.0
│ └─JuliaFEM [f80590ac] log:
│ ├─possible versions are: 0.5.0-0.5.1 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions: 0.5.0-0.5.1
└─restricted by julia compatibility requirements to versions: 0.4.28-0.4.45 or uninstalled, leaving only versions: uninstalled

Hi
Try with a clean environment: 4. Working with Environment · Pkg.jl

julia> cd("C:/Temp")
(@v1.10) pkg> activate CleanEnvironment
(CleanEnvironment) pkg> add Gridap

Similar suggestion as the last poster, but slightly different:

mkdir myproject
cd myproject
julia --project="."
]
add Gridap

Always create a local environment per project.

After the project is created, launch Julia like this:

cd myproject
julia --project
2 Likes