Building Calculix to Run Native on 64-Bit Windows

Until recently, one of the limitations of running Calculix on Windows has been the 32-bit address space which places an upper bound on the size of models which can be solved. Thanks to the mingw-w64 project it is now possible to build applications to run on 64-bit windows using the familiar gcc tool chain.  This project has reverse engineered the API to the 64-bit windows system and allows developers to compile code which will run native in this environment.  Building 64-bit Calculix will require setting up the mingw-w64 compiler tool chain with MSYS.  At the time of this writing the project is a fast moving target with nightly build releases.  The building process documented here is based on the MSYS release bundle provided by the mingw-w64 project team.  It also uses the gcc 4.5 tool chain binaries from sezero’s personal build on 10-2-2010.

Get started by downloading the MSYS zip file from here. The link to the mingw-w64 wiki documentation for the MSYS bundle is available at this link.  Next, download the mingw-w64 binaries which will run on a Windows machine and produce 64-bit output from here. These two zip files have been originally acquired from the sourceforge website.  It can be a bit confusing navigating around and often times the links change.  These files have been re-hosted on a separate server to ensure the links won’t change and they are easy to find.

These two zip files will need to be extracted.  In the case of this documentation they have been installed in the C:\ directory.  After extraction there should be two folders located at C:\msys and C:\mingw64.  Inside of the msys folder will be a file named msys.bat.  This file will launch the bash shell and provide access to the MSYS command line environment.  Please note this is different from Cygwin, but rather similar in the same regard.  MSYS is a minimalistic set of tools while Cygwin offers nearly anything the user could desire.

Open up the bash shell by double clicking on the msys.bat file.  At this point a post install script must be run to attach the MSYS environment to the development tools located in C:\mingw64.  Issue the following command and answer the questions as shown in the following screen shot.

sh /postinstall/pi.sh

After the link up is finished type the following command to verify the version of gcc and examine the output as shown in the following screen shot.

The information printed to the shell indicates that the correct version of gcc is being recognized by the MSYS environment.  The next step is to install the pthreads libraries.  These libraries provide an interface which allow code written with pthreads to run on Windows.  This library comes with sezero’s personal build and should be located at C:\mingw_w64\pthreads-w64.zip.  Extract the zip file, the necessary libraries and headers will be installed such that they are available to mingw-w64.

Now that the build environment is setup download the source code for CalculiX CrunchiX, SPOOLES and ARPACK by clicking on the respective links.  These are links to files hosted for this article.  They can also be retrieved by going to the primary site for the project.  Also note, this article was written for Calculix version 2.2.  Version 2.3 has just been released at the time of writing and it has not been tested using these instructions.  There will be another post here with any updates if there are special changes for version 2.3.

Move the three downloaded files to your home directory under the MSYS environment.  In Windows this will be located at C:\msys\home\<user name>.  Make a new directory named SPOOLES.2.2.  Move the spooles.2.2.tgz file into this newly created directory.  Extract each of the archive files so the directory structure looks like the following in your home folder.

The next step will require making some modifications to the makefiles and some source files within the three folders.  ARPACK will be the first to be modified.  Find the file located at ARPACK\ARmake.inc and open it.  Change the file to resemble the images below.  The modified makefile has been hosted for download at this link.

Now find the second.f file located in the ARPACK\UTIL directory.  This file will need to have the 24th line commented out to look like the following.  The modified file is available for download at this link.

Within the ARPACK directory type the make lib command using the MSYS bash shell.  The computer goes to work and the output scrolls across the screen.  This will compile the library and create a file named libarpack_INTEL.a.

Now it is time to make modifications to the SPOOLES library files.  The first task is to make a correction to one of the files.  The file is located at SPOOLES.2.2/Tree/src/MakeGlobalLib.  Change line 9 from drawTree.c to draw.c.  The corrected file should look like the following.  The modified file is available for download at this link.

The file located at SPOOLES.2.2/MT/src/QRfactorMT.c needs to have line 204 commented out and replaced by the following line as shown below.  On Linux systems the pthread_t variable type is typedef as an int.  In the Windows implementation it is a structure.  Trying to zero out a structure by assigning an integer value to it throws an error during compilation.  The memset function is used to clear the structure instead.  The modified file is available for download at this link.

Next, there are changes to SPOOLES.2.2/Make.inc

The modified Make.inc file is available for download at this link.

