How do I build ccx?

I’m glad to see you worked it out nicely!

Yes, both should have the same effect if used correctly in the 1st column :slight_smile:

Hello once more, and sorry that it is me again

   as the compilation of the serial version succeeded I thought that the MT compilation will also run smoothly.

Unfortunately I was wrong.
I was trying to follow the ccx compilation instruction submitted with the code:

  • compiled the spooles in MT version
  • compiled the ARPACK - exactly as serial
  • in ccx Makefile introduced: -DUSE_MT

Effect as below:
./date.pl; cc -Wall -O2 -I …/…/…/SPOOLES -DARCH=“Linux” -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT -DUSE_MT -c ccx_2.20.c; gfortran -Wall -O2 -o ccx_2.20 ccx_2.20.o ccx_2.20.a /home/maciej/CalculiXSPOOLESMT/SPOOLES/spooles.a /home/maciej/CalculiXSPOOLESMT/ARPACK/ARPACK/libarpack_linux.a -lpthread -lm -lc -fopenmp
Can’t open ccx_2.20step.c: No such file or directory at ./date.pl line 18.
ccx_2.20.c: In function ‘main’:
ccx_2.20.c:1766:18: warning: ‘nkon0’ may be used uninitialized in this function [-Wmaybe-uninitialized]
1766 | ne=ne0;nkon=nkon0;
| ^~
In file included from ccx_2.20.c:30:
CalculiX.h:62:29: warning: ‘ne0’ may be used uninitialized in this function [-Wmaybe-uninitialized]
62 | #define RENEW(a,b,c) a=(b *)u_realloc((b *)(a),(c)*sizeof(b),FILE,LINE,#a)
| ^~~~~~~~~
ccx_2.20.c:72:39: note: ‘ne0’ was declared here
72 | iprestr,kode,isolver,nslavs,nkon_,ne0,nkon0,mortar,
| ^~~
ccx_2.20.c:63:22: warning: ‘nxstate’ may be used uninitialized in this function [-Wmaybe-uninitialized]
63 | *ipoinpc=NULL,mt,nxstate,nload0,iload,*iuel=NULL,*ne2boun=NULL,
| ^~~~~~~
maciej@maciej-T7500:~/CalculiXSPOOLESMT/CalculiX/ccx_2.20/src$

Actually have no idea what is wrong, so any suggestion are most appreciated.

It looks like you have a missing file or need to be renamed (?).
Also, note that some of the other warnings are not related to this… These appear to be uninitialized variables- you can initialize them, and these go away.

Yes, I did so. My makefile for linuxmint, probably it will do fine on ubuntu as well.

MY_INCLUDE = /usr/include
MY_LIB = /usr/lib/x86_64-linux-gnu
# -L $(MY_LIB) -I $(MY_INCLUDE)
CFLAGS = -w -O3 -DARCH=“Linux” -DMATRIXSTORAGE
FFLAGS = -w -O3 -fopenmp -m64 $(OPTIONS)
LIBS = -lm -lc -lpthread -ldl -L /usr/local/lib -larpack -lblas -llapack

# Spooles
CFLAGS += -I $(MY_INCLUDE)/spooles -DSPOOLES
LIBS += $(MY_LIB)/libspooles.so

# Multithreaded spooles
# CFLAGS += -DUSE_MT
# LIBS += $(MY_LIB)/spoolesMT.a

# ARPACK
LIBS += /usr/local/lib/libarpack.so
CFLAGS += -DARPACK

CC=gcc
FC=gfortran

OPTIONS = -w -fno-second-underscore -fcray-pointer -x f77-cpp-input
FPPSTOP= -x none

.SUFFIXES: .o .c .cu
.c.o :
$(CC) $(CFLAGS) -c $<
.f.o :
$(FC) $(FFLAGS) -c $<

include Makefile.inc

SCCXMAIN = ccx_2.11.c # put your version file

# OCCXCU = $(SCCXCU:.cu=.o)
OCCXF = $(SCCXF:.f=.o)
OCCXC = $(SCCXC:.c=.o)
OCCXMAIN = $(SCCXMAIN:.c=.o)

ccx: $(OCCXMAIN) ccx_2.11.a \ # ccx is a name of your new executable file
./date.pl; $(CC) $(CFLAGS) -c ccx_2.11.c;
$(FC) $(FFLAGS) -o $@ $(FPPSTOP) $(OCCXMAIN) ccx_2.11.a
-Wl,–start-group
$(LIBS)
-Wl,–end-group

ccx_2.11.a: $(OCCXCU) $(OCCXF) $(OCCXC)
ar vr $@ $?

I do thank very much for both and quick answers :slight_smile:

The Makefile I have to study - it seems to be very advanced and I presume combines all library’s like SPOOLES and ARPACK.
I’m doing this manually step by step - with the hope that I will be able to write Makefile’s like the one above in future.

So I’ve focused on the answer from “jbr” - its 2-nd part and I’ve noticed that actually the executable ccx_2.20 has been generated.
If I type export OMP_NUM_THREADS=2 and 3 I see that the log information displays the amount of CPU-s i.e. 2 or 3 but for SPOOLES is always 1 and the job terminates with message “Job finished”.
But the spooles.out file is empty and I’ve read that it is empty only when calculation is being performed ob 1 CPU and if in more then it should include some information.
Have to think about this.


