From bug-request at octave dot org Sun Apr 16 16:09:22 2006 Subject: Re: CVS Compilation with PGI compiler From: "Christopher Hulbert" To: "John W. Eaton" Cc: bug at octave dot org Date: Sun, 16 Apr 2006 17:07:08 -0400 On 4/16/06, John W. Eaton wrote: > On 16-Apr-2006, Christopher Hulbert wrote: > > | Problems with PGI compiler: > | > | SparseType.cc lines 95 and 418. PGI didn't like > | bool found [nrows] complaining nrows wasn't constant. I'm not > | well-versed with the C++ standard (am with the C) so I'm not sure if > | it conforms to the standard or not. > | > | I fixed with: > | bool *found = new bool[nrows]; > | ... > | delete found /* At the end of the if block */ > > I decided to use > > std::vector found (nrows); > > instead. Ok, I've modified mine to use that, and it compiles fine. > > | I'm also having trouble with octave_print_internal in pr-output.cc > | with calling the abs function for unsigned integer types. I cannot > | get the PGI C++ compiler to compile this. Does the C++ standard define > | an abs function for unsigned types? Should I report this as a bug > | against the PGI c++ compiler? > > Can you provide more details? What version of Octave do you have? > What are the error messages you see? What lines cause trouble (it > might help to show the offending code if you are not working with the > current CVS version of Octave)? It's the current CVS source code, but first I got an error that a storage class cannot be defined here (line 1607). It looked like an empty function template, so I commented out the template <> line above it. The abs function error is src/pr-output.cc line 2302 and 2308. The error is: more than one instance of overloaded function "abs" matches the argument list: function "abs(double)" function "abs(int)" function "std::abs(long)" function "std::abs(long double)" argument types are: (octave_uint32_t) It also lists the same error with argument type octave_uint64_t > > | "kpse.cc", line 383: error: "hash" is ambiguous > | unsigned n = hash (table, key); > | ^ > | > | 1 error detected in the compilation of "pathsearch.cc". > | > | Fixed by changing the hash function to octhash. It looks like pgi has > | a hash function in their STL > | ($PGI/6.0/include/CC/stl/_string_hash.h,$PGI/6.0/include/CC/stl/_hash_fun.h)? > | That's what I'm guessing caused the problem anyways. > > That seems bad since I don't think we have any "using namespace std" > declarations that would be visible in this function, so we shouldn't > be picking up any std::hash function unless we specifically ask for > it. But I changed the name to kpse_hash anyway. I thought it was odd that it was picking up the STL hash function as well. Perhaps a little more digging and I'll send a report to PGI. I also overlooked an error in liboctave/dblDET.cc line 66 and liboctave/CmplxDET.cc line 69. PGI says that more than one overloaded function matches the argument list. THis seems misleading since no arguments seem to match. It gives the argument list as int and matching ones as: log10(double) std::log10(long double) std::log10(float) I fixed this by replacing 2 by 2.0, but this may just be needed on my compiler? Similar error as with the SparseType.cc bool in liboctave/Sparse.cc line 1903 where it complains that n doesn't have a constant value. I used the std::vector again. Thanks again for the quick help. Chris > > Thanks, > > jwe > ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------