C: ctype_base.h errors with gcc 4

  • Thread starter Thread starter neurocomp2003
  • Start date Start date
  • Tags Tags
    Errors Gcc
Click For Summary

Discussion Overview

The discussion revolves around errors encountered with the ctype_base.h header while using gcc 4, particularly in the context of building the ChaNGa astrophysics N-body simulation software that relies on the Charm++ parallel framework. Participants explore potential causes and solutions related to these compilation errors.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant reports encountering errors related to '' when trying to compile code that includes ctype_base.h, suggesting it may be an issue with gcc 4.
  • Another participant has not experienced issues with ctype_base.h and requests a reproducible example of the problem.
  • A suggestion is made to enable concept checks in gcc to obtain better diagnostics for the errors encountered.
  • The original poster clarifies that they are building ChaNGa and have not written code themselves, indicating the errors arise from included system headers rather than their own code.
  • One participant advises checking the specific source file (Reductions.cpp) for issues related to type information and suggests increasing verbosity in the compiler output to help locate the problem.
  • Another participant provides guidance on how to enable concept checks, noting it is a command line option in gcc and directing the original poster to the documentation for specifics.

Areas of Agreement / Disagreement

Participants express differing experiences with the ctype_base.h errors, with some suggesting potential solutions while others seek clarification on how to implement those suggestions. The discussion remains unresolved regarding the root cause of the errors.

Contextual Notes

There are limitations in the discussion regarding the specific nature of the errors, as well as the dependency on the particular setup and configurations of gcc and the Charm++ framework. The original poster's lack of familiarity with Linux programming may also affect their ability to implement suggested solutions.

neurocomp2003
Messages
1,359
Reaction score
4
Hi all,
I was wondering if anyone has ever run into ctype_base.h errors
like:
'<anonymous enum>' is/uses anonymous type.'
error: trying to instantiate 'template<class T> void operator|(PUP::er&, T&)'

some sites that i have visited
say its an error with gcc4

GUI-mandriva
sfwr-charm++ for NchiladaNC
 
Last edited:
Technology news on Phys.org
I haven't run into any problems with that header, though I've never explicitly included it. Can you post an example that reproduces the problem?
 
Try enabling concept checks to get a better diagnostic if there's an error in your code.
 
I'm trying to build a released software called
ChaNGa(astrophysics N-body sim) that uses charm++ as its parallel framework. Thus i haven't actuallly coded anything on my own.
----------------------------
/1/home/kongw/_Code/API/charm-mpi/mpi-linux/bin/charmc -O3 -I../structures -I../ParallelGravity -DCACHE_TREE -I.. -c -o Reductions.o Reductions.cpp
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:58: error: '<anonymous enum>' is/uses anonymous type
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:58: error: trying to instantiate 'template<class T> void operator|(PUP::er&, T&)'
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:58: error: '<anonymous enum>' is/uses anonymous type
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:58: error: trying to instantiate 'template<class T> void operator|(PUP::er&, T&)'
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:61: error: '<anonymous enum>' is/uses anonymous type
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:61: error: trying to instantiate 'template<class T> void operator|(PUP::er&, T&)'
Fatal Error by charmc in directory /home/kongw/_Code/API2/ChaNGa/changa
Command mpicxx -I/1/home/kongw/_Code/API/charm-mpi/mpi-linux/bin/../include -D__CHARMC__=1 -I../structures -I../ParallelGravity -DCACHE_TREE -I.. -O3 -I/usr/include -c Reductions.cpp -o Reductions.o returned error code 1
charmc exiting...
make: *** [Reductions.o] Error 1
----------------------------

The error builds pointing to the parallel language Charm++...
and technically you don't include this header it is included by other system headers. Hurkyl:"Try enabling concept checks to get a better diagnostic if there's an error in your code." How do you do this, I'm not a native linux programmer.
 
neurocomp2003 said:
Hurkyl:"Try enabling concept checks to get a better diagnostic if there's an error in your code." How do you do this, I'm not a native linux programmer.
It's one of gcc's comand line options. I forget the exact command, but you should be able to find it in the man page, or in the online documentation.
 
Given that you were building in changa when the error occurred, I would first look in changa, specifically Reductions.cpp. It looks like they're trying to instantiate a function with inadequate type information. See if you can take their mpicxx command and pump up the verbosity. gcc points me to the site at which the instantiation was attempted in these situations, makes it easier to locate the problem. Try -Wall.
 

Similar threads

Replies
63
Views
6K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 49 ·
2
Replies
49
Views
12K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 28 ·
Replies
28
Views
9K
  • · Replies 15 ·
Replies
15
Views
5K
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
611
  • · Replies 27 ·
Replies
27
Views
6K