# Libnetcdf not defined

**URL:** <https://discourse.julialang.org/t/libnetcdf-not-defined/59039>\
**Category:** General Usage\
**Tags:** package\
**Created:** [April 11, 2021, 3:18pm UTC](https://discourse.julialang.org/t/libnetcdf-not-defined/59039 "2021-04-11T15:18:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixstam1453](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mixstam1453/32/23731_2.png) [@mixstam1453](https://discourse.julialang.org/u/mixstam1453)\
**Post date:** [April 11, 2021, 3:18pm UTC](https://discourse.julialang.org/t/libnetcdf-not-defined/59039/1 "2021-04-11T15:18:08Z")

</div>

Hello everybody,  
I get “libnetcdf not defined” when i try to open a ncfile, using NCDatasets & NetCDF. I use Debian Buster, 32 bit. Julia 1.5.3.  
Have you any idea to solve it ?  
I already did this  
"  
using Pkg  
pkg"add Conda"  
Conda.runconda(`install -c anaconda libnetcdf`)  
"  
But the error still exists.

This is what i do:  
using NCDatasets  
ds = Dataset(“/home//michael/file.nc”)

ERROR: UndefVarError: libnetcdf not defined  
Stacktrace:  
[1] nc\_open(::String, ::UInt16) at /home/michael/.julia/packages/NCDatasets/eDnxY/src/netcdf\_c.jl:267  
[2] NCDataset(::String, ::String; format::Symbol, diskless::Bool, persist::Bool, attrib::Array{Any,1}) at /home/michael/.julia/packages/NCDatasets/eDnxY/src/dataset.jl:241  
[3] NCDataset at /home/michael/.julia/packages/NCDatasets/eDnxY/src/dataset.jl:226 [inlined] (repeats 2 times)  
[4] top-level scope at REPL[2]:1

Thanks for your support!

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 11, 2021, 3:34pm UTC](https://discourse.julialang.org/t/libnetcdf-not-defined/59039/2 "2021-04-11T15:34:59Z")

</div>

> [@mixstam1453](#):
>
> Debian Buster, 32 bit

32-bit Linux? Wow. I don’t think these packages support this platform

---

<div class="post-metadata">

**Author:** ![Alexander-Barth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexander-barth/32/3692_2.png) [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)\
**Post date:** [April 19, 2021, 8:16am UTC](https://discourse.julialang.org/t/libnetcdf-not-defined/59039/3 "2021-04-19T08:16:43Z")

</div>

Indeed, 32-bit version are currently not build for NetCDF\_jll for Linux.

[https://github.com/JuliaPackaging/Yggdrasil/blob/0063d7f62a447270bf31614d6490e4afe3743e9a/N/NetCDF/common.jl#L58](https://github.com/JuliaPackaging/Yggdrasil/blob/0063d7f62a447270bf31614d6490e4afe3743e9a/N/NetCDF/common.jl#L58)

Are you using a 32-bit OS because, because of some restrictions on your hardware? (I am asking because sometimes people install a 32-bit version of their OS without known that they could also run a 64-bit version).

---

<div class="post-metadata">

**Author:** ![mixstam1453](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mixstam1453/32/23731_2.png) [@mixstam1453](https://discourse.julialang.org/u/mixstam1453)\
**Post date:** [April 19, 2021, 8:25am UTC](https://discourse.julialang.org/t/libnetcdf-not-defined/59039/4 "2021-04-19T08:25:59Z")

</div>

This pc is too old and support only 32-bit. Nevertheless, thank you very much !!

---

<div class="post-metadata">

**Author:** ![Alexander-Barth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexander-barth/32/3692_2.png) [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)\
**Post date:** [April 19, 2021, 9:17am UTC](https://discourse.julialang.org/t/libnetcdf-not-defined/59039/6 "2021-04-19T09:17:40Z")

</div>

I just checked the status about HDF5 (which is required for NetCDF). Unfortunately, it is not build for 32-bit linux either. So it is not so easy to bring support for 32-bit Linux back. But previous versions of NetCDF\_jll did support this architecture (for julia 1.5).

[https://juliapackages.com/p/netcdf\_jll](https://juliapackages.com/p/netcdf_jll)

Maybe it works if you install these (slightly) older versions by using:

]add NCDatasets@0.11.2  
]add NetCDF\_jll@4.7.4

Maintaining builds on less used CPU architectures is quite some work. More volunteers able to dedicate some time would certainly make a difference.

In any case a more helpful error message would be nice. I am wondering if you did not see any message before when the package manager installed NetCDF\_jll .

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [April 19, 2021, 9:46am UTC](https://discourse.julialang.org/t/libnetcdf-not-defined/59039/7 "2021-04-19T09:46:10Z")

</div>

> [@Alexander-Barth](#):
>
> Unfortunately, it is not build for 32-bit linux either. So it is not so easy to bring support for 32-bit Linux back.

The problem is in particular that we can’t cross-compile HDF5, so we have to rely on whatever is available in the latest builds of conda

---

<div class="post-metadata">

**Author:** ![mixstam1453](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mixstam1453/32/23731_2.png) [@mixstam1453](https://discourse.julialang.org/u/mixstam1453)\
**Post date:** [April 20, 2021, 4:45pm UTC](https://discourse.julialang.org/t/libnetcdf-not-defined/59039/8 "2021-04-20T16:45:52Z")

</div>

> [@Alexander-Barth](#):
>
> add NCDatasets@0.11.2

Hello,  
While i install NCDatasets.jl or NetCDF.jl, i don’t get any error.  
I install the older versions as you mentioned:  
]add NCDatasets@0.11.2  
]add NetCDF\_jll@4.7.4  
but i when i try to open a file.nc , i get the same error too:  
ERROR: UndefVarError: libnetcdf not defined  
Stacktrace:  
[1] nc\_open(::String, ::UInt16) at /home/michael/.julia/packages/NCDatasets/KVato/src/netcdf\_c.jl:267  
[2] NCDataset(::String, ::String; format::Symbol, diskless::Bool, persist::Bool, attrib::Array{Any,1}) at /home/michael/.julia/packages/NCDatasets/KVato/src/dataset.jl:241  
[3] NCDataset at /home/michael/.julia/packages/NCDatasets/KVato/src/dataset.jl:226 [inlined] (repeats 2 times)  
[4] top-level scope at REPL[4]:1

– i also installed add NCDatasets@0.11.1 , but the same error. -
