Time-stamp: <2012-12-19 16:39:37 tony>
Current Status: SOMEWHAT BROKEN
but we are rebuilding it.
Here’s a general fast start approach for using this.
- Get access to a Common Lisp implementation on your platform. Make sure you have BLAS, LAPACK, and their corresponding development environments on your system
- if needed, install quicklisp (http://www.quicklisp.org)
- if needed, install git (http://www.git-scm.org/)
- Use git to fetch common-lisp-statistics from the repository: git://github.com/blindglobe/common-lisp-stat.git and put it into your quicklisp local-projects directory (you will need to put a few more projects there as well)
- Start up the Common Lisp implementation, and:
- get coffee, review the Common Lisp Statistics mailing list, chat with friends, etc, until it is done compiling and loading.
- Report success/failure back to the news group or to me (mailto:firstname.lastname@example.org)
- Start trying it out.
Common Lisp, Support Libraries
Right now, one needs a Common Lisp implementation, SBCL, CCL, and CLISP seem to be the easiest to get. There are many others.
GCL might be one NOT to try at this point?
Currently, LispCabinet would be the simplest way to get started, with either SBCL or CCL as the Lisp Implementation. Need experiences from others using
FIXME: (how) does one need to get BLAS, LAPACK, and the compilation environment if needed, on Microsoft Windows?
SBCL is known to work (0.58+, 1.1.1+)
CCL is thought to work
Get lapack-dev, blas-dev from your Linux distribution.
(CMUCL and CLISP may work, but not tested)
FIXME: Tony has no clue, please fill this in since most mailing list folks use Macs.
- CCL is thought to work
- SBCL is known to work
- LAPACK/BLAS: get from
LispCabinet has it preinstalled, and you can use that version to upgrade
Debian/Ubuntu also allow you access to a (possibly outdated) version. Not sure about upgrade potential.
On Linux and MacOSX, I would recommend using the instructions at the QuickLisp www site (http://www.quicklisp.org).
Unfortunately, as much as we really would like to get rid of this PITA stage, we are pre-alpha, and that means no chance, unless you want to fix your own bugs and copy/paste fixes, etc. Much simpler to figure out a small bit of git.
Hopefully, your distribution (Linux) has it, or you can get it for MacOSX and Microsoft Windows via http://www.git-scm.org/
GitHub also has a Microsoft Windows application that might be useful.
Using git to fetch Common Lisp Statistics
At this stage, we need to identify where you will put the D/L’d package. If you are have an existing, highly tuned quicklisp setup, please figure it out and jump to the next stage, but basically you need to pull common-lisp-stat from Blindglobe’s repository, along with a few others.
FIXME: must figure out the current “few others” and keep it current.
Compile and load dependencies.
Start up your Common Lisp implementation and type in:
and everything should be working. This is the case for at least one person, so data on failures is very welcome.
Start trying it out
Now, load into your IDE or lisp, the files in the examples directory, to get a feel for what to do.
Version 2 (David)
(This held for the version before we removed liblispstat and plplot and some other “crutches” which had a bit too much bitrot).
We assume that you have a lisp installed and that you have a passing acquaintence with the unix shell.
- The first point that you should note that is that these instructions are written with the assumption of the availibility of quicklisp.
If you do not have quicklisp , please go to www.quicklisp.org and install it now
- The second point to note is that you will need the “git” utility
installed on your machine.
for mac osx sudo port install git for linux (eg debian) sudo apt-get install git
- Once that is done execute the following shell commands
cd ~/quicklisp/local-projects git clone git://github.com/blindglobe/common-lisp-stat.git cd comon-list-stat git submodules init
These commands copy the the source from the repository and all the associated libraries. It will live as a quicklisp project in the local-projects directory. I find it convenient to symbolically link the quicklisp direct to ~/lisp for easy access
ln ~/quicklisp/local-projects ~/lisp
- Configure the locations of the BLAS and LINPACK libraries
Currently this is a manual operation, which will change in a later version.
Edit the file external/cl-blapack/load-blapack-libs.lisp
Search for the following 3 parameters gfortran-lib blas-lib lapack-lib
For OS X: change the parameters as suggested in the file. Both BLAS and LAPACK are pre installed on Mac OSX.
For linux, make sure you have the neccessary libraries installed, through apt, yum or otherwise
sudo apt-get install libblas sudo apt-get install liblapack
For windows, we recommend you use cygwin to get straightforward access. I’ll document the steps if there is a demand.
- You need to check that your dynamic library path has been properly set up in the shell.
In your .bashrc (or equivalent shell init file) For Mac OSX set DYLD_FALLBACK-LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/opt/local/lib For Linux set LD_LIBRARY_PATH=$LD_LIBRARY_PATH:????
If you get this wrong the load process will not be able to find the libraries and will prompt you.
- Once the pre prequisites have been done, start your favourite lisp and enter
(ql:register-local-projects) (ql:quickload :cls)
Retire for a well earned coffee and upon your return you should find the package completely installed. Obviously, potential errors can creep in with spelling the filenames correctly, so be careful.
Example Usage steps
change directory into the CommonLispStat working directory.
start your lisp
follow the commands in the ls-demo.lisp (need to add link) file, i.e.
Initially we will work in the cls package as all the basic functions we would need are present
For serious work we would create our own workspace and save it in a separate package, but for now we will take this short cut.
(setf mytest (normal-rand 20))
… (and so on) …
and see if they work (basic CFFI functionality for external C library, LIFT package for unit-testing framework to ensure run time stability).
- start your lisp
- load CLS
Setup a place to work
In Common Lisp, you need to select and setup namespace to store data and functions. There is a scratch user-package, or sandbox, for CLS, cls-user , which you can select via:
and this has some basic modules from CLS instantiated (dataframes, probability calculus, numerical linear algebra, basic summaries (numerical and visual displays).
However, it can be better is to create a package to work in, which pulls in only desired functionality:
(in-package cl-user) (defpackage :my-package-user (:documentation "demo of how to put serious work should be placed in a similar package elsewhere for reproducibility. This hints as to what needs to be done for a user- or analysis-package.") (:nicknames :my-clswork-user) (:use :common-lisp ; always needed for user playgrounds! :lisp-matrix ; we only need the packages that we need... :common-lisp-statistics :cl-variates :lisp-stat-data-examples) ;; this ensures access to a data package (:shadowing-import-from :lisp-stat ;; This is needed temporarily until we resolve the dependency and call structure. call-method call-next-method expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh float random truncate floor ceiling round minusp zerop plusp evenp oddp < <= = /= >= > > ;; complex conjugate realpart imagpart phase min max logand logior logxor lognot ffloor fceiling ftruncate fround signum cis <= float imagpart) (:export summarize-data summarize-results this-data this-report)) (in-package :my-clswork-user) ;; or :my-package-user (setf my-data (let ((var1 )) ))
We need to pull in the packages with data or functions that we need; just because the data/function is pulled in by another package, in that package’s namespace, does NOT mean it is available in this name space. However, the common-lisp-statistics package will ensure that fundamental objects and functions are always available.
Get to work [0/3]
Pull in or create data
Save work and results for knowledge building and reuse
One can build a package, or save an image (CL implementation dependent) or…
Inform moi of problems or successes
NEED TO SETUP A MAILING LIST!!
mailto:email@example.com if there is anything wrong, or even if something happens to work.
- SBCL is target platform. CCL and CMUCL should be similar.
- CLISP is finicky regarding the problems that we have with CFFI conversation. In particular that we can not really do typing that we need to take care of. I think this is my (Tony’s) problem, not someone elses, and specifically, not CLISP’s
- Need to test ECL.
“Languages shape how we …” Need to get and insert this quote that Duncan Temple-Lang found.
The API should distinguish between the realization and the statistical interpretation. Goal is to teach statisticians how to think “systems-computationally”, and programmers, comp-sci types, informaticists and other “data scientists” how to think “statistically”, in order to get a jump on the competition.
The goal of this system is to promote a change in thinking, to move the data analysis approach, currently stuck in a mix of 70s-early 90s approaches, into a new generation/level.
The approach we are taking is one where we provide a general method, and some fundamental building blocks, but don’t force users into approaches in order to allow for experimentation.
DSL’s should be built on top of the core packages, as needed or wanted.
(TonyR:) The DSL I want to build is a verbose statistically precise computing language, but we need quality code underneathe (which others could use for specialized terse DSL’s).
DSL: domain specific language.
See files in file:Doc/ for history, design considerations, and random, sometimes false and misleading, musings.
Local modifications, Development, Contributions
Since this project is
# git clone git://repo.or.cz/CommonLispStat.git git clone git://github.com/blindglobe/common-lisp-stat.git cd common-lisp-stat # git submodules init # git submodules update
will pull the whole repository, and create a “master” branch to work on. If you are making edits, which I’d like, you don’t want to use the master branch, but more to use a topic-centric branch, so you might:
git checkout -b myTopicBranch
and then work on myTopicBranch, pulling back to the master branch when needed by
git checkout master git pull . myTopicBranch
git rebase myTopicBranch
BETTER DOCUMENTATION EXAMPLES EXIST ON-LINE!! PLEASE READ THEM, THE ABOVE IS SPARSE AND MIGHT BE OUTDATED!
Contributing through GitHub
Alternatively, one can work on the github repositories as well. They are a bit differently organized, and require one to get a github account and work from there.
basically, clone the repository on github on the WWW interface, then make a branch (as below), push back the branch to github, and notify the main repository that there is something to be pulled. And we’ll pull it back in.
Commiting with the MOB on repo.or.cz
of course, perhaps you want to contribute to the mob branch. For that, after cloning the repository as above, you would:
git checkout -b mob remotes/origin/mob
(work, work, work… through a cycle of
<edit> git add <files just edited> git commit -m "what I just did"
ad-nauseum. When ready to commit, then just:
git push git+ssh://firstname.lastname@example.org/srv/git/CommonLispStat.git mob:mob
and it’ll be put on the mob branch, as a proposal for merging.
Another approach would be to pull from the topic branch into the mob branch before uploading. Will work on a formal example soon.
(the basic principle is that instead of the edit cycle on mob, do something like:
git checkout mob git pull . myTopicBranch git push git+ssh://email@example.com/srv/git/CommonLispStat.git mob:mob
Licensing will be important. Next decade. But do think through what you intend with your contributions. Should we become famous (Ha!) make sure that you’ve communicated your expectations…
We currently are using and recommend the MIT style license approach.
[fn:1] I´m not including instructions for Emacs or git, as the former is dealt with other places and the latter was required for you to get this. Since disk space is cheap, I´m intentionally forcing git to be part of this system. Sorry if you hate it. Org-mode, org-babel, and org-babel-lisp, and hypo are useful for making this file a literate and interactively executable piece of work.