1This is a short overview of the installation procedure of CalculiX CrunchiX
2Version 2.18
3
4***************************************************************************
5
6A. IF YOU WOULD LIKE TO GENERATE THE EXECUTABLE FROM SCRATCH:
7
81. copy ccx_2.18.src.tar.bz2, ccx_2.18.doc.tar.bz2,
9   ccx_2.18.test.tar.bz2 and ccx_2.18.README.INSTALL to
10   directory /usr/local
11
122. bunzip2 and untar ccx_2.18.src.tar.bz2, ccx_2.18.doc.tar.bz2 and
13 ccx_2.18.test.tar.bz2; the following directory tree is generated:
14 /usr/local/CalculiX/ccx_2.18/src
15 /usr/local/CalculiX/ccx_2.18/doc
16 /usr/local/CalculiX/ccx_2.18/test
17
183. get SPOOLES.2.2 and ARPACK from the internet
19   (e.g.
20   http://www.netlib.org/linalg/spooles/spooles.2.2.html
21   and http://www.caam.rice.edu/software/ARPACK/) and install them in
22   /usr/local/SPOOLES.2.2 and /urs/local/ARPACK.
23
24   Note: makefile ~/SPOOLES.2.2/Tree/src/makeGlobalLib contains an
25         error: file drawTree.c does not exist and should be replaced
26         by draw.c
27
28   If you would like to experiment with TAUCS, or if you have
29   access to the SGI scientific library, or if you would like to use PARDISO, continue reading. Else, go to
30   item 4.
31
32   If you like to use TAUCS as solver, install TAUCS in /usr/local/taucs
33   (and lapack, blas and metis in /usr/local/taucs/external/lib/linux)
34   and change the Makefile in
35   /usr/local/CalculiX/ccx_2.18/src as follows:
36   a) add "-I ../../../taucs/src -I ../../../taucs/build/linux -DTAUCS" to
37      the CFLAGS (without double quotes)
38   b) add
39       "../../../taucs/lib/linux/libtaucs.a \
40        ../../../taucs/external/lib/linux/liblapack.a \
41        ../../../taucs/external/lib/linux/libblas.a \
42        ../../../taucs/external/lib/linux/libmetis.a \"
43      to LIBS
44   Notice that you only need lapack, blas and metis if you want to
45   install TAUCS.
46   Look at file tau.c and the documentation of TAUCS for details. Right now,
47   only the LLT version of TAUCS is selected. It only applies to positive
48   definite systems. For more than 50,000 equations the out-of-core version
49   is selected with default in-core-memory of 500 MB. Defaults can be
50   changed in file tau.c (for instance the location of the scratch file).
51
52   If you have access to the SGI scientific library, change the Makefile in
53   /usr/local/CalculiX/ccx_2.18/src as follows:
54   a) add "-DSGI" to the CFLAGS (without double quotes)
55   b) add -lscs to
56	g77 -Wall -O  -o $@ $(OCCXMAIN) ccx_2.18.a  $(LIBS)
57   The linear equation solver in the SGI library is about twice as
58   fast as SPOOLES and comes in an out-of-core version as well. For
59   details look at file sgi.c. The out-of-core is automatically
60   selected for more than 200,000 equations with in-core-memory
61   of 2 GB. You can change the in-core memory is overwritten by
62   the environment variable CCX_OOC_MEM, if defined.
63   If you prefer multiple threads, replace -lscs by -lscs_mp and set
64   the number of thread using the environment variable MP_SET_NUMTHREADS.
65   Default is all possible threads. There may be a problem combining
66   multiple threads with the out-of-core capability.
67
68   If you do not want to link SPOOLES and/or ARPACK, delete -DSPOOLES
69   and/or -DARPACK in the CFLAGS in the Makefile in
70   /usr/local/CalculiX/ccx_2.18/src.
71
72   If you would like to use PARDISO, add the flag -DPARDISO to the CFLAGS. You
73   can find more information on PARDISO and its license on
74   www.pardiso-project.org. PARDISO is about twice faster than SPOOLES and
75   seems to scale better.
76
77   Finally, CalculiX has recently been linked with PaStiX. PaStiX is a very
78   fast freeware solver able to use the Graphical Processing Unit
79   (GPU). Benchmark tests have revealed a speed-up of a factor up to 8 for
80   static calculations with contact. This, however, assumes that you have a
81   hight-end Graphical card with at least 32 GB of memory on it. Still, even
82   without using the GPU speed-ups of up to a factor of 4 were observed. This
83   applies to medium to big models in the range between 1 and 5 million
84   degrees of freedom. In order to use PaStiX you need:
85   1) BLAS (e.g. OpenBLAS)
86   2) hwloc (e.g. hwloc-2.1.0)
87   3) parsec (by Mathieu Faverge; can be cloned from
88   "https://bitbucket.org/mfaverge/parsec/src/master", or on the command line:
89   "git clone https://bitbucket.org/mfaverge/parsec.git")
90   4) scotch (e.g. scotch_6.0.8)
91   5) PaStiX modified for CalculiX (PaStiX4CalculiX)
92   You need to compile these libraries in version that supports 8-byte
93   integers in the above order (the requirement for 8-byte integers comes from
94   the fact that some of the above libraries automatically assume the use of 8
95   bytes for an integer). In the CalculiX source directory shell scripts *.sh
96   are provided to do the compiling and linking job. They assume a directory
97   tree in the form:
98   1) ~/OpenBLAS_i8
99   2) ~/PaStiX/hwloc-2.1.0
100   3) ~/PaStiX/parsec
101   4) ~/PaStiX/scotch_6.0.8
102   5) ~/PaStiX/pastix_src
103   So a possible way to proceed is:
104   0) download CUDA and compile (needed if you want to use the GPU; only works
105      if the Graphical card is a Nvidea card)
106   1) download BLAS and compile; BLAS can be obtained from different sources,
107      e.g. OpenBLAS, the Intel MKL-Library,..
108   2) download hwloc-2.1.0.tar.bz2, unpack in ~/PaStiX, copy
109      make_hwloc.sh in ~/PaStiX/hwloc-2.1.0, go to that directory and
110      run ./make_hwloc.sh
111   3) clone parsec in ~/PaStiX (i.e. type the clone command in that directory),
112      copy make_parsec.sh in ~/PaStiX/parsec, go to
113      that directory and run ./make_parsec.sh
114   4) download scotch_6.0.8.tar.bz2, unpack in ~/PaStiX, copy make_scotch.sh
115      in ~/PaStiX/scotch_6.0.8 and run ./make_scotch.sh
116   5) enter "git clone https://github.com/Dhondtguido/PaStiX4CalculiX" in
117   ~/PaStiX, rename PaStiX4CalculiX into pastix_src, copy make_pastix.sh in
118   ~/PaStiX/pastix_src and run make_pastix.sh
119   You may need to modify the paths in the *.sh-files, if you use other
120   paths. The same applies to the names of the packages, if you use other
121   versions.
122   Then, run "make -f Makefile_i8" in the CalculiX directory to get the
123   CalculiX executable. The resulting executable uses 8-byte integers by
124   default. The Makefile_i8 contains flags in the form -DPASTIX by default. If
125   you want to create a 8-byte integer executable without using PASTIX, remove
126   all references to PASTIX in Makefile_i8.
127
128   There is a small Perl script in the distribution in file date.pl. Its
129   purpose is to insert the date you made CalculiX CrunchiX into the source
130   code (CalculiX.c) such that you get the message: "You are using an
131   executable made on (actual date)" on the screen each time you execute
132   CalculiX CrunchiX. If you do not want this, or if you do not have Perl,
133   delete "./date.pl; $(CC) $(CFLAGS) -c ccx_2.18.c; " near
134   the end of the Makefile. Remember that the Makefile syntax requires
135   this line to start with a TAB, no blanks, so be careful if you change
136   that line.
137
1384. change to /usr/local/CalculiX/ccx_2.18/src and type make;
139   ccx_2.18 is made; put the executable in /usr/local/bin.
140   Make sure the file access permissions are set by typing
141   "chmod a+rx ccx_2.18" in directory
142   /usr/local bin. Make sure /usr/local/bin is in your $PATH variable
143   (check by typing "echo $PATH". If /usr/local/bin is not in the
144   path, add it in your start script (e.g. .bashrc) by adding a line
145   "PATH=$PATH:/usr/local/bin".
146
147For ATHLON users: replace the contents of the variables CFLAGS and
148FFLAGS in the Makefile by:
149CFLAGS =  -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
150-fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loops=2
151-malign-jumps=2 -malign-functions=2 -DCPU=586   -DEXPORT_SYMTAB -DARCH="Linux"
152FFLAGS =  -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
153-fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loops=2
154-malign-jumps=2 -malign-functions=2 -DCPU=586   -DEXPORT_SYMTAB
155
156For people not working on Linux (e.g. HP-UNIX): change the
157architecture flag in CFLAGS, e.g. for IRIX: -DARCH="IRIX". Look at
158file CalculiX.h in the src directory: the ARCH flag is used to
159determine how FORTRAN files are called from C files (with or without underscore).
160
161For peoples working on HP systems: use the following flags in the Makefile:
162CC = c89
163F77 = f77
164CFLAGS = -DARCH="HP"
165FFLAGS = +e +es -C +A3 -K +ppu -g
166LD = c89
167
1685. change to /usr/local/CalculiX/ccx_2.18/doc and type "latex
169   ccx.tex" at least three times, followed by "dvips ccx.dvi". A
170   postscript version of the documentation is made. Type "mv ccx.ps
171   ccx_2.18.ps" to get the version attached. If available, use
172   latex2html to create a html version by typing "latex2html ccx.tex".
173   A new directory is generated with the name
174   /usr/local/CalculiX/ccx_2.18/doc/ccx. This way it can be
175   called from CalculiX GraphiX.
176
1776. change to /usr/local/CalculiX/ccx_2.18/test, and type
178   " ccx_2.18 beamp"; check whether a beamp.dat file has been
179   created and compare with beamp.dat.ref. Minor differences can occur
180   depending on the machine type you are using. Check whether a
181   beamp.frd file has been created and look at the results with
182   CalculiX Graphix, if already installed. Choose any other .inp file,
183   or try the script "compare" which executes all calculations. If large
184   differences occur, have a look at the comments at the start of the
185   corresponding input file (these comments are also included in the last
186   section of the user's manual): some examples need some preparation in order
187   to run smoothly.
188
1897. Ready!
190
191*****************************************************************************
192
193B. IF YOU WOULD LIKE TO RUN THE EXECUTABLE YOU COPIED FROM THE
194HOMEPAGE (ccx_2.18.tar.bz2):
195
1961. copy ccx_2.18.tar.bz2 to /usr/local. Bunzip2 and untar the
197   executable; the file ccx_2.18 is
198   generated and put into /usr/local/CalculiX/ccx_2.18/src. Move
199   the executable to /usr/local/bin.
200
2012. to run examples, get ccx_2.18.test.tar.bz2 from the homepage
202   and follow the instructions under A.
203
2043. to get the documentation, get ccx_2.18.ps.tar.bz2 and
205   ccx_2.18.htm.tar.bz2, copy them to /usr/local and bunzip2 and
206   untar them. Alternatively, create the documentation from the tex
207   original ccx_2.18.doc.tar.bz2 and proceed as explained under A.
208
209******************************************************************************
210
211If you like a slower pace, here some more information:
212
213You should have obtained four files: ccx_2.18.src.tar.bz2,
214ccx_2.18.doc.tar.bz2, ccx_2.18.htm.tar.bz2,
215ccx_2.18.test.tar.bz2 and the present file
216ccx_2.18.README.INSTALL. By typing "bunzip2 ccx_2.18.src.tar.bz2"
217and "tar -xvf ccx_2.18.src.tar" you extract the source code and some
218other useful files into a subdirectory ./CalculiX/ccx_2.18/src of
219the directory in which you copied ccx_2.18.src.tar.bz2, preferably /usr/local.
220
221The source files include .c, .f and .h files.
222
223The other useful files are:
224
225- Makefile: Makefile to make the executable; check the path names for
226  your  installation!
227- TODO: a file describing future work on the program.
228- BUGS: a synopsis of known bugs.
229- LOGBOOK: a description of the program history
230
231CalculiX has been written in FORTRAN and C. So you will need the g77 compiler.
232
233The program provides an ITERATIVE static solver of its own. However,
234standard for static problems is
235SPOOLES and for frequency problems SPOOLES and ARPACK. The source code
236for these programs is freely available in the internet and can be
237easily localized using any web browser. Alternatively, you can try the
238following web-sites:
239
240for SPOOLES: http://www.netlib.org/linalg/spooles/spooles.2.2.html
241for ARPACK: http://www.caam.rice.edu/software/ARPACK/
242
243The current version of CalculiX assumes you install and use the serial
244version of  SPOOLES 2.2 and the serial double precision version of
245ARPACK. The Makefile of CalculiX assumes that, if CalculiX is
246installed in ./CalculiX/ccx_2.18/src, SPOOLES 2.2 is installed in
247./SPOOLES.2.2 and ARPACK in ./ARPACK (and their
248subdirectories). Change the Makefile if you wish not to comply with
249this  procedure, or if you want to use TAUCS or the SGI solver (see
250A). This also applies if you want to suppress the renumbering (see A).
251
252The file ccx_2.18.doc.tar.bz2 can be unzipped and untarred in a
253similar way as ccx_2.18.src.tar.bz2. The files are expanded in a
254subdirectory ./CalculiX/ccx_2.18/doc/, and contain a User's
255Manual in the form of the tex-file ccx_2.18.tex, in which several
256*.eps and *.ps pictures are included.
257
258The file ccx_2.18.test.tar.bz2 can be unzipped and untarred in a
259similar way as ccx_2.18.src.tar.bz2. The files are expanded in a
260subdirectory ./CalculiX/ccx_2.18/test/, and contain the input
261files (*.inp) and result files (*.dat.ref) of several small sample
262problems, each of them testing a specific property of
263CalculiX. Running the script "compare" runs all problems and compares
264the output (*.dat) with the reference (*.dat.ref) writing any
265differences exceeding a preset limit in an extra error file. Maybe the paths have to be
266adapted to your needs in the script file "compare". The examples are
267described in the file CalculiX.tex. Beware that differences between
268the output files and the reference files can be due to the accuracy of
269you  machine or other compile options.
270
271Summarizing, after unpacking the above .tar.bz2 files, you obtain the
272following directory structure:
273./CalculiX/ccx_2.18/src
274./CalculiX/ccx_2.18/doc
275./CalculiX/ccx_2.18/test
276SPOOLES.2.2 and ARPACK are assumed to be in
277./SPOOLES.2.2
278./ARPACK
279
280
281******************************************************************************
282USING CALCULIX IN MULTITHREADING MODE, i.e. using more than one processor
283on a multiprocessor machine for SPOOLES
284******************************************************************************
285
286This part was contributed by Manfred Spraul.
287
288Starting with CalculiX Version 2.0 an extra Makefile is included with name
289Makefile_MT, which takes care of some of the actions below.
290
291Support for multi-processor computers
292-------------------------------------
293
294CalculiX supports the multithreaded solve option of the spooles sparse
295solver. This option is disabled by default but can be enabled at compile
296time. The option should work on all platforms that have a pthread compatible
297threading library, it was tested on RedHat Linux and Debian Linux.
298
299
300Steps required to enable the multithread option
301-----------------------------------------------
302
303
304Four changes are required:
3051) The multithread option must be compiled into the spooles library.
306   The last line in the file 'makefile' in the top level directory of
307   the spooles build directory must be modified: From
308   "# cd misc/src           ; make -f makeGlobalLib"
309   to
310   "	cd misc/src           ; make -f makeGlobalLib"
311   (without the quotation marks)
312   Then the spooles library must be rebuilt.
313
3142) the "USE_MT" define must be set when compiling the CalculiX .c files.
315   The first line of the file 'Makefile' in the build directory of CalculiX
316   must be modified: "-DUSE_MT" must be added to the CFLAGS define. This is
317   taken care of if you use the Makefile_MT file.
318
3193) Depending on your platform it may be necessary to add additional flags to
320   CFLAGS and/or FFLAGS, please check your C library and compiler
321   documentation. Examples are -D_REENTRANT, -D_THREAD_SAFE and/or
322   -D_POSIX_PTHREAD_SEMANTICS.
323
3244) The pthread library must be linked into the CalculiX executable by adding
325   the correct library to the LIBS list. The exact name depends on the
326   platform, typically it's one of -lpthread, -lpthreads, -kthread, -Kthread,
327   -mt, -mthreads. Please check your system documentation.
328
329The resulting executable contains both the single-threaded solver and the
330multi-threaded solver. See below how to select the multi-threaded solver.
331
332
333How to use the multi-threaded SPOOLES solver
334--------------------------------------------
335
336By default, the single-threaded solver is used.
337
338This can be changed by setting the OMP_NUM_THREADS  environment variable. For
339more information the reader is referred to Section "How to perform CalculiX
340calculations in parallel" in the CalculiX CrunchiX USER'S MANUAL.
341
342The number of cpus that was used for the calculation can be checked by
343looking at the 'spooles.out' file: After a calculation it will contain a line
344like
345
346	Using 2 threads
347
348The file is empty if the single threaded solver was used.
349
350For multithreading using PARDISO the user is referred to the PARDISO manuals.
351
352******************************************************************************
353USING CALCULIX with 8 byte per integer
354******************************************************************************
355
356This may be necessary for really big models. Right now, there is a file
357Makefile_i8 showing you how it works. The integers in the FORTRAN files must
358be compiled with the option -fdefault-integer-8 (for the GNU compiler). This
359tells the compiler to consider all integers in the FORTRAN files as
3608-byte integers. For the C-files, the flag -DLONGLONG must be added to the
361CFLAGS. Right now, the CalculiX distribution assumes that you also generate
362a integer*8 version of ARPACK (use the above FORTRAN flag) and an
363integer*8 version of PARDISO (of course only if you use any if these, i.e.
364if you have the flags -DPARDISO and -DARPACK in your Makefile). The
365SPOOLES distribution, however, is assumed to be an integer *4, since it
366is not known that an integer*8 version of SPOOLES has already been made.
367
368******************************************************************************
369DEBUGGING INFORMATION
370******************************************************************************
371
372Starting with version 2.8 the environment variable
373CCX\_LOG\_ALLOC has been introduced. If set to 1 (default is zero) one gets
374detailed information on all allocated, reallocated and deallocated fields
375during the executation of CalculiX. This may be particularly important during
376debugging of segmentation faults.
377