CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

coment lines in UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   November 11, 2003, 11:58
Default coment lines in UDF
Posts: n/a
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.


  Reply With Quote

Old   November 11, 2003, 12:55
Default Re: coment lines in UDF
Posts: n/a
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?
  Reply With Quote

Old   November 21, 2003, 13:03
Default Re: coment lines in UDF
Posts: n/a
Thanks for sharing this information. ==> Mahesh
  Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorials] Tutorial of how to plot residuals ! wolle1982 OpenFOAM Community Contributions 149 December 13, 2017 04:40
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
Plotting Residuals ata OpenFOAM 12 July 8, 2011 02:50
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01

All times are GMT -4. The time now is 12:03.