calculix-adapter icon indicating copy to clipboard operation
calculix-adapter copied to clipboard

Installation using Intel OneAPI

Open davidscn opened this issue 2 years ago • 2 comments

While trying to install CalculiX and the adapter on the computer cluster ITO using Intel's OneAPI, we faced some issues I would like to summarize here. We used the GCC standard library v9.2 and the Intel OneAPI v2021.3.

  • First of all, the adapter was only compatible with libyaml-cpp-0.7.0. Our documentation proposes to download and install version 0.6.2, which lead to link-time errors. Installing v0.7.0 worked fine.
  • After installing the dependencies, building the adapter lead to a link-time error undefined reference to MAIN__. As described in this Intel forum post the solution was to add an additional flag to the Fortran compiler https://github.com/precice/calculix-adapter/blob/6fdce488932dd9f4c035b607008566617e5c44e0/Makefile#L65
-FFLAGS = -Wall -O3 -fopenmp $(INCLUDES) ${ADDITIONAL_FFLAGS}
+FFLAGS = -Wall -O3 -fopenmp $(INCLUDES) ${ADDITIONAL_FFLAGS} -nofor-main

in order to " link Fortran objects with a C main program".

  • Lastly, we ended up with issues originating from the multi-threading of SPOOLES (similar to the one described on Discourse). We tried a few things to get the multi-threading module work, but eventually disabled the multi-threading (enabled by default) in CalculiX by removing the USE_MT flag.
-CFLAGS = -Wall -O3 -fopenmp $(INCLUDES) -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT
+CFLAGS = -Wall -O3 -fopenmp $(INCLUDES) -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE

Maybe reading a bit more in detail through the SPOOLES documentation might help to resolve this issue in the future.

davidscn avatar Dec 17 '22 08:12 davidscn

The CI script has always been reliant on libyaml-cpp-0.7.0, so I guess we should update the documentation to recommend building that one from source.

Now there are quite a few flags that might be optional: USE_MT, -fallow-argument-mismatch (for GCC >= 10) and this -no-for-main. Maybe we should update the doc with a list of useful flags instead of putting them (or not) by default and hoping for the best

boris-martin avatar Dec 17 '22 13:12 boris-martin

@yagi was able to install the CalculiX-adapter using multi-threading:

The path to the spoolesMT library has to be added in the LIBS specification before the actual spooles library. Example:

SPOOLES_LIBS_MT = /path/to/SPOOLES.2.2/MT/src/spoolesMT.a
SPOOLES_LIBS = /path/to/SPOOLES.2.2/spooles.a


LIBS = \
$(SPOOLES_LIBS_MT) \
$(SPOOLES_LIBS) \
...

Specifying the SPOOLES_LIBS first lead to the linking issues described above (on discourse).

davidscn avatar Dec 19 '22 07:12 davidscn