-
Notifications
You must be signed in to change notification settings - Fork 43
Getting Started
This is the recommended approach. Create a project.clj that looks like this for 0.5.0
:
(defproject your-project-name "your.project.version"
:description "A description of your project"
:dependencies [[org.clojure/clojure "1.1.0"]
[org.clojure/clojure-contrib "1.1.0"]
[penumbra "0.5.0"]]
:native-dependencies [[lwjgl "2.2.2"]]
:dev-dependencies [[native-deps "1.0.0"]
[leiningen/lein-swank "1.1.0"]])
And this for 0.6.0-SNAPSHOT
:
(defproject your-project-name "your.project.version"
:description "A description of your project"
:dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
[org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]
[penumbra "0.6.0-SNAPSHOT"]]
:native-dependencies [[penumbra/lwjgl "2.4.2"]]
:dev-dependencies [[native-deps "1.0.1"]
[leiningen/lein-swank "1.1.0"]])
At the command line, run lein deps
followed by lein native-deps
. After that, you can run lein swank
, and in Emacs, M-x slime-connect
to connect to the REPL.
First, run lein deps
, followed by lein native-deps
.
Penumbra relies on the following:
- Current versions of clojure and clojure-contrib.
- /src needs to be added to the classpath, and /lib/* (osx, linux, or windows) to the class and library paths.
- 32-bit libraries are in /x86, 64-bit in /x86_64.
The easiest way to satisfy the last requirement is a script that looks something like this:
java -cp \
/.../clojure/1.2.0-master-SNAPSHOT.jar:\
/.../clojure-contrib/clojure-contrib.jar:\
/.../penumbra/src:\
/.../penumbra/test:\
/.../penumbra/lib/* \
-Djava.library.path=/.../penumbra/native/x86/osx \
clojure.main
Where ‘…’ is the respective path to each of these directories. To run all example programs one by one, enter this at the REPL:
user=> (require 'examples)
nil
user=> (examples/run)
Depending on your hardware and drivers, some examples may not work properly. If this is the case, please file a report with your hardware, driver version, and the output of glxinfo
at the command line.
The above method may not fit well with your preferred workflow. You can also
- Alter environment variables such that your default class and library paths include the above directories.
- Put files in a directory already included in your class or library paths. All jar and clj files must be in your class path, all other files must be in your library path.
Methods of altering environment variables vary widely by platform, and are beyond the scope of this article. You can discover the appropriate locations for files at the REPL by entering (System/getProperty "java.library.path")
for binary files, and (System/getProperty "java.ext.dirs")
for jar and clj files.