/usr/bin/ld: cs_user_initialization.o: in function `cs_user_initialization':
cs_user_initialization.c:(.text+0x6b): undefined reference to `GDALAllRegister'
/usr/bin/ld: cs_user_initialization.c:(.text+0x86): undefined reference to `GDALOpen'
/usr/bin/ld: cs_user_initialization.c:(.text+0x96): undefined reference to `GDALGetDatasetDriver'
/usr/bin/ld: cs_user_initialization.c:(.text+0xa1): undefined reference to `GDALGetDriverLongName'
/usr/bin/ld: cs_user_initialization.c:(.text+0xac): undefined reference to `GDALGetDriverShortName'
Can you run "ldd" on the cs_solver executable in your execution directory, to check that the version of GDAL you are liking to is the one you expect (in cas of multiple installs, for example on in the base system and one in SALOME) ?
Otherwise, is GDAL split into multiple libraries ?
Currently, if this works with "code_saturne compile --libs=-lgdal" but not with "code_saturne run", you probably need to add a cs_user_scripts.py file to your DATA directory and edit the domain.compile_libs entry in that file.
In the future, this option will be moved from cs_user_scripts.py to run.cfg, but this is not the case yet.
code_saturne compile --libs=-lgdal --source=./SRC --dest=./DATA
cp ./DATA/* ./RESU/test/
code_saturne run --no-stage --id test
I tried again on code_saturne v7 which worked just fine before i updated to Debian 12, and it does not work anymore.
I think the issue may be related to Debian 12.
There may be another issue with Debian 11 and 12, which seems related to an incorrect behavior of the linker.
If you add
LDFLAGS=-Wl,--no-as-needed
to you initial code_saturne configuration command, you might avoid the issue specific to Debian 12.
I would need to automate a workaround, but the error seems to be in the handling of the "as-needed" behavior of the linker on Debian, which does not "see" required libraries. I have this issue on a (Debian 11 based) Scibian 11 machine, but do not have it under Arch Linux.
I will try on next install
But everything is working just fine at the moment, so I will keep the solution mentionned before.
I will give an update when trying your fix.