Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aksnzhy committed Sep 9, 2018
1 parent 5c21d02 commit e3f2281
Showing 1 changed file with 56 additions and 51 deletions.
107 changes: 56 additions & 51 deletions install/index.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
Installation Guide
----------------------------------

For now, xLearn can support both Linux and Mac OS X. We will support it on the Windows platform in the near
future. This page gives instructions on how to build and install the xLearn package using pip and how to build
For now, xLearn can support both Linux and Mac OS X. We will support it on Windows platform in the near
future. This page gives instructions on how to build and install the xLearn using ``pip`` and how to build
it from source code. No matter what way you choose, make sure that your OS has already installed ``GCC`` or ``Clang``
(with the support of ``C++ 11``) and ``CMake``.

Install GCC or Clang
^^^^^^^^^^^^^^^^^^^^^^^^

If you have already installed your C++ compiler before, you can skip this step.
*If you have already installed your C++ compiler before, you can skip this step.*

* On Cygwin, run ``setup.exe`` and install ``gcc`` and ``binutils``.
* On Debian/Ubuntu Linux, type the command: ::

sudo apt-get install gcc binutils

to install GCC (or Clang) by using ::
to install GCC (or Clang) by using: ::

sudo apt-get install clang

* On FreeBSD, type the following command to install Clang ::
* On FreeBSD, type the following command to install Clang: ::

sudo pkg_add -r clang

Expand All @@ -30,9 +30,7 @@ If you have already installed your C++ compiler before, you can skip this step.
Install CMake
^^^^^^^^^^^^^^^^^^^^^^^^

If you have already installed CMake before, you can skip this step.

To install CMake from binary packages:
*If you have already installed CMake before, you can skip this step.*

* On Cygwin, run ``setup.exe`` and install cmake.
* On Debian/Ubuntu Linux, type the command to install cmake: ::
Expand All @@ -43,85 +41,92 @@ To install CMake from binary packages:
sudo pkg_add -r cmake

On Mac OS X, if you have ``homebrew``, you can use the command ::
On Mac OS X, if you have ``homebrew``, you can use the command: ::

brew install cmake

or if you have ``MacPorts``, run ::
or if you have ``MacPorts``, run: ::

sudo port install cmake

You won't want to have both Homebrew and MacPorts installed.

Install xLearn from Source Code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Install xLearn from pip
^^^^^^^^^^^^^^^^^^^^^^^^

The easiest way to install xLearn Python package is to use ``pip``. The following command will
download the xLearn source code from pip and install Python package locally. ::
Building xLearn from source code consists two steps:

sudo pip install xlearn
First, you need to build the executable files (``xlearn_train`` and ``xlearn_predict``), as well as the
shared library (``libxlearn_api.so`` for Linux or ``libxlearn_api.dylib`` for Mac OSX) from the C++ code. After that, users need to install the xLearn Python Package.

The installation process will take a while to complete. After that, you can type the following script
in your python shell to check whether the xLearn has been installed successfully:
Build from Source Code
=======================

>>> import xlearn as xl
>>> xl.hello()
Users need to clone the code from github: ::

You will see: ::
git clone https://github.com/aksnzhy/xlearn.git

-------------------------------------------------------------------------
_
| |
__ _| | ___ __ _ _ __ _ __
\ \/ / | / _ \/ _` | '__| '_ \
> <| |___| __/ (_| | | | | | |
/_/\_\_____/\___|\__,_|_| |_| |_|
cd xlearn
mkdir build
cd build
cmake ../
make

xLearn -- 0.31 Version --
-------------------------------------------------------------------------
If the building is successful, users can find two executable files (``xlearn_train`` and ``xlearn_predict``) in the ``build`` path. Users can test the installation by using the following command: ::

If you want to build the latest code from `Github`__, or you want to use the xLearn command line
instead of the Python API, you can see how to build xLearn from source code as follow. *We highly
recommend that you can build xLearn from source code.*
./run_example.sh

.. __: https://github.com/aksnzhy/xlearn
Install Python Package
=======================

Install xLearn from Source Code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Then, you can install the Python package through ``install-python.sh``: ::

Building xLearn from source code consists two steps.
cd python-package
sudo ./install-python.sh

First, you need to build the executable files (``xlearn_train`` and ``xlearn_predict``), as well as the
shared library (``libxlearn_api.so`` for Linux or ``libxlearn_api.dylib`` for Mac OSX) from the C++ code.
You can also test the Python package by using the following command: ::

Then, you can install the Python package through ``install-python.sh``.
cd ../
python test_python.py

Fortunately, we write a script ``build.sh`` to do all the cumbersome work for users.
One-Button Building
=======================

You just need to clone the code from github ::
We have already write a script ``build.sh`` to do all the cumbersome work for users, and users can just use the folloing commands: ::

git clone https://github.com/aksnzhy/xlearn.git

and then build xLearn using the folloing commands: ::

cd xlearn
sudo ./build.sh

You may be asked to input your password during installation.

Test Your Building
Install xLearn from pip
^^^^^^^^^^^^^^^^^^^^^^^^

Now you can test your installation by using the following command: ::
The easiest way to install xLearn Python package is to use ``pip``. The following command will
download the xLearn source code from pip and install Python package locally. You must make sure that you have already installed C++11 and CMake in your local machine ::

sudo pip install xlearn

cd build
./run_example.sh
The installation process will take a while to complete. After that, you can type the following script in your python shell to check whether the xLearn has been installed successfully: ::

You can also test the Python package by using the following command: ::
>>> import xlearn as xl
>>> xl.hello()

You will see if the installation is successful: ::

-------------------------------------------------------------------------
_
| |
__ _| | ___ __ _ _ __ _ __
\ \/ / | / _ \/ _` | '__| '_ \
> <| |___| __/ (_| | | | | | |
/_/\_\_____/\___|\__,_|_| |_| |_|

xLearn -- 0.31 Version --
-------------------------------------------------------------------------

cd python-package/test
python test_python.py

Install R Package
^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit e3f2281

Please sign in to comment.