Differences between revisions 4 and 5
Revision 4 as of 2018-08-28 08:42:32
Size: 1748
Editor: davidsch
Comment:
Revision 5 as of 2020-09-02 13:50:32
Size: 1832
Editor: davidsch
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#rev 2020-09-02 davidsch
Line 4: Line 5:
=== Compiling OpenGL applications on Debian Linux ===
The Debian platform managed by the ISG.EE has a new directory layout for the OpenGL libraries and headers:

=== Compiling OpenGL/ NVidia CUDA-based applications on Debian Linux ===
The Debian platform managed by ISG.EE uses the following directory layout for the OpenGL libraries and headers:
Line 10: Line 12:
The /usr/lib/libGL* libraries are symbolic links to the hardware-specific libraries. There is a mechanism in the starup process of each client workstation which detects the accurate OpenGL library based on the information about the graphics card and the kernel driver. The /usr/lib/x86_64-linux-gnu/libGL*.so OpenGL libraries are symbolic links to the hardware-specific libraries. There is a mechanism in the starup process of each client workstation which detects the accurate OpenGL library based on the information about the graphics card and the kernel driver. The CUDA runtime libraries are found in the same directory.
Line 12: Line 14:
Line 15: Line 18:
1. For compatibility reasons, the default OpenGL headers (from the MESA package) are saved in their default location, /usr/include/GL.
2. The extended OpenGL header files from Nvidia are stored in /usr/lib/nvidia/include/GL which have to be included in the compile path in order to use the extended Nvidia functions.
The OpenGL headers are found under /usr/include/GL. For NVidia programming, a CUDA toolkit that should work with
the installed NVidia graphics card is installed (CUDA headers in /usr/include).
Line 18: Line 21:
Line 19: Line 23:
{{{
No special CFLAGS/ CXXFLAGS and LDFLAGS must be set. The required headers and libraries are all found under the
standard system paths. If you use an own OpenGL/ CUDA toolkit, e.g. installed in your home, make sure it is
compatible with the graphics driver/ hardware installed on the system. Then set CFLAGS (standard C programming,
e.g. compiling with gcc) and/ or CXXFLAGS (C++ programming, e.g. compiling with g++) and LDFLAGS as follows:
Line 20: Line 29:
{{{
add to CFLAGS / CPPFLAGS / CXXFLAGS
`-I/usr/lib/nvidia/include/GL`
add to LDFLAGS ``
`-L/usr/lib/nvidia/lib` ` -Wl,-rpath -Wl,/usr/lib/nvidia/lib`
Assume you have installed the toolkit under /home/$USER/toolkit, then set the mentioned environment
variables in your Debian shell (bash, tcsh, ...) as follows, before you start compiling/ linking:

export CFLAGS="-I/home/$USER/toolkit/include"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L/home/$USER/toolkit/lib -Wl,-rpath,/home/$USER/toolkit/lib"

$USER must of course be replaced with your ETH (login-) username.
Line 26: Line 38:
Remarks:
Line 28: Line 39:
{{{
If you are using the libGLU you will get the following linker warning: `/usr/bin/ld: warning: libstdc++.so.5, needed by /usr/bin/../lib/libGLU.so, may conflict with libstdc++.so.6`
This shouldn't affect your programs (the libGLU was linked against the old C++ standard library and most of the installed gnu compilers will link against the newer library).
If you have problems linking against `libGL.so` from `/usr/lib` it is possible to access symbols directly from the NVidia opengl library in `/usr/lib/nvidia/lib`:
remove `-L/usr/lib` and add instead `-L/usr/lib/nvidia/lib -lGL` to your `LDFLAGS` environment/ make variable.
}}}

OpenGL

Compiling OpenGL/ NVidia CUDA-based applications on Debian Linux

The Debian platform managed by ISG.EE uses the following directory layout for the OpenGL libraries and headers:

Libraries:

The /usr/lib/x86_64-linux-gnu/libGL*.so OpenGL libraries are symbolic links to the hardware-specific libraries. There is a mechanism in the starup process of each client workstation which detects the accurate OpenGL library based on the information about the graphics card and the kernel driver. The CUDA runtime libraries are found in the same directory.

Header Files:

The OpenGL headers are found under /usr/include/GL. For NVidia programming, a CUDA toolkit that should work with
the installed NVidia graphics card is installed (CUDA headers in /usr/include).

Compiling sources and linking against the NVidia libraries:

No special CFLAGS/ CXXFLAGS and LDFLAGS must be set. The required headers and libraries are all found under the
standard system paths. If you use an own OpenGL/ CUDA toolkit, e.g. installed in your home, make sure it is
compatible with the graphics driver/ hardware installed on the system. Then set CFLAGS (standard C programming,
e.g. compiling with gcc) and/ or CXXFLAGS (C++ programming, e.g. compiling with g++) and LDFLAGS as follows:

Assume you have installed the toolkit under /home/$USER/toolkit, then set the mentioned environment
variables in your Debian shell (bash, tcsh, ...) as follows, before you start compiling/ linking:

export CFLAGS="-I/home/$USER/toolkit/include"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L/home/$USER/toolkit/lib -Wl,-rpath,/home/$USER/toolkit/lib"

$USER must of course be replaced with your ETH (login-) username.


CategoryLXSW

Programming/Libraries/OpenGL (last edited 2023-10-16 13:36:41 by alders)