Skip to content

Precompilation fails: LaMEM overwrites ReadVTK.piece(::VTKFile) #95

@wenrongcao

Description

@wenrongcao

Hi Boris and others,

I’m seeing a precompilation failure when importing LaMEM (v0.4.8) although test LaMEM shows all tests passed.

To reproduce this failure: Julia> using LaMEM.

Julia tries to precompile LaMEM and errors with method overwriting during precompilation:

[ Info: Precompiling LaMEM [2e889f3d-35ce-4a77-8ea2-858aecb630f7]
WARNING: Method definition piece(ReadVTK.VTKFile) in module ReadVTK at /Users/wenrongcao/.julia/packages/ReadVTK/cMvIT/src/ReadVTK.jl:186 overwritten in module IO_functions at /Users/wenrongcao/.julia/packages/LaMEM/hssJ1/src/read_timestep.jl:279.
ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
┌ Info: Skipping precompilation due to precompilable error. Importing LaMEM [2e889f3d-35ce-4a77-8ea2-858aecb630f7].
└   exception = Error when precompiling module, potentially caused by a __precompile__(false) declaration in the module.

After this, LaMEM may still import (with “Skipping precompilation…”), but the module is not cached and the warning/error repeats in sessions and can also show up when other packages trigger extension precompilation Julia> using Plots.

It is likely that 'src/read_timestep.jl' defines a method: piece(::ReadVTK.VTKFile) that appears to overwrite an existing method in ReadVTK: piece(::ReadVTK.VTKFile) in ReadVTK.jl:186.

I am using:
Julia Version 1.12.3, macOS (x86_64-apple-darwin24.0.0, GeophysicalModelGenerator v0.7.16, LaMEM v0.4.8, Plots v1.41.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions