Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for support of newer pythons #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Start by creating a new `conda` environment. Let's call it `fcidecomp`, but
any valid name would do (change the following instructions accordingly):

conda create -n fcidecomp python=$PYTHON_VERSION

where Python versions currently supported by ``fcidecomp`` are 3.7 <= `$PYTHON_VERSION` <= 3.9.

Activate the environment:
Expand All @@ -49,12 +49,33 @@ Once the installation has completed, re-activate the `conda` environment running

conda deactivate
conda activate fcidecomp

This last step ensures the `HDF5_PLUGIN_PATH` environment variable is correctly set to the directory containing the
FCIDECOMP decompression libraries.


## Build and installation from the source code
## Build and local installation of the conda package

This allows to skip the next section

### Prerequisites

Make sure you have a conda environment to work in. Also, `boa` needs to be installed.

### Building

To start the build from the `fcidecomp` directory:

conda mambabuild .

### Installing

To install from the locally build conda package:

mamba install fcidecomp -c local


## Build and installation of the libraries from the source code

### Install pre-requisite packages

Expand All @@ -81,20 +102,20 @@ the ``epel-release`` repository is needed as well, so execute the following:

First, install the software required to build the binaries (common for ``CharLS`` and ``fcidecomp``):

sudo apt install -y git
sudo apt-get install -y cmake gcc=4:9.3.0-1ubuntu2 g++
sudo apt install -y git
sudo apt-get install -y cmake gcc=4:9.3.0-1ubuntu2 g++

Then, let's install some ``fcidecomp``-specific dependency packages:

sudo apt install -y zlib1g-dev libhdf5-dev


### Build CharLS

Next step is to build and install CharLS. `fcidecomp` has been tested with CharLS version ``2.1.0``, so let's
use this one:

git clone -b 2.1.0 https://github.com/team-charls/charls.git && cd charls
git clone -b 2.1.0 https://github.com/team-charls/charls.git && cd charls
mkdir release && cd release
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=On ..
make && sudo make install
Expand All @@ -105,7 +126,7 @@ Now we can build ``fcidecomp`` proper.

Go to one folder up.

Obtain the source code either from the Open Source EUMETSAT repository (set ``FCIDECOMP_TAG`` to the proper
Obtain the source code either from the Open Source EUMETSAT repository (set ``FCIDECOMP_TAG`` to the proper
``fcidecomp`` tag, e.g. `2.0.1`):

git clone -b $FCIDECOMP_TAG https://gitlab.eumetsat.int/open-source/fcidecomp/
Expand All @@ -130,4 +151,3 @@ Finally, set the environment variable ``HDF5_PLUGIN_PATH`` to the install path o
specified above (following the instructions above, it is ``/usr/local/fcidecomp/hdf5/lib/plugin/`` (for Ubuntu20.04)):

export HDF5_PLUGIN_PATH=/usr/local/fcidecomp/hdf5/lib/plugin/

2 changes: 1 addition & 1 deletion conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ cp -r ${PATH_TO_DELIVERY}/fcidecomp/* ${FCIDECOMP_BUILD_PATH}
# ./gen/build.sh fcicomp-H5Zjpegls test
./gen/install.sh fcicomp-H5Zjpegls

pip install --no-deps --ignore-installed -vv ../fcidecomp-python
pip install --no-deps --ignore-installed --use-pep517 -vv ../fcidecomp-python

mkdir -p "${PREFIX}/etc/conda/activate.d"
cp "${RECIPE_DIR}/scripts/activate.sh" "${PREFIX}/etc/conda/activate.d/${PKG_NAME}_activate.sh"
Expand Down
6 changes: 3 additions & 3 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python:
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
14 changes: 5 additions & 9 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# - https://github.com/mraspaud/fcidecomp-conda-recipe/blob/master/build.sh

{% set setup_data = load_setup_py_data(setup_file='../src/fcidecomp-python/setup.py', from_recipe_dir=True) %}
{% set charls_version = "2.1.0" %}
{% set charls_version = "2.4.2" %}

package:
name: fcidecomp
Expand All @@ -25,17 +25,13 @@ requirements:
- make # [not win]
- ninja # [win]
host:
- charls=2.1.0 # [not win32]
- hdf5=1.10.*
- h5py=2.* # [not win]
- h5py=3.6.0 # [win]
- charls>=2.1.0 # [not win32]
- h5py>=3.6.0 # [win]
- python {{ python }}
- zlib
run:
- charls=2.1.0 # [not win32]
- hdf5=1.10.*
- h5py=2.* # [not win]
- h5py=3.6.0 # [win]
- charls>=2.1.0 # [not win32]
- h5py>=3.6.0 # [win]
- libnetcdf!=4.8.0 # [win]
- libssh2 # [win]
- netcdf4
Expand Down
9 changes: 5 additions & 4 deletions src/fcidecomp-python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@

setup(
name='fcidecomp-python',
version=version,
version="2.0.1",
#version=version,
description="FCIDECOMP Python plugin",
long_description=readme,
author="B-Open Solutions srl",
Expand All @@ -59,8 +60,8 @@
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
)