CalculiX Version 2.20, Copyright(C) 1998-2022 Guido Dhondt
CalculiX comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are welcome to redistribute it under
certain conditions, see gpl.htm


You are using an executable made on pon, 10 kwi 2023, 19:01:07 CEST
Decascading the MPC’s

Determining the structure of the matrix:
Using up to 3 cpu(s) for setting up the structure of the matrix.
number of equations
720
number of nonzero lower triangular matrix elements
37458

Using up to 3 cpu(s) for the stress calculation.

Using up to 3 cpu(s) for the symmetric stiffness/mass contributions.

Factoring the system of equations using the symmetric spooles solver
Using 1 cpu for spooles.

Using up to 3 cpu(s) for the stress calculation.

The numbers below are estimated upper bounds

number of:

nodes: 261
elements: 32
one-dimensional elements: 0
two-dimensional elements: 0
integration points per element: 27
degrees of freedom per node: 3
layers per element: 1

distributed facial loads: 0
distributed volumetric loads: 0
concentrated loads: 9
single point constraints: 63
multiple point constraints: 1
terms in all multiple point constraints: 1
tie constraints: 0
dependent nodes tied by cyclic constraints: 0
dependent nodes in pre-tension constraints: 0

Haven’t followed the whole thread, but my installation script should build it for you:

https://www.feacluster.com/install/install

To run:

perl install

If you plan to run large models, then install with Intel pardiso. Spooles is 2-3X slower than Pardiso.

1 Like

Thank you very much for the perl script as well as the recommendation regarding Pardiso.
Will need some time to thoroughly study and try to understand the script but it is a very great help and support for me, so once more thank you very much. I will let know if I’ve succeeded or not :slight_smile:

1 Like

Hello once more,
I did not study yet the received perl script but tried to follow the instruction in ccx manual as it seems to be easier for me.
I started the ccx compilation following the Makefile_MT but received the message on the right side.
I’m really confused as the header file spoolesMT.h is included in the director MT/ and in the directory SPOOLES/MT/src I have the spoolesMT.a file

Warning: ‘iaddelem’ may be used uninitialized in this function [-Wmaybe-uninitialized]
cc -Wall -O2 -fopenmp -I …/…/…/SPOOLES.2.2 -DARCH=“Linux” -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT=1 -c add_rect.c
cc -Wall -O2 -fopenmp -I …/…/…/SPOOLES.2.2 -DARCH=“Linux” -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT=1 -c arpack.c
In file included from arpack.c:26:
spooles.h:30:10: fatal error: MT/spoolesMT.h: No such file or directory
30 | #include <MT/spoolesMT.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile_MT:9: arpack.o] Error 1
maciej@maciej-T7500:~/CalculiXSPOOLESMT/CalculiX/ccx_2.20/src$

=====================================================================
AS I CAN NOT ANSWER DIRECTLY (post limit to 3) TO THE LAST POST FROM “fgr” i WILL DO THIS SO:

Indeed, no experience in code compiling and additionally I’ve not been cautious enough and in the Makefile_MT I did not change the directory name at CFLAGS.
And I’ve not noticed that until I saw the remark from “fgr”
Now the code is compiling without errors and in the spooles.out I see the message with the number of threads.

So the code is ready now I will start to master the CalculiX itself and write the input deck so very likely will come with new questions on a different list / post.

But now I would like to thank all of you and each individually for the great support and help I’ve received.
It is really a great feeling to know that in case of problems, one is not left alone, but there is a chance to get such valuable support and help - and in such a quick time.
Thank you very much :grinning:

The include file spoolesMT.h should/will be a part of the SPOOLES2.2 installation and placed in the sub dir MT under SPOOLES2.2
In case spoolesMT.h really exist your problem probably will be that the compiler include flag
" -I …/…/…/SPOOLES2.2 "
is pointed at a wrong location

1 Like

@Maciek this script works like a charm. I’ve used it in the past, thank you @feacluster!!

1 Like

Exactly! That’s what I thought too.

I do appreciate very much the support and help I’ve received in the last days.
The script is a very valuable source of information for me and for sure I will use it, but in the beginning I just wanted to get a running software in order to start the simulation, because I’m already much behind the schedule.
Now I will focus on the input deck - just to get the feeling that I will be able to conduct / start a simulation. I wanted to run a thermo-mechanical simulation via preCICE of a disc brake - I’ve tried to follow an Abaqus tutorial and prepared the input deck based on PrePoMax - but it is not working yet - just as my ccx-case: everything looks much easier when you only watch a tutorial or read an instruction - when you start yourself it looks not so ease any more and then it is very important to have the possibility to ask professionals

After I manage somehow the input deck I will try to optimize the ccx environment according the received script ccx e.g. by compiling a ccx version with library offered by oneAPI MKL library from Intel.
I have heard that this library and by that the PARDISO solver is now free for educational purposes so will try tu use it.

Once more many thanks from my side for the great support and help I’ve received :grinning:

1 Like