Library not found with custom compile file

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
fracenvi
Posts: 29
Joined: Wed Jun 19, 2024 9:58 am

Re: Library not found with custom compile file

Post by fracenvi »

Hello,

I tried to do the same thing you suggested for libple.so.2:

Code: Select all

cs_couple compile --cxxflags='-std=c++17 -std=gnu++17 -I/home/cenvinzf@coria.fr/libtorch/include -I/home/cenvinzf@coria.fr/libtorch/include/torch/csrc/api/include' --libs='-L/home/cenvinzf@coria.fr/libtorch/lib -lc10 -ltorch -ltorch_cpu -lstdc++ -L/home/cenvinzf@coria.fr/CS_predict4ANN/8.0.3/code_saturne-8.0.3/arch/Linux_x86_64/lib -Wl,-rpath -Wl,/home/cenvinzf@coria.fr/CS_predict4ANN/8.0.3/code_saturne-8.0.3/arch/Linux_x86_64/lib -lple''
but still no success.

I attached the whole RESU/<id> folder for you to see the outputs.

Also the code runs normally without using the additional library, and i've noticed that libple.so.2 is missing in that case too. Yet, it goes smoothly.

Regards,
Francesco
Attachments
20241004-1753.zip
(51.13 KiB) Downloaded 63 times
Yvan Fournier
Posts: 4164
Joined: Mon Feb 20, 2012 3:25 pm

Re: Library not found with custom compile file

Post by Yvan Fournier »

Hello,

In the attached file, I see only the inputs, not the outputs, such as "run_solver".

Also, you never mentioned on what type of system you are running. So if you could specify you OS version and post your config.log file (from the code installation), that might also provide useful information.

Best regards,

Yvan
fracenvi
Posts: 29
Joined: Wed Jun 19, 2024 9:58 am

Re: Library not found with custom compile file

Post by fracenvi »

Hello,

The reason you only see those files is because those are the only ones i got when i run the code, when adding the external library.

So, for the OS it is a simple Ubuntu 22.04.3 LTS and it gives me no problem at all with the other configurations i tried to run (always without the PyTorch library).

Hopefully this may help.

Regards,
Francesco
Attachments
config.log
(172.09 KiB) Downloaded 62 times
Yvan Fournier
Posts: 4164
Joined: Mon Feb 20, 2012 3:25 pm

Re: Library not found with custom compile file

Post by Yvan Fournier »

Hello,

Yes, there does not seem to be anything exceptional about your install (except maybe the "@coria.fr' in the paths, but I guess that should not be a problem).

Could you also post the output of "ldd cs_solver" for a working case (or in the code installation directory, in the libexec/code_saturne directory), and do the same (output of "ldd") on your added ibrary ?
Just to check if there are inconsistencies.

A possibility would be that some paths are too long when adding flags, but looking at the config.log, again, there is nothing unusual, so I am not sure yet why this happens.

Best regards,

Yvan
fracenvi
Posts: 29
Joined: Wed Jun 19, 2024 9:58 am

Re: Library not found with custom compile file

Post by fracenvi »

Hello,

The paths necessitate of the "@coria.fr" addition since it is the standard username definition for my lab.

Here it is the output of ldd for a running case:
Screenshot 2024-10-07 alle 14.10.27.png
This one is when i do it in the installation directory:
Screenshot 2024-10-07 alle 14.11.13.png
Whereas this one is for the additional library case:
Screenshot 2024-10-07 alle 14.13.32.png
Do you see anything that can help?
Francesco
Yvan Fournier
Posts: 4164
Joined: Mon Feb 20, 2012 3:25 pm

Re: Library not found with custom compile file

Post by Yvan Fournier »

Hello,

I see that libple.so is already "not found" in the basic setup (but probably works through the additional LD_LIBRARY_PATH) set by the code in run_solver).

Could you try reinstalling the code adding:

Code: Select all

LDFLAGS=-Wl,--no-as-needed
to the configure command ?

Best regards,

Yvan
fracenvi
Posts: 29
Joined: Wed Jun 19, 2024 9:58 am

Re: Library not found with custom compile file

Post by fracenvi »

Hello,

I did as you suggested and now it seems that the code sees libple.so (as shown in the output of ldd cs_solver, obtained via external compile of the source files).

Screenshot 2024-10-07 alle 18.11.32.png

Yet, when i do launch the run command, no output is produced again (same when i compile externally). I'm wondering that there might be some issues in the subroutines i'm also trying to implement, like cs_user_extra_operations.c, where i try to recompute the time of the simulation.

Can this be a possible issue?

Regards,
Francesco
Attachments
cs_user_extra_operations.c
(11.66 KiB) Downloaded 63 times
Yvan Fournier
Posts: 4164
Joined: Mon Feb 20, 2012 3:25 pm

Re: Library not found with custom compile file

Post by Yvan Fournier »

Hello,

In any case, remove the "pragma weak" directive in actual user files, to ensure its priority is higher than the one in the code.

At this stage, after compilation, does the script generate a "run_solver" file ? Do you have any messages in the terminal, or in some log or batch output file ?

Regards,

Yvan
fracenvi
Posts: 29
Joined: Wed Jun 19, 2024 9:58 am

Re: Library not found with custom compile file

Post by fracenvi »

Hello,

This is the output of the terminal when i run the code:

Screenshot 2024-10-08 alle 10.55.06.png

I cannot see any run_solver or cs_solver yet in the RESU folder.

I attached all of the output files produced at the time i run the mentioned instance (i did not attach the restart folder because is too large, it is here if you need it: https://we.tl/t-bWrbhUNWAB)

Regards,
Francesco
Attachments
output.zip
(52.11 KiB) Downloaded 59 times
Yvan Fournier
Posts: 4164
Joined: Mon Feb 20, 2012 3:25 pm

Re: Library not found with custom compile file

Post by Yvan Fournier »

Hello,

I do not understand why there is no visible error message at any stage. Is your machine a standard Ubuntu machine, or a VM running on a Mac ? (guessing from the junk OS X adds to folders) ? It should not make a difference in theory, but there might be subtle effects...

Instead of simply running "code_saturne run" (or "cs_couple run"), could you add "--initialize" to the command (i.e. "cs_couple run --initialize") ?

This should prepare the code for a run, but leave the run_solver script in place, as well as the cs_solver executable.
I am interested both in the content of 'run_solver' and output of ("ldd cs_solver"), as well as any error message you get when running ./cs_solver.

If the code does not get that for, it may mean the error is actually not where we are searching for it, but we might have somehting that causes a premature return in a Python function.

Best regards,

Yvan
Post Reply