GCC 3.2 -- Celestia can't build -- Gentoo

The place to discuss creating, porting and modifying Celestia's source code.
Guest

GCC 3.2 -- Celestia can't build -- Gentoo

Post #1by Guest » 13.09.2002, 17:05

Hi !

I had do a search here in this forum to see if someone take care of the trouble with GCC 3.X. Just one or two with no response.

What will you do for this ?? It's planned to work in 1.2.5 ??

Celestia is very very good !! But i can't install on my Gentoo 1.4RC1 because of GCC3.2 :(

I hope in 1.2.5 this will work !

Thanks !!

watersb

I'd like to help...

Post #2by watersb » 14.09.2002, 09:53

I would like to help porting this app to gcc3.2 and/or Gentoo 1.4

If I can get it to work I'll let you know; at this point I'm not at all familiar with what needs to be done.

I work with a guy who recently ported our Astronomical Image Processing Software (AIPS++) to gcc 3.2; he should know about general compiler issues.

watersb
Posts: 12
Joined: 14.09.2002
With us: 22 years
Location: where the hell is Socorro, NM?

now registered...

Post #3by watersb » 14.09.2002, 09:59

ok, now I'm registered on this board... didn't mean to voluneer for work without any contact info... :?

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 2 months
Location: Lyon (France)

Post #4by Christophe » 14.09.2002, 14:35

What kind of error do you get with gcc 3.2 ?

watersb
Posts: 12
Joined: 14.09.2002
With us: 22 years
Location: where the hell is Socorro, NM?

Post #5by watersb » 15.09.2002, 07:51

What kind of error do you get with gcc 3.2 ?


Well, I don't have a full-up Gnome installation, but rather have the minimum set of pieces I need to use everything I've needed so far...in particular, I installed GtkGLCanvas, but the config dies at this point:

Code: Select all

checking whether to disable GTK.... no
checking for gtk-config... /usr/bin/gtk-config
checking for GTK - version >= 1.2.0... yes
checking for gdk_gl_query in -lgtkgl... yes
checking for gnome-config... no
checking for gnomeConf.sh file in /usr/local/lib... not found
configure: error: Could not find the gnomeConf.sh file that is generated by gnome-libs install


I am certainly aware that this is not the issue, you can expect this sort of thing with my setup.

So I do this:

Code: Select all

./configure --without-gtk


and I get numerous compile errors that seem to involve the collsion between my system-installed /usr/include/GL/gl.h and Celestia's glext.h:

Code: Select all

glext.h:600: `void (*glVertexAttribs3dvNV)(unsigned int, int, const GLdouble*)'
   redeclared as different kind of symbol
/usr/include/GL/gl.h:2743: previous declaration of `void
   glVertexAttribs3dvNV(unsigned int, int, const GLdouble*)'


is one instance. I don't think that's a gcc issue, however.

Also this warning/error:

Code: Select all

In file included from texmanager.h:15,
                 from 3dsmesh.cpp:15:
../celutil/resmanager.h: In member function `ResourceHandle
   ResourceManager<T>::getHandle(const T&)':
../celutil/resmanager.h:62: warning: `typename std::map<T, ResourceHandle,
   std::less<_Key>, std::allocator<std::pair<const T, ResourceHandle> >
   >::iterator' is implicitly a typename
../celutil/resmanager.h:62: warning: implicit typename is deprecated, please
   see the documentation for details


This last one is probably related to gcc 3.x.

Guest

Post #6by Guest » 15.09.2002, 08:08

OK, I searched the forum on glext and got this very helpful tip from an anonymous poster:

In Gentoo, you have to switch to xfree opengl setting before compiling, then switch back to the nvidia afterwords. Do it like this:

Code: Select all

opengl-update xfree
emerge celestia
opengl-update nvidia


So I'm tried this, and get the warnings about implicit typenames, and then I hit this hard error:

Code: Select all

c++ -DHAVE_CONFIG_H -I. -I. -I../.. -I..    -march=i686 -O3 -pipe  -O2 -Wall -ffast-math -fexpensive-optimizations -fomit-frame-pointer    -c starbrowser.cpp
c++ -DHAVE_CONFIG_H -I. -I. -I../.. -I..    -march=i686 -O3 -pipe  -O2 -Wall -ffast-math -fexpensive-optimizations -fomit-frame-pointer    -c stardb.cpp
In file included from ../celengine/texmanager.h:15,
                 from simulation.h:22,
                 from starbrowser.h:17,
                 from starbrowser.cpp:15:
../celutil/resmanager.h: In member function `ResourceHandle
   ResourceManager<T>::getHandle(const T&)':
../celutil/resmanager.h:62: warning: `typename std::map<T, ResourceHandle,
   std::less<_Key>, std::allocator<std::pair<const T, ResourceHandle> >
   >::iterator' is implicitly a typename
../celutil/resmanager.h:62: warning: implicit typename is deprecated, please
   see the documentation for details
In file included from starbrowser.cpp:15:
starbrowser.h: At global scope:
starbrowser.h:32: syntax error before `*' token
starbrowser.cpp:93: syntax error before `*' token
starbrowser.cpp:94: type specifier omitted for parameter `Pred'
starbrowser.cpp:94: parse error before `,' token
starbrowser.cpp:95: ISO C++ forbids declaration of `findStars' with no type
starbrowser.cpp: In function `int* findStars(...)':
starbrowser.cpp:96: `vector' undeclared (first use this function)
starbrowser.cpp:96: (Each undeclared identifier is reported only once for each
   function it appears in.)
starbrowser.cpp:96: parse error before `*' token
starbrowser.cpp:97: `nStars' undeclared (first use this function)
starbrowser.cpp:98: `finalStars' undeclared (first use this function)
starbrowser.cpp:102: `Pred' undeclared (first use this function)
starbrowser.cpp:102: ISO C++ forbids declaration of `multiset' with no type
starbrowser.cpp:102: template-id `multiset<const Star*, <expression error> >'
   used as a declarator
starbrowser.cpp:102: parse error before `;' token
starbrowser.cpp:103: `StarSet' undeclared (first use this function)
starbrowser.cpp:105: `stardb' undeclared (first use this function)
starbrowser.cpp:113: `firstStars' undeclared (first use this function)
starbrowser.cpp:122: `pred' undeclared (first use this function)
starbrowser.cpp:132: parse error before `::' token
starbrowser.cpp:133: `iter' undeclared (first use this function)
starbrowser.cpp: In member function `const Star* StarBrowser::nearestStar()':
starbrowser.cpp:147: parse error before `*' token
starbrowser.cpp:148: `stars' undeclared (first use this function)
starbrowser.cpp:144: warning: unused variable `Universe*univ'
starbrowser.cpp: At global scope:
starbrowser.cpp:154: syntax error before `*' token
starbrowser.cpp:163: syntax error before `.' token
starbrowser.cpp:164: syntax error before `.' token
starbrowser.cpp:182: syntax error before `.' token
starbrowser.cpp:183: syntax error before `.' token
starbrowser.cpp:193: syntax error before `.' token
make[3]: *** [starbrowser.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/var/tmp/portage/celestia-1.2.4/work/celestia-1.2.4/src/celengine'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/celestia-1.2.4/work/celestia-1.2.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/celestia-1.2.4/work/celestia-1.2.4'
make: *** [all-recursive-am] Error 2


Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 2 months
Location: Lyon (France)

Post #7by Christophe » 15.09.2002, 08:19

watersb wrote:I am certainly aware that this is not the issue, you can expect this sort of thing with my setup.

So I do this:

Code: Select all

./configure --without-gtk


You can probably do a ./configure --without-gnome instead. That way you'll get the gtk menu at least.

watersb wrote:and I get numerous compile errors that seem to involve the collsion between my system-installed /usr/include/GL/gl.h and Celestia's glext.h:

Code: Select all

glext.h:600: `void (*glVertexAttribs3dvNV)(unsigned int, int, const GLdouble*)'
   redeclared as different kind of symbol
/usr/include/GL/gl.h:2743: previous declaration of `void
   glVertexAttribs3dvNV(unsigned int, int, const GLdouble*)'


is one instance. I don't think that's a gcc issue, however.

I've had that problem too, try commenting out #include <celengine/glext.h>.

watersb wrote:Also this warning/error:

Code: Select all

In file included from texmanager.h:15,
                 from 3dsmesh.cpp:15:
../celutil/resmanager.h: In member function `ResourceHandle
   ResourceManager<T>::getHandle(const T&)':
../celutil/resmanager.h:62: warning: `typename std::map<T, ResourceHandle,
   std::less<_Key>, std::allocator<std::pair<const T, ResourceHandle> >
   >::iterator' is implicitly a typename
../celutil/resmanager.h:62: warning: implicit typename is deprecated, please
   see the documentation for details


This last one is probably related to gcc 3.x.


I think so too. I don't know how to resolve it though.

Guest

Post #8by Guest » 15.09.2002, 16:57

Is the same for me....

Thanks !

watersb
Posts: 12
Joined: 14.09.2002
With us: 22 years
Location: where the hell is Socorro, NM?

cross-reference to celestia thread on gentoo forum

Post #9by watersb » 16.09.2002, 08:59

There is a Celestia and GCC 3.x thread on the Gentoo Forum

I think that we should also follow the Mac OS X development efforts, as GCC 3.x is the default compiler for the current release of that OS.

Rich Pinkall Pollei

Fix for GCC 3.2

Post #10by Rich Pinkall Pollei » 30.10.2002, 00:44

I haven't signed up for write access to the CVS dirs, as I probably won't be a regular contributor. However, I've created a patch file based on the Mandrake celestia 1.2.4 patches for the CVS version I checked out on 10/29. It also includes a temporary fix for the ringed planet crashing problem. It's not long, so I'm including it below.

I'm also working on packaging it for RedHat 8.0. If anyone wants the SPEC file when It's ready, or if you want to host the package, let me know via e-mail at whraven@worldnet.att.net.

Here's the patch:

--- ./src/celengine/render.cpp.orig 2002-10-29 18:30:24.000000000 -0600
+++ ./src/celengine/render.cpp 2002-10-29 18:31:08.000000000 -0600
@@ -380,6 +380,7 @@
DPRINTF(1, "Renderer: multi-texture supported.\n");
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,
(GLint*) &nSimultaneousTextures);
+ nSimultaneousTextures = 1;
}
if (ExtensionSupported("GL_EXT_texture_env_combine"))
{
--- ./src/celestia/celestiacore.cpp.orig 2002-10-29 18:20:45.000000000 -0600
+++ ./src/celestia/celestiacore.cpp 2002-10-29 18:23:18.000000000 -0600
@@ -205,7 +205,7 @@
sim->setFrame(fav.coordSys, sim->getSelection());
}

