Error Code 2 when building CalculiX adapter

Hello everyone,

I am facing errors when running make to build the CalculiX adapter. I hope that someone can point me in the right direction :slight_smile:

This is the final error message, before which many warnings for .c and .f files appear.

...
adapter/PreciceInterface.c(658): error: identifier "i" is undefined
   for (int i = 0; i < interface->num2DNodes; i++)
                   ^
compilation aborted for adapter/PreciceInterface.c (code 2)
make: *** [/home/luna/lib/adapter_ccx//PreciceInterface.o] Error 2

Please find attached the terminal output from the make -j 4 command and the Makefile.

I am working on a hpc without root access and I have a working PreCICE library as well as the source files from ccx 2.16 and the dependencies described in the get CalculiX section. Now I downloaded the CalculiX adapter from the github master branch. I configured the Makefile according to the adapter documentation and ran make -j 4

System details:

  • RedHat 7.6
  • GCC 7.4.0 (used to compile PreCICE 2.2.1, CCX 2.16, Spooles.2.2, Arpack, yaml-cpp 0.6.3)
  • MPI 1.4.4
  • PreCICE was built from source (all tests successful)

I used gfortran as fortran compiler since mpifort was not available. Using mpif90 did not change the output of warnings and errors.

There are multiple versions of gcc and openmpi installed on the cluster, I’m wondering whether I mixed up something… or maybe the versions I’m using are too old? It seems like the code has some major compilation problems.

I’m interested in any opinions on the case, thanks in advance!

Makefile.txt (3.7 KB)
log_make-j4.txt (1.7 MB)

Could you edit the Makefile file of the Calculix adapter? In line 54 please add -std=c11 to the line containing CFLAGS. It should look something like this:

CFLAGS = -Wall -O3 -fopenmp $(INCLUDES) -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -std=c11

If this does not work you could try -std=c99 instead.

Maybe this already helps. It would also be nice if you could post the output of the command mpicc -v

Edit: Just as an addition. You have loaded GCC, but it seems that your MPI uses an old version of the Intel compiler which in turn uses a very old C standard as default. An alternative solution (maybe the better solution) would be a newer version of MPI which (hopefully) includes a newer version of the used compilers as well.

1 Like

Problem solved.

The -std=c11 flag did not work, c11 is an invalid argument.
Using the -std=c99 did not solve the problem either.

You pointed me in the right direction - I found a newer MPI version on the cluster (openmpi 4.0.4 compiled with GCC 7.4.0). With this version the compilation works, although I naturally get compatibility warnings since PreCICE was compiled with the old MPI version. I’m now going to rebuild PreCICE aswell.

For the sake of completeness, the output of mpicc -v was

INFO:  $LD_LIBRARY_PATH="/share/hpc_apps//icc_compiler/12.1/lib:/gpfs3/applications/openmpi/1.4.4/intel/12.1/lib:/gpfs3/applications/ifc_compiler/12.1/mkl/lib/intel64:/gpfs3/applications/ifc_compiler/12.1/lib/intel64:/gpfs3/applications/icc_compiler/12.1/lib/intel64:/gpfs3/applications/icc_compiler/12.1/composer_xe_2011_sp1.8.273/compiler/lib/intel64:/gpfs3/applications/openmpi/1.4.4/gnu/4.1.2/lib:/home/luna/OpenFOAM/luna-v2012/platforms/linux64GccDPInt64Opt/mpi:/home/luna/software/precice/include:/home/luna/software/precice/lib64:/gpfs3/applications/openmpi/1.4.4/intel/12.1/lib:/share/hpc_apps/gcc/7.4.0/redhatel7/lib64:/home/luna/software/precice/lib:/home/luna/software/boost/lib:/home/luna/software/precice/lib:/home/luna/software/boost/lib:"

icc version 12.1.2 (gcc version 4.6.0 compatibility)

With the new openmpi 4.0.4 module loaded, the output changes to:

Using built-in specs.
COLLECT_GCC=/share/hpc_apps/gcc/7.4.0/redhatel7/bin/gcc
COLLECT_LTO_WRAPPER=/share/hpc_apps/gcc/7.4.0/redhatel7/libexec/gcc/x86_64-pc-linux-gnu/7.4.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/share/hpc_apps/gcc/7.4.0/redhatel7 --enable-default-ssp --enable-default-pie
Thread model: posix
gcc version 7.4.0 (GCC) 

Thanks a lot for un-confusing me.

1 Like

Great that this works!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.