Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > SDL -- framwork vs. unix-like

SDL -- framwork vs. unix-like
Thread Tools
Theodour
Forum Regular
Join Date: Apr 2000
Location: A drip off Lake Michigan
Status: Offline
Reply With Quote
Sep 13, 2004, 04:00 PM
 
I am trying to compile the latest Stellarium to run under X11.
During the configure, it complains about the lack of SDL.
I have SDL installed, but only as the OSX-friendly Framework.

Do I need to install the Unix version of SDL, or can I use symlinks?

Also, if I do need to install the Unix version, does anyone know if running both types of installs will casue a problem?
     
utidjian
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Sep 13, 2004, 05:10 PM
 
Originally posted by Theodour:
I am trying to compile the latest Stellarium to run under X11.
During the configure, it complains about the lack of SDL.
I have SDL installed, but only as the OSX-friendly Framework.

Do I need to install the Unix version of SDL, or can I use symlinks?

Also, if I do need to install the Unix version, does anyone know if running both types of installs will casue a problem?
I tried installing stellarium-0.6.0.tar.gz and it also asked for SDL. I installed SDL with:

sudo fink install SDL

which went fine.

I then tried to configure and build it with:

sudo ./configure --with-sdl-prefix=/sw
sudo make

The configure went fine but the make failed at some point.

I then downloaded and installed the stellarium-0.5.2.dmg file. The dmg (though an earlier version) seems to run fine. It was built by jameslowery (at) fsmail.net so you may want to ask him how he did it ;-)

I also tried to do the build in Linux... went off without a hitch and it runs fine.

Where did you get the "OSX-friendly Framework" of SDL?

It shouldn't matter which one you use (fink version or other). The version of SDL installed via fink is 1.2.7. I may need to install further SDL packages via fink... trying....

Nah... build still dies.
-DU-...etc...
     
Theodour  (op)
Forum Regular
Join Date: Apr 2000
Location: A drip off Lake Michigan
Status: Offline
Reply With Quote
Sep 13, 2004, 06:59 PM
 
Hey,
libsdl.org has an actual installer .pkg for 1.2.7 for OS X. It installs as a framework in /Library ... which is the preffered way to do it on OSX, I guess (like Tcl/Tk, and Python ... and Java, too). Otherwise, I would guess it would go in /usr/local/ or something like that.

I'm trying not to use fink on this particular machine ... nothing against it, but I've noticed in the past that when I mix Fink with regular "make"s and also Frameworks, stuff starts to break.

By that philosophy, I'm loath to mess with adding another SDL install when I've got the OS X-style framework already.

Sounds like Stellarium .6 won't "make" anyway ... so I'll just stick to the quite lovely .5.2 build.

Just for kicks, did you happen to note where the 0.6 "make" fails?
( Last edited by Theodour; Sep 14, 2004 at 01:45 AM. )
     
utidjian
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Sep 14, 2004, 05:53 AM
 
Originally posted by Theodour:
Hey,
libsdl.org has an actual installer .pkg for 1.2.7 for OS X. It installs as a framework in /Library ... which is the preffered way to do it on OSX, I guess (like Tcl/Tk, and Python ... and Java, too). Otherwise, I would guess it would go in /usr/local/ or something like that.
OK got the SDL-1.2.7.pkg.tar.gz and the SDL-devel-1.2.7.pkg.tar.gz from the libsdl.org website. Unpacked, installed.


I'm trying not to use fink on this particular machine ... nothing against it, but I've noticed in the past that when I mix Fink with regular "make"s and also Frameworks, stuff starts to break.

By that philosophy, I'm loath to mess with adding another SDL install when I've got the OS X-style framework already.
Interesting. The problem I have is that I don't like to install anything NOT supplied by Apple into the pristine Xcode tree. I actually prefer it that third party code and libs and code be installed to /sw or /usr/local.

Well, in this case, both builds appear to fail in the exact same place....

Code:
observator.cpp: In member function `float Observator::get_GMT_shift_from_system(double) const': observator.cpp:169: error: pointer value used where a floating point value was expected observator.cpp:169: error: `daylight' undeclared (first use this function) observator.cpp:169: error: (Each undeclared identifier is reported only once for each function it appears in.) make[3]: *** [observator.o] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all] Error 2 make: *** [all-recursive] Error 1

Sounds like Stellarium .6 won't "make" anyway ... so I'll just stick to the quite lovely .5.2 build.
Yeah sounds that way. I have a few more things to try... be back later.
-DU-...etc...
     
utidjian
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Sep 14, 2004, 03:38 PM
 
Back...

OK I finally got it to build and run correctly.

Note: All credit for this is due to steven-j-s whose workarounds I found on the stellarium.sourceforge.net. I followed this post:
http://sourceforge.net/tracker/index...57&atid=454374

Here are my build notes:

1. Unpack the pristine sources from http://prdownloads.sourceforge.net/s...ar.gz?download
in /usr/local/src/

Code:
sudo cp ~/Desktop/stellarium-0.6.0.tar.gz /usr/local/src/ cd /usr/local/src/ sudo tar -xzvf stellarium-0.6.0.tar.gz cd stellarium-0.6.0/
2. Edit src/observator.cpp as per Stevens instructions:

Code:
cd src/ sudo cp observator.cpp observator.cpp.orig sudo vi +169 observator.cpp
(or use your favorite text editor).

The code I changed in src/observator.cpp is as follows:

Original section:
Code:
float Observator::get_GMT_shift_from_system(double JD) const { return -(float)timezone/3600 + (daylight!=0); /* time_t rawtime = get_time_t_from_julian(JD); struct tm * timeinfo; timeinfo = localtime(&rawtime); static char heure[20]; heure[0] = '\0'; my_strftime(heure, 19, "%z", timeinfo); cout << heure << endl; cout << timezone << endl; heure[5] = '\0'; float min = 1.f/60.f * atoi(&heure[3]); heure[3] = '\0'; return min + atoi(heure); */ }
To:
Code:
float Observator::get_GMT_shift_from_system(double JD) const { /* ## comment out next line for Mac OS X ## */ /* return -(float)timezone/3600 + (daylight!=0); */ /* ## uncomment the rest of the lines except for cout lines for Mac OS X ## */ time_t rawtime = get_time_t_from_julian(JD); struct tm * timeinfo; timeinfo = localtime(&rawtime); static char heure[20]; heure[0] = '\0'; my_strftime(heure, 19, "%z", timeinfo); // cout << heure << endl; // cout << timezone << endl; heure[5] = '\0'; float min = 1.f/60.f * atoi(&heure[3]); heure[3] = '\0'; return min + atoi(heure); }
3. Run ./configure:

Code:
cd /usr/local/src/stellarium-0.6.0/ sudo ./configure
4. AFTER you have run ./configure AND BEFORE you run make, make install you will need to edit src/Makefile. I did not need to edit src/config.h as Steven did because it appears that everything is set correctly. You will still need to make the changes to src/Makefile.

Code:
sudo vi src/Makefile
As per Stevens instructions I edited out the '-s' flags on the CFLAGS and CXXFLAGS lines in src/Makefile.
I also added the '-lmx' directive to the LIBS line in src/Makefile.

5. NOW you can run make and it should compile without error (though plenty of miscellaneous warnings). If everything built OK also run 'make install'.
Code:
sudo make sudo make install
6. We are not quite done. If you try to run the program /usr/local/bin/stellarium it will fail because there is no /usr/local/share/stellarium/config/config.ini file. You will need to create one. Fortunately there is a default_config.ini file available. But to get it to install and work correctly you need to first run it as the root user via sudo.

Code:
sudo stellarium
A regular user will now use that default config file. They will not be able to save their own however. If you figure out a way to get that working I will be interested.

That about does it... a few annoyances, but it (mostly) works.
-DU-...etc...
     
Theodour  (op)
Forum Regular
Join Date: Apr 2000
Location: A drip off Lake Michigan
Status: Offline
Reply With Quote
Sep 16, 2004, 08:58 AM
 
Thanks.
This is great.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:34 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,