Skip to content

Commit a8d28bd

Browse files
committed
ECC-1923: build own openjpeg lib as part of binary wheel
1 parent 09f9413 commit a8d28bd

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

scripts/build-linux.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ chmod -R a+w .
1515

1616
pwd
1717

18+
GIT_OPENJPEG=https://github.com/uclouvain/openjpeg
19+
OPENJPEG_VERSION=2.5.2
20+
1821
# To allow the manylinux image to continue to use yum afer EOL. See, for example:
1922
# https://github.com/zanmato1984/arrow/commit/1fe15e06fac23983e5f890c2d749d9ccecd2ca15
2023
# https://github.com/apache/arrow/issues/43119
@@ -24,7 +27,7 @@ sudo sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
2427

2528
source scripts/common.sh
2629

27-
for p in libaec-devel libpng-devel gobject-introspection-devel openjpeg-devel
30+
for p in libaec-devel libpng-devel gobject-introspection-devel
2831
do
2932
sudo yum install -y $p
3033
# There may be a better way
@@ -50,6 +53,21 @@ PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH
5053
PKG_CONFIG_PATH=$TOPDIR/install/lib/pkgconfig:$TOPDIR/install/lib64/pkgconfig:$PKG_CONFIG_PATH
5154
LD_LIBRARY_PATH=$TOPDIR/install/lib:$TOPDIR/install/lib64:$LD_LIBRARY_PATH
5255

56+
# Build openjpeg
57+
# - because the one supplied with 'yum' is built with fast-math, which interferes with Python
58+
59+
[[ -d src/openjpeg ]] || git clone --branch $OPENJPEG_VERSION --depth=1 $GIT_OPENJPEG src/openjpeg
60+
61+
mkdir -p $TOPDIR/build-binaries/openjpeg
62+
cd $TOPDIR/build-binaries/openjpeg
63+
64+
cmake \
65+
$TOPDIR/src/openjpeg/ \
66+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
67+
-DCMAKE_INSTALL_PREFIX=$TOPDIR/install
68+
69+
cd $TOPDIR
70+
cmake --build build-binaries/openjpeg --target install
5371

5472
# Build eccodes
5573

@@ -61,7 +79,10 @@ $TOPDIR/src/ecbuild/bin/ecbuild \
6179
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
6280
-DENABLE_PYTHON=0 \
6381
-DENABLE_BUILD_TOOLS=0 \
82+
-DENABLE_JPG=1 \
6483
-DENABLE_JPG_LIBJASPER=0 \
84+
-DENABLE_JPG_LIBOPENJPEG=1 \
85+
-DOPENJPEG_DIR=$TOPDIR/install \
6586
-DENABLE_MEMFS=1 \
6687
-DENABLE_INSTALL_ECCODES_DEFINITIONS=0 \
6788
-DENABLE_INSTALL_ECCODES_SAMPLES=0 \

0 commit comments

Comments
 (0)