Users of CUDA usually know its major.minor version.
If you want to know the full major.minor.patch version of CUDA you are using:
$ cat /usr/local/cuda/version.txt
For example, when I tried on my CUDA 9.2 installation:
$ cat /usr/local/cuda-9.2/version.txt
CUDA Version 9.2.148
The command is the same as what you would use to find the version of the kernel on a Linux system:
$ uname -r
Another method is to check the version of the cygwin package:
$ cygcheck -c | grep cygwin
Tried with: Cygwin 2.10.0-1 and Windows 10
To find out the exact version of Windows you are using open the winver program. You can type this command at the Start menu or at the command prompt too. It opens up a dialog showing the Windows version and build number.
Tried with: Windows 10 Enterprise
I tried to import a Python package that I had installed from source. The import failed with this error:
File "/usr/lib/python2.7/distutils/version.py", line 40, in __init__
File "/usr/lib/python2.7/distutils/version.py", line 107, in parse
raise ValueError, "invalid version number '%s'" % vstring
ValueError: invalid version number '2.7.0rc3'
It turns out that package version number has to be in the x.y.z format. Else Python throws this error.
Since I had the source code of this package, I found all instances of
2.7.0rc3 and changed it to
2.7.0. Typically, this will be in the
version.py files. I removed the previously installed package and reinstalled this changed source code. I was able to import after this successfully.
Tried with: Ubuntu 14.04
XFree86 is an implementation of the X Window System. You may need to know which version of XFree86 is running on your computer.
Finding this is easy:
$ X -version
For information about other options:
$ X -help
The X man page does not list any of the options and is not useful for this purpose.
Tried with: X 1.17.1 and Ubuntu 14.04
Multiple versions of GCC can be installed and used on Ubuntu as described here. The
update-alternatives tool makes it easy to switch between multiple versions of GCC.
g++ are just symbolic links to the actual binaries of a specific version of GCC. By switching the version, invoking
gcc will execute the particular version of the compiler binary that you wish. You can make any of these version as the default at any time effortlessly.
As an example, I had installed GCC version 4.8 from the Ubuntu repositories. This was the default version of GCC, so
gcc was a symlink to
gcc-4.8 binary. Wanting to use some new C++11 features I installed version 4.9 of GCC. This compiler can be invoked using
gcc-4.9. I now want to switch the default
gcc to invoke
gcc-4.9. I also want the freedom to switch back 4.8 as the default whenever I want. You can switch the symlinks yourself manually, but using this tool makes it easy and clean.
Let us begin:
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
Here, we have provided the
gcc as the master and
g++ as slave. Multiple slaves can be appended along with master. When master symbolic link is changed, the slaves will be changed too.
- Pass the second version of these tools to be recorded:
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
- Now you can switch between these versions by using:
$ sudo update-alternatives --config gcc
Tried with: Ubuntu 14.04
I executed a Java program downloaded from the web and got this error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/filebot/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.security.AccessController.doPrivileged(Native Method)
This error from the Java virtual machine (VM) executing the Java class file indicates that the version 52.0 is not supported by it. This is usually means that the Java program requires a newer version of Java VM for its execution.
The mysterious part is the number 52, which is much higher than any Java version we know. This is a Java class file format version number. The Java version that maps to 52 can be found from the table of class file format version to Java version mapping. For 52.0, it is Java 8. So, this error means that I need to have Java 8 VM to execute this class file. That was correct since I had Java 7 on this computer.
A Java class file holds the Java bytecode for a Java class that can be executed on a Java virtual machine (VM). Encoded at the beginning of a class file is a major and minor version number of the class file format that is used in it. This major.minor number indicates which Java VM can execute this class file. The class file format is typically changed with a new release of Java.
The mapping from Java version to the major number is as follows:
J2SE 8 = 52
J2SE 7 = 51
J2SE 6.0 = 50
J2SE 5.0 = 49
JDK 1.4 = 48
JDK 1.3 = 47
JDK 1.2 = 46
JDK 1.1 = 45
Reference: Wikipedia page on Java class file
Raspbian is based on Debian, so the distribution version information for both is stored in the same file:
Here is what I got on my Raspbian 9 (Stretch):
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
Visual Studio has a branded name with a year (like Visual Studio 2013), but also an internal version number. Visual Studio supports a C++ compiler, a C# compiler, the .Net Framework and many other internal tools. Each of these also have their own version names and numbers. Confusingly, either the year-version or version-number is used at several places in Windows.
Here is some information I note down and update as I use these software:
Visual Studio 2015
- Visual Studio: 14
- Visual C++ compiler: 19.0.23026.0
- Visual C compiler: 19.0.23026.0
Visual Studio Professional 2013
- Visual Studio: 12.0
- Visual C++ compiler: 18.0.21005.1
- Visual C compiler: 18.0.21005.1
- Microsoft .Net Framework: 4.5.50938
Visual Studio Professional 2012
- Visual Studio: 11.0
- Visual C++ compiler: 17.00.50727.1
- Visual C compiler: 17.00.50727.1