-void CelestiaCore::addFavorite(string name, string parentFolder, FavoritesList::iterator*iter)
+void CelestiaCore::addFavorite(string const & name, string const & parentFolder, const FavoritesList::iterator* iter)
{
FavoritesList::iterator pos;
if(!iter)
@@ -225,7 +225,7 @@
favorites->insert(pos, fav);
}

-void CelestiaCore::addFavoriteFolder(string name, FavoritesList::iterator* iter)
+void CelestiaCore::addFavoriteFolder(string const & name, const FavoritesList::iterator* iter)
{
FavoritesList::iterator pos;
if(!iter)
@@ -1297,7 +1297,7 @@
{
double distFromSun = body.getHeliocentricPosition(t).distanceFromOrigin();
float planetTemp = sun->getTemperature() *
- (float) (pow(1 - body.getAlbedo(), 0.25) *
+ (float) (pow(1.0 - body.getAlbedo(), 0.25) *
sqrt(sun->getRadius() / (2 * distFromSun)));
overlay << setprecision(0);
overlay << "Temperature: " << planetTemp << " K\n";
--- ./src/celestia/celestiacore.h.orig 2002-10-29 18:23:37.000000000 -0600
+++ ./src/celestia/celestiacore.h 2002-10-29 18:25:40.000000000 -0600
@@ -145,8 +145,8 @@
void readFavoritesFile();
void writeFavoritesFile();
void activateFavorite(FavoritesEntry&);
- void addFavorite(std::string, std::string, FavoritesList::iterator* iter=NULL);
- void addFavoriteFolder(std::string, FavoritesList::iterator* iter=NULL);
+ void addFavorite(std::string const&, std::string const&, const FavoritesList::iterator* iter=NULL);
+ void addFavoriteFolder(std::string const&, const FavoritesList::iterator* iter=NULL);
FavoritesList* getFavorites();

const DestinationList* getDestinations();
--- ./src/celestia/gtkmain.cpp.orig 2002-10-29 18:25:52.000000000 -0600
+++ ./src/celestia/gtkmain.cpp 2002-10-29 18:26:17.000000000 -0600
@@ -43,6 +43,8 @@
#include "celengine/simulation.h"
#include <libgnomeui/gnome-init.h>

+using namespace std;
+

char AppName[] = "Celestia";

--- ./src/buildstardb.cpp.orig 2002-10-29 18:26:26.000000000 -0600
+++ ./src/buildstardb.cpp 2002-10-29 18:29:41.000000000 -0600
@@ -923,7 +923,8 @@
{
MultistarSystem* multiSystem = new MultistarSystem();
multiSystem->nStars = 1;
- multiSystem->stars[0] = iter;
+ // (gb) stars[] could have been an array of iterators
+ multiSystem->stars[0] = &(*iter);
starSystems.insert(MultistarSystemCatalog::value_type(iter->CCDMIdentifier, multiSystem));
}
else
@@ -935,7 +936,7 @@
}
else
{
- multiSystem->stars[multiSystem->nStars] = iter;
+ multiSystem->stars[multiSystem->nStars] = &(*iter);
multiSystem->nStars++;
}
}
@@ -1164,7 +1165,7 @@
for (vector<HipparcosStar>::iterator iter = stars.begin();
iter != stars.end(); iter++)
{
- starIndex.insert(starIndex.end(), iter);
+ starIndex.insert(starIndex.end(), &(*iter));
}

HIPCatalogComparePredicate pred;

Rich Pinkall Pollei

Fix for GCC 3.2

Post #11by Rich Pinkall Pollei » 30.10.2002, 00:48

Sorry about the formatting. I'm still getting used to the forum. Here's a properly formatted version:

Code: Select all

--- ./src/celengine/render.cpp.orig     2002-10-29 18:30:24.000000000 -0600
+++ ./src/celengine/render.cpp  2002-10-29 18:31:08.000000000 -0600
@@ -380,6 +380,7 @@
         DPRINTF(1, "Renderer: multi-texture supported.\n");
         glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,
                       (GLint*) &nSimultaneousTextures);
