Skip to main content

News

Topic: Linux install instructions (Read 5794 times) previous topic - next topic

Linux install instructions
A few years ago I had successfully installed sphere on linux/wine with some really handy instructions somewhere on the old site. Now that those years have passed by a lot has changed, including the site and me getting a new computer. Anyway, do linux install instructions exist anywhere?

Re: Linux install instructions
Reply #1
I recently hacked up the Sphere source to compile on Linux again. I was working with DaVince to get it set up for him, but that effort stalled. I didn't plan on posting up any instructions until that succeeded.

I have, however, compiled and run Sphere natively on Linux on several of my own machines. I could help you get that running, if you want.
If you want to do it that way, you will need:



  • git

  • g++

  • python 2.7

  • scons



Clone the git repos at https://github.com/FlyingJester/Corona, https://github.com/FlyingJester/Audiere, and https://github.com/FlyingJester/Sphere. Build and install Corona and Audiere. Then, download, build,and install SpiderMonkey (contemporarily just called JS) as we did here.

Then, you should be able to build my fork of Sphere.

The Sphere GL driver is spotty on Linux, but there is another driver that works on Linux that provides hardware acceleration if Sphere GL doesn't work and SDL32 is too slow. And SDL32 is slow.

  • Rahkiin
  • [*][*][*]
Re: Linux install instructions
Reply #2

Clone the git repos at (...) Build and install Corona and Audiere. Then, download, build,and install SpiderMonkey (contemporarily just called JS)

Then, you should be able to build my fork of Sphere.


@pancakes4ever I hope you are not a GUI-only Ubuntu user :P

Re: Linux install instructions
Reply #3
To be sure, this isn't as simple as running an installer.

If you have trouble or are confused at any point, I can help. Just ask  :)

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Linux install instructions
Reply #4
If you want the Windows version to work well on Wine, do the following:

Get Winetricks (it's in the package repo). Run:
Code: [Select]
winetricks mfc42


Now you'll be able to open both the engine and included editor with Wine through your file manager.


Quote
I recently hacked up the Sphere source to compile on Linux again. I was working with DaVince to get it set up for him, but that effort stalled. I didn't plan on posting up any instructions until that succeeded.

Oops... Sorry! I kind of forgot you replied. My main system is half-broken so I use another one now, but will see if I can get you some debug output later.

Re: Linux install instructions
Reply #5

To be sure, this isn't as simple as running an installer.
If you have trouble or are confused at any point, I can help. Just ask  :)


Awesome! Thanks. Yeah I will ask if I have any trouble. I'm gonna try giving it go tonight. I was expecting a bit of a challenge to get it up and running but it sounds fun :)


@pancakes4ever I hope you are not a GUI-only Ubuntu user :P


Luckily, no. Although, I did make the mistake of being a home Linux user without internets before. Ugh, that was a rough time.


If you want the Windows version to work well on Wine, do the following:
Get Winetricks (it's in the package repo). Run:
Code: [Select]
winetricks mfc42

Now you'll be able to open both the engine and included editor with Wine through your file manager.


That's what I was forgetting! I remembered the audiere bit but definitely not mfc42.
I was using wine method the first time. I think I'm gonna try going native first but it'll be nice to know I have an escape rope in case I fail miserably.

Thanks everybody.

Re: Linux install instructions
Reply #6
So I got pretty far into the build and am currently trying to build sphere. Getting a slew of errors about  Corona.o has unreferenced ( or undefined references) to PNG_WHATEVER...
Am I missing an #include somewhere or I tried adding lpng as a linker and as lib in the sconstruct and received the same error.

Re: Linux install instructions
Reply #7
Are using my copy of Corona? What is the exact PNG name that is undefined?
  • Last Edit: March 12, 2014, 01:53:52 pm by Flying Jester

Re: Linux install instructions
Reply #8
Yeah I did use your version of corona
Keep in mind, I'm definitely took a few stabs in the dark to get this far so I may have screwed some things up...
I had to comment out an if-statement in the headers of Corona/Src/Openpng.cpp in order to get it to compile and I'm starting to think that was a bad idea. I also tinkered with the Sconstruct, try to include libpng to see if that was it.
Oh, I'm also on (LUBUNTU) 12.04. I apologize for the train-wreck in advance. :p

Code: [Select]

g++ -o source/engine/engine -lpng -lz -lz -lpng source/engine/SpritesetServer.o source/engine/benchmark.o source/engine/engine.o source/engine/log.o source/engine/map_engine.o source/engine/render.o source/engine/rendersort.o source/engine/parameters.o source/engine/script.o source/engine/sfont.o source/engine/sfxr.o source/engine/simage.o source/engine/smap.o source/engine/sphere.o source/engine/ssfxr.o source/engine/sspriteset.o source/engine/swindowstyle.o source/engine/PlayerConfig.o -Lsource/common -Lsource/particle_engine -L/usr/lib/x86_64-linux-gnu -Lsource/engine/unix -lcommon -laudiere -lcorona -lmng -ljpeg -lz -lparticle_engine -lSDL -lunix -ldl -ljs
/usr/local/lib/libcorona.so: undefined reference to `png_set_error_fn'
/usr/local/lib/libcorona.so: undefined reference to `png_create_info_struct'
/usr/local/lib/libcorona.so: undefined reference to `png_sig_cmp'
/usr/local/lib/libcorona.so: undefined reference to `png_read_png'
/usr/local/lib/libcorona.so: undefined reference to `png_malloc'
/usr/local/lib/libcorona.so: undefined reference to `png_get_io_ptr'
/usr/local/lib/libcorona.so: undefined reference to `png_set_read_fn'
/usr/local/lib/libcorona.so: undefined reference to `png_destroy_read_struct'
/usr/local/lib/libcorona.so: undefined reference to `png_set_IHDR'
/usr/local/lib/libcorona.so: undefined reference to `png_set_rows'
/usr/local/lib/libcorona.so: undefined reference to `png_destroy_write_struct'
/usr/local/lib/libcorona.so: undefined reference to `png_get_bit_depth'
/usr/local/lib/libcorona.so: undefined reference to `png_create_read_struct'
/usr/local/lib/libcorona.so: undefined reference to `png_set_sig_bytes'
/usr/local/lib/libcorona.so: undefined reference to `png_get_channels'
/usr/local/lib/libcorona.so: undefined reference to `png_get_tRNS'
/usr/local/lib/libcorona.so: undefined reference to `png_get_image_height'
/usr/local/lib/libcorona.so: undefined reference to `png_write_png'
/usr/local/lib/libcorona.so: undefined reference to `png_get_rows'
/usr/local/lib/libcorona.so: undefined reference to `png_set_write_fn'
/usr/local/lib/libcorona.so: undefined reference to `png_get_image_width'
/usr/local/lib/libcorona.so: undefined reference to `png_get_PLTE'
/usr/local/lib/libcorona.so: undefined reference to `png_create_write_struct'
/usr/local/lib/libcorona.so: undefined reference to `png_error'
/usr/local/lib/libcorona.so: undefined reference to `png_free'
/usr/local/lib/libcorona.so: undefined reference to `png_set_PLTE'
  • Last Edit: March 12, 2014, 07:23:02 pm by pancakes4ever

Re: Linux install instructions
Reply #9
Libpng-related pkgs installed:
libpng12-0
libpng12-dev
libpnglite-dev
libpng3
libpng++-dev
libpng12-0:i386

Re: Linux install instructions
Reply #10
You're going to need those if statements.

Near the top of the file OpenPNG.cpp, you should see this:
Code: [Select]
#if (PNG_LIBPNG_VER < 12000)


The quick fix is to change it from < to >. You have one of the versions of LibPNG that land on the wrong side of my assumptions about the API.

The real fix for this is to find out when png_struct was removed, and what the PNG_LIBPNG_VER definition was for that version, and check against that. I tried to figure it out, but in the I just took a guess, which is clearly not really correct.
  • Last Edit: March 12, 2014, 08:05:52 pm by Flying Jester

Re: Linux install instructions
Reply #11

You're going to need those if statements.

Near the top of the file OpenPNG.cpp, you should see this:
Code: [Select]
#if (PNG_LIBPNG_VER < 12000)


The quick fix is to change it from < to >. You have one of the versions of LibPNG that land on the wrong side of my assumptions about the API.

The real fix for this is to find out when png_struct was removed, and what the PNG_LIBPNG_VER definition was for that version, and check against that. I tried to figure it out, but in the I just took a guess, which is clearly not really correct.


Gah, I knew that commenting was come back to get me.
This reminded of an thread I found while I was doing some internet digging while at work. It looks like the people were having a similar issue and inserted range of png_libpng_version rather than a single </> statement. I don't know if it applies here but I'll link it when I find it again.

Re: Linux install instructions
Reply #12
It's the same kind of issue, but unless they were dealing with png's setjump and the guts of png_struct being laid bare, it wouldn't help much. That change was made all at once, sometime between libpng 1.0 and libpng 1.4. I just don't know exactly when.

Re: Linux install instructions
Reply #13
Ok, so I got it to make it past scons it ended up being due to the fact that I didn't include the jpg,png,and zlib with corona in the Sconstruct...

but now (so close yet so far) have met with another error

Code: [Select]

./engine: error while loading shared libraries: libunix.so: cannot open shared object file: No such file or directory


libunix.so shows up the in the source/engine/unix/folder but where is the engine looking?

Re: Linux install instructions
Reply #14
Whoops I got it. Moved libunix.so to usr/lib
now getting this error
Code: [Select]
engine: source/common/Map.cpp:141: LAYER_HEADER_AssertStructSize__::LAYER_HEADER_AssertStructSize__(): Assertion `sizeof(LAYER_HEADER) == 30' failed.
Aborted (core dumped)


also noticing that i dont see the wxeditor anywhere... is that normal?