The last file which needs to be changed is SPOOLES.2.2/makefile, uncomment the lines with MT to include the multi-threaded code when the make lib command is issued.  The modified makefile is available for download at this link.

SPOOLES is now ready to be compiled.  Type make lib at the command line in the SPOOLES.2.2 directory.  After a short wait the spooles.a library will be created in the current folder.  Also, the spoolesMT.a file will be created in the SPOOLES.2.2/MT/src directory.

The next step is to modify the source code for Calculix CCX. Changes will need to be made to files located in the CalculiX/ccx_2.2/src directory.  Find the date.pl file and open it.  Find line number 8 that contains $^I=””.  This line will need to be changed such that it looks like the line shown below.  Due to some combination of factors within the MSYS environment Windows is unable to do a write in place to the ccx_2.2.c file.  Thus, adding the .old results in another file being created and allows the script to work properly.  The modified file is available for download at this link.

The next step is to get working on the makefile situation for CCX.  The ccx 2.2 source code comes with two different makefiles.  One named makefile and another named makefile_MT.  You’ll want to rename makefile to something like makefile.old.  Then change the name of makefile_MT to just makefile.  Now open the newly named makefile and edit it to look like the following. Otherwise, just download the makefile from this link.

Now that the makefile and date.pl files have been update it is time to issue the make command within the ccx source directory to build the final binary.  The result will be named ccx_2.2_MT64.exe.  Using the ls -l command the file can be listed with its date in order to verify when it was created.

In order to access the multithreaded capacity, the CCX_NPROC environment variable must be set.  If you plant to run the ccx program from the command line issue the following commands to set and verify the $CCX_NPROC variable has been set to the number of threads you would like to have created.

Now you will need to locate the pthreadGC2-w64.dll file in the /c/mingw64/bin directory and move it into the same folder as the newly created ccx_2.2_MT64.exe binary. The ccx binary depends on this library file and it needs to be in the same directory in order for ccx to execute. If not it will show an error box saying it can’t find the file. That should be everything to get up and running native on 64-bit Windows.

Thanks for reading!
-Ty Beede

Advertisements

About mechanicalguy

My name is Ty Beede and I'm a mechanical engineer currently working in the aerospace sector. My interests include computational structural analysis, metal fabrication, building and modifying Jeeps for extreme off-roading, and design/fabrication of bicycles for on and off road use. I enjoy working hard and my passion in life is building and learning new skills related to mechanical, computer, and electrical engineering.
This entry was posted in Calculix FEA Tutorials. Bookmark the permalink.

40 Responses to Building Calculix to Run Native on 64-Bit Windows

  1. compsci says:

    Hi Ty,
    I tried compiling calculix as per the procedure stated by you but i get an error which says that there is no file or directory by the name pthread.h. Please use the link given below for detailed error message. Do i need to make some changes to pthread.h in mingw?
    https://picasaweb.google.com/101339704655861483861/MinGwError#5590125147924439954

    Thanks

    • Hello, it sounds like you may have missed the step where you have to unzip the pthreads-w64.zip file that came with sezero’s mingw-w64 build. I used 7 zip to unzip it in place and that installs the pthread package into the build environment. The pthreads-w64.zip file should be located in C:\mingw_w64\pthreads-w64.zip. After it is installed you can open up the msys terminal and go looking for it. It is located at /c/mingw_w64/x86_64-w64-mingw32/include/pthread.h using the command line. You can also use the command “find /c/mingw_w64 -name pthread.h” to do a search for it. Let me know if that solves the problem. If not I’ll try to duplicate it on my end. -Ty

  2. compsci says:

    Hi Ty,

    I think i am through with the pthread.h problem but i have a new problem which says that :

    make: *** No rule to make target `../../../SPOOLES.2.2/MT/src/spoolesMT.a’, need
    ed by `ccx_2.2_MT64.exe’. Stop.

    Please let me know where i am going wrong.

    • No problem, I’m happy to help. The error you are getting is related to the location of the spoolesMT.a library. I would double check the name of the SPOOLES.2.2 directory. It might be lower case and you’ll need to rename it to upper case. Also check to make sure the SPOOLES.2.2 directory is located at the right spot relative to the CalculiX/ccx_2.2/src folder. I bet the issue is relative to the upper/lower case with spooles direcotry name. By default it is lower case and the ccx makefile expects it to be upper case.
      From the text you included above the build is almost done. It is just trying to link up the newly built *.o binary files with the spoolesMT.a library file to create the final executable. The error indicates it is having trouble finding the spoolesMT.a file. When you are in the calculix src directory you should be able to type the command “ls ../../../SPOOLES.2.2/MT/src/spoolesMT.a” and it will show you spoolesMT.a as the output of the command. The “ls” command is alot like DOS’s dir, just a bit different synatax. You can use the “ls -l” switch to get a listing which shows the date information to show when the file was created.

      • compsci says:

        Hi Ty,

        I checked every point you posted and i am not getting spoolesMT.a file as the output of ls statement. I double checked the loaction and case sensitive Spooles directory. That seems fine.

      • Ok, I think we are getting to the bottom of it! Thanks for bearing with me and helping debug this. My directions are missing the step where you need to type “make lib” in the ARPACK and SPOOLES.2.2 directories. This will build the binary libraries from the source code. Then when you type “make” in the CalculiX/ccx_2.2/src directory the libraries will be there to link against. After issuing the “make lib” command in the SPOOLES.2.2 directory you should be able to do an “ls” for the library file that is missing and it will show up. Also, have a look at my documentation titled “Building Calculix CCX from Source on Windows” which has this step included. I’ll go back through this tutorial and add in the missing steps.

  3. compsci says:

    Thanks for the help and awesome document Ty. I am able to compile calculix now and create the exe. I will get back to you in case i need your help again.

    • Just a quick note, I added one more step about putting pthreadGC2-w64.dll into the same directory as the ccx binary file that gets compiled. Thanks for helping test the instructions and providing feedback!

      • compsci says:

        Thanks again for the help and one more question..Do i need to do anything different for building calculix on 32 -bit windows using the same compiler or the same would work..

      • There are two branches of mingw compiler tool chains. One for 64 bit and another for 32 bit. To complicate things you can also build it with Cygwin. I’ve written a separate article that explains how I like to compile for 32-bit Windows systems. It is located at this link.

  4. Mark says:

    Hello,

    thanx for the detailed explantion. But I have some problems. After downloading the files listed I get problems making the libs

    in Arpack make lib leeds to:
    User@Nb1 ~/ARPACK
    $ make lib
    Making lib in /home/User/ARPACK/BLAS
    make[1]: Entering directory `/home/User/ARPACK/BLAS’
    Makefile:69: warning: overriding commands for target `.f.o’
    ../ARmake.inc:96: warning: ignoring old commands for target `.f.o’
    gfortran LDFLAGS = -O -c srotg.f
    gfortran.exe: LDFLAGS: No such file or directory
    gfortran.exe: =: No such file or directory
    make[1]: *** [srotg.o] Error 1
    make[1]: Leaving directory `/home/User/ARPACK/BLAS’
    Making lib in /home/User/ARPACK/LAPACK
    make[1]: Entering directory `/home/User/ARPACK/LAPACK’
    Makefile:91: warning: overriding commands for target `.f.o’
    ../ARmake.inc:96: warning: ignoring old commands for target `.f.o’
    gfortran LDFLAGS = -O -c slaexc.f
    gfortran.exe: LDFLAGS: No such file or directory
    gfortran.exe: =: No such file or directory
    make[1]: *** [slaexc.o] Error 1
    make[1]: Leaving directory `/home/User/ARPACK/LAPACK’
    Making lib in /home/User/ARPACK/UTIL
    make[1]: Entering directory `/home/User/ARPACK/UTIL’
    Makefile:47: warning: overriding commands for target `.f.o’
    ../ARmake.inc:96: warning: ignoring old commands for target `.f.o’
    gfortran LDFLAGS = -O -c second.f
    gfortran.exe: LDFLAGS: No such file or directory
    gfortran.exe: =: No such file or directory
    make[1]: *** [second.o] Error 1
    make[1]: Leaving directory `/home/User/ARPACK/UTIL’
    Making lib in /home/User/ARPACK/SRC
    make[1]: Entering directory `/home/User/ARPACK/SRC’
    Makefile:50: warning: overriding commands for target `.f.o’
    ../ARmake.inc:96: warning: ignoring old commands for target `.f.o’
    gfortran LDFLAGS = -O -c snaitr.f
    gfortran.exe: LDFLAGS: No such file or directory
    gfortran.exe: =: No such file or directory
    make[1]: *** [snaitr.o] Error 1
    make[1]: Leaving directory `/home/User/ARPACK/SRC’
    ranlib /home/User/ARPACK/libarpack_INTEL.a
    c:\mingw64\bin\ranlib.exe: ‘C:/msys/home/User/ARPACK/libarpack_INTEL.a’: No such
    file
    make: *** [arpacklib] Error 1

    and in Spooles:
    User@Nb1 ~/SPOOLES.2.2
    $ make lib
    makefile:127: *** missing separator. Stop.

    What is wrong? Any help available?

    Thanx in advance

    Mark

    • Hey Mark, I think for ARPACK you’ll need to remove the -c flag from the FFLAGS variable. That flag isn’t supported with gfortran and it might be causing you some trouble. With the SPOOLES I would guess that you need to double check the syntax at line 127 in the makefile. I’ll go ahead and post up the ARPACK and SPOOLES makefiles tonight so you can download them.

      • I uploaded all the files and added links to them in the article. Hopefully this should get you fixed up. -Ty

      • compsci says:

        Hi Ty,
        I wish to compile calculix on 32 – bit windows using mingw but the version i downloaded from mingw website does not have pthread zip file.can i use the same mingw version provided by you and compile on 32 bit windows. I would like to use mingw instead of cygwin.

      • compsci says:

        Hi Ty,
        I am not able to figure out how pthread library works for 32 bit windows. I am stuck at making the spooles library. Please let me know if you know the solution.

        Thanks

      • Hello, sorry for the delay. I’ve had quite a number of other irons in the fire this week. I’m sure you can build 32-bit Calculix with mingw’s 32 bit branch. However, you would need to build the pthreads library from source code with that tool chain. I haven’t personally tried it. -Ty

      • compsci says:

        Hi Ty,

        Thanks for all the help. I am able to compile calculix for both 64 and 32 bit windows using mingw.

      • compsci says:

        Hi Ty,

        Do you have a clue about building cgx on 32 bit windows?

        Thanks

      • Runar Tenfjord posted a comment which indicated he had some info about building cgx on windows. I replied to him and perhaps he will have a chance to send it over and I’ll post it up here.

      • compsci says:

        Hi Ty, Were you able to figure out anything about CGX compilation or the problem in the 32 bit build? I saw a few posts about building CGX in the yahoo groups forum but I failed to get anything concrete from those posts.

      • Jeff Baylor says:

        Hi Ty,

        I love your blog, thanks.

        The next CalculiX for Windows build (2.3.001) will have all of the project and source files for building CGX. This has always been the more complex of the two applications in CalculiX and every build requires debugging. That portion of the build is already finished. I only have to add a 64bit build (the installer offers a choice of 32 or 64 bit now) and test on Vista.

        Best,
        Jeff

  5. Mark says:

    Thanks for your help, but I am still in trouble.

    I could manage to build ARPACK libarpack_INTEL.a (972 kB)
    after using your makefiles.

    But with Spooles I still get errors (see below)
    pthreads-w64.zip is unziped in C:\mingw_w64\pthreads-w64
    and the pthread.h is in
    C:\mingw_w64\pthreads-w64\x86_64-w64-mingw32\include !!!

    (There are directories c:\mingw64
    and c:\mingw_w64 )

    spooles.a in SPOOLES.2.2 is created (size 272 kB)
    spoolesMT.a in SPOOLES.2.2/MT/src isn’t build

    What’s the problem

    User@Nb1 ~/SPOOLES.2.2
    $ make lib
    cd A2 ; make lib
    make[1]: Entering directory `/home/User/SPOOLES.2.2/A2′
    cd src ; make makeLib
    make[2]: Entering directory `/home/User/SPOOLES.2.2/A2/src’
    perl ../../makeLib > makeG
    make -f makeG
    make[3]: Entering directory `/home/User/SPOOLES.2.2/A2/src’
    makeG:21: warning: overriding commands for target `.c.o’
    ../../Make.inc:90: warning: ignoring old commands for target `.c.o’
    gcc -c -O basics.c -o A2_basics.o
    gcc -c -O copyEntriesToVector.c -o A2_copyEntriesToVector.o
    gcc -c -O init.c -o A2_init.o
    gcc -c -O instance.c -o A2_instance.o
    gcc -c -O IO.c -o A2_IO.o
    gcc -c -O makeStaircase.c -o A2_makeStaircase.o
    gcc -c -O norms.c -o A2_norms.o
    gcc -c -O QRreduce.c -o A2_QRreduce.o
    gcc -c -O sort.c -o A2_sort.o
    gcc -c -O util.c -o A2_util.o
    ar rv ../../spooles.a A2_*.o
    r – A2_IO.o
    r – A2_QRreduce.o
    r – A2_basics.o
    r – A2_copyEntriesToVector.o
    r – A2_init.o
    r – A2_instance.o
    r – A2_makeStaircase.o
    r – A2_norms.o
    r – A2_sort.o
    r – A2_util.o
    rm -f A2_*.o
    echo ../../spooles.a
    ../../spooles.a
    make[3]: Leaving directory `/home/User/SPOOLES.2.2/A2/src’
    rm -f makeG
    make[2]: Leaving directory `/home/User/SPOOLES.2.2/A2/src’
    make[1]: Leaving directory `/home/User/SPOOLES.2.2/A2′
    cd BKL ; make lib
    make[1]: Entering directory `/home/User/SPOOLES.2.2/BKL’
    cd src ; make makeLib
    make[2]: Entering directory `/home/User/SPOOLES.2.2/BKL/src’
    perl ../../makeLib > makeG
    make -f makeG
    make[3]: Entering directory `/home/User/SPOOLES.2.2/BKL/src’
    makeG:17: warning: overriding commands for target `.c.o’
    ../../Make.inc:90: warning: ignoring old commands for target `.c.o’
    gcc -c -O basics.c -o BKL_basics.o
    gcc -c -O evalfcn.c -o BKL_evalfcn.o
    gcc -c -O exhSearch.c -o BKL_exhSearch.o
    gcc -c -O fidmat.c -o BKL_fidmat.o
    gcc -c -O init.c -o BKL_init.o
    gcc -c -O util.c -o BKL_util.o
    ar rv ../../spooles.a BKL_*.o
    r – BKL_basics.o
    r – BKL_evalfcn.o
    r – BKL_exhSearch.o
    r – BKL_fidmat.o
    r – BKL_init.o
    r – BKL_util.o
    rm -f BKL_*.o
    echo ../../spooles.a
    ../../spooles.a
    make[3]: Leaving directory `/home/User/SPOOLES.2.2/BKL/src’
    rm -f makeG
    make[2]: Leaving directory `/home/User/SPOOLES.2.2/BKL/src’
    make[1]: Leaving directory `/home/User/SPOOLES.2.2/BKL’
    cd BPG ; make lib
    make[1]: Entering directory `/home/User/SPOOLES.2.2/BPG’
    cd src ; make makeLib
    make[2]: Entering directory `/home/User/SPOOLES.2.2/BPG/src’
    perl ../../makeLib > makeG
    make -f makeG
    make[3]: Entering directory `/home/User/SPOOLES.2.2/BPG/src’
    makeG:18: warning: overriding commands for target `.c.o’
    ../../Make.inc:90: warning: ignoring old commands for target `.c.o’
    gcc -c -O basics.c -o BPG_basics.o
    gcc -c -O DM.c -o BPG_DM.o
    gcc -c -O init.c -o BPG_init.o
    gcc -c -O IO.c -o BPG_IO.o
    gcc -c -O makeGraphs.c -o BPG_makeGraphs.o
    gcc -c -O maxFlow.c -o BPG_maxFlow.o
    gcc -c -O pseudo.c -o BPG_pseudo.o
    ar rv ../../spooles.a BPG_*.o
    r – BPG_DM.o
    r – BPG_IO.o
    r – BPG_basics.o
    r – BPG_init.o
    r – BPG_makeGraphs.o
    r – BPG_maxFlow.o
    r – BPG_pseudo.o
    rm -f BPG_*.o
    echo ../../spooles.a
    ../../spooles.a
    make[3]: Leaving directory `/home/User/SPOOLES.2.2/BPG/src’
    rm -f makeG
    make[2]: Leaving directory `/home/User/SPOOLES.2.2/BPG/src’
    make[1]: Leaving directory `/home/User/SPOOLES.2.2/BPG’
    cd Chv ; make lib
    make[1]: Entering directory `/home/User/SPOOLES.2.2/Chv’
    cd src ; make makeLib
    make[2]: Entering directory `/home/User/SPOOLES.2.2/Chv/src’
    perl ../../makeLib > makeG
    make -f makeG
    make[3]: Entering directory `/home/User/SPOOLES.2.2/Chv/src’
    makeG:23: warning: overriding commands for target `.c.o’
    ../../Make.inc:90: warning: ignoring old commands for target `.c.o’
    gcc -c -O assemble.c -o Chv_assemble.o
    gcc -c -O basics.c -o Chv_basics.o
    gcc -c -O copy.c -o Chv_copy.o
    gcc -c -O factor.c -o Chv_factor.o
    gcc -c -O findPivot.c -o Chv_findPivot.o
    gcc -c -O init.c -o Chv_init.o
    gcc -c -O instance.c -o Chv_instance.o
    gcc -c -O IO.c -o Chv_IO.o
    gcc -c -O search.c -o Chv_search.o
    gcc -c -O swap.c -o Chv_swap.o
    gcc -c -O update.c -o Chv_update.o
    gcc -c -O util.c -o Chv_util.o
    ar rv ../../spooles.a Chv_*.o
    r – Chv_IO.o
    r – Chv_assemble.o
    r – Chv_basics.o
    r – Chv_copy.o
    r – Chv_factor.o
    r – Chv_findPivot.o
    r – Chv_init.o
    r – Chv_instance.o
    r – Chv_search.o
    r – Chv_swap.o
    r – Chv_update.o
    r – Chv_util.o
    rm -f Chv_*.o
    echo ../../spooles.a
    ../../spooles.a
    make[3]: Leaving directory `/home/User/SPOOLES.2.2/Chv/src’
    rm -f makeG
    make[2]: Leaving directory `/home/User/SPOOLES.2.2/Chv/src’
    make[1]: Leaving directory `/home/User/SPOOLES.2.2/Chv’
    cd ChvList ; make lib
    make[1]: Entering directory `/home/User/SPOOLES.2.2/ChvList’
    cd src ; make makeLib
    make[2]: Entering directory `/home/User/SPOOLES.2.2/ChvList/src’
    perl ../../makeLib > makeG
    make -f makeG
    make[3]: Entering directory `/home/User/SPOOLES.2.2/ChvList/src’
    makeG:15: warning: overriding commands for target `.c.o’
    ../../Make.inc:90: warning: ignoring old commands for target `.c.o’
    gcc -c -O basics.c -o ChvList_basics.o
    In file included from ../../Lock.h:3:0,
    from ../ChvList.h:4,
    from basics.c:3:
    ../../Lock/Lock.h:16:21: fatal error: pthread.h: No such file or directory
    compilation terminated.
    make[3]: *** [basics.o] Error 1
    make[3]: Leaving directory `/home/User/SPOOLES.2.2/ChvList/src’
    make[2]: *** [makeLib] Error 2
    make[2]: Leaving directory `/home/User/SPOOLES.2.2/ChvList/src’
    make[1]: *** [lib] Error 2
    make[1]: Leaving directory `/home/User/SPOOLES.2.2/ChvList’
    make: *** [lib] Error 2

    • Hey Mark, did you manage to get the build working?

      • Mark says:

        hello,

        unfortunately I could not build the Spooles library.
        The Error message was attached above

      • Mark says:

        The compilation was terminated with the following message.
        Seem’s pthread.h is not found, but what is the reason. Kindly check my message above

        from basics.c:3:
        ../../Lock/Lock.h:16:21: fatal error: pthread.h: No such file or directory
        compilation terminated.

      • Hello, it sounds like you may have missed the step where you have to unzip the pthreads-w64.zip file that came with sezero’s mingw-w64 build. I used 7 zip to unzip it in place and that installs the pthread package into the build environment. The pthreads-w64.zip file should be located in C:\mingw_w64\pthreads-w64.zip. After it is installed you can open up the msys terminal and go looking for it. It is located at /c/mingw_w64/x86_64-w64-mingw32/include/pthread.h using the command line. You can also use the command “find /c/mingw_w64 -name pthread.h” to do a search for it. Let me know if that solves the problem.

        I will also post up a version of the sezero tool chain with this extraction step already completed along with a binary version of SPOOLES so you can get to compiling the ccx source code. I should be able to get this done tonight.

  6. compsci says:

    Hi Ty,
    I am not sure how to work with p-thread on 32-bit windows.Can u please put some light on it.

  7. Mark says:

    The compiling problem still exists. Ichecked the path to pthread.h

    User@Nb1 ~/spooles.2.2
    $ find /c/mingw_w64 -name pthread.h
    /c/mingw_w64/x86_64-w64-mingw32/include/pthread.h

    (is it ok that there is the
    c/mingw64 directory too ?)

    but make lib ends in the following message:

    perl ../../makeLib > makeG
    make -f makeG
    make[3]: Entering directory `/home/User/spooles.2.2/ChvList/src’
    makeG:15: warning: overriding commands for target `.c.o’
    ../../Make.inc:90: warning: ignoring old commands for target `.c.o’
    gcc -c -O basics.c -o ChvList_basics.o
    In file included from ../../Lock.h:3:0,
    from ../ChvList.h:4,
    from basics.c:3:
    ../../Lock/Lock.h:16:21: fatal error: pthread.h: No such file or direct
    compilation terminated.
    make[3]: *** [basics.o] Error 1
    make[3]: Leaving directory `/home/User/spooles.2.2/ChvList/src’
    make[2]: *** [makeLib] Error 2
    make[2]: Leaving directory `/home/User/spooles.2.2/ChvList/src’
    make[1]: *** [lib] Error 2
    make[1]: Leaving directory `/home/User/spooles.2.2/ChvList’
    make: *** [lib] Error 2

    User@Nb1 ~/spooles.2.2
    $

    • I’m not sure what is causing the problem. I’ve run back through the steps on my machined with a clean start and everything is working as normal. Here are a couple links to download the 64-bit windows version of the two SPOOLES library files.

      spooles.a download link
      spoolesMT.a download link

      • Mark says:

        thanx for the link’s . I’ll try them on the weekend.

        Can you confirm that there are the directories
        C:\mingw64
        and
        C:\mingw_w64

        If yes, can you post or mail the directory structure and/or the filese that have to be in the directories

      • compsci says:

        Hi Ty,

        I have a problem running the 32 bit build. I think there is a difference in compiling spoooles on 64 and 32 bit machines. Can you please tell me how to use spooles.a and spoolesMT.a without compiling the source code. On the net there are different .a files for 32 and 64 bit windows.

      • I will have to take a look at it. Not too sure and I’m not at my PC.

  8. Mark says:

    compilation of ccx faild, too
    even after downloading the spooles.a and spoolesMT.a files
    ant the makefile

    User@Nb1 ~/CalculiX/ccx_2.2/src
    $ make
    gcc -Wall -O -I ../../../SPOOLES.2.2 -DARCH=”Linux” -DSPOOLES -DARPACK -DMATRIX
    STORAGE -DUSE_MT=1 -c arpack.c
    In file included from ../../../SPOOLES.2.2/FrontMtx/../ChvManager/../Lock.h:3:0,

    from ../../../SPOOLES.2.2/FrontMtx/../ChvManager/ChvManager.h:4
    ,
    from ../../../SPOOLES.2.2/FrontMtx/../ChvManager.h:3,
    from ../../../SPOOLES.2.2/FrontMtx/FrontMtx.h:8,
    from ../../../SPOOLES.2.2/FrontMtx.h:3,
    from spooles.h:25,
    from arpack.c:26:
    ../../../SPOOLES.2.2/FrontMtx/../ChvManager/../Lock/Lock.h:16:21: fatal error: p
    thread.h: No such file or directory
    compilation terminated.
    make: *** [arpack.o] Error 1

    • Darn… I’m going to zip up my whole working install and post it for download this weekend. That will get you a working setup and I will triple check the steps.

      • Mark says:

        I hope you will be able to share your installation.
        I would be happy to be able to compile ccx under windows 64 bit

      • Hey Mark, sorry for the long delay. I was out of town last week and I started a new job which has here from 7am to 8pm with about 2 hours of driving! I will get it posted on Saturday or Sunday. -Ty

  9. compsci says:

    Hi Ty,

    The 32 bit build is getting stuck for a vibrational analysis test case. It works fine for the 64 bit build. I am unable to figure out where the problem. Can you please suggest some solution.

    Thanks

  10. Mark says:

    Hi Ty,

    I am still interested in ccx 64, I didn’t ask because I won’t bother you.
    Anyway, if you could share your working installation it be great!

  11. Ajay says:

    Hi Ty
    I followed the process for compiling the CCX in windows and I am getting following error (below). Although in my case I am using CCX_2.3 and i assumed there should be no difference in compiling it following your instructions for 2.2

    AshokDesktop@Ashok ~/calculix/ccx_2.3/src
    $ make
    ./date.pl
    gcc -Wall -O -I ../../../SPOOLES.2.2 -DARCH=”Linux” -DSPOOLES -DARPACK -DMATRIX
    STORAGE -DUSE_MT=1 -c ccx_2.3.c
    gfortran -static-libgcc -static-libgfortran -Wall -O3 -o ccx_2.3_MT64.exe ccx_2.
    3.o ccx_2.3_MT.a ../../../SPOOLES.2.2/MT/src/spoolesMT.a ../../../SPOOLES.2.2/sp
    ooles.a ../../../ARPACK/libarpack_INTEL.a /c/mingw64/x86_64-w64-mingw32/lib/libp
    thread.a /c/mingw64/x86_64-w64-mingw32/lib/libm.a
    ccx_2.3_MT.a(arpack.o):arpack.c:(.text+0x25cb): undefined reference to `dsaupd_’

    ccx_2.3_MT.a(arpack.o):arpack.c:(.text+0x28bc): undefined reference to `dsaupd_’

    ccx_2.3_MT.a(arpack.o):arpack.c:(.text+0x2a75): undefined reference to `dseupd_’

    ccx_2.3_MT.a(arpackcs.o):arpackcs.c:(.text+0x276a): undefined reference to `dsau
    pd_’
    ccx_2.3_MT.a(arpackcs.o):arpackcs.c:(.text+0x2a85): undefined reference to `dsau
    pd_’
    ccx_2.3_MT.a(arpackcs.o):arpackcs.c:(.text+0x2c3b): undefined reference to `dseu
    pd_’
    ccx_2.3_MT.a(arpackbu.o):arpackbu.c:(.text+0x4186): undefined reference to `dsau
    pd_’
    ccx_2.3_MT.a(arpackbu.o):arpackbu.c:(.text+0x4419): undefined reference to `dsau
    pd_’
    ccx_2.3_MT.a(arpackbu.o):arpackbu.c:(.text+0x4588): undefined reference to `dseu
    pd_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0xb6): undefined reference to `xerbla_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x252): undefined reference to `xerbla_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x5d8): undefined reference to `xerbla_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0xbab): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0xbcc): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0xbeb): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0xc6f): undefined reference to `xerbla_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x2cde): undefined reference to `xerbla_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x328d): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x32b7): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x32d4): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x3310): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x332d): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x3354): more undefined references to `lsam
    e_’ follow
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x34e7): undefined reference to `xerbla_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x35aa): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x3a5c): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x419b): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x41be): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x4228): undefined reference to `lsame_’
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x4247): more undefined references to `lsam
    e_’ follow
    ccx_2.3_MT.a(dgesv.o):dgesv.f:(.text+0x43a5): undefined reference to `xerbla_’
    ccx_2.3_MT.a(ddebdf.o):ddebdf.f:(.text+0x5c5b): undefined reference to `daxpy_’
    ccx_2.3_MT.a(ddebdf.o):ddebdf.f:(.text+0x5e3d): undefined reference to `daxpy_’
    ccx_2.3_MT.a(ddebdf.o):ddebdf.f:(.text+0x5efc): undefined reference to `daxpy_’
    ccx_2.3_MT.a(ddebdf.o):ddebdf.f:(.text+0x6331): undefined reference to `daxpy_’
    ccx_2.3_MT.a(ddebdf.o):ddebdf.f:(.text+0x64db): undefined reference to `daxpy_’
    ccx_2.3_MT.a(ddebdf.o):ddebdf.f:(.text+0x6591): more undefined references to `da
    xpy_’ follow
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0x7e): undefined reference to `lsame_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0xa5): undefined reference to `lsame_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0xef): undefined reference to `xerbla_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0xe49): undefined reference to `lsame_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0xe6f): undefined reference to `lsame_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0xecc): undefined reference to `xerbla_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0x1de0): undefined reference to `lsame_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0x1dff): undefined reference to `lsame_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0x1e67): undefined reference to `xerbla_’

    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0x1fdb): undefined reference to `lsame_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0x24b3): undefined reference to `lsame_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0x24d2): undefined reference to `lsame_’
    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0x2520): undefined reference to `xerbla_’

    ccx_2.3_MT.a(dsptri.o):dsptri.f:(.text+0x257b): undefined reference to `lsame_’
    collect2: ld returned 1 exit status
    make: *** [ccx_2.3_MT64.exe] Error 1

  12. http://dream-analysis.org says:

    Hello, i believe that i saw you visited my blog so i came to “go back the want”.I’m attempting to in finding issues to enhance my web site!I guess its ok to use a few of your ideas!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s