Skip to content

Commit

Permalink
Moved and updated the manual build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
rbotzer committed Dec 17, 2021
1 parent 108fe90 commit e82105f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 108 deletions.
67 changes: 38 additions & 29 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,83 @@
# Manually Building the Python Client for Aerospike

The Python client for Aerospike works with Python 3.6, 3.7, 3.8, 3.9 running on
**64-bit** macOS 10.15+ and Linux.
Python 3.6 hits [End of Life](https://endoflife.date/python) on December 23rd,
2021, and is now deprecated.

First clone this repository to get the necessary files.

## Dependencies
`git clone --recurse-submodules ...`

The Python client for Aerospike works with Python 3.6, 3.7, 3.8, 3.9 running on
**64-bit** OS X 10.9+ and Linux.
or to initialize the submodules after cloning

`git submodule update --init --checkout --recursive`

## Dependencies

The client depends on:

- The Python devel package
- OpenSSL
- OpenSSL 1.1 >= 1.1.1
- The Aerospike C client

### RedHat 6+ and CentOS 6+
### RedHat 7+ and CentOS 7+

The following are dependencies for:

- RedHat Enterprise (RHEL) 6 or newer
- CentOS 6 or newer
- RedHat Enterprise (RHEL) 7 or newer
- CentOS 7 or newer
- Related distributions which use the `yum` package manager

```sh
sudo yum install openssl-devel
sudo yum install python26-devel # on CentOS 6 and similar
sudo yum install python-devel # on CentOS 7
# Possibly needed
sudo yum install python-setuptools
```

To get `python26-devel` on older distros such as CentOS 5, see [Stack Overflow](http://stackoverflow.com/a/11684053/582436).

### Debian 6+ and Ubuntu 14.04+
### Debian 8+ and Ubuntu 18.04+

The following are dependencies for:

- Debian 6 or newer
- Ubuntu 14.04 or newer
- Debian 8 or newer
- Ubuntu 18.04 or newer
- Related distributions which use the `apt` package manager

```sh
sudo apt-get install libssl-dev
sudo apt-get install build-essential python-dev
```

### OS X
### macOS

By default OS X will be missing command line tools. On Mavericks (OS X 10.9)
and higher those [can be installed without Xcode](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/).
By default macOS will be missing command line tools.

xcode-select --install # install the command line tools, if missing

The dependencies can be installed through the OS X package manager [Homebrew](http://brew.sh/).
The dependencies can be installed through the macOS package manager [Homebrew](http://brew.sh/).

brew install openssl@1.1
brew install openssl@1
# brew uninstall openssl@3

## Build

To build the library:

if repo is not cloned with "git clone --recurse-submodules ...", run the following command to initialize necessary sub-modules:
git submodule update --init --checkout --recursive
export DOWNLOAD_C_CLIENT=0
export AEROSPIKE_C_HOME=$(pwd)/aerospike-client-c
export STATIC_SSL=1
# substitute the paths to your OpenSSL 1.1 library
export SSL_LIB_PATH=/usr/local/Cellar/openssl@1.1/1.1.1l/lib/
export CPATH=/usr/local/Cellar/openssl@1.1/1.1.1l/include/
python setup.py build --force

### Troubleshooting OS X builds
### Troubleshooting macOS

Building on OS X versions >= 10.11 , may cause a few additional errors to be generated. If the build command fails with an
In some versions of macOS, Python 2.7 is installed as ``python`` with
``pip`` as its associated package manager, and Python 3 is installed as ``python3``
with ``pip3`` as the associated package manager. Make sure to use the ones that
map to Python 3, such as `python3 setup.py build --force`.

Building on macOS versions >= 10.15 , may cause a few additional errors to be generated. If the build command fails with an
error similar to: `error: could not create '/usr/local/aerospike/lua': Permission denied` there are a couple of options:

- Rerun the build command with the additional command line flags `--user --prefix=` *Note that there are no charcters after the '='.* This will cause the library to only be installed for the current user, and store the library's data files in a user specific location.
Expand All @@ -80,14 +92,11 @@ MACOSX_DEPLOYMENT_TARGET=10.12 python setup.py install --force

## Install

To install the library:
Once the client is built:

python setup.py install --force

### Troubleshooting OS X Installation

Installing on OS X versions >= 10.11 , may cause a few additional errors to be generated. If the install command fails with an
error similar to: `error: could not create '/usr/local/aerospike/lua': Permission denied` there are a couple of options:
### Troubleshooting macOS

- Rerun the install command with the additional command line flags `--user --prefix=` *Note that there are no charcters after the '='.* This will cause the library to only be installed for the current user, and store the library's data files in a user specific location.
- rerun the command with sudo.
Expand Down
108 changes: 29 additions & 79 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,121 +12,71 @@ Compatibility
-------------

The Python client for Aerospike works with Python 3.6, 3.7, 3.8, 3.9 running on
**64-bit** OS X 10.9+ and Linux.
**64-bit** macOS 10.15+ and Linux (RHEL/CentOS 7 & 8; Debian 8, 9 & 10; Ubuntu
18.04 & 20.04).

Python 3.6 hits `End of Life <https://endoflife.date/python>`__ on December 23rd,
2021, and is now deprecated.

NOTE: Aerospike Python client 5.0.0 and up MUST be used with Aerospike server 4.9 or later.
**NOTE:** Aerospike Python client 5.0.0 and up MUST be used with Aerospike server 4.9 or later.
If you see the error "-10, ‘Failed to connect’", please make sure you are using server 4.9 or later.


Dependencies
------------

The following dependencies only apply to installations that build from source
on linux, or OS X installations.
For client>=3.8.0 and pip>=19.0 on linux platforms, can skip to "Install" section.

The client depends on:

- Python devel package
- OpenSSL
- The Aerospike C client

RedHat 6+ and CentOS 6+
~~~~~~~~~~~~~~~~~~~~~~~

The following are dependencies for:

- RedHat Enterprise (RHEL) 6 or newer
- CentOS 6 or newer
- Related distributions which use the ``yum`` package manager

::

sudo yum install python-devel
sudo yum install openssl-devel

Debian 6+ and Ubuntu 14.04+
~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following are dependencies for:

- Debian 6 or newer
- Ubuntu 14.04 or newer
- Related distributions which use the ``apt`` package manager

::

sudo apt-get install python-dev
sudo apt-get install libssl-dev

- You may also need libz:

::

sudo apt-get install zlib1g-dev

OS X
~~~~~~~~

By default OS X will be missing command line tools. On Mavericks (OS X 10.9)
and higher those `can be installed without Xcode <http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/>`__.
Install
-------

::

xcode-select --install # install the command line tools, if missing

OpenSSL can be installed through the `Homebrew <http://brew.sh/>`__ OS X package
manager.
pip install aerospike

::
In most cases ``pip`` will install a precompiled binary (wheel) matching your OS
and version of Python. If a matching wheel isn't found it, or the
``--install-option`` argument is provided, pip will build the Python client
from source.

brew install openssl
Please see the `build instructions <https://github.com/aerospike/aerospike-client-python/blob/master/BUILD.md>`__
for more.

Install
-------

Aerospike Python Client can be installed using ``pip``:
Troubleshooting
~~~~~~~~~~~~~~~

::

pip install aerospike

# client >=3.8.0 will attempt a manylinux2010 wheel installation for linux distros
# client >=3.8.0 will attempt a manylinux wheel installation for Linux distros
# to force a pip install from source:
pip install aerospike --no-binary :all:

# to troubleshoot pip versions >= 6.0 you can
pip install --no-cache-dir aerospike

# to trouleshoot installation on OS X El-Capitan (10.11) or OS X Sierra (10.12)
pip install --no-cache-dir --user aerospike

If you run into trouble installing the client on a supported OS, you may be
using an outdated ``pip``.
Versions of ``pip`` older than 7.0.0 should be upgraded, as well as versions of
``setuptools`` older than 18.0.0.


OS X Installation
~~~~~~~~~~~~~~~~~~
Upgrading ``pip`` on OS X El-Capitan (10.11) or OS X Sierra(10.12)
runs into `SIP issues <https://apple.stackexchange.com/questions/209572/how-to-use-pip-after-the-el-capitan-max-os-x-upgrade>`__
with ``pip install --user aerospike`` as the recommended workaround to install aerospike on those versions of OS X.
Troubleshooting macOS
~~~~~~~~~~~~~~~~~~~~~

In some versions of macOS, Python 2.7 is installed as ``python`` with
``pip`` as its associated package manager, and Python 3 is installed as ``python3``
with ``pip3`` as the associated package manager. Make sure to use the ones that
map to Python 3, such as ``pip3 install aerospike``.

Attempting to install the client with pip for the system default Python may cause permissions issues when copying necessary files. In order to avoid
those issues the client can be installed for the current user only with the command: ``pip install --user aerospike``

If the version of Python is not in the officially supported list, or the ``--install-option`` argument is provided, pip will attempt to compile the client from source. Please see the `build directions in the GitHub repository <https://github.com/aerospike/aerospike-client-python/blob/master/BUILD.md>`__
to troubleshoot any issues caused by compiling the client.
::

# to trouleshoot installation on macOS try
pip install --no-cache-dir --user aerospike


Build
-----

For instructions on manually building the Python client, please refer to the
``BUILD.md`` file in this repo.
For instructions on manually building the Python client, please refer to
`BUILD.md <https://github.com/aerospike/aerospike-client-python/blob/master/BUILD.md>`__.

Documentation
-------------
Expand Down

0 comments on commit e82105f

Please sign in to comment.