{"id":1253,"date":"2020-09-15T14:23:13","date_gmt":"2020-09-15T05:23:13","guid":{"rendered":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/?p=1253"},"modified":"2020-09-15T16:56:07","modified_gmt":"2020-09-15T07:56:07","slug":"ubuntu-%e3%81%ab-maxima-jupyter-%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/1253\/","title":{"rendered":"Ubuntu \u306b Maxima-Jupyter \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b"},"content":{"rendered":"<p>\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\uff0cUbuntu (20.04 LTS) \u306b<strong> Maxima-Jupyter (Maxima kernel for Jupyter)<\/strong> \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<p><code>sudo apt install maxima<\/code> \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u3082\u306e\u3067\u306f <strong>Maxima-Jupyter<\/strong> \u304c\u3046\u307e\u304f\u52d5\u304d\u307e\u305b\u3093\u3002<code>--enable-sbcl-exec<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u304d\u3067 <code>make<\/code> \u3055\u308c\u3066\u3044\u308b\u304b\u3089\u3067\u306f\uff1f\u3068\u601d\u3044\u307e\u3059\u304c\uff0c<a href=\"https:\/\/maxima.hatenablog.jp\/entry\/2020\/05\/25\/001814\">\u4ee5\u4e0b\u306e Maxima \u3067\u7db4\u308b\u6570\u5b66\u306e\u65c5\u306e\u8a18\u4e8b<\/a>\u306b\u5f93\u3063\u3066\uff0c\u30bd\u30fc\u30b9\u304b\u3089 <code>make install<\/code> \u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/robert-dodier\/maxima-jupyter\">GitHub &#8211; robert-dodier\/maxima-jupyter: A Maxima kernel for Jupyter, based on CL-Jupyter (Common Lisp kernel)<\/a><\/li>\n<li><a href=\"https:\/\/maxima.hatenablog.jp\/entry\/2020\/05\/25\/001814\">-\u305d\u306e\u4ed6- Maxima\u306e\u74b0\u5883\u6574\u5099(2) Jupyter lab \/ notebook &#8211; Maxima \u3067\u7db4\u308b\u6570\u5b66\u306e\u65c5<\/a><\/li>\n<\/ul>\n<h3>Python<\/h3>\n<p>(brew install python3 \u306f\u6e08\uff09<\/p>\n<pre>sudo apt install python3-pip python-is-python3\r\ncd \/usr\/bin\r\nsudo ln -s pip3 pip<\/pre>\n<pre>$ python -V; pip -V\r\nPython 3.8.2\r\npip 20.2.2 from \/usr\/local\/lib\/python3.8\/dist-packages\/pip (python 3.8)\r\n\r\nsudo pip install jupyter jupyterlab \r\nsudo pip install matplotlib numpy sympy # \u3053\u308c\u306f\u4efb\u610f\u3067<\/pre>\n<h3>Gnuplot<\/h3>\n<p><code>sudo apt install gnuplot<\/code> \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3082\u306e\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u65e5\u672c\u8a9e\u5165\u529b\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u5b57\u5316\u3051\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/1209\/\">Ubuntu\uff1a\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u65e5\u672c\u8a9e\u5165\u529b\u5b57\u5316\u3051\u5bfe\u7b56\u3068\u3057\u3066 gnuplot 5.4 \u3092\u30bd\u30fc\u30b9\u304b\u3089 make<\/a><\/li>\n<\/ul>\n<h3>sbcl<\/h3>\n<pre>curl -OL http:\/\/prdownloads.sourceforge.net\/sbcl\/sbcl-2.0.8-x86-64-linux-binary.tar.bz2\r\ntar xf sbcl-2.0.8-x86-64-linux-binary.tar.bz2 \r\ncd sbcl-2.0.8-x86-64-linux\/\r\nsudo sh .\/install.sh<\/pre>\n<h3>Quicklisp<\/h3>\n<p><a href=\"https:\/\/www.quicklisp.org\/beta\/\">Quicklisp beta<\/a> \u306e Installation \u3092\u53c2\u7167\u3002<\/p>\n<pre>cd ~\/Downloads\r\n\r\ncurl -O https:\/\/beta.quicklisp.org\/quicklisp.lisp\r\ncurl -O https:\/\/beta.quicklisp.org\/quicklisp.lisp.asc\r\ngpg --verify quicklisp.lisp.asc quicklisp.lisp\r\n\r\nsbcl --load quicklisp.lisp\r\n...\r\nTo continue, evaluate: (quicklisp-quickstart:install)\r\n...\r\n* (quicklisp-quickstart:install)\r\n...\r\nNIL\r\n* (ql:system-apropos \"vecto\")\r\n...\r\nNIL\r\n* (ql:quickload \"vecto\")\r\n...\r\n(\"vecto\")\r\n* (ql:add-to-init-file)\r\n...\r\n#P\"\/Users\/quicklisp\/.sbclrc\"\r\n* (quit)<\/pre>\n<h3>Maxima<\/h3>\n<pre>sudo apt install texinfo\r\ncurl -OL https:\/\/sourceforge.net\/projects\/maxima\/files\/Maxima-source\/5.44.0-source\/maxima-5.44.0.tar.gz\r\ntar xvfz maxima-5.44.0.tar.gz \r\ncd maxima-5.44.0\/\r\n.\/configure --enable-sbcl\r\nmake\r\nsudo make install\r\nsudo apt install rlwrap libczmq-dev\r\nrmaxima # \u52d5\u4f5c\u30c1\u30a7\u30c3\u30af\u3002rmaxima \u3060\u3068\u4e0a\u4e0b\u77e2\u5370\u30ad\u30fc\u3082\u4f7f\u3048\u308b\u3002<\/pre>\n<h3>Maxima-Jupyter<\/h3>\n<pre>cd ~\/Downloads\r\ngit clone https:\/\/github.com\/robert-dodier\/maxima-jupyter.git\r\ncd maxima-jupyter\/\r\nmaxima\r\n(%i1) load(\"load-maxima-jupyter.lisp\");\r\n(%i2) jupyter_install();\r\n(%i3) quit();<\/pre>\n<p><code>(%i2)<\/code> \u306e\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u306f\uff0c\u4ee5\u4e0b\u306e\u8a18\u8ff0\u3092\u53c2\u8003\u306b\u3002<\/p>\n<p style=\"padding-left: 40px;\">After the install script has loaded then install using one of the kernel types.<\/p>\n<p style=\"padding-left: 40px;\">User specific Quicklisp kernel: <code>jupyter_install();<\/code><br \/>\nUser specific binary image kernel: <code>jupyter_install_image();<\/code><br \/>\nSystem-wide Quicklisp bundled kernel: <code>jupyter_system_install(true, \"pkg\/\");<\/code><\/p>\n<p style=\"padding-left: 40px;\">After the installation is complete then exit Maxima. For the System-wide installation copy the files in pkg to the system root, i.e. <code>sudo cp -r pkg\/* \/<\/code> on Linux. (macOS \u3067\u3082\u540c\u69d8)<\/p>\n<p>\u500b\u4eba\u3067\u4f7f\u3046\u306b\u306f\uff0c<code>jupyter_install();<\/code> \u3084 <code>jupyter_install_image();<\/code> \u3067\u3088\u3044\u304c\uff0c\u5b9f\u7fd2\u5ba4 PC \u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u6559\u80b2\u7528\u306b&#8230; \u3068\u601d\u3046\u3068\uff0csystem-wide \u306a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\uff0c<code>jupyter_system_install(true, \"pkg\/\");<\/code><\/p>\n<p>\u3057\u304b\u3057\uff0csystem-wide \u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\uff0c\u8d77\u52d5\u6642\u306b\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u5927\u91cf\u306e Warning \u304c\u51fa\u307e\u304f\u308b\u3002\u5b9f\u884c\u306b\u306f\u652f\u969c\u304c\u306a\u3044\u3088\u3046\u3060\u304c\uff0c\u3069\u3046\u3057\u305f\u3082\u306e\u304b\u3068&#8230;<\/p>\n<pre><span style=\"font-size: 10pt;\">% jupyter console --kernel=maxima<\/span>\r\n<span style=\"font-size: 10pt;\">WARNING: System definition file #P\"\/usr\/local\/share\/maxima-jupyter\/software\/cl-base64-20150923-git\/cl-base64.asd\" contains definition for system \"cl-base64-tests\". Please only define \"cl-base64\" and secondary systems with a name starting with \"cl-base64\/\" (e.g. \"cl-base64\/test\") in that file.<\/span>\r\n<span style=\"font-size: 10pt;\">WARNING: redefining UIOP\/PACKAGE::WHEN-PACKAGE-FISHINESS in DEFMACRO<\/span>\r\n<span style=\"font-size: 10pt;\">WARNING: redefining UIOP\/PACKAGE::NOTE-PACKAGE-FISHINESS in DEFMACRO<\/span>\r\n<span style=\"font-size: 10pt;\">WARNING: redefining UIOP\/PACKAGE:DEFINE-PACKAGE in DEFMACRO<\/span>\r\n<span style=\"font-size: 10pt;\">WARNING: redefining UIOP\/COMMON-LISP::LOOP* in DEFMACRO<\/span>\r\n... \r\n\r\n<span style=\"font-size: 10pt;\">maxima-jupyter: a Maxima Jupyter kernel; (C) 2019 Robert Dodier (BSD)<\/span>\r\n<span style=\"font-size: 10pt;\">In [1]:<\/span><\/pre>\n<h3>Maxima-Jupyter \u306e Code Highlighting Installation<\/h3>\n<pre>cd \/usr\/local\/lib\/python3.8\/dist-packages\/notebook\/static\/components\/codemirror\/mode\/\r\nsudo mkdir maxima\r\nsudo cp ~\/Downloads\/maxima-jupyter\/maxima.js maxima\/\r\nsudo vi meta.js \r\n  {name: \"Mathematica\", mime: \r\n+ {name: \"Maxima\", mime: \"text\/x-maxima\", mode: \"maxima\", ext: [\"mac\", \"max\"]},\r\n  {name: \"Modelica\", mime:<\/pre>\n<pre>cd \/usr\/local\/lib\/python3.8\/dist-packages\/pygments\/lexers\/\r\nsudo cp ~\/Downloads\/maxima-jupyter\/maxima_lexer.py .\r\nsudo vi _mapping.py \r\n  'MatlabSessionLexer': ('pygments.lexers.matlab', \r\n+ 'MaximaLexer': ('pygments.lexers.maxima_lexer', 'Maxima', ('maxima', 'macsyma'), ('*.mac', '*.max'), ()),\r\n  'MiniDLexer': ('pygments.lexers.d', 'MiniD',<\/pre>\n<h3>\u4ed8\u9332\uff1a wxMaxima<\/h3>\n<pre>sudo apt install wxmaxima fonts-jsmath\r\ncd \/usr\/bin\r\nsudo chmod -x maxima # \u30bd\u30fc\u30b9\u304b\u3089\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u305f\u3082\u306e\u3068\u6df7\u540c\u3057\u306a\u3044\u3088\u3046\u306b\r\n# which maxima \u3067 \/usr\/local\/bin\/maxima \u3060\u304b\u3089\u5927\u4e08\u592b\u3068\u306f\u601d\u3046\u3051\u3069\u3002<\/pre>\n<h3><span id=\"i-3\">\u4f7f\u7528\u4f8b<\/span><\/h3>\n<p>Jupyter notebook \u74b0\u5883\u3067\uff0cWeb \u30d6\u30e9\u30a6\u30b6\u3092\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u30fb\u30a8\u30c7\u30a3\u30bf\u306b\u3057\u3066 Maxima \u304c\u4f7f\u3048\u308b\u306e\u306f\u3042\u308a\u304c\u305f\u3044\u3002\u5b9a\u6570\u3084\u95a2\u6570\u306e\u5b9a\u7fa9\uff0c\u63cf\u753b\u7d50\u679c\u3082\u4fdd\u5b58\u3057\u3066\u304a\u3051\u308b\u3057\u306d\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/jupyter\/maxima\/\">Maxima-Jupyter \u306b\u3088\u308b\u6570\u5f0f\u51e6\u7406\u3068\u30b0\u30e9\u30d5\u4f5c\u6210 \u2013 \u5f18\u524d\u5927\u5b66 Home Sweet Home<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\uff0cUbuntu (20.04 LTS) \u306b Ma <a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/1253\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[14,15,12],"tags":[],"class_list":["post-1253","post","type-post","status-publish","format-standard","hentry","category-jupyter","category-maxima","category-ubuntu"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/posts\/1253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/comments?post=1253"}],"version-history":[{"count":5,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/posts\/1253\/revisions"}],"predecessor-version":[{"id":1256,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/posts\/1253\/revisions\/1256"}],"wp:attachment":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/media?parent=1253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/categories?post=1253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/tags?post=1253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}