Puppy Linux Blog Post:

How to compile GNU Guile 2.0.11 in Lucid Puppy Linux 5.2.8
12/29/2015

Post Below
12/29/2015 - How to compile GNU Guile 2.0.11 in Lucid Puppy Linux 5.2.8 (Puppy Linux)

    Hide/Show:


   ▲ Top  ▼ Bottom  △ TOC
How to compile GNU Guile 2.0.11 in Lucid Puppy Linux 5.2.8
Tuesday, December 29th, 2015
13:07:46 GMT

Puppy Linux

I apparently managed to compile GNU Guile in Lucid Puppy Linux 5.2.8 version 004 - though doing so was even more difficult than the last few things I compiled.

And I'm not sure the way I did it was a good idea, since I had to do something rather questionable to trick libunistring into acknowledging that my copy of iconv works. I hope this didn't break anything, but I have no idea. So, please be careful.


I got interested in GNU Guile because it uses the programming language Scheme, which is related to Lisp, and GNU Guile has a component called Guile-Gnome (which I haven't tried to compile yet) which apparently lets you deal with GTK stuff.

So, I guess basically I'm fishing around for Lisp-y alternatives to PHP-GTK, just in case I turn out to like Lisp or maybe even Scheme more than PHP.

But maybe in the end I'll just use lisphp with PHP and PHP-GTK. Or maybe I won't even like Lisp enough to do that? I just haven't done enough with any Lisp or Scheme yet to be able to decide.

Also, another factor to take into consideration is, how cross-platform are these Lisp and Scheme-based things? Will they make it as easy as PHP-GTK to make Astroblahhh Desktop capable of working in not only Linux, but also Windows and Macs?


How to build GNU Guile in Lucid Puppy Linux 5.2.8 version 004:

  1. There were at least two dependencies of GNU Guile I had to download, compile and install - libunistring (I used version 0.9.5), and libgc (I used version 7.2).

    And if I hadn't already had libffi 3.2.1 as a result of compiling newLISP the other day, I probably would have had to install libffi too.

    So, the first step is to download the dependencies you need:

    https://www.gnu.org/software/libunistring/#downloading

    http://www.hboehm.info/gc/#where

    https://sourceware.org/libffi/


  2. Lucid Puppy 5.2.8 version 004 apparently already has iconv - so, I'm not sure if this step 2 is necessary. But, I upgraded to libiconv 1.14 in the hope that that would get rid of libunistring's refusal to acknowledge that I have a working copy of iconv.

    But, even upgrading libiconv still didn't fix that problem, so I had to resort to something which I'm hoping was not a bad, dangerous thing to do - I edited libunistring's configure script to make it just assume iconv is working. (I'll explain exactly what I did in a later step.)

    I don't know whether or not GNU Guile can use the iconv that comes with Lucid Puppy 5.2.8, so, maybe it's best to upgrade to libiconv 1.14, as I did.

    So, step 2 is to download libiconv, if you want to update iconv.

    https://www.gnu.org/software/libiconv/#downloading


  3. And, download the source code of GNU Guile itself. (I used version 2.0.11.)

    http://www.gnu.org/software/guile/download/

    ftp://ftp.gnu.org/gnu/guile/guile-2.0.11.tar.gz


  4. Unzip the libffi source code tarball, open the libffi source code folder, and open a terminal window. Then, do these 3 commands:

    ./configure

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  5. Next, unzip the libgc source code tarball, open the source code folder, open a terminal, and do these commands:

    ./configure

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  6. If you decided not to upgrade libiconv, you can skip this step.

    If you decided to upgrade libiconv, unzip the libiconv source code tarball, open the libiconv code folder, open a terminal window, and do these commands:

    ./configure --prefix=/usr/local

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)

    Then, to stop your system from trying to use the old iconv instead of the new iconv - go to the folder /usr/bin, and rename the file iconv to something else.


  7. Next, unzip the libunistring source code tarball, and open the libunistring source code folder.


  8. This is the trickiest and probably the most potentially dangerous and questionable step. I'm not sure this is a good idea at all, but, I haven't yet found any other way to make the build of GNU Guile succeed, because GNU Guile's ./configure complains if libunistring is compiled without libiconv support.

    In the libunistring source code folder, open the file "configure" with a text editor. Go to line 17639, which says:

    am_cv_func_iconv_works=no

    Change it to:

    am_cv_func_iconv_works=yes


  9. Next, open a terminal at the libunistring source code folder. Do this command:

    ./configure --prefix=/usr/local

    If it worked properly, it should say the following starting around line 114 of the stuff printed by ./configure:

    checking for iconv... yes
    checking for working iconv... yes
    checking how to link with libiconv... /usr/local/lib/libiconv.so -Wl,-rpath -Wl,/usr/local/lib
    checking for iconv declaration... 
             extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
    checking for iconv.h... yes

    If it does say that, then, do these commands:

    make

    make install

    (Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)


  10. Now that GNU Guile's dependencies have been installed, we can proceed with building GNU Guile. Unzip GNU Guile's source code tarball, open the GNU Guile source code folder, and open a terminal window. Do these commands:

    LD_LIBRARY_PATH=/usr/local/lib

    ./configure

    (The first line somehow stops "make" from complaining about not being able to find libunistring.)


  11. Next, do this command:

    make

    And be prepared to wait a long time for it to build. For me, it took more than a half an hour, even on the 3.4 GHz dual core desktop computer I was building it on.

    At first it looks like it's going pretty fast and doing lots of stuff, but it seemed to get stuck for a very long time doing something with these files:

    wrote `ice-9/eval.go'
      GUILEC ice-9/psyntax-pp.go
    wrote `ice-9/psyntax-pp.go'
      GUILEC ice-9/boot-9.go
    wrote `ice-9/boot-9.go'
      GUILEC ice-9/vlist.go
    wrote `ice-9/vlist.go'
      GUILEC srfi/srfi-1.go
    wrote `srfi/srfi-1.go'
      GUILEC language/tree-il/peval.go
    wrote `language/tree-il/peval.go'
      GUILEC language/tree-il/cse.go

    And so on. I was a bit worried something went wrong and it was never going to finish, but, all I had to do was wait. And wait, and wait.


  12. Once "make" is finished, you can do this command:

    make install

    (Or, if you want to build an .sfs or .pet file, put "new2dir make install" (without quotes) instead of "make install".)


Now, it should be possible to run GNU Guile simply by typing "guile" in a terminal.

I don't know if there's a GUI (graphical user interface) somewhere, but, if I find there is, I'll update this post.


I don't yet know how to make GNU Guile do anything particularly eye-catching, but, you can make it do some addition by typing something like this:

(+ 2 2)

To which GNU Guile will respond:

$1 = 4

And apparently that creates a variable called $1, containing "4" (the result of adding 2+2).


And you can use the automatically-created $1 variable in other commands like this:

(+ $1 1)

To which GNU Guile will respond:

$2 = 5

($1 equals 4, and 4 plus 1 equals 5.)

   ▲ Top  ▼ Bottom  △ TOC


    Hide/Show: