diff --git a/README.md b/README.md index 78ef0751..fa4e8103 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ First clone the repository, and move into that directory git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git cd ./xeus-cpp ``` -The safest usage of xeus-cpp is to build and install it within a clean environment named `xeus-cpp`. You can create and activate this environment +The safest usage of xeus-cpp from source is to build and install it within a clean environment named `xeus-cpp`. You can create and activate this environment with mamba by executing the following ```bash mamba create -n "xeus-cpp" diff --git a/docs/source/InstallationAndUsage.rst b/docs/source/InstallationAndUsage.rst index 2a2912c3..fd26fce9 100644 --- a/docs/source/InstallationAndUsage.rst +++ b/docs/source/InstallationAndUsage.rst @@ -1,31 +1,54 @@ -InstallationAndUsage +Installation And Usage -------------------- -You will first need to install dependencies. +Installation from source +======================== + +To ensure that the installation works, it is preferable to install `xeus-cpp` in a +fresh environment. It is also needed to use a miniforge or miniconda installation +because with the full Anaconda installation you may have a conflict with the `zeromq` +library which is already installed in the anaconda distribution. First clone the +repository, and move into that directory .. code-block:: bash - mamba install cmake cxx-compiler xeus-zmq nlohmann_json cppzmq xtl jupyterlab - clangdev=16 cpp-argparse pugixml -c conda-forge + git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git + cd ./xeus-cpp + +The safest usage of xeus-cpp from source is to build and install it within a +clean environment named `xeus-cpp`. You can create and activate +this environment with mamba by executing the following +.. code-block:: bash -**Note:** Use a mamba environment with python version >= 3.11 for fetching clang-versions. + mamba create -n "xeus-cpp" + source activate "xeus-cpp" -The safest usage is to create an environment named `xeus-cpp`. +We will now install the dependencies needed to compile xeux-cpp from source within +this environment by executing the following .. code-block:: bash - mamba create -n xeus-cpp - source activate xeus-cpp + mamba install notebook cmake cxx-compiler xeus-zmq nlohmann_json=3.11.2 cppzmq + xtl jupyterlab CppInterOp cpp-argparse<3.1 pugixml doctest -c conda-forge -Installing from conda-forge: -Then you can install in this environment `xeus-cpp` and its dependencies. +Now you can compile the kernel from the source by executing (replace `$CONDA_PREFIX` +with a custom installation prefix if need be) .. code-block:: bash - mamba install xeus-cpp notebook -c conda-forge - mkdir build && cd build - cmake .. -D CMAKE_PREFIX_PATH=$CONDA_PREFIX - -D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX -D CMAKE_INSTALL_LIBDIR=lib - make && make install \ No newline at end of file + cmake .. -D CMAKE_PREFIX_PATH=$CONDA_PREFIX -D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX + -D CMAKE_INSTALL_LIBDIR=lib + make && make install + +Installing from conda-forge +=========================== + +If you have conda installed then you can install xeus-cpp using the follwing command + +.. code-block:: bash + + conda install conda-forge::xeus-cpp + +Xeus-cpp is available for Linux, MacOS and Windows. \ No newline at end of file