From bug-request at octave dot org Sun Apr 16 14:09:59 2006 Subject: CVS Compilation with PGI compiler From: "John W. Eaton" To: "Christopher Hulbert" Cc: bug at octave dot org Date: Sun, 16 Apr 2006 15:09:41 -0400 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. | 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)? | "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. 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 -------------------------------------------------------------