- check library version netcdf linux
- 4 Answers 4
- Not the answer you’re looking for? Browse other questions tagged linux ubuntu netcdf or ask your own question.
- Related
- Hot Network Questions
- Subscribe to RSS
- Viewing Linux Library / Executable version info
- 4 Answers 4
- How do you find what version of libstdc++ library is installed on your linux machine?
- 4 Answers 4
- How to check if a library is installed?
- 9 Answers 9
- Find out library version
- 3 Answers 3
- Not the answer you’re looking for? Browse other questions tagged linux ubuntu version or ask your own question.
- Related
- Hot Network Questions
- Subscribe to RSS
check library version netcdf linux
how do I determine which version of the netcdf library is installed in my system? Is there a command line? I tried to search «netcdf» and I find a bunch of files but I can’t determine the version number. Is there a command to check the version of anything installed?
4 Answers 4
netCDF provides the nc-config command line tool for this purpose.
To print the version.
To print more information on the netCDF build you have:
Assuming the package is installed, you can use the following command:
Personally I don’t have netcdf installed, but you will have an output like this:
I’m adding two solutions that are more OS-agnostic than dpkg-query (which doesn’t work on, e.g. Mac OS X). First, often the version information is included in the path where the package is installed, and so you can use which to display it:
Second, many docstrings also include the version number, so just printing them out will do the trick. For example, print the usage instructions of ncdump by calling it with with no arguments:
You can do it in a few lines of C:
On my laptop that reports:
Not the answer you’re looking for? Browse other questions tagged linux ubuntu netcdf or ask your own question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник
Viewing Linux Library / Executable version info
In Windows, EXE and DLL have version info, including at least the following fields:
- file version
- product version
- internal name
- product name
- copyright
In Linux Library / Executable:
- Which fields are present?
- How to view such info?
- What tools/libraries to read?
4 Answers 4
The version info in not explicitly stored in an ELF file. What you have in there is the name of the library, the soname , which includes the major version. The full version is usually stored as a part of the library file name.
If you have library, say libtest.so , then you usually have:
- libtest.so.1.0.1 — The library file itself, containing the full version
- libtest.so.1 — Symlink to libtest.so.1.0.1 , having the same name as soname
- libtest.so — Symlink to libtest.so.1 used for linking.
In the library file libtest.so.1.0.1 , there will be an entry called SONAME in dynamic section, that will say this library is called libtest.so.1 . When you link a program against this library, the linked program will store the soname of the library under NEEDED entry in the dynamic section.
If you want to verify, what exactly is in which ELF file, you can try to run:
where elffile can be either an library of an executable.
If you simply want to get the library version, you can play with:
AFAIK, there’s no such info (at least not by default) in executable files.
Or you can rely on the program itself or your packaging system, as Rahul Patil wrote.
Источник
How do you find what version of libstdc++ library is installed on your linux machine?
I found the following command: strings /usr/lib/libstdc++.so.6 | grep GLIBC from here. It seems to work but this is an ad-hoc/heuristic method.
Is there a specific command that can be used to query the library version of C++? Or is the method I found the accepted method?
4 Answers 4
To find which library is being used you could run
The list of compatible versions for libstdc++ version 3.4.0 and above is provided by
For earlier versions the symbol GLIBCPP is defined.
The date stamp of the library is defined in a macro __GLIBCXX__ or __GLIBCPP__ depending on the version:
The table of datestamps of libstdc++ versions is listed in the documentation:
What exactly do you want to know?
The shared library soname? That’s part of the filename, libstdc++.so.6 , or shown by readelf -d /usr/lib64/libstdc++.so.6 | grep soname .
The minor revision number? You should be able to get that by simply checking what the symlink points to:
That tells you it’s 6.0.16, which is the 16th revision of the libstdc++.so.6 version, which corresponds to the GLIBCXX_3.4.16 symbol versions.
Or do you mean the release it comes from? It’s part of GCC so it’s the same version as GCC, so unless you’ve screwed up your system by installing unmatched versions of g++ and libstdc++.so you can get that from:
Or, on most distros, you can just ask the package manager. On my Fedora host that’s
As other answers have said, you can map releases to library versions by checking the ABI docs
The mechanism I tend to use is a combination of readelf -V to dump the .gnu.version information from libstdc++, and then a lookup table that matches the largest GLIBCXX_ value extracted.
if your version of sort is too old to have the -V option (which sorts by version number) then you can use:
instead of the sort -u -V , to sort by up to 4 version digits.
In general, matching the ABI version should be good enough.
If you’re trying to track down the libstdc++.so. , though, you can use a little bash like:
so for my system this yielded 6.0.10 .
If, however, you’re trying to get a binary that was compiled on systemX to work on systemY, then these sorts of things will only get you so far. In those cases, carrying along a copy of the libstdc++.so that was used for the application, and then having a run script that does an:
generally works around the issue of the .so that is on the box being incompatible with the version from the application. For more extreme differences in environment, I tend to just add all the dependent libraries until the application works properly. This is the linux equivalent of working around what, for windows, would be considered dll hell.
Источник
How to check if a library is installed?
In Linux, how do I check if a library is installed or not? (from the command line of course).
In my specific case now, I want to check whether libjpeg is installed.
9 Answers 9
To do this in a distro-independent* fashion you can use ldconfig with grep, like this:
If libjpeg is not installed, there will be no output. If it is installed, you will get a line for each version available.
Replace libjpeg by any library you want, and you have a generic, distro-independent* way of checking for library availability.
If for some reason the path to ldconfig is not set, you can try to invoke it using its full path, usually /sbin/ldconfig .
**99% of the times*
You can check with the package manager of your distribution (aptitude, yum, . ) but as you did not give your distribution I can’t give you the right command.
Another way can be to run gcc -ljpeg , if you get ‘ld: library not found for -ljpeg’ it means that gcc has not found the library (but it don’t mean that it’s not installed), if you get something like ‘Undefined symbols: «_main», referenced from: . ‘ it means that libjpeg has been found.
locate libjpeg; ls /usr/lib/libjpeg*; ls /lib/libjpeg* are some other way to find if the lib in installed in the system
There is many other way to check that, if you give us more context (why you need to check if libjpeg is installed) we could give you the best solution for your specific case.
Источник
Find out library version
I want to find out what version of a C library is installed in my system (Ubuntu 12.04). In particular, I’m interested in libnuma. What is the proper way to do it?
3 Answers 3
I would use dpkg -l | grep libnuma1 to get the version.
As an example, I have ran dpkg -l on xterm and you can see that I’m running versoin 278-4 of xterm.
The file name or contents won’t always keep track of the exact version, so you’d typically want to use the packaging system facilities. For Ubuntu, you can either go to packages.ubuntu.com, search for your file, and see what version of the package is in your version of Ubuntu.
Or from the command line, you can first search for the name of the associated package using dpkg -S /usr/lib/libnuma.so.1 , which probably returns libnuma1 as the package name. Then run apt-cache showpkg libnuma1 to find the package version. The apt-cache output can be pretty long, but the version should be in the first few lines.
Not the answer you’re looking for? Browse other questions tagged linux ubuntu version or ask your own question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник