Comments (7)
@JoshuaLampert, can you take a look?
My current thought is that we probably should add HDF5_jll to the project if we are going to set a preference on it. The main question is can we do that for the user or not?
Before Julia 1.11 (master branch), adding a dependency on Pkg
was basically free, but from Julia 1.11, Pkg can be quite the dependency to load.
My main resolution here would be to add a friendlier message about adding HDF5_jll.jl to the project. Speculatively, we might be able to do the following for the user.
@eval Main begin
using Pkg
Pkg.add("HDF5_jll") # include UUID
end
from hdf5.jl.
If this (having to Pkg.add("HDF5_jll")
) is expected behavour, just having an error message saying this instead of the rather cryptic one in my original post would be good, and might be enough?
For me, it's not a problem to add HDF5_jll as long as I know that I'm supposed to have to do that, and it's not just a workaround for a bug.
from hdf5.jl.
IMO, it should also be possible without explicitly adding HDF5_jll. I look into it. But as a workaround you can add HDF5_jll to your project.
from hdf5.jl.
I cannot reproduce this. With an empty ~/.julia
directory in an empty project on julia 1.10.0:
julia> using Pkg
julia> Pkg.activate(".")
Activating new project at `~/test_hdf5_set_libraries`
julia> Pkg.status()
Status `~/test_hdf5_set_libraries/Project.toml` (empty project)
julia> Pkg.add("HDF5")
Installing known registries into `~/.julia`
[...]
julia> using HDF5
julia> hdf5_dir = "/usr/lib/x86_64-linux-gnu/hdf5/openmpi/"
"/usr/lib/x86_64-linux-gnu/hdf5/openmpi/"
julia> HDF5.API.set_libraries!(joinpath(hdf5_dir, "libhdf5.so"),
joinpath(hdf5_dir, "libhdf5_hl.so"))
[ Info: Please restart Julia and reload HDF5.jl for the library changes to take effect
EDIT: For me, HDF5_jll
is added to the [extras]
in the Project.toml when HDF5.API.set_libraries!
is called.
EDIT: As long as there are no preferences set, we load HDF5_jll and thus Preferences.jl finds it here. Once we have set the preferences, we have it in the Project.toml [extras]
and it is found here.
from hdf5.jl.
Did you have any LocalPreferences.toml in your active project before, @johnomotani? If yes, it should also work again after deleting the LocalPreferences.toml.
from hdf5.jl.
@JoshuaLampert thanks, yes it does work after deleting LocalPreferences.toml.
Sorry, I didn't work hard enough at making a reproducible example to start with! If I do what you did, but then delete everything in Project.toml while leaving LocalPreferences.toml there, then I get the error in the original post. Deleting LocalPreferences.toml fixes the problem. Doing Pkg.add("HDF5_jll")
also fixes the problem.
from hdf5.jl.
Yes, that makes sense. The problem only occurs when there are preferences in the LocalPreferences.toml and there is no HDF5_jll in the Project.toml. This is kind of an edge case since it only occurs when copying a LocalPreferences.toml file into a project or when manually deleting HDF5_jll from the Project.toml after setting the preferences, but not when setting the preferences normally. Should we catch this case anyway? If yes, I see two possibilities to deal with the situation:
- Give a more helpful error message that suggests to either delete the LocalPreferences.toml or
Pkg.add
ing HDF5_jll. - Make it work. For this, we have again some possibilities. Either
Pkg.add("HDF5_jll")
as suggested by @mkitti above, manually writeHDF5_jll
to the[extras]
section of the Project.toml similar to what Preferences.jl does, orusing HDF5_jll
(which also prevents Preferences.jl to raise the error). I'm not quite sure if the last two possibilities are feasible and don't have any negative side effects.
What are your thoughts on this, @mkitti?
from hdf5.jl.
Related Issues (20)
- Test failures in h5a_iterate HOT 1
- Changed requirements in HDF5_jll's `libhdf5.so` for `libcurl.so`? HOT 8
- Can't get HDF5.jl work with Julia running in docker (julia:1.8-alpine3.17) - can't find libmpi.so.12 HOT 6
- Add mid/high level interface for HDF5 Dimension Scale HOT 1
- Writing scalar datasets of compound types HOT 3
- freeze when `hdf5_type_id` on self-referential datatype HOT 17
- Get rid of HISTORY.md? HOT 1
- Segfault when writing variable length string as attribute HOT 8
- Feature request - add support for SparseMatrixCSC HOT 1
- Support szip (freely) HOT 5
- Installing HDF5.jl on ARM M1 HOT 5
- HDF5.jl triggers segfault in ccall with openmp+clang(m1) with julia 1.10 HOT 20
- Inconsistent writing of complex data inside compound type HOT 1
- h5_is_library_threadsafe() gives unreliable results due to unspecified initial value HOT 1
- The HDF Group CI
- Examine error handling per thread
- The H5T_BITFIELD class should not be directly mapped to Bool HOT 1
- Would it be possible to be able to save @enum values?
- View to a subset of a dataset HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hdf5.jl.