Write your own Einstein@home screensaver

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6588
Credit: 317195357
RAC: 365082

RE: RE: @Bernd : I've

Message 78168 in response to message 78167

Quote:
Quote:
@Bernd : I've just pushed a Mac makefile to GitHub that ought work for you.

Thanks, I now get:
[pre]
Successfully built and installed SolarSystem [Framework]!
Building SolarSystem [Application]...
rm -rf resources.cpp AcceleratedPlatform.o Buffer_OBJ.o Constellation.o Constellations.o Craft.o EinsteinRadioAdapter.o EinsteinS5R3Adapter.o ErrorHandler.o Globe.o GridGlobe.o HUDBorderLayout.o HUDContainer.o HUDContent.o HUDFlowLayout.o HUDFlowHorizontalLayout.o HUDFlowVerticalLayout.o HUDImage.o HUDItem.o HUDTextLine.o HUDTextLineScroll.o InertialPlatform.o OGL_ID.o OrdStar.o OrthoNormalPlatform.o Pulsar.o Pulsars.o Renderable.o Simulation.o SolarSystem.o SolarSystemRadio.o SolarSystemS5R3.o SolarSystemGlobals.o Sphere.o SpinPlatform.o Star.o SunOrbit.o Supernova.o Supernovae.o Texture_OBJ.o TranslatablePlatform.o TriggerTimer.o UTC.o Vector3D.o VectorSP.o Vertex.o resources.o graphics_app*
make: *** No rule to make target `solarsystem', needed by `release'. Stop.
[/pre]

Getting better ...

BM


Try now .... slight case problem

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Bernd Machenschalk
Bernd Machenschalk
Moderator
Administrator
Joined: 15 Oct 04
Posts: 4312
Credit: 250514829
RAC: 34312

Almost: [pre] g++ -g

Message 78169 in response to message 78168

Almost:
[pre]
g++ -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -I/opt/local/include -I/Users/bema/Einstein-At-Home-Screensaver/install/include -I/Users/bema/Einstein-At-Home-Screensaver/install/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/Users/bema/Einstein-At-Home-Screensaver/install/include/freetype2 -I/Users/bema/Einstein-At-Home-Screensaver/install/include -I/Users/bema/Einstein-At-Home-Screensaver/install/include/libxml2 -I/Users/bema/Einstein-At-Home-Screensaver/install/include/boinc -I/usr/include -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -I/Users/bema/Einstein-At-Home-Screensaver/src/solarsystem -I/Users/bema/Einstein-At-Home-Screensaver/src/solarsystem/../framework -DNDEBUG -ggdb3 -O3 -Wall -Wno-switch-enum -D SCIENCE_APP=EinsteinS5R3 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -L/opt/local/lib -static-libgcc /Users/bema/Einstein-At-Home-Screensaver/src/solarsystem/main.cpp -o "graphics_app=einstein_RUNLABEL_VERSION_graphics_i686-apple-darwin" AcceleratedPlatform.o Buffer_OBJ.o Constellation.o Constellations.o Craft.o EinsteinRadioAdapter.o EinsteinS5R3Adapter.o ErrorHandler.o Globe.o GridGlobe.o HUDBorderLayout.o HUDContainer.o HUDContent.o HUDFlowLayout.o HUDFlowHorizontalLayout.o HUDFlowVerticalLayout.o HUDImage.o HUDItem.o HUDTextLine.o HUDTextLineScroll.o InertialPlatform.o OGL_ID.o OrdStar.o OrthoNormalPlatform.o Pulsar.o Pulsars.o Renderable.o Simulation.o SolarSystem.o SolarSystemRadio.o SolarSystemS5R3.o SolarSystemGlobals.o Sphere.o SpinPlatform.o Star.o SunOrbit.o Supernova.o Supernovae.o Texture_OBJ.o TranslatablePlatform.o TriggerTimer.o UTC.o Vector3D.o VectorSP.o Vertex.o resources.o -lframework -loglft -L/Users/bema/Einstein-At-Home-Screensaver/install/lib -L/Users/bema/Einstein-At-Home-Screensaver/install/lib -lfreetype -lz -L/Users/bema/Einstein-At-Home-Screensaver/install/lib -lxml2 -lz -lpthread -liconv -lm -lboinc_graphics2 -lboinc_api -lboinc -L/Users/bema/Einstein-At-Home-Screensaver/install/lib -L/Users/bema/Einstein-At-Home-Screensaver/install/lib /Users/bema/Einstein-At-Home-Screensaver/install/lib/libSDLmain.a /Users/bema/Einstein-At-Home-Screensaver/install/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit -lstdc++ -lpthread -lm -lc
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
_SetMacSSLevel
collect2: ld returned 1 exit status
make: *** [solarsystem_Einstein_LVC] Error 1
[/pre]

