PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

Problems in Compiling Gromacs
Goto page Previous  1, 2
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message

Joined: 06 Jul 2005
Posts: 4

PostPosted: Fri Jul 08, 2005 11:40 pm    Post subject: Re: matrix box Reply with quote

mleair wrote:

I was not able to reproduce the warning on the pr_box case. I could only produce it if I was passing a const char * actual argument to a char * formal argument. Nonetheless, it seems the important issue is the severe error you are getting on the "if (*box)" expression.

The box object is declared a matrix which, according to you, is typedef to a statically allocated two dimensional array. The way *box gets interpretted is implementation defined. For example, gcc and the Sun compiler do not complain. Perhaps they interpret box[DIM][DIM] as an array of pointers rather than an array of arrays. Our compiler interprets box[DIM][DIM] as an array of arrays. Therefore, *box is semantically giving you an array rather than a pointer to an array. Hence, the error. ICC seems to interpret this the same way too, as it generates a warning. Perhaps our compiler should just generate a warning too.

My guess is that once upon a time this code used dynamic memory allocation for the matrix and the expression "if (*box)" is checking to make sure the second dimension is not NULL. Otherwise, I can't figure out why this check is there in the first place -- it's always true with statically allocated arrays. Anyway, to work around this problem, you can add a cast (e.g., "if ( (matrix*) *box)") and the code should compile without issue on any C compiler.


Thanks very much Mark, The problem is solved by adding an explicit convertion of the pointer (matrix*). I think there must be a bug of the program, because the 'box' according to its definition matrix which is a static real 2D array rather than an dynamically allocated array of arrays.

I encountered another problem. The '--rpath' option was not recognized by the pgcc compiler. Is there any other options in pgcc that perform the function of the --rpath? Thanks for your help.
Back to top
View user's profile

Joined: 19 Jul 2004
Posts: 67
Location: Portland Group

PostPosted: Mon Jul 11, 2005 12:53 pm    Post subject: --rpath Reply with quote

Please try using -Wl,--rpath,(your path)

Also as a follow-up to your previous question... We are looking into fixing the "error message" that your program exposed for the next release of pgcc. We may issue a warning or just do what GCC does and just ignore it. Thanks for bringing this issue to our attention.

Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page Previous  1, 2
Page 2 of 2

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © phpBB Group