When I do Pkg.add(url="https://github.com/AhmedSalih3d/SPHExample.git")
It seems to work and after installing for a few minutes it then outputs:
Precompiling project...
✗ SPHExample
73 dependencies successfully precompiled in 126 seconds. 46 already precompiled.
1 dependency errored.
For a report of the errors see `julia> err`. To retry use `pkg> precompile`
So SPHExample was never installed, which is unfortunate. I really am unsure where to start on this?
It works fine for me when I do a ‘git clone’ directly and then run the main script, but does not when trying to do it the more Julia way, through Pkg.add.
Any pointers or anyone who can spot what I am missing?
EDIT: And err outputs the following, which I just realized.
julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:
SPHExample [49649ea8-6f54-4931-9342-0ba915f114f7]
Failed to precompile SPHExample [49649ea8-6f54-4931-9342-0ba915f114f7] to "C:\\Users\\-\\.julia\\compiled\\v1.10\\SPHExample\\jl_E56F.tmp".
ERROR: LoadError: Creating a new global in closed module `Main` (`AuxillaryFunctions`) breaks incremental compilation because the side effects will not be permanent.
Stacktrace:
[1] includet(mod::Module, file::String)
@ Revise C:\Users\-\.julia\packages\Revise\FaTes\src\packagedef.jl:1026
[2] includet(file::String)
@ Revise C:\Users\-\.julia\packages\Revise\FaTes\src\packagedef.jl:1031
[3] top-level scope
@ C:\Users\-\.julia\packages\SPHExample\fR52f\src\SPHExample.jl:1
[4] include
@ Base .\Base.jl:495 [inlined]
[5] 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:2216
[6] top-level scope
@ stdin:3
in expression starting at C:\Users\-\.julia\packages\SPHExample\fR52f\src\SPHExample.jl:1
in expression starting at stdin:3
Try getting rid of Revise.jl altogether as a dependency (of your package, I’m not talking about the REPL), pretty sure your package doesn’t need it. Use include instead of includet, of course.
If the problem persists afterwards, give the error messages again.
Revise should only be used for when developing the package not the final release, got it.
Now I get:
julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:
SPHExample [49649ea8-6f54-4931-9342-0ba915f114f7]
Failed to precompile SPHExample [49649ea8-6f54-4931-9342-0ba915f114f7] to "C:\\Users\\-\\.julia\\compiled\\v1.10\\SPHExample\\jl_247.tmp".
ERROR: LoadError: UndefVarError: `include` not defined
I suppose a simple using Pkg at top will fix it, but I don’t think I’ve seen other packages do that?
Made a branch here with the changes of removing Revise, and it outputs the error above:
You have to enclose your package code into a module: module SPHExample ... end.
Also, you shouldn’t have Manifest.toml in your Git repo, usually it’s in .gitignore (as automatically set up by PkgTemplates.jl), so you don’t have to worry about that.
And don’t forget to delete Revise.jl from your package’s deps, in Project.toml.