coment lines in UDF
Hi, all,
I have many coment lines in my UDFs, leading with double slash. I had no problem when interpret the UDFs, but when trying compiling them, I had errors caused by the double-slash comments. I have to bracket them with /* (slash-star) and */ (star-slash). How come to this? I am running FLUENT on linux which has gcc compiler which recognise both types of comments. I saw from FLUENT console that it invokes the preprocessor /usr/bin/cpp to interpret a UDF and use /usr/bin/cc (symbolic link to gcc on linux) to compile it. But so what? I tested compiling a C source which has double-slash comments from command line, and it works fine. Therefore, there might be either: 1) the makefile Fluent creates has some special option to turn of the double-slash comment support; 2) Fluent first preprocesses the UDF somehow without support for double-slash comments, before the system gcc takes over the job. I am looking at the makefile for a clue, but even I find the reason, how can I get over it? Does FLUENT store a template for the makefile in plain text somewhere? I hope someone can put up a suggestion, other than bracketing every comment with /* and */. Because I am used to use this kind of comments to comment out some block of code and in the block double-slash comments may exist. Thanks, jx |
Re: coment lines in UDF
Arha, caught the one.
It is because the make file created by FLUENT has a compiler flag "-ansi" which turns off the double-slashed comment support. And fortunately, I found the template for the makefile is $FLUENT_INC/fluent6.1/src/makefile.udf (another file, $FLUENT_INC/fluent6.1/realgas/src/Makefile, also switches on option "-ansi" for gcc). However, removing the option or change it to something like "-std=gnu89", "-std=c99", etc, does not make peace, I got a parse error in compiling /usr/include/math.h. Sigh! I am fed up with this sort of things. Maybe I should remove all comments in my UDFs? |
Re: coment lines in UDF
Thanks for sharing this information. ==> Mahesh
|
All times are GMT -4. The time now is 10:34. |