From 815f038babbee6943cd9dd52059f89ff458b4dd3 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Mon, 8 Jul 2024 19:37:56 +0530 Subject: [PATCH 1/2] Minor docs & env updates on the Jupyter kernel --- appveyor.yml | 2 +- ci/azure_install_macos.sh | 2 +- doc/src/installation.md | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a12bb34a57..11e3ac655c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,7 @@ build_script: - call conda config --set always_yes yes --set changeps1 no - call conda info -a - call conda update -q conda -- call conda install -c conda-forge python=3.7 re2c m2-bison xonsh llvmdev=11.1.0 jupyter xeus=1.0.1 xtl nlohmann_json cppzmq jupyter_kernel_test pytest +- call conda install -c conda-forge python=3.8 re2c bison=3.4 m4 xonsh=0.16.0 llvmdev=11.0.1 toml cmake=3.17.0 jupyter pytest xeus=5.1.0 xeus-zmq=3.0.0 nlohmann_json=3.11.3 jupyter_kernel_test - set CONDA_PREFIX=C:\\Miniconda37-x64 - set WIN=1 - set MACOS=0 diff --git a/ci/azure_install_macos.sh b/ci/azure_install_macos.sh index 5012f14ae7..0f4af45658 100755 --- a/ci/azure_install_macos.sh +++ b/ci/azure_install_macos.sh @@ -5,7 +5,7 @@ set -ex conda config --set always_yes yes --set changeps1 no conda info -a conda update -q conda -conda install -c conda-forge python=3.8 re2c bison=3.4 m4 xonsh llvmdev=11.0.1 toml cmake=3.17.0 jupyter pytest xeus=1.0.1 xtl nlohmann_json cppzmq jupyter_kernel_test +conda install -c conda-forge python=3.8 re2c bison=3.4 m4 xonsh=0.16.0 llvmdev=11.0.1 toml cmake=3.17.0 jupyter pytest xeus=5.1.0 xeus-zmq=3.0.0 nlohmann_json=3.11.3 jupyter_kernel_test export MACOSX_DEPLOYMENT_TARGET="10.12" export CONDA_PREFIX=/usr/local/miniconda export LFORTRAN_CMAKE_GENERATOR="Unix Makefiles" diff --git a/doc/src/installation.md b/doc/src/installation.md index bc02241cab..38916e2592 100644 --- a/doc/src/installation.md +++ b/doc/src/installation.md @@ -185,6 +185,38 @@ You can run the following examples manually in a terminal: ./src/bin/lpython --show-c examples/expr2.py ``` +## Enabling the Jupyter Kernel + +To install the Jupyter kernel, install the following Conda packages also: +``` +conda install xeus=5.1.0 xeus-zmq=3.0.0 nlohmann_json +``` +and enable the kernel by `-DWITH_XEUS=yes` and install into `$CONDA_PREFIX`. For +example: +``` +cmake \ + -DCMAKE_BUILD_TYPE=Debug \ + -DWITH_LLVM=yes \ + -DWITH_XEUS=yes \ + -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ + -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \ + . +cmake --build . -j4 --target install +``` +To use it, install Jupyter (`conda install jupyter`) and test that the LPython +kernel was found: +``` +jupyter kernelspec list --json +``` +Then launch a Jupyter notebook as follows: +``` +jupyter notebook +``` +Click `New->Python`. To launch a terminal jupyter LPython console: +``` +jupyter console --kernel=python +``` + ## Found a bug? Please report any bugs you find at our issue tracker [here](https://github.com/lcompilers/lpython/issues). Or, even better, fork the repository on GitHub and create a Pull Request (PR). From f20705992cb4de55c6b9b2b9011d87294d3117a0 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Tue, 9 Jul 2024 00:51:43 +0530 Subject: [PATCH 2/2] removed some files --- appveyor.yml | 24 ------------------------ ci/azure_install_macos.sh | 14 -------------- doc/src/installation.md | 10 +++++----- 3 files changed, 5 insertions(+), 43 deletions(-) delete mode 100644 appveyor.yml delete mode 100755 ci/azure_install_macos.sh diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 11e3ac655c..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,24 +0,0 @@ -image: Visual Studio 2017 -# List of preinstalled software in the image: -# https://www.appveyor.com/docs/windows-images-software/ - -build_script: -- set CONDA_INSTALL_LOCN=C:\\Miniconda37-x64 -- call %CONDA_INSTALL_LOCN%\Scripts\activate.bat -- call conda config --set always_yes yes --set changeps1 no -- call conda info -a -- call conda update -q conda -- call conda install -c conda-forge python=3.8 re2c bison=3.4 m4 xonsh=0.16.0 llvmdev=11.0.1 toml cmake=3.17.0 jupyter pytest xeus=5.1.0 xeus-zmq=3.0.0 nlohmann_json=3.11.3 jupyter_kernel_test -- set CONDA_PREFIX=C:\\Miniconda37-x64 -- set WIN=1 -- set MACOS=0 -#- set LFORTRAN_CMAKE_GENERATOR=Visual Studio 15 2017 Win64 -- set LFORTRAN_CMAKE_GENERATOR=Ninja -- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd" -arch=x64 -- xonsh ci\build.xsh - -# Uncomment the following two lines to be able to login to the build worker. You -# can use the `remmina` program in Ubuntu, use the login information that the -# line below prints into the log. -#on_finish: -#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) diff --git a/ci/azure_install_macos.sh b/ci/azure_install_macos.sh deleted file mode 100755 index 0f4af45658..0000000000 --- a/ci/azure_install_macos.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -conda config --set always_yes yes --set changeps1 no -conda info -a -conda update -q conda -conda install -c conda-forge python=3.8 re2c bison=3.4 m4 xonsh=0.16.0 llvmdev=11.0.1 toml cmake=3.17.0 jupyter pytest xeus=5.1.0 xeus-zmq=3.0.0 nlohmann_json=3.11.3 jupyter_kernel_test -export MACOSX_DEPLOYMENT_TARGET="10.12" -export CONDA_PREFIX=/usr/local/miniconda -export LFORTRAN_CMAKE_GENERATOR="Unix Makefiles" -export WIN=0 -export MACOS=1 -xonsh ci/build.xsh diff --git a/doc/src/installation.md b/doc/src/installation.md index 38916e2592..dff2027ff7 100644 --- a/doc/src/installation.md +++ b/doc/src/installation.md @@ -194,14 +194,14 @@ conda install xeus=5.1.0 xeus-zmq=3.0.0 nlohmann_json and enable the kernel by `-DWITH_XEUS=yes` and install into `$CONDA_PREFIX`. For example: ``` -cmake \ +cmake . -GNinja \ -DCMAKE_BUILD_TYPE=Debug \ -DWITH_LLVM=yes \ -DWITH_XEUS=yes \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \ - -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \ + -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" . -cmake --build . -j4 --target install +ninja install ``` To use it, install Jupyter (`conda install jupyter`) and test that the LPython kernel was found: @@ -212,9 +212,9 @@ Then launch a Jupyter notebook as follows: ``` jupyter notebook ``` -Click `New->Python`. To launch a terminal jupyter LPython console: +Click `New->LPython`. To launch a terminal jupyter LPython console: ``` -jupyter console --kernel=python +jupyter console --kernel=lpython ``` ## Found a bug?