Differences between revisions 46 and 47
Revision 46 as of 2020-09-02 09:08:00
Size: 5749
Editor: davidsch
Comment:
Revision 47 as of 2020-09-02 09:44:03
Size: 5672
Editor: davidsch
Comment:
Deletions are marked like this. Additions are marked like this.
Line 57: Line 57:
 * [[http://www.hu.freebsd.org/hu/doc/psd/20.ipctut/paper.html|An introductory 4.4BSD interprocess communication tutorial]] To aid the programmer in developing programs which are comprised of cooperating processes, the different choices are discussed and a series of example programs are presented. by Stuart Sechrest [[http://www.ecst.csuchico.edu/~beej/guide/net/|Beej's Guide to network programming]] This document should give the average competent C programmer the edge s/he needs to get a grip on this networking noise.  * If you are completely new to socket programming, have a look at [[https://www.binarytides.com/socket-programming-c-linux-tutorial/|this]] tutorial. It explains socket programming step-by-step with code examples that a easily be compiled and run on your computer.
Line 59: Line 59:
 * [[http://www.uwo.ca/its/doc/courses/notes/socket/index.html|An Introduction to socket programming]] These course notes are directed at Unix application programmers who want to develop client/server applications in the TCP/IP domain. [[http://www.ecst.csuchico.edu/~beej/guide/net/|Unix socket programming]] Amongst other things, this is the home of the unix-socket-faq.  * If you run in a situation where your TCP/ IP socket code compiles and runs, but from time to time a connection is lost for no obvious reasons or there are too many open sockets, then one good idea is to check the [[https://en.wikipedia.org/wiki/File:Tcp_state_diagram.png|TCP state diagram] first, and review your code afterwards.
Line 61: Line 61:
== Linux desktop GUI programming ==
 * The "X Window System" (X11) is window system, which was first developed at MIT in 1984. On the Debian clients managed by ISG.EE, "X.org" (X server) is the current reference software implementation based the original X11 server. Most programmers nowadays no longer directly write software that is interacting with the X server server directly (for those who are still interested in that, read: [[http://www.rahul.net/kenton/xsites.framed.html|X11 Programming]]).
 * For contemporary and fast Linux GUI programming, one usually uses a high-level C/C++ programming toolkit library like [[https://www.qt.io/|QT]] or [[https://www.gtk.org/|GTK]]. For programming languages that come with their own UI toolkits (like Java), one even doesn't have to care about the platform - those languages follow the paradigm "write once, run everywhere". However, in practice you will notice small differences between the platforms, even when the paradigm mentioned should apply.
Line 62: Line 65:
== Linux debugging ==
Unfortunately, it is difficult to write bug-free programs. A good debugger is very helpful tracking down errors. On the Debian clients managed by ISG.EE we recommend to use the Data Display Debugger (DDD). DDD supports a variety of programming languages: Ada, C, C++, Chill, Fortran, Java, Modula, Pascal, Perl, Python.
Line 63: Line 68:
== X11 ==
 * [[http://www.rahul.net/kenton/xsites.framed.html|X11 Programming]] X is a graphical network based windows systems, it was developed from MIT in 1984. This system gives the basis for many Unix windows systems. [[http://qt-project.org/|Qt GUI Toolkit]] Qt is the C++ library which builds the base of KDE. Qt is the ideal starting point for your graphical unix applications. Qt is installed on Tardis. [[http://www.gtk.org/|GTK+ GUI Toolkit]] GTK+ was initially developed for and used by the [[http://www.gimp.org/|GIMP]], the GNU Image Manipulation Program. Therefore, it is named "The GIMP Toolkit", so that the origins of the project are remembered. Today GTK+ is used by a large number of applications, and is the toolkit used by the GNU project's [[http://www.gnome.org/|GNOME]] desktop.

== Debugger ==
Unfortunately, it is difficult to write bug-free programs. A good debugger is very helpful tracking down errors. On the Tardis cluster we recommend to use the Data Display Debugger (DDD). DDD supports a variety of programming languages: Ada, C, C++, Chill, Fortran, Java, Modula, Pascal, Perl, Python.

For a current list go to the DDD manual (man ddd).
For a current list, consult the DDD manual (man ddd).

Programming

Programming language literature

On the free Ebook foundation website, you will find an overview of a bunch of programming e-books (PDF/ HTML) free of charge for almost any language in the areas of

  • Regular programming (e.g. C, C++, C#, Java, Go, MATLAB, PHP, Rust, Scala, ...)

  • Scripting (e.g. JavaScript, make, Perl, Python, R, Ruby, Unix/ Windows Shells, SQL, ...)

  • Document rendering (e.g. HTML, CSS, LaTeX, ...)

  • Multiprocessing/ parallel computing APIs (e.g. OpenMP, ...)

  • Programming related tools (e.g. Git, Subversion, Mercurial, Jenkins)

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.

Perl

  • Please use the default perl (/usr/bin/perl) that is installed on all Debian Linux computers.
  • If you use older perl interpreters from other directories, you should switch to the default perl interpreter.
  • A bunch of most-often used perl modules is installed with the default perl interpreter.

Network Programming

  • If you are completely new to socket programming, have a look at this tutorial. It explains socket programming step-by-step with code examples that a easily be compiled and run on your computer.

  • If you run in a situation where your TCP/ IP socket code compiles and runs, but from time to time a connection is lost for no obvious reasons or there are too many open sockets, then one good idea is to check the [[https://en.wikipedia.org/wiki/File:Tcp_state_diagram.png|TCP state diagram] first, and review your code afterwards.

Linux desktop GUI programming

  • The "X Window System" (X11) is window system, which was first developed at MIT in 1984. On the Debian clients managed by ISG.EE, "X.org" (X server) is the current reference software implementation based the original X11 server. Most programmers nowadays no longer directly write software that is interacting with the X server server directly (for those who are still interested in that, read: X11 Programming).

  • For contemporary and fast Linux GUI programming, one usually uses a high-level C/C++ programming toolkit library like QT or GTK. For programming languages that come with their own UI toolkits (like Java), one even doesn't have to care about the platform - those languages follow the paradigm "write once, run everywhere". However, in practice you will notice small differences between the platforms, even when the paradigm mentioned should apply.

Linux debugging

Unfortunately, it is difficult to write bug-free programs. A good debugger is very helpful tracking down errors. On the Debian clients managed by ISG.EE we recommend to use the Data Display Debugger (DDD). DDD supports a variety of programming languages: Ada, C, C++, Chill, Fortran, Java, Modula, Pascal, Perl, Python.

For a current list, consult the DDD manual (man ddd).

Database programming

If you want to learn about database design and programming you can get an account on our MySQL database server. Get in touch with us and let us know what your plans are. The address of our database server is remi.ee.ethz.ch where mysql runs on the default port (3306). For database configuration and setup tasks you can also make use of our phpMyAdmin setup.

  • Swiss MySQL mirror site MySQL is a true multi-user, multi-threaded SQL database server. SQL is the most popular database language in the world. MySQL is a client/server implementation that consists of a server daemon mysqld and many different client programs and libraries.


CategoryLXSW