Installation ============ Stable release -------------- Python ~~~~~~ To install ``abess`` on Python, you can simply get the stable version with: .. code:: bash $ pip install abess If you don't have `pip `__ installed, this `Python installation guide `__ can guide you through the process. R ~~~~~~ To install stable version into R environment, run the command: .. code:: r install.packages("abess") Latest version -------------- This page gives instructions on how to build and install ``abess`` from the source code. If the instructions do not help for you, please feel free to ask questions by opening an `issue `__. First of all, clone our the latest `github project `__ by `Git `__ to your device: .. code:: bash $ git clone https://github.com/abess-team/abess.git $ cd abess Next, there have different processing depend on the programming langulage you prefer. .. _python-1: Python ~~~~~~ Before installing ``abess`` from source, some compiling tools should be installed first, which may be a little different in different platforms: - `cmake `__: control the software compilation process. Make sure it has been added into PATH, which means it can be called on the command line like ``cmake --version``. - `pybind11 `__: create Python bindings of existing C++ code. If you want to install from PyPI, please use ``pip install "pybind11[global]"``. - For **Linux** and **MacOS** user, please download and install `GCC `__. - For **Windows** user, please download `Microsoft C++ Build Tools `__, and then install the "Desktop development with C++" module inside. After that, we can manually install ``abess`` by conducting command: .. code:: bash $ cd ./python $ pip install . or .. code:: bash $ cd ./python $ python setup.py install --user If it finishes with ``Finished processing dependencies for abess``, the installation is successful. Alternatively, if you would like to develop ``abess``, install ``abess`` in `editable mode `__ (it is very convenient for development): .. code:: bash $ cd ./python $ pip install -e . or .. code:: bash $ cd ./python $ python setup.py develop --user Note that some may meet "Permission denied" problem like `this issue `__ when installing with ``pip install -e .``. There are three solutions: 1. run the command as administrator; 2. feel free to use ``python setup.py develop --user`` instead; 3. try to edit ``setup.py`` like `here `__ (not recommend). .. _r-1: R ~ To install the development version, some dependencies need to be installed. Before installing ``abess``, some dependencies should be installed first, which may be a little different in different platforms: - **Linux**: ``$ sudo apt install autoconf`` (for Ubuntu, other Linux systems are similar); - **Windows**: install `Rtools `__. - **MacOS**: ``$ brew install autoconf``. Then, you need to install R library dependencies ``Rcpp`` and ``RcppEigen`` via conducting ``install.packages(c("Rcpp", "RcppEigen"))`` in R console. After installing dependencies, run the following code in terminal/bash: .. code:: bash cd R-package autoreconf R CMD INSTALL . If it finishes with ``* DONE (abess)``, the installation is successful. Dependencies -------------- C++ ~~~ Our core C++ code is based on some dependencies: - `Eigen `__ (version 3.3.4): a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. - `Spectra `__ (version 1.0.0): a header-only C++ library for large scale eigenvalue problems. They would be automatically included while installing the ``abess`` packages. OpenMP ^^^^^^ To support OpenMP parallelism in Cpp, the dependence for OpenMP should be install. Actually, many compliers and tools have supported and you can check `here `__. What is more, if you receive a warning like “*Unknown option ‘-fopenmp’*” while installing abess, it means that OpenMP has not been enabled. Without OpenMP, abess only use a single CPU core, leading to suboptimal learning speed. To enable OpenMP: - In Windows, `Visual C++ `__ or many other C++ compliers can support OpenMP API, but you may need to enable it manually in additional features (based on the complier you use). - In Linux, the dependence would be supported if GCC is installed (version 4.2+). - In MacOS, the dependence can be installed by: .. code:: bash $ brew install llvm $ brew install libomp .. _python-2: Python ~~~~~~ Some `basic Python packages `__ are required for ``abess``. Actually, they can be found on ``abess/python/setup.py`` and automatically installed during the installation. - `pybind11 `__: seamless operability between C++11 and Python - `numpy `__: the fundamental package for array computing with Python. - `scipy `__: work with NumPy arrays, and provides many user-friendly and efficient numerical routines. - `scikit-learn `__: a Python module for machine learning built on top of SciPy. - `pandas `__: support data manipulation and input. Furthermore, if you want to develop the Python packages, some additional packages should be installed: - `pytest `__: simple powerful testing with Python. - `lifelines `__: support testing for survival analysis. - `Sphinx `__: develop the Python documentation. - `sphinx-rtd-theme `__: “Read the Docs” theme for Sphinx. - `sphinix-gallery `__: develop the gallery of Python examples. .. - `pandas `__: .. support data manipulation in Tutorials and Testing. .. _r-2: R ~ The R version should be 3.1.0 and newer in order to support C++11. ``abess`` R package relies on limited R packages dependencies: - `Rcpp `__: convert R Matrix/Vector object into C++. - `RcppEigen `__: linear algebra in C++. Furthermore, if you would to develop the R package, it would be better to additionally install: - `testthat `__: conduct unit tests. - `roxygen2 `__: write R documentations. - `knitr `__ and `rmarkdown `__: write tutorials for R package. - `pkgdown `__: build website for the ``abess`` R package.