BM

BM

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6588
Credit: 317195357
RAC: 365082

Whoops, missed that

Whoops, missed that dependency. Try now ... crosses fingers. :-)

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Bernd Machenschalk
Bernd Machenschalk
Moderator
Administrator
Joined: 15 Oct 04
Posts: 4312
Credit: 250514829
RAC: 34312

This probably just needs

Message 78171 in response to message 78169

This probably just needs SetMacSSLevel.o to be added to the objects...

BM

BM

Bernd Machenschalk
Bernd Machenschalk
Moderator
Administrator
Joined: 15 Oct 04
Posts: 4312
Credit: 250514829
RAC: 34312

Before you submitted your

Message 78172 in response to message 78171

Before you submitted your change, I modified the Makefile manually:

[pre]diff --git a/src/solarsystem/Makefile.macos b/src/solarsystem/Makefile.macos
index bd19042..673550a 100755
--- a/src/solarsystem/Makefile.macos
+++ b/src/solarsystem/Makefile.macos
@@ -56,7 +56,7 @@ OBJS += SolarSystemRadio.o SolarSystemS5R3.o
OBJS += SolarSystemGlobals.o Sphere.o SpinPlatform.o Star.o SunOrbit.o
OBJS += Supernova.o Supernovae.o Texture_OBJ.o TranslatablePlatform.o
OBJS += TriggerTimer.o UTC.o Vector3D.o
-OBJS += VectorSP.o Vertex.o
+OBJS += VectorSP.o Vertex.o SetMacSSLevel.o
OBJS += $(RESOURCESPEC).o
RESOURCESPEC = resources
[/pre]

This build worked, I haven't tested your change, though.

BM

BM

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6588
Credit: 317195357
RAC: 365082

RE: Before you submitted

Message 78173 in response to message 78172

Quote:

Before you submitted your change, I modified the Makefile manually:

[pre]diff --git a/src/solarsystem/Makefile.macos b/src/solarsystem/Makefile.macos
index bd19042..673550a 100755
--- a/src/solarsystem/Makefile.macos
+++ b/src/solarsystem/Makefile.macos
@@ -56,7 +56,7 @@ OBJS += SolarSystemRadio.o SolarSystemS5R3.o
OBJS += SolarSystemGlobals.o Sphere.o SpinPlatform.o Star.o SunOrbit.o
OBJS += Supernova.o Supernovae.o Texture_OBJ.o TranslatablePlatform.o
OBJS += TriggerTimer.o UTC.o Vector3D.o
-OBJS += VectorSP.o Vertex.o
+OBJS += VectorSP.o Vertex.o SetMacSSLevel.o
OBJS += $(RESOURCESPEC).o
RESOURCESPEC = resources
[/pre]

This build worked, I haven't tested your change, though.


Great! My change is just an inserted line

OBJS += SetMacSSLevel.o

which would make no odds. Terrific :-0

Cheers, Mike.

( edit ) Now if I can get hold of that binary, then I can zip it up for distribution via my personal domain.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Bernd Machenschalk
Bernd Machenschalk
Moderator
Administrator
Joined: 15 Oct 04
Posts: 4312
Credit: 250514829
RAC: 34312

Doesn't it have a standalone

Message 78174 in response to message 78172

Doesn't it have a standalone mode? I got an empty window that vanished after a second:

[pre]
himac:~/dist bema$ cat stderrgfx.txt
11:12:35 (283): Can't open init data file - running in standalone mode
No node found using XPath expression: /project_preferences/graphics/@fps
No node found using XPath expression: /project_preferences/graphics/@quality
No node found using XPath expression: /project_preferences/graphics/@width
No node found using XPath expression: /project_preferences/graphics/@height
SolarSystemGlobals::loadImage() - image file NOT loaded
himac:~/dist bema$ cat solarsystem_stderr.txt
FATAL EXIT: SolarSystemGlobals::loadImage() - image file NOT loaded
[/pre]

BM

BM

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6588
Credit: 317195357
RAC: 365082

RE: Doesn't it have a

Message 78175 in response to message 78174

Quote:

Doesn't it have a standalone mode? I got an empty window that vanished after a second:

[pre]
himac:~/dist bema$ cat stderrgfx.txt
11:12:35 (283): Can't open init data file - running in standalone mode
No node found using XPath expression: /project_preferences/graphics/@fps
No node found using XPath expression: /project_preferences/graphics/@quality
No node found using XPath expression: /project_preferences/graphics/@width
No node found using XPath expression: /project_preferences/graphics/@height
SolarSystemGlobals::loadImage() - image file NOT loaded
himac:~/dist bema$ cat solarsystem_stderr.txt
FATAL EXIT: SolarSystemGlobals::loadImage() - image file NOT loaded
[/pre]

BM


It does, but for debugging I had it FATAL out if the image files wouldn't load. Sorry. You need :

aps_header.bmp
earthmap.bmp
geo_small.bmp
ligo_small.bmp
lsclogo.bmp
sunmap.bmp
wyplogo.bmp

in the same directory as the executable. You'll find them in the src directory of the solarsystem branch on git hub.

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Bernd Machenschalk
Bernd Machenschalk
Moderator
Administrator
Joined: 15 Oct 04
Posts: 4312
Credit: 250514829
RAC: 34312

Hm - still the

Message 78176 in response to message 78175

Hm - still the same:
[pre]
himac:~/dist bema$ ls -al
total 77640
drwxr-xr-x 14 bema admin 476 10 Feb 11:22 .
drwxr-xr-x 105 bema admin 3570 10 Feb 11:05 ..
-rwxr-xr-x 1 bema admin 100854 10 Feb 11:21 aps_header.bmp
-rwxr-xr-x 1 bema admin 6291510 10 Feb 11:21 earthmap.bmp
-rwxr-xr-x 1 bema admin 10230 10 Feb 11:21 geo_small.bmp
-rwxr-xr-x 1 bema admin 12381636 10 Feb 11:12 graphics_app=einstein_RUNLABEL_VERSION_graphics_i686-apple-darwin
-rwxr-xr-x 1 bema admin 12381636 10 Feb 11:11 graphics_app=einsteinbinary_RUNLABEL_VERSION_graphics_i686-apple-darwin
-rwxr-xr-x 1 bema admin 13302 10 Feb 11:21 ligo_small.bmp
-rwxr-xr-x 1 bema admin 43574 10 Feb 11:21 lsclogo.bmp
-rw-r--r-- 1 bema admin 138 10 Feb 11:21 solarsystem_stderr.txt
-rw-r--r-- 1 bema admin 858 10 Feb 11:21 stderrgfx.txt
-rwxr-xr-x 1 bema admin 2097206 10 Feb 11:21 sunmap.bmp
-rwxr-xr-x 1 bema admin 6291510 10 Feb 11:21 worldmap.bmp
-rwxr-xr-x 1 bema admin 69990 10 Feb 11:21 wyplogo.bmp
himac:~/dist bema$ ./graphics_app\=einstein_*
himac:~/dist bema$ cat solarsystem_stderr.txt
FATAL EXIT: SolarSystemGlobals::loadImage() - image file NOT loaded
FATAL EXIT: SolarSystemGlobals::loadImage() - image file NOT loaded
FATAL EXIT: SolarSystemGlobals::loadImage() - image file NOT loaded
[/pre]

BM

BM

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6588
Credit: 317195357
RAC: 365082

Hmmmm indeed. This means we

Message 78177 in response to message 78176

Hmmmm indeed. This means we got a null pointer return from the SDL API call here :

[pre]SDL_Surface* SolarSystemGlobals::loadImage(std::string filename, GLenum* format) {
// See if SDL will load the image file into a surface struct ....
SDL_Surface* ret_val = SDL_LoadBMP(filename.c_str());

// Did that work?
if(ret_val == NULL) {
// No, the image did not load into a surface struct.
ErrorHandler::record("SolarSystemGlobals::loadImage() - image file NOT loaded ", ErrorHandler::FATAL);
}
[/pre]

I'll have to ponder on that ....

Cheers, Mike.

( edit ) Does Mac - akin to Windows - do something with filename extensions? It's not 'filename.bmp.bmp' or whatever ? Is there a GIMP-ish utility that could load it ?

( edit ) SDL_LoadBMP wants a 'const char*' and std::string::c_str() returns one of those, so that's cool.

( edit ) OK, a quick Google indicates there is a problem with the SDL Mac backend, causing precisely this problem. It is related to whether you draw the map from top->down or bottom->up, and thus possibly reporting the vertical dimension as being of negative extent rather than positive ie. 100 x -100 pixels instead of 100 x 100, say. If a bmp is created on a Mac and viewed on a Mac, then no problem ...

Right. I'll need to think of a workaround for this.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.