+       nSimultaneousTextures = 1;
     }
     if (ExtensionSupported("GL_EXT_texture_env_combine"))
     {
--- ./src/celestia/celestiacore.cpp.orig        2002-10-29 18:20:45.000000000 -0600
+++ ./src/celestia/celestiacore.cpp     2002-10-29 18:23:18.000000000 -0600
@@ -205,7 +205,7 @@
     sim->setFrame(fav.coordSys, sim->getSelection());
 }

-void CelestiaCore::addFavorite(string name, string parentFolder, FavoritesList::iterator*iter)
+void CelestiaCore::addFavorite(string const & name, string const & parentFolder, const FavoritesList::iterator* iter)
 {
     FavoritesList::iterator pos;
     if(!iter)
@@ -225,7 +225,7 @@
     favorites->insert(pos, fav);
 }

-void CelestiaCore::addFavoriteFolder(string name, FavoritesList::iterator* iter)
+void CelestiaCore::addFavoriteFolder(string const & name, const FavoritesList::iterator* iter)
 {
     FavoritesList::iterator pos;
     if(!iter)
@@ -1297,7 +1297,7 @@
             {
                 double distFromSun = body.getHeliocentricPosition(t).distanceFromOrigin();
                 float planetTemp = sun->getTemperature() *
-                    (float) (pow(1 - body.getAlbedo(), 0.25) *
+                    (float) (pow(1.0 - body.getAlbedo(), 0.25) *
                              sqrt(sun->getRadius() / (2 * distFromSun)));
                 overlay << setprecision(0);
                 overlay << "Temperature: " << planetTemp << " K\n";
--- ./src/celestia/celestiacore.h.orig  2002-10-29 18:23:37.000000000 -0600
+++ ./src/celestia/celestiacore.h       2002-10-29 18:25:40.000000000 -0600
@@ -145,8 +145,8 @@
     void readFavoritesFile();
     void writeFavoritesFile();
     void activateFavorite(FavoritesEntry&);
-    void addFavorite(std::string, std::string, FavoritesList::iterator* iter=NULL);
-    void addFavoriteFolder(std::string, FavoritesList::iterator* iter=NULL);
+    void addFavorite(std::string const&, std::string const&, const FavoritesList::iterator* iter=NULL);
+    void addFavoriteFolder(std::string const&, const FavoritesList::iterator* iter=NULL);
     FavoritesList* getFavorites();

     const DestinationList* getDestinations();
--- ./src/celestia/gtkmain.cpp.orig     2002-10-29 18:25:52.000000000 -0600
+++ ./src/celestia/gtkmain.cpp  2002-10-29 18:26:17.000000000 -0600
@@ -43,6 +43,8 @@
 #include "celengine/simulation.h"
 #include <libgnomeui/gnome-init.h>

+using namespace std;
+

 char AppName[] = "Celestia";

--- ./src/buildstardb.cpp.orig  2002-10-29 18:26:26.000000000 -0600
+++ ./src/buildstardb.cpp       2002-10-29 18:29:41.000000000 -0600
@@ -923,7 +923,8 @@
             {
                 MultistarSystem* multiSystem = new MultistarSystem();
                 multiSystem->nStars = 1;
-                multiSystem->stars[0] = iter;
+                              // (gb) stars[] could have been an array of iterators
+                multiSystem->stars[0] = &(*iter);
                 starSystems.insert(MultistarSystemCatalog::value_type(iter->CCDMIdentifier, multiSystem));
             }
             else
@@ -935,7 +936,7 @@
                 }
                 else
                 {
-                    multiSystem->stars[multiSystem->nStars] = iter;
+                    multiSystem->stars[multiSystem->nStars] = &(*iter);
                     multiSystem->nStars++;
                 }
             }
@@ -1164,7 +1165,7 @@
         for (vector<HipparcosStar>::iterator iter = stars.begin();
              iter != stars.end(); iter++)
         {
-            starIndex.insert(starIndex.end(), iter);
+            starIndex.insert(starIndex.end(), &(*iter));
         }

         HIPCatalogComparePredicate pred;

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 6 months
Location: Hamburg, Germany

Fix for GCC 3.2

Post #12by t00fri » 30.10.2002, 08:36

Rich Pinkall Pollei wrote:Sorry about the formatting. I'm still getting used to the forum. Here's a properly formatted version:

Code: Select all

--- ./src/celengine/render.cpp.orig     2002-10-29 18:30:24.000000000 -0600
+++ ./src/celengine/render.cpp  2002-10-29 18:31:08.000000000 -0600
@@ -380,6 +380,7 @@
         DPRINTF(1, "Renderer: multi-texture supported.\n");
         glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,
                       (GLint*) &nSimultaneousTextures);
+       nSimultaneousTextures = 1;
     }
     if (ExtensionSupported("GL_EXT_texture_env_combine"))
     {



It does not look like a good idea to me to generically switch off multi-texture support with your "fix". This is rather "castration";-)

nSimultaneousTextures = 1;

should only be a last resort, in case of cards that do not support it. You do not want to take the fun out of NVIDIA owners over there at RedHat, do you?

Bye Fridger

whraven
Posts: 1
Joined: 30.10.2002
With us: 21 years 11 months
Location: Madison, Wisconsin

Fix for GCC 3.2

Post #13by whraven » 30.10.2002, 20:56

It does not look like a good idea to me to generically switch off multi-texture support with your "fix". This is rather "castration";-)

nSimultaneousTextures = 1;

should only be a last resort, in case of cards that do not support it. You do not want to take the fun out of NVIDIA owners over there at RedHat, do you?


Agreed, which is why I gave it as a "temporary" fix. I plan on removing that part of the patch
after the base problem is fixed.

Guest

Post #14by Guest » 01.11.2002, 18:52

Meanwhile celestia-1.2.4 compiles with gcc-3.2 under Gentoo-1.4-rc1. Obviously the ebuild has been changed. So go on and enjoy it[/b]


Return to “Development”