Quick reference guide Scientific Linux for DESY

Previous Contents Index Next 

11. Programming

The compilers listed below do usually accept the following options:

-c compile and create object output file, but do not link
-o file place output in file (link output or object file)
-Dmacro[=def] define macro as def
-Umacro undefine macro
-llibrary use the library named library when linking
-Idir search in dir for include files
-Ldir search in dir for libraries
-g add debugging information to the compiled output
-p add code to generate profile information at runtime (for prof)
-O[n] turn on optimization (level n, 0 means no optimization)

Most of the other options are compiler (and operating system) dependent. Consult manuals for details (user guide, optimization guide, language reference).

ar [-][dmpqrtx][v] archive member[s]
Create, modify, and extract from archives. The following modes are available:
-d delete members -m move members in an archive
-p print content of members -q append members to an archive
-r replace members -t display contents of an archive
-x extract members -v give verbose output
c++ [options] [file[s]] (L)
C++ Compiler. Comes as c++ and g++ for GNU, pgCC for Portland and icpc for Intel. See start of chapter for common options.  
cc [options] [file[s]] (L)
C compiler. Comes as cc and gcc for GNU, pgcc for Portland and icc for Intel. See start of chapter for common options.  
cpp [options] [file[s]]
The C language preprocessor. Is usually integrated into the C compilers, but sometimes abused as a standalone macro processor, therefore existing as a separate command. Documentation
cvs [options] command [command_options] [command_args]
Concurrent Versions System based on RCS. The commands are similar to the more recent svn system. For a list of commands use cvs help  
ddd [--help] [-gdb] [more_options] [program [corefile]]
Graphical interface for the source-level debugger gdb and other debuggers.  
gdb [options] [program [corefile]] (L)
Source-level debugger. Consult manuals for instructions or use ddd. Besides gdb for GNU there is pgdbgfor Portland and idb for Intel. Documentation
gfortran [options] [file[s]] ()
GNU Fortran 95 compiler. Alternatives are the pgf95, pghpf, pgf90 and pgf77 (Portland ) and ifort (Intel) compilers. The old GNU compilers f77 and g77 should only be used for compatibility reasons. See start of chapter for common options.  
git [options] command [arg[s]] ()
Git is a fast, scalable, distributed revision control system. The most commonly used git commands can be displayed using the option --help.  
gprof [options] [program [profile_file]] (L)
Display the execution profile of a program compiled with -pg. There is also a pgprof profiler for the Portland compiler. Documentation
java [options] [classfile] [argument[s]]
java [options] -jar jarfile [argument[s]]  
Java interpreter. Executes compiled java code. For advanced use please consult the manuals. Alternate versions might have been provided, please run ini and look for the string jdk.  
javac [options] [file[s]]
Java compiler. For advanced use please consult the manuals.  
ld [options] [file[s]]
Linker. Combines object and archive files to create executables or prelinked modules. Usage similar to cc. Environment variables LD_LIBRARY_PATH and LD_RUN_PATH influence the linking process. Documentation
ldd [file[s]]
Prints the shared libraries required by file[s].  
lsof -p pid
List information about files opened by a process with a given pid.  
ltrace [-p pid] [command]
Run a command and print dynamic library calls made in the program. It can be attached (-p) to an already running program with a given pid.  
m4 [-es] [-Dmacro[=defn]] [-Umacro] [file[s]] F
Macro processor. Process file[s] or STDIN (and define or undefine macros with -D and -U). Enable line sync output for cpp (#line lines) with -s.  
make [-deinprt] [-f makefile] [target[s]] [macro=def]
Make utility to maintain groups of programs. Targets in Makefile (or makefile) are brought up to date according to dependency rules. For compatibility among platforms gmake is recommended on non Linux systems.
-d print debugging information
-e environment variables override makefiles
-i ignore errors from commands
-n no execution mode. Print commands only
-p print out the complete set of macro definitions and target descriptions
-r disable the built-in implicit rules
-t touch targets instead of remaking them
nm [-Cgu] [-t radix] [file[s]]
List symbols from object files. Use -C for C++ files, -u to print undefined symbols, -g to print external symbols only. The radix determines the radix for printing offsets. Documentation
patch [-pnum] < patchfile f
Apply a diff file to an original. With -p strip the smallest prefix containing num leading slashes from each file name found in the patch file. Documentation
perl [options] [script_file] [argument[s]]
Practical Extraction and Report Language. Alternate versions might have been provided, please run ini and look for the string perl. The more common options are:
-d[:debugger] run scripts under debugger
-e 'script' execute script instead of script_file
-h print short usage text
-Idir add dir to @INC include path
-n assume 'while () { ... }' loop around script
-p as -n, print in addition line (as for sed)
-T turn on tainting checks
-V print perl configuration information
-w turn warnings on for compilation of script. Recommended
python [options] [script_file] [argument[s]]
An interpreted, interactive, object-oriented programming language. The more common options are:
-c 'script' execute script instead of script_file
-h print short usage text
-O turn on basic optimizations
-t Issue a warning when a source file mixes tabs and spaces
-v Print a message each time a module is initialized
Calling python without arguments enters an interactive python shell.
strace [-p pid] [command]
Run a command and print system calls and signals made in the program. It can be attached (-p) to an already running program with a given pid.  
strip [file[s]]
Discard symbols from object file[s]. Used to reduce the size of executables. Documentation
svn command [options] [args]
Subversion command line client tool. Subversion is a version control system similar to cvs. A list of commands is displayed by svn help.
The most important commands are checkout module[s], update, add file[s], delete file[s], commit and status [-u].

Previous Contents Index Next