Dependencies installation docs are missing #2

Closed
Nek opened this Issue Aug 22, 2013 · 24 comments

Projects

None yet

4 participants

@Nek
Nek commented Aug 22, 2013

I've tried to run examples but my complete lack of experience with guile prevented me from installing the dependencies (guile-sdl and guile-figl).

Can I have an example or a link to the manual?

@davexunit
Owner

Thank you for attempting to install things.

Guile-sdl is easy to install: Grab the latest release tarball, version 0.5.0, from here http://www.gnu.org/software/guile-sdl/

You'll need SDL 1.2 installed and SDL_image, I think.

cd guile-sdl-0.5.0/
./configure --prefix=/usr
make
sudo make install

FIGL can be more problematic, since it's an as-of-yet unreleased library. I run off of the latest master, which has a small error in the documentation files that causes the build to fail. Let me try to walk you through the process:

git clone https://gitorious.org/guile-figl/guile-figl
cd guile-figl
autoreconf -vif
./configure --prefix=/usr
make
sudo make install

You will probably encounter a syntax error in the low-level-gl.texi, to fix it you will need to join the lines 19152 and 19153 together, I think. There are a lot of warnings that get output, but only one actual error. The documentation is auto-generated from the OpenGL docs and there are still a few bugs in the generator.

I hope this helps. I should move this information into an INSTALL file or something. If/when I do an official release, I will look into bundling these dependencies with the release tarball to save everyone the headache.

@Nek
Nek commented Aug 23, 2013

Thanks for the instructions.

I've tried to follow but bumped into the problem with guile-sdl.

I'm on a mac (OS X 10.8.4) and have SDL installed with brew package manager.
So I had to configure SDL prefix:

./configure --prefix=/usr/ --with-sdl-prefix=/usr/local/Cellar/sdl/1.2.15/

Which gave me (it's not the full backtrace):

ERROR: In procedure open-file:
ERROR: In procedure open-file: No such file or directory: "/usr/include/SDL/SDL_ttf.h"

Ok. I reconfigured it:

./configure --prefix=/usr/ --with-sdl-prefix=/usr/local/Cellar/sdl/1.2.15/ --disable-ttf 

Which gave me (not the full backtrace again):

ERROR: In procedure open-file:
ERROR: In procedure open-file: No such file or directory: "/usr/include/SDL/SDL_video.h"

It looks like build script keeps looking for a part of SDL inside /usr/include/SDL/ despite being provided with the right SDL prefix.

I hope someone with a mac and adequate experience will jump on and give a helping hand.

@davexunit
Owner

Hmm, that's a bummer. I'm not an OS X user but I might be able to use a friend's machine and investigate this issue. I would certainly like to see guile-2d to run on OS X.

@Nek
Nek commented Aug 23, 2013

When you get to this issue you can count on me to test the solution.
I'm rather excited about your creation and would love to use it for a game dev compo someday (better sooner then later :).

@davexunit
Owner

Glad to see some interest in my project! Thanks for testing things out. I think I'll send an email to the guile-sdl developer and see what he thinks.

@Nek
Nek commented Aug 23, 2013

You are welcome! Let's see what he thinks.

@davexunit
Owner

Here's ttn's (the guile-sdl dev) response:

"Thanks for the bug report. Unfortunately, until now, i was not even
aware of ‘--with-sdl-prefix’ -- ignorance is bliss! The next release
will fix that, but until then, you might try to specify these dirs on
the configure script command line via VAR=VAL pairs, something like:

./configure --prefix=$HOME/eval
CPPFLAGS=-I/usr/local/Cellar/sdl/1.2.15/include
LDFLAGS=-L/usr/local/Cellar/sdl/1.2.15/lib

I'm guessing at the leaf-dir names (include, lib); they need to be
chosen such that <SDL/SDL.h> can be found by appending to includedir,
and the shared object library (i think .dynlib under OSX) in libdir."

So, give that a try and see how it goes. If it doesn't, I can CC you when emailing ttn in the future.

@Nek
Nek commented Aug 23, 2013

I've tried to (the paths are correct :):

./configure --prefix=/urs/
CPPFLAGS=-I/usr/local/Cellar/sdl/1.2.15/include/
LDFLAGS=-L/usr/local/Cellar/sdl/1.2.15/lib --disable-ttf

And got:

ERROR: In procedure open-file:
ERROR: In procedure open-file: No such file or directory: "/usr/include/SDL/SDL_video.h"
@davexunit
Owner

This is probably not the issue, but you have a typo here: --prefix=/urs/

@Nek
Nek commented Aug 23, 2013

Oh, you are right. And yes it's not the issue the backtrace stays the same with --prefix=anything or no prefix at all.

@davexunit
Owner

Got this back from ttn, it's a bit hard to parse but maybe it will help a bit:

"This is from the script build-aux/guile-baux/k2c, which scans various
headers to produce the enums and flags init data, in src/k/. Although
k2c can take ‘-I DIR’, the build system currently does not make use of
that option. There are two possible workarounds:

  • Modify k2c (line 370) to substitute "/usr/include" w/ "DIR".
  • Modify the src/k/Makefile.in pattern rules ‘.kf.c’ and ‘.kp.c’ to
    add ‘-I DIR’ to the k2c invocation, and invoke config.status at
    top-level to re-instantiate src/k/Makefile.

Both of these probably require "make -C src/k/ clean" (at a minimum) to
ensure known-good (re)start state."

@Nek
Nek commented Aug 26, 2013

It helped a bit. :)

Now I've got the next problem:

../build-aux/guile-baux/gbaux-do c2x -o sdl.x sdl.c -- -DHAVE_CONFIG_H -I. -       I/usr/local/Cellar/sdl/1.2.15//include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -D_THREAD_SAFE -  I/usr/local/Cellar/guile/2.0.9/include/guile/2.0 -I/usr/local/Cellar/readline/6.2.4/include -I/usr/local/Cellar/bdw- gc/7.2d/include 
In file included from /usr/include/stdio.h:500,
             from /usr/local/include/SDL/SDL_stdinc.h:38,
             from /usr/local/include/SDL/SDL_main.h:27,
             from /usr/local/include/SDL/SDL.h:31,
             from guile-sdl.h:41,
             from sdl.c:23:
/usr/include/secure/_stdio.h:48: error: syntax error in macro parameter list
/usr/include/secure/_stdio.h:55: error: syntax error in macro parameter list
In file included from sdl.c:23:
guile-sdl.h:57: error: libguile.h: No such file or directory
In file included from guile-sdl.h:60,
             from sdl.c:23:
snuggle/humdrum.h:76: error: guile/gh.h: No such file or directory
c2x: preprocessor had problems (exit val 1)
make[1]: *** [sdl.x] Error 1
make: *** [all-recursive] Error 1

Now I'm sure we need someone with a Mac and a knowledge of make.
Also there will be problems with SDL. SDL apps don't work out of the box on Macs and need a C wrapper to run.

I wish I knew C and make.

@davexunit
Owner

This is quite the rabbit hole we're going down. Where did you install guile from? I install 2.0.9 from source to /usr. Where is libguile.h? This could be yet another brew problem.

@Nek
Nek commented Aug 26, 2013

It's inside

/usr/local/Cellar/guile/2.0.9/include/guile/2.0/

I'll try to install guile and everything needed from sources.

@davexunit
Owner

Ah, installed via brew. That would explain why it cannot find the C headers. You'll need to get that path into GCC's include path via the -I flag.

@Nek
Nek commented Aug 26, 2013

It looks to me it's already there. I can see it in the first line of the latest error backtrace.
Here is the appropriate part of it:

../build-aux/guile-baux/gbaux-do c2x -o sdl.x sdl.c -- -DHAVE_CONFIG_H -I. \ 
-I/usr/local/Cellar/sdl/1.2.15//include/SDL -D_GNU_SOURCE=1 \
-D_THREAD_SAFE -D_THREAD_SAFE -  I/usr/local/Cellar/guile/2.0.9/include/guile/2.0 \ 
-I/usr/local/Cellar/readline/6.2.4/include -I/usr/local/Cellar/bdw- gc/7.2d/include
@davexunit
Owner

Hmm. The plot thickens. I'll need to try to install this myself on a friend's OS X machine some time.

@holden-L

OS X user here.
Currently installing guile-sdl. After some trouble, I got the ./configure portion to work, by reinstalling sdl and sdl_image through brew, and using the

./configure --prefix=/usr/ --with-sdl-prefix=/usr/local/Cellar/sdl/1.2.15/

command shown above. Now trying to make gives me this error:

Backtrace:
In ice-9/boot-9.scm:
 157: 6 [catch #t #<catch-closure 10b7fa4e0> ...]
In unknown file:
   ?: 5 [apply-smob/1 #<catch-closure 10b7fa4e0>]
In ice-9/boot-9.scm:
  63: 4 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 3 [eval # #]
In ../../build-aux/guile-baux/k2c:
 361: 2 [k2c/qop #<procedure 10c088800 at build-aux/guile-baux/common.scm:162:4 (key . proc)>]
 146: 1 [scan-file "/usr/include/SDL/SDL_active.h" (#t "SDL_APP[A-Z]+") #f]
In unknown file:
   ?: 0 [open-file "/usr/include/SDL/SDL_active.h" "r" ...]

ERROR: In procedure open-file:
ERROR: In procedure open-file: No such file or directory: "/usr/include/SDL/SDL_active.h"
make[2]: *** [appstate.c] Error 1
make[1]: *** [k-stamp] Error 2
make: *** [all-recursive] Error 1

I can't make heads or tails of this.

Also, an unrelated note to others installing guile through brew: it takes a LONG time on the make install portion (19 minutes for me). Just sit patient.

@davexunit
Owner

This seems to be another instance of guile-sdl assuming that the SDL header files are in /usr/include. Have you tried the things that @Nek has tried in the comments above? I really need to find an OS X machine to sit down at for awhile and sort this mess out.

@davexunit davexunit added a commit that referenced this issue Aug 30, 2013
@davexunit Fix issue #2.
draw-sprite-vertices was drawing the entire vertex array rather than
only drawing the amount specified in the size argument.
e6ff58c
@davexunit
Owner

Updating this issue to say that I still haven't had the chance to work on an OS X machine. Sorry. :(

@davexunit
Owner

guile-sdl 0.5.1 has been released. Could someone please give that a shot? Maybe one of you will get a bit farther along with the installation.

@paines
paines commented Apr 4, 2016

I tried to build 0.5.2. Things seems to get a bit better if you pull gcc-4.7 or gcc-4.8 via brew and then do

CC=gcc-4.8 ./configure --prefix=/usr/ --includedir=/usr/local/include/SDL

However I then ran into compile issues like

3 warnings generated.
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
make[3]: Nothing to be done for `all-am'.
cat k/*.list > k-stamp
printf '#define KOTK_N  %d\n' \
      `ls -l k/*.c | wc -l` \
    > k-count.h
../build-aux/guile-baux/gbaux-do c2x -o sdl.x sdl.c -- -DHAVE_CONFIG_H -I. -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -D_THREAD_SAFE -I/usr/local/Cellar/guile/2.0.11_2/include/guile/2.0 -I/usr/local/opt/gmp/include -I/usr/local/opt/readline/include -I/usr/local/Cellar/bdw-gc/7.4.2/include
Backtrace:
In ice-9/boot-9.scm:
 157: 5 [catch #t #<catch-closure 1038e9260> ...]
In unknown file:
   ?: 4 [apply-smob/1 #<catch-closure 1038e9260>]
In ice-9/boot-9.scm:
  63: 3 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 2 [eval # #]
In ../build-aux/guile-baux/c2x:
 349: 1 [main/qop #<procedure 103ab1360 at build-aux/guile-baux/common.scm:162:4 (key . proc)> ...]
 198: 0 [condense #f ()]

../build-aux/guile-baux/c2x:198:31: In procedure condense:
../build-aux/guile-baux/c2x:198:31: In procedure car: Wrong type argument in position 1 (expecting pair): #f
make[1]: *** [sdl.x] Error 1
make: *** [all-recursive] Error 1

Please ping me if I can provide more info. Thank!

@davexunit
Owner

Guile-2d is no longer maintained here. The project name has been changed to Sly and the repo has moved to https://dthompson.us/sly.git

The upcoming Sly 0.2 release later this month will no longer depend on guile-sdl, which is a relief because its build system is terrible as you can see.

Thanks!

@davexunit
Owner

Oh, and the new home page is https://dthompson.us/pages/software/sly.html

@davexunit davexunit closed this Apr 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment