gsll installation on clisp & cygwin

Mirko Vukovic

Introduction

GSLL, GSD, and FSBV had to be slightly adapted to clisp and cygwin. After the modifications, the FSBV, GSD pass all tests and GSLL passes the vast majority of them.

The clisp & cygwin modifications are independent of each other. All modifications are done using read-time conditionalizations (RTC) such as #+cygwin, #-cygwin, #+clisp, and #-clisp.

Note: According to gsll documentation, the only required part of fsbv is convert. However, gsd's foreign-array does not compile because defcstruct is undefined. defcstruct is defined in file cstruct. We compile the full fsbv.

Cygwin setup

Needed cygwin libraries and utilities:

Also add /lib/lapack to PATH. I have it added to the windows' PATH, but it should work with cygwin's PATH.

On linking to libraries

GSLL & FSBV call the following libraries:

For cygwin, the corresponding libraries are:

Make appropriate modifications to the fsbv/init.lisp and gsll/init/init.lisp files (details below). Library definition and loading syntax is discussed in the cffi manual.

FSBV

Modify the following files:

Finally,

GSD

GSD systems load cleanly on cygwin/clisp. The only modifications are to the unit-tests.

clisp does not honor grid's requests in creating double-float grids. Instead it creates float grids, and mapping on them returns single-floats. As grid specifies test results in term of double-floats, the test `element-functions' fails because of different precisions.

We fix that test by relaxing the error tolerance. In file tests/element-functions.lisp, add the following `let' body around the tests:

(let ((lisp-unit:*epsilon* #+clisp 1e-5 #-clisp nil))
         ... test-forms ... )

Finally,

All tests should pass.

GSLL

In gsll only init/init.lisp needs a few modifications.

The `gsl-config' function

This function seems to be needed primarily for the darwin OS. Nevertheless it is invoked on all platforms because of the #. read macro in a library definitions.

Unfortunately, asdf:run-shell-command does not do the right job on clisp and returns `nil.' This causes the read statements to fail.

The fix is to use a separate form for clisp and the original one for non-clisp. For clisp, the function body should be:

#+clisp
(read-line
  (ext:run-shell-command
      (format nil "gsl-config ~s" arg)
      :output :stream)
     nil :gsl-config-returned-with-error)

If this form returns an error, something is wrong with the gsl setup. Thus this form could be used as one test of gsl installation correctness.

GSL library paths

Add the cygwin library path definitions to libgslcblas and libgsl.

Compile, load and test GSLL

Load systems gsll and gsll-tests. Verify the installation by switching to the gsll package and executing

gsll> (let ((lisp-unit:*epsilon* 1e-5))
       (lisp-unit:run-tests))
On my system I get:
TOTAL: 3376 assertions passed, 22 failed, 9 execution errors.