Re-compiling the kernel for using "freesteam"

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Vincent

Re-compiling the kernel for using "freesteam"

Post by Vincent »

Hi,

In order to access and use the functions of "freesteam" (http://freesteam.sourceforge.net/),
I had to re-compile the kernel ncs-2.0.1 (current used version) adding some parameters (libraries and includes) in the file "cs_compile.py".
However, if the compiling has been completed, the use of freesteam functions, through "usproj.f90" calling for ".c" files, yields problems apparently due to the option -std=c99 linked to the compiling of ".c" files.

Thanks in advance for your support.

Kind regards,

Vincent
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Re-compiling the kernel for using "freesteam"

Post by Yvan Fournier »

Hello,

You should not need to modify the cs_compile.py file directly if you simply add the necessary flags (CPPFLAGS, CFLAGS, LDFLAGS, and LIBS) to the configure command. This way, the cs_compile.py file will contain the necessary flags, even if you recompile/reinstall the code.

More importantly, what error messages do you have relative to std=c99 ?

Best regards,

Yvan
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Re-compiling the kernel for using "freesteam"

Post by Yvan Fournier »

Hello Again,

We checked the cause of the problem with Cyril, and the cause of the problem is due to Freesteam's headers using structures with anonymous unions, which are not standard in C99 (though they appear in the C2011 standard).

Using std=gnu99 would solve the issue, but a simpler solution (assuming you are using GCC) is to add:

CFLAGS=-fms-extensions

to the configure line for Code_Saturne.

You may also directly add -fms-extensions after -std=c99 in cs_compile.py.

Best regards,

Yvan
Vincent

Re: Re-compiling the kernel for using "freesteam"

Post by Vincent »

You were right. It works well now !
Thanks a lot.
Post Reply