Friday, December 13, 2013

Compiling CalculiX CrunchiX (CCX) from Source

I was having errors using CCX provided as the Linux executable on the CalculiX website, so I decided to compile it from source so I can finally get it working. I followed the compilation steps detailed on the CalculiX website, in addition to the following few changes.

I compiled on Ubuntu 12.04 LTS.

In order to compile CalculiX, you also need to install SPOOLES.2.2 and ARPACK.

Installing SPOOLES.2.2 is straightforward, just follow their directions on their website.

Installing ARPACK required a bit more modification. For me, I had to make the following changes in '':
     -Add '-lg2c' flag to LDFLAGS, LNFLAGS, and FFLAGS
     -Changed the fortran compiler to gfortran
     -Changed the MAKE directory to /usr/bin/make (original: /bin/make)
     -Changed the PLAT to INTEL, rather than SUN4
And the following change to 'UTIL/second.f':
     -Changed the two lines:
            REAL                      ETIME
            EXTERNAL           ETIME
            EXTERNAL    REAL        ETIME

Then, I was able to compile CCX as detailed on the website.

Another note about the deck input... I was trying to use the solver on the test cases as provided on the CalculiX website and took me a little while to figure out how to get the post-processed results (colorful stress and strain fields, etc.). I thought the results were written to *.frd file by *EL PRINT (which are already in the test input files), but the Datasets to be displayed in CGX actually have to be written by *EL FILE and *NODE FILE. So, to get the stress and displacement fields I had to type the following into the deck input file:


Where S denotes stress and U denotes displacement. For the rest of the keywords for other fields, you can check the CCX Manual.


  1. Hi have you ever tried to compile calculix with a patch which gives output in exodus format instead of .frd. See the link

    Paraview is significantly way advanced than CGX which in my view a software of late 90's. ABAQUS output can be viewed in Exodus or nemesis format. THis means paraview can be used to vie outputs of both ABAQUS and Calculix. Let me know if u can install Calculix with paraview patch.

    Do provide us a step=by-step instructions or better a short youtube video showing steps. Also, show us how to install CGX from source.

  2. Hello Vizag, I have not tried the patches you refer to, as for me cgx works perfectly fine, for my relatively simple cases. Although, I do wish I can define boundary condition nodes and faces through a script rather than manually through the CGX GUI. Currently I use gmsh and convert it to Abaqus format.

    What do you want to do with Exodus? I have not heard of it and am not too motivated to install it. Have you tried compiling it yet? I am no expert on this but perhaps I could help with some specific errors you have.

  3. Hi Lordvon

    The CGX is although good. It is very behind the time, and looks like 90s package. ABAQUS can provide output in .odb (default) and Exodus-II formats. The Exodus-II is sort of open source. It can be viewed in paraview. The paraview is far superior postprocessing tool. It also uses python console. A number of other softwares also rely on Parview. I recommend you to watch some of youtube videos on paraview. Rather than using CGX use paraview.

    In a way you can view both ABAQUS results and calculix results just in one post-processor. There no need to learn two seperate post-processing tools.

    On an another note, use open source salome-meca as preprocessor. It is just similar to ABAQUS in looks. you can generate several format meshes which can be exported. You type input decks and use the sets of nodes and elements. You n get output in .unv format. I believe calculix can read .unv format if not read in gmsh and convert to .inp. using CCX solve it and view in paraview.

    One me thing have ever used open source code-aster? I recommed you to view this professors webpage where there is a code available to convert mesh from code-aster.