CalculiX not being linked to preCICE properly

I am Nithin and I am trying to work with CalculiX and preCICE to conduct FSI simulations as a part of a graduation thesis.

I installed and configured everything required as per instructions.
When I run a standard perpendicular flap tutorial, the fluid solver (pimpleFoam) is working fine but the solid solver (CalculiX) isn’t being initiated.
I have attached all the dependencies and my openfoam adapter folder along with the test case with log files. I have even attached my bashrc script file in PDF format to this discussion.

I’d be really grateful if anyone can kindly point out where I am going wrong.

Thank you.

All the files involved

Welcome to the preCICE Discourse, @nithinadidela! :beers:

There are several issues here, some of which are common among many other users.

CalculiX adapter problems

In the file perpflap/Solid.log I see:

./Allrun: line 80: ccx_preCICE: command not found

This means that your system cannot find ccx_preCICE. You can check this by running ccx_preCICE from anywhere in a terminal. When you built the CalculiX adapter, you also noticed this note in the building instructions (after checking that everything built successfully):

After building successfully, the executable ccx_preCICE is located in the bin folder. You may want to add this to your $PATH , or move it to a searchable bin directory.

This you already tried, as I see in your .bashrc:

export PATH="/home/nithin/CalculiX/calculix-adapter-master/bin/ccx_preCICE:$PATH"

but it should actually be:

export PATH="/home/nithin/CalculiX/calculix-adapter-master/bin/:$PATH"

Notice that, after adding this to your .bashrc, you need to open a new terminal (or just do source ~/.bashrc). You can always check environment variables with e.g. echo $PATH.

OpenFOAM adapter problems

In the file flapPerp/Fluid.log, I see that OpenFOAM cannot find the adapter:

Starting time loop

--> FOAM Warning : 
    From function void* Foam::dlOpen(const Foam::fileName&, bool)
    in file POSIX.C at line 1251
    dlopen error : cannot open shared object file: No such file or directory

Usually this happens if something went wrong while building the adapter (always look for any errors/warnings!).

With this hint, I look into your openfoam-adapter/ldd.log:

ldd: /opt/openfoam/platforms/linux64GccDPInt32Opt/lib/include:/home/nithin/OpenFOAM/nithin-7/platforms/linux64GccDPInt32Opt/lib/ No such file or directory

So, the linker could not find either. Was it even created?

Let’s look into your openfoam-adapter/wmake.log:

wmake libso .
/opt/openfoam7/wmake/makefiles/general:164: *** target pattern contains no '%'.  Stop.

This is a very strange error, which I had to search for and find this hint on StackOverflow:

This error is due to a presence of a ":" . Therefore it no longer supports windows paths.

Which leads me to the question: are you trying to use preCICE on Windows? Probably not, as you have a .bashrc file. But are you maybe mixing up some Windows directory somewhere (e.g. running Windows Subsystem for Linux)?

Note: Although we have tried preCICE on Windows in the past, we don’t currently recommend this and it would be better to use a full Linux installation.

Additional: OpenFOAM version

In your log files I also see that you are using OpenFOAM 7, but I see that you are using the adapter from the master Git branch. This does not support OpenFOAM 7 and you need to change to a different branch. Please read our notes on OpenFOAM versions and preferably install one of the versions supported by the master branch of the adapter.

No preCICE build

I see that in your ~/.bashrc you have:

export PRECICE_ROOT=/home/nithin/precice-1.6.1

However, I don’t see any build directory in precice-1.6.1 (or any other CMake files). Have you installed preCICE in any other way?

Please also note that it is not necessary anymore to set a PRECICE_ROOT and the link build/last is not created by CMake (which we use as default since preCICE v1.4.0).

Please refer to the following wiki pages to build preCICE:

Since you are using Ubuntu, you can alternatively install a binary package.

Thank you so much…
I followed every step of the installation clearly this time and it seems that I have overlooked another error while running “make” during the CalculiX installation.

I’d really appreciate any thoughts or corrections.

Have you already followed our instructions to build CalculiX, as well as SPOOLES?

What did you set for SPOOLES in the CalculiX adapter Makefile?

The address of the SPPOOLES directory $(Home)/SPOOLES

I am sorry for the earlier comment…
I figured the CalculiX make part…

Now, I am caught up in a preCICE “build” error

I am pretty sure this is a minor mistake that i am doing but i am unable to figure what…

I figured the CalculiX make part…

What was the issue? Please write it here so that you help future readers. :wink:

The latest error you get (while linking) is:

/usr/bin/ld: cannot find -lboost::regex

How/where have you installed Boost? Which version? If you installed it in a local directory, did you add it to your LD_LIBRARY_PATH?

The boost master folder is in home/Boost_1.67
Since it’s a local directory, how should I link it?

You can try adding the following to your ~/.bashrc (and reloading it):

# ==== boost ====

Make sure that the path $HOME/Boost_1.67/lib exists.

Okay… Now I think I get it…
I was clueless about boost…
So, I just followed this discussion of yours and filled in some parts which were not there in the installation guide…
Now, I’ll do what you have suggested for boost and strictly stick to your github repository instructions page…

Although I do have one more doubt
You suggested that I clone from Openfoam7 branch repository of openfoam-adapter
Which I think is this…

I need to clone this repository and stick to the installation guide, am I correct?

P. S. Sorry, I am really new to anything related open source. I really appreciate your time.

1 Like

This is correct, you can get it with:

git clone -b OpenFOAM7

I just now updated that branch, so please do a git pull to update it in your system and rebuild.

I still cannot fine the build/last directory…
I suppressed the python dependency while building of precice using Cmake…Is it because of that?
Also, while running “make” file while building CalculiX adapter i get this error

What do I do?

Since you have built preCICE from source and installed it in a local directory, you need to set the PKG_CONFIG_PATH as well.

I still cannot fine the build/last directory…

Where did you read about the build/last directory? This is not relevant/recommended in the latest versions of preCICE and we should remove any traces of it from the documentation.

Pardon me about the build/last part…I got it from a discussion…

I took every one of your advice and re did the whole thing. There were no errors this time although I got this.

From the documentation I realise that that you used preCICE as a static library, but I didn’t specify its dependencies correctly.
Will that be a problem going forward doing FSI simulations with CalculiX and openFoam?

P.S. I am almost there. Thanks for all the help until now.

Now this is about the OpenFOAM and we should move to a different topic. Could you please open a new one and post this and the output of ldd.log? Feel free to link to this topic as well, for the history.