   Feb 18 18:28:35 GMT 2006 in Munich (Germany), 
   written by Klaus Wittig (klaus.h.wittig@t-online.de)

                          Basic Installation
                          ==================

    If you encounter problems please read the last section "Possible
    problems and some hints" and the section "Known Problems" in the
    documentation.

    There are two possible ways of instalation:
    A: Installation of the binary
       You need openGL
    B: Instalation from the source:
       If you encounter problems or if your hardware is not supported.


 A: Installation of the binary
    --------------------------


 1. Get the binary and do the following
    - bunzip2 cgx_1.5.bz2 (beware your browser could scip the ending
      .bz2, then please rename the filename before unzipping to the above one)

  . It is necessary to have openGL on your system!
    With this binary you can use the graphic-card specific drivers and
    gain maximum performance.

    The libraries:
    /usr/lib/libGL.so
    /usr/lib/libGLU.so

    must exist. You might create such links to other locations if the libraries are 
    stored at different places.

    For example:

    ln -s /usr/i486-linux-libc5/lib/libGL.so.3 /usr/lib/libGL.so

 2. login as root

 3. if possible rename the binary to /usr/local/bin/cgx
    mv cgx_1.5 /usr/local/bin/cgx
    chmod ao+rx /usr/local/bin/cgx

 4. If you like the help-system to work then please do the following:

 5. login as root if not already done.

 4. get the documentation (html) and do the following
    - move the file containing the docu cgx_1.5.htm.tar.bz2 to /usr/local 
    - bunzip2 cgx_1.5.htm.tar.bz2 (beware sometimes the ending .bz2 is missed, 
      please rename the filename to the above one)
    - tar -xvf cgx_1.5.htm.tar

 7. Check the path /usr/local/CalculiX/cgx_1.5/doc/cgx
    all the html files should be located there

 8. Check the installation, if you performed step 3. type:
    cgx -b dummy.fbd
    a window should appear on your screen.
    Go with the mouse-ponter outside the inner big black rectangle.
    Press the left mouse button. The menu will appear. Go down to "Help" and
    choose "Html Manual cgx". 
    mozilla should open and the documentation should be vissible. If not be
    sure that the documentation is in /usr/local/CalculiX/cgx_1.5/doc/cgx

 9. get the examples and do the following
    - move the file cgx_1.5.exa.tar.bz2 to /usr/local 
    - bunzip2 cgx_1.5.exa.tar.bz2
    - tar -xvf cgx_1.5.exa.tar.bz2



 B: Instalation from the source:
    ----------------------------

    The `configure' shell script is not yet ready. Therefore some manual 
    fixes to the Makefile might be necessary.

    You need openGL on your system. Check your file system for the
    three following libraries:

    The openGL-library:              libGL.so  or  libMesaGL.so
    The higher level openGL-library: libGLU.so  or  libMesaGLU.so

    On some systems the extension might also be ~.a instead of ~.so

    You might search for this files with for example "locate libGL" or 
    "find /usr/* -name libGL* -print"

    If you find only libMesaGL and libMesaGLU instead of libGL and libGLU
    you have to create a link or a copy with the names libGL and libGLU
    but ceep the extension .a or .so.

    This files should be located in:
    /usr/lib/

    otherwhise you have to modify the file:
    /usr/local/CalculiX/cgx_1.5/src/Makefile.

    If you do not have this libs or if you
    have any trouble later on, then first check the CD from your distribution.

    The original glut package from mark Kilgard is now in the distribution and
    will be compiled with the other source files.

 1. Unpack the file cgx_1.5.all.tar.bz2 in "/usr/local".

 2. Then change to the following directory with:
    cd /usr/local/CalculiX/cgx_1.5/src

 3. Change the path names in the Makefile to the ones used on your system if
    necessary.

 4. It is recommended to change to index mode if you are running an sgi or if
    you work on a computer which supports index mode. Therefore set the 
    parameter INX_MODE to "1" and TEX_MODE to "0" in "cgx.h". On linux pc's
    no action is required. 

    If your installation path is not "/usr/local" then you must also change
    the path for the html-help-files in "cgx.h",
    see parameter "HELPFILE". If your web-browser is not mozilla change the 
    parameter "BROWSER" also.

 5. run "make" or  "make -f Makefile_Athlon64" as root. Or if you have trouble
    with c++ code use Makefile_pure_c or Makefile_Athlon64_pure_c to use
    only c code. But you will not be able to deal with nurbs any more.

    Then copy the binary "cgx" to
    "/usr/local/bin/cgx" with:
    cp cgx /usr/local/bin/cgx

    If /usr/local/bin does not exist, create it with:
    mkdir /usr/local/bin

    Then you might change the protections:
    chmod ao+rx /usr/local/bin/cgx

 6. If you have "latex" and "latex2html" on your system then run "latex cgx" 
    in "/usr/local/CalculiX/cgx_1.5/doc" (run it 3 times!!!) and then run
    "latex2html cgx". 
    This creates the html-help-files. Alternatively you might download them
    as well. Then get cgx_1.5.htm.tar.bz2 and unpack this package in 
    /usr/local/.

 7. The program needs to write an info file to your home directory during run 
    time. Be sure that "HOME" is defined and that you have write permission to
    this directory. Type "echo $HOME" and check your permissions for the 
    printed directory.

 8. Check the installation, type:
    cgx -b dummy.fbd
    and a window should appear on your screen.
    Go with the mouse-ponter outside the inner black rectangle.
    Press the left mouse button. The menu will appear. Go down to "Help" and
    choose "Html Manual (cgx)". 
    mozilla should open and the documentation should be vissible. If not be
    sure that the documentation is in /usr/local/CalculiX/cgx_1.5/doc/cgx

 9. get the examples and do the following
    - move the file cgx_1.5.exa.tar.bz2 to /usr/local 
    - bunzip2 cgx_1.5.exa.tar.bz2
    - tar -xvf cgx_1.5.exa.tar.bz2

    Possible problems and some hints:
    ---------------------------------

 1. No lighting:
    with some libGL.so or libGL.a from recent distributions lighting might
    not work with cgx. I could overcome this problem by compiling the mesaGL
    on my pc and not using the pre-compiled version.

 2. I have made very good experiences with the nvidia driver for the GEforce 
    but you still need "libGLU.a" from the latest mesa distribution.
    The "libGLU" must be the one from sgi, otherwhise nurbs-trimming is not
    supported. 

 3. If you get some linker errors then you probably have multiple libGL and 
    libGLU on your system. Be sure to use only the static libraries produced 
    at 1.) and delete or rename all other such libs. The shared libs might
    work on some systems but i had trouble with the mesa-libs.

 4. If you get some glut errors you have probably compiled for the index mode
    ("INX_MODE 1" in cgx.h). Change to "INX_MODE 0" and "TEX_MODE 1".

 5. If your typed commands like "plot n all" are not recognized by the program
    then your mouse pointer was probably not in the main window during 
    typing {;->)
 
 6. If the compilation produces a lot of lines like that:
    > readStdCmap.o(.text+0x39f): undefined reference to `XFreeColors'
    > collect2: ld returned 1 exit status
    > make: *** [cgx] Error 1
    then the compiler could not locate some libraries.
    The order of the libs could be wrong to!

 7. If the loader complains that a specific lib is not there, then often a 
    newer version is available. Create a link with the required name to the 
    new lib (ln -s new old).

 8. If you have problems with the libSNL or c++ in general then
    use Makefile_pure_c or Makefile_Athlon64_pure_c to use
    only c code. But you will not be able to deal with nurbs any more.

 9. if you get a segmentation fault if you type "plot e all" then use "plot ei
    all" instead. This bug is known but could not be tracked down so far.
 
Good luck,

Klaus Wittig


