Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support installatino with roswell #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cl-jupyter.lisp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@



;; not yet installed in quicklisp directory
(push (truename (format nil "~Asrc/" (directory-namestring *load-truename*)))
asdf:*central-registry*)

#-ros.init
(let ((cmd-args
;; Borrowed from apply-argv, command-line-arguments. Temporary solution (?)
;; This is not PvE's code.
Expand Down Expand Up @@ -47,5 +51,9 @@
(in-package #:cl-jupyter-user)

;; start main loop
#-ros.init
(cl-jupyter:kernel-start)

#+ros.init
(defun main (&rest argv)
(cl-jupyter:kernel-start argv))
72 changes: 72 additions & 0 deletions install-cl-jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,58 @@ def process_command_line(argv):
raise RequirementException(message)

print("... Kernel: using {}".format(sbcl_version_string))
elif config.lisp_implementation == "roswell":
if not config.lisp_executable:
config.lisp_executable = 'ros'
try:

sbcl_version_string = subprocess.check_output([config.lisp_executable, "-L", "sbcl-bin", "run", "--", "--version"]).decode()
except FileNotFoundError:
halt("Error: Lisp executable '{0}' not in PATH".format (config.lisp_executable))
except subprocess.CalledProcessError as e:
halt("Error: {} from SBCL".format(e))

print("sbcl reports version {}".format(sbcl_version_string))

import re
try:
regexp = re.compile(r'(\d+)\.(\d+)\.(\d+)')
version = regexp.findall(sbcl_version_string)[0]
except IndexError:
halt("Error: issue with sbcl version string (please report)")

config.sbcl_version = map(int, version)

sbcl_min_version = (1, 2, 0)
for have, need in zip(config.sbcl_version, sbcl_min_version):
if have < need:
message = "found {}; required: sbcl >= {}"
message = message.format(config.sbcl_version, sbcl_min_version)
raise RequirementException(message)

print("... Kernel: using {}".format(sbcl_version_string))
elif config.lisp_implementation == "roswell-ccl":
if not config.lisp_executable:
config.lisp_executable = 'ros'

try:
ccl_version_string = subprocess.check_output([config.lisp_executable, "-L", "ccl-bin", "run", "--","-V"]).decode()
except FileNotFoundError:
halt("Error: Lisp executable '{0}' not in PATH".format (config.lisp_executable))
except subprocess.CalledProcessError as e:
halt("Error: {} from CCL".format(e))

import re
m = re.match(r".*[^0-9](([0-9]+\.)[0-9]+\.[0-9]+)", ccl_version_string)
if not m:
halt("Error: issue with ccl version string (please report)")

config.ccl_version = tuple([int(d) for d in m.group(1).split(".")])
#print("ccl version = {}".format(config.ccl_version))
if config.ccl_version[0] < 1 or config.ccl_version[1] < 10:
halt("Error: require CCL v1.10 or above")

print("... Kernel: using {}".format(ccl_version_string))

elif config.lisp_implementation == "ccl":
if not config.lisp_executable:
Expand Down Expand Up @@ -253,6 +305,26 @@ def process_command_line(argv):
"display_name": "SBCL Lisp",
"language": "lisp"
}
elif config.lisp_implementation == "roswell":
KERNEL_SPEC = {
"argv": [
config.lisp_executable,
'-L', 'sbcl-bin',
"{0}/cl-jupyter.lisp".format(config.cl_jupyter_startup_def_dir),
'{connection_file}'],
"display_name": "roswell",
"language": "lisp"
}
elif config.lisp_implementation == "roswell-ccl":
KERNEL_SPEC = {
"argv": [
config.lisp_executable,
'-L', 'ccl-bin',
"{0}/cl-jupyter.lisp".format(config.cl_jupyter_startup_def_dir),
'{connection_file}'],
"display_name": "roswell-ccl",
"language": "lisp"
}
elif config.lisp_implementation == "ccl":
KERNEL_SPEC = {
"argv": [
Expand Down
4 changes: 2 additions & 2 deletions src/kernel.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
(signature-scheme :initarg :signature-scheme :reader config-signature-scheme :type string)
(key :initarg :key :reader kernel-config-key)))

(defun kernel-start ()
(let ((cmd-args (get-argv)))
(defun kernel-start (&optional args)
(let ((cmd-args (or args (get-argv))))
;(princ (banner))
(write-line "")
(format t "~A: an enhanced interactive Common Lisp REPL~%" +KERNEL-IMPLEMENTATION-NAME+)
Expand Down