Skip to content

Commit 9fca8d8

Browse files
authored
BIGTOP-3964: Add isal installation in bigtop toolchain and use isal library when compiling hadoop (#1142)
1 parent d2a4e55 commit 9fca8d8

File tree

5 files changed

+53
-7
lines changed

5 files changed

+53
-7
lines changed

bigtop-packages/src/common/hadoop/do-component-build

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ if [ -z "$BUNDLE_SNAPPY" ] ; then
119119
[ -f /usr/lib64/libsnappy.so ] && BUNDLE_SNAPPY="-Dsnappy.prefix=x -Dbundle.snappy=true -Dsnappy.lib=/usr/lib64"
120120
[ -f /usr/lib/${HOSTTYPE}-linux-gnu/libsnappy.so ] && BUNDLE_SNAPPY="-Dsnappy.prefix=x -Dbundle.snappy=true -Dsnappy.lib=/usr/lib/${HOSTTYPE}-linux-gnu"
121121
fi
122-
122+
if [ -z "$BUNDLE_ISAL" ] ; then
123+
[ -f /usr/lib/libisal.so ] && BUNDLE_ISAL="-Dbundle.isal=true -Disal.lib=/usr/lib"
124+
[ -f /usr/lib64/libisal.so ] && BUNDLE_ISAL="-Dbundle.isal=true -Disal.lib=/usr/lib64"
125+
[ -f /usr/local/lib/libisal.so ] && BUNDLE_ISAL="-Dbundle.isal=true -Disal.lib=/usr/local/lib/"
126+
[ -f /usr/lib/${HOSTTYPE}-linux-gnu/libisal.so ] && BUNDLE_ISAL="-Dbundle.isal=true -Disal.lib=/usr/lib/${HOSTTYPE}-linux-gnu"
127+
fi
123128
mkdir build
124129
mkdir build/src
125130

@@ -133,7 +138,7 @@ MAVEN_OPTS+="-DskipTests -DskipITs "
133138
. $(dirname ${0})/maven_deploy.sh
134139

135140
# Build artifacts
136-
mvn $BUNDLE_SNAPPY -Pdist -Pnative -Psrc -Pyarn-ui -Dtar ${MAVEN_OPTS} install ${EXTRA_GOALS} "$@"
141+
mvn $BUNDLE_SNAPPY $BUNDLE_ISAL -Pdist -Pnative -Psrc -Pyarn-ui -Dtar ${MAVEN_OPTS} install ${EXTRA_GOALS} "$@"
137142
mvn site site:stage ${MAVEN_OPTS} $@
138143

139144
(cd build ; tar --strip-components=1 -xzvf ../hadoop-dist/target/hadoop-${HADOOP_VERSION}.tar.gz)

bigtop-packages/src/common/hadoop/install_hadoop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ cp ${BUILD_DIR}/include/hdfs.h $PREFIX/$SYSTEM_INCLUDE_DIR/
275275
cp -r ${BUILD_DIR}/include/hdfspp $PREFIX/$SYSTEM_INCLUDE_DIR/
276276

277277
cp ${BUILD_DIR}/lib/native/*.a $PREFIX/$HADOOP_NATIVE_LIB_DIR/
278-
for library in `cd ${BUILD_DIR}/lib/native ; ls libsnappy.so.1.* 2>/dev/null` libhadoop.so.1.0.0 libnativetask.so.1.0.0; do
278+
for library in `cd ${BUILD_DIR}/lib/native ; ls libsnappy.so.1.* 2>/dev/null; ls libisal.so.2.* 2>/dev/null` libhadoop.so.1.0.0 libnativetask.so.1.0.0; do
279279
cp ${BUILD_DIR}/lib/native/${library} $PREFIX/$HADOOP_NATIVE_LIB_DIR/
280280
ldconfig -vlN $PREFIX/$HADOOP_NATIVE_LIB_DIR/${library}
281281
ln -s ${library} $PREFIX/$HADOOP_NATIVE_LIB_DIR/${library/.so.*/}.so

bigtop_toolchain/manifests/installer.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
include bigtop_toolchain::user
2626
include bigtop_toolchain::renv
2727
include bigtop_toolchain::grpc
28+
include bigtop_toolchain::isal
2829
Class['bigtop_toolchain::jdk11']->Class['bigtop_toolchain::jdk']
2930

3031
case $::operatingsystem {

bigtop_toolchain/manifests/isal.pp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
class bigtop_toolchain::isal {
16+
require bigtop_toolchain::packages
17+
$url = "https://github.com/intel/isa-l/archive/refs/tags/v2.29.0.tar.gz"
18+
$isal = "v2.29.0.tar.gz"
19+
$isaldir = "isa-l-2.29.0"
20+
exec { "download isal":
21+
cwd => "/usr/src",
22+
command => "/usr/bin/wget $url && mkdir -p $isaldir && /bin/tar -xvzf $isal -C $isaldir --strip-components=1",
23+
creates => "/usr/src/$isaldir",
24+
}
25+
exec { "install isal":
26+
cwd => "/usr/src/$isaldir",
27+
command => "/usr/src/$isaldir/autogen.sh && /usr/src/$isaldir/configure --prefix=/usr/local && /usr/bin/make && /usr/bin/make install",
28+
creates => "/usr/local/bin/$isaldir",
29+
require => EXEC["download isal"],
30+
timeout => 3000
31+
}
32+
}

bigtop_toolchain/manifests/packages.pp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
"libffi-devel",
6464
"krb5-devel",
6565
"net-tools",
66-
"perl-Digest-SHA"
66+
"perl-Digest-SHA",
67+
"nasm",
68+
"yasm"
6769
]
6870

6971
if ($operatingsystem == 'Fedora' or $operatingsystemmajrelease !~ /^[0-7]$/) {
@@ -118,7 +120,9 @@
118120
"libffi48-devel",
119121
"texlive-latex-bin-bin",
120122
"libapr1",
121-
"libapr1-devel"
123+
"libapr1-devel",
124+
"nasm",
125+
"yasm"
122126
]
123127
# fix package dependencies: BIGTOP-2120 and BIGTOP-2152 and BIGTOP-2471
124128
exec { '/usr/bin/zypper -n install --force-resolution krb5 libopenssl-devel libxml2-devel libxslt-devel boost-devel':
@@ -149,7 +153,9 @@
149153
"snappy-devel",
150154
"libzstd-devel",
151155
"bzip2-devel",
152-
"libffi-devel"
156+
"libffi-devel",
157+
"nasm",
158+
"yasm"
153159
] }
154160
/(Ubuntu|Debian)/: {
155161
$_pkgs = [
@@ -209,7 +215,9 @@
209215
"python-setuptools",
210216
"libffi-dev",
211217
"python3-dev",
212-
"python2.7-dev"
218+
"python2.7-dev",
219+
"nasm",
220+
"yasm"
213221
]
214222
if (($operatingsystem == 'Ubuntu' and 0 <= versioncmp($operatingsystemmajrelease, '22.04'))) {
215223
file { '/usr/bin/python':

0 commit comments

Comments
 (0)