You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by sumory <gi...@git.apache.org> on 2017/12/18 02:27:16 UTC
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
GitHub user sumory opened a pull request:
https://github.com/apache/incubator-trafodion/pull/1353
[TRAFODION-2802] Prepare the build environment with one command
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sumory/incubator-trafodion fix-2802
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-trafodion/pull/1353.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1353
----
commit d1f1db6e922994a6292e7a7ba119e91813c4692b
Author: sumory.wu <su...@gmail.com>
Date: 2017-12-18T02:26:54Z
[TRAFODION-2802] Prepare the build environment with one command
----
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158090398
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
--- End diff --
Typo: "not exist" -> "does not exist"
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158089957
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
--- End diff --
Maybe better to say "check some basic commands"
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158098624
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
+ exit 1
+esac
+
+osver=`lsb_release -r | cut -d : -f 2-`
+osvermajor=`echo $osver | cut -d . -f 1-1`
+osverminor=`echo $osver | cut -d . -f 2-2`
+case ${osvermajor} in
+ 6|7)
+ echo "INFO: os version is [$osver]"
+ ;;
+ *)
+ echo "ERROR: OS version is [$osver]. Only 6.x versions are presently supported."
+ exit 1
+esac
+
+# install all libs
+dependlibs=(
+ epel-release alsa-lib-devel ant ant-nodeps apr-devel \
+ apr-util-devel boost-devel cmake device-mapper-multipath \
+ dhcp doxygen flex gcc-c++ gd git glibc-devel \
+ glibc-devel.i686 graphviz-perl gzip ${MY_JAVA_VER}-devel \
+ libX11-devel libXau-devel libaio-devel libcurl-devel \
+ libibcm.i686 libibumad-devel libibumad-devel.i686 libiodbc \
+ libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
+ libxml2-devel lua-devel lzo-minilzo net-snmp-devel \
+ net-snmp-perl openldap-clients openldap-devel \
+ openldap-devel.i686 openmotif openssl-devel \
+ openssl-devel.i686 perl-Config-IniFiles perl-Config-Tiny \
+ perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
+ perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
+ perl-Time-HiRes protobuf-compiler protobuf-devel \
+ readline-devel rpm-build saslwrapper sqlite-devel unixODBC \
+ unixODBC-devel uuid-perl wget xerces-c-devel xinetd \
+ ncurses-devel)
+faillibs=()
+echo "INFO: install dependent library start"
+for dependlib in ${dependlibs[@]}
+do
+ (${MY_YUM} install ${dependlib}) >>${LOGFILE}2>&1
+ if [ "x$?" != "x0" ]; then
+ faillibs=("${faillibs[@]}" "${dependlib}")
+ echo "ERROR: install dependent library [${dependlib}] fail"
+ else
+ echo "INFO: install dependent library [${dependlib}] success"
+ fi
+done
+echo "INFO: install dependent library finish"
+
+# remove pdsh and qt-dev
+echo "INFO: remove pdsh and qt-dev trafodion scripts get confused."
--- End diff --
Maybe say "INFO: remove pdsh and qt-dev commands to avoid problems with trafodion scripts"
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158093989
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
+ exit 1
+esac
+
+osver=`lsb_release -r | cut -d : -f 2-`
+osvermajor=`echo $osver | cut -d . -f 1-1`
+osverminor=`echo $osver | cut -d . -f 2-2`
+case ${osvermajor} in
+ 6|7)
+ echo "INFO: os version is [$osver]"
+ ;;
+ *)
+ echo "ERROR: OS version is [$osver]. Only 6.x versions are presently supported."
+ exit 1
+esac
+
+# install all libs
+dependlibs=(
+ epel-release alsa-lib-devel ant ant-nodeps apr-devel \
+ apr-util-devel boost-devel cmake device-mapper-multipath \
+ dhcp doxygen flex gcc-c++ gd git glibc-devel \
+ glibc-devel.i686 graphviz-perl gzip ${MY_JAVA_VER}-devel \
+ libX11-devel libXau-devel libaio-devel libcurl-devel \
+ libibcm.i686 libibumad-devel libibumad-devel.i686 libiodbc \
+ libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
+ libxml2-devel lua-devel lzo-minilzo net-snmp-devel \
+ net-snmp-perl openldap-clients openldap-devel \
+ openldap-devel.i686 openmotif openssl-devel \
+ openssl-devel.i686 perl-Config-IniFiles perl-Config-Tiny \
+ perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
+ perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
+ perl-Time-HiRes protobuf-compiler protobuf-devel \
+ readline-devel rpm-build saslwrapper sqlite-devel unixODBC \
+ unixODBC-devel uuid-perl wget xerces-c-devel xinetd \
+ ncurses-devel)
+faillibs=()
+echo "INFO: install dependent library start"
+for dependlib in ${dependlibs[@]}
+do
+ (${MY_YUM} install ${dependlib}) >>${LOGFILE}2>&1
+ if [ "x$?" != "x0" ]; then
+ faillibs=("${faillibs[@]}" "${dependlib}")
+ echo "ERROR: install dependent library [${dependlib}] fail"
+ else
+ echo "INFO: install dependent library [${dependlib}] success"
+ fi
+done
+echo "INFO: install dependent library finish"
+
+# remove pdsh and qt-dev
+echo "INFO: remove pdsh and qt-dev trafodion scripts get confused."
+(${MY_YUM} erase pdsh) >>${LOGFILE}2>&1
+(${MY_YUM} erase qt-dev) >>${LOGFILE}2>&1
+
+# check and set the java
+echo "INFO: check and set java environment"
+javadir=`\ls -L ${MY_JVM_PATH} | grep "${MY_JAVA_VER}-"`
+javapath="${MY_JVM_PATH}/${javadir}"
+dirs="ASSEMBLY_EXCEPTION bin include jre jre-abrt lib LICENSE" \
+ " tapset THIRD_PARTY_README"
+if [ ! -d ${javapath} ]; then
+ echo "ERROR: java dir [${javapath}] isn't right"
+ exit 1
+fi
+
+javahome=`grep JAVA_HOME ~/.bashrc | wc -l`
+if [ "x${javahome}" = "x0" ]; then
+ echo -en "export JAVA_HOME=${javapath}\n" >> $HOME/.bashrc
+ echo -en "export PATH=\$PATH:\$JAVA_HOME/bin\n" >> $HOME/.bashrc
+fi
+
+# check and set locale
+local_locale=`locale | grep -v "xen_US.UTF-8"`
--- End diff --
This code did not work for me when I tried it on my workstation. I saw several issues: a) the extra "x" in "xen_US" on line 197, the comparison to "x" in line 198 and the fact that my locale command returns multiple lines. The following worked for me:
```
local_locale=`locale | grep "LANG="`
if [ "${local_locale}" != "LANG=en_US.UTF-8" ]; then
```
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by sumory <gi...@git.apache.org>.
Github user sumory commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158637644
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
--- End diff --
I don‘t have the environment as you say, if the user has this environment, user can installed by modifying the environment variable MY_YUM
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158101687
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
+ exit 1
+esac
+
+osver=`lsb_release -r | cut -d : -f 2-`
+osvermajor=`echo $osver | cut -d . -f 1-1`
+osverminor=`echo $osver | cut -d . -f 2-2`
+case ${osvermajor} in
+ 6|7)
+ echo "INFO: os version is [$osver]"
+ ;;
+ *)
+ echo "ERROR: OS version is [$osver]. Only 6.x versions are presently supported."
+ exit 1
+esac
+
+# install all libs
+dependlibs=(
+ epel-release alsa-lib-devel ant ant-nodeps apr-devel \
+ apr-util-devel boost-devel cmake device-mapper-multipath \
+ dhcp doxygen flex gcc-c++ gd git glibc-devel \
+ glibc-devel.i686 graphviz-perl gzip ${MY_JAVA_VER}-devel \
+ libX11-devel libXau-devel libaio-devel libcurl-devel \
+ libibcm.i686 libibumad-devel libibumad-devel.i686 libiodbc \
+ libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
+ libxml2-devel lua-devel lzo-minilzo net-snmp-devel \
+ net-snmp-perl openldap-clients openldap-devel \
+ openldap-devel.i686 openmotif openssl-devel \
+ openssl-devel.i686 perl-Config-IniFiles perl-Config-Tiny \
+ perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
+ perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
+ perl-Time-HiRes protobuf-compiler protobuf-devel \
+ readline-devel rpm-build saslwrapper sqlite-devel unixODBC \
+ unixODBC-devel uuid-perl wget xerces-c-devel xinetd \
+ ncurses-devel)
+faillibs=()
+echo "INFO: install dependent library start"
+for dependlib in ${dependlibs[@]}
+do
+ (${MY_YUM} install ${dependlib}) >>${LOGFILE}2>&1
+ if [ "x$?" != "x0" ]; then
+ faillibs=("${faillibs[@]}" "${dependlib}")
+ echo "ERROR: install dependent library [${dependlib}] fail"
+ else
+ echo "INFO: install dependent library [${dependlib}] success"
+ fi
+done
+echo "INFO: install dependent library finish"
+
+# remove pdsh and qt-dev
+echo "INFO: remove pdsh and qt-dev trafodion scripts get confused."
+(${MY_YUM} erase pdsh) >>${LOGFILE}2>&1
+(${MY_YUM} erase qt-dev) >>${LOGFILE}2>&1
+
+# check and set the java
+echo "INFO: check and set java environment"
+javadir=`\ls -L ${MY_JVM_PATH} | grep "${MY_JAVA_VER}-"`
+javapath="${MY_JVM_PATH}/${javadir}"
+dirs="ASSEMBLY_EXCEPTION bin include jre jre-abrt lib LICENSE" \
+ " tapset THIRD_PARTY_README"
+if [ ! -d ${javapath} ]; then
+ echo "ERROR: java dir [${javapath}] isn't right"
+ exit 1
+fi
+
+javahome=`grep JAVA_HOME ~/.bashrc | wc -l`
+if [ "x${javahome}" = "x0" ]; then
+ echo -en "export JAVA_HOME=${javapath}\n" >> $HOME/.bashrc
+ echo -en "export PATH=\$PATH:\$JAVA_HOME/bin\n" >> $HOME/.bashrc
+fi
--- End diff --
It would probably be good to add a test here that runs
```
$JAVA_HOME/bin/java -version
```
and checks that we get an acceptable version.
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158099468
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
+ exit 1
+esac
+
+osver=`lsb_release -r | cut -d : -f 2-`
+osvermajor=`echo $osver | cut -d . -f 1-1`
+osverminor=`echo $osver | cut -d . -f 2-2`
+case ${osvermajor} in
+ 6|7)
+ echo "INFO: os version is [$osver]"
+ ;;
+ *)
+ echo "ERROR: OS version is [$osver]. Only 6.x versions are presently supported."
+ exit 1
+esac
+
+# install all libs
+dependlibs=(
+ epel-release alsa-lib-devel ant ant-nodeps apr-devel \
+ apr-util-devel boost-devel cmake device-mapper-multipath \
+ dhcp doxygen flex gcc-c++ gd git glibc-devel \
+ glibc-devel.i686 graphviz-perl gzip ${MY_JAVA_VER}-devel \
+ libX11-devel libXau-devel libaio-devel libcurl-devel \
+ libibcm.i686 libibumad-devel libibumad-devel.i686 libiodbc \
+ libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
+ libxml2-devel lua-devel lzo-minilzo net-snmp-devel \
+ net-snmp-perl openldap-clients openldap-devel \
+ openldap-devel.i686 openmotif openssl-devel \
+ openssl-devel.i686 perl-Config-IniFiles perl-Config-Tiny \
+ perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
+ perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
+ perl-Time-HiRes protobuf-compiler protobuf-devel \
+ readline-devel rpm-build saslwrapper sqlite-devel unixODBC \
+ unixODBC-devel uuid-perl wget xerces-c-devel xinetd \
+ ncurses-devel)
+faillibs=()
+echo "INFO: install dependent library start"
+for dependlib in ${dependlibs[@]}
+do
+ (${MY_YUM} install ${dependlib}) >>${LOGFILE}2>&1
+ if [ "x$?" != "x0" ]; then
+ faillibs=("${faillibs[@]}" "${dependlib}")
+ echo "ERROR: install dependent library [${dependlib}] fail"
+ else
+ echo "INFO: install dependent library [${dependlib}] success"
+ fi
+done
+echo "INFO: install dependent library finish"
+
+# remove pdsh and qt-dev
+echo "INFO: remove pdsh and qt-dev trafodion scripts get confused."
+(${MY_YUM} erase pdsh) >>${LOGFILE}2>&1
+(${MY_YUM} erase qt-dev) >>${LOGFILE}2>&1
+
+# check and set the java
+echo "INFO: check and set java environment"
+javadir=`\ls -L ${MY_JVM_PATH} | grep "${MY_JAVA_VER}-"`
+javapath="${MY_JVM_PATH}/${javadir}"
+dirs="ASSEMBLY_EXCEPTION bin include jre jre-abrt lib LICENSE" \
+ " tapset THIRD_PARTY_README"
+if [ ! -d ${javapath} ]; then
+ echo "ERROR: java dir [${javapath}] isn't right"
+ exit 1
+fi
+
+javahome=`grep JAVA_HOME ~/.bashrc | wc -l`
+if [ "x${javahome}" = "x0" ]; then
+ echo -en "export JAVA_HOME=${javapath}\n" >> $HOME/.bashrc
--- End diff --
When writing into the users .bashrc, I would recommend adding a comment that shows what tool wrote this. Something like:
```
# Lines added by traf_checkset_env.sh
exprt JAVA_HOME=...
```
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158183083
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
+ exit 1
+esac
+
+osver=`lsb_release -r | cut -d : -f 2-`
+osvermajor=`echo $osver | cut -d . -f 1-1`
+osverminor=`echo $osver | cut -d . -f 2-2`
+case ${osvermajor} in
+ 6|7)
+ echo "INFO: os version is [$osver]"
+ ;;
+ *)
+ echo "ERROR: OS version is [$osver]. Only 6.x versions are presently supported."
+ exit 1
+esac
+
+# install all libs
+dependlibs=(
+ epel-release alsa-lib-devel ant ant-nodeps apr-devel \
+ apr-util-devel boost-devel cmake device-mapper-multipath \
+ dhcp doxygen flex gcc-c++ gd git glibc-devel \
+ glibc-devel.i686 graphviz-perl gzip ${MY_JAVA_VER}-devel \
+ libX11-devel libXau-devel libaio-devel libcurl-devel \
+ libibcm.i686 libibumad-devel libibumad-devel.i686 libiodbc \
+ libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
+ libxml2-devel lua-devel lzo-minilzo net-snmp-devel \
+ net-snmp-perl openldap-clients openldap-devel \
+ openldap-devel.i686 openmotif openssl-devel \
+ openssl-devel.i686 perl-Config-IniFiles perl-Config-Tiny \
+ perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
+ perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
+ perl-Time-HiRes protobuf-compiler protobuf-devel \
+ readline-devel rpm-build saslwrapper sqlite-devel unixODBC \
+ unixODBC-devel uuid-perl wget xerces-c-devel xinetd \
+ ncurses-devel)
+faillibs=()
+echo "INFO: install dependent library start"
+for dependlib in ${dependlibs[@]}
--- End diff --
Sounds good, we can always change that later if needed.
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158095073
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
--- End diff --
This command needs a help text that should mention the following:
- Who should use this script (people who want to set up a single node
development system on a machine where they have sudo privileges)
- What does the script do (e.g. yum install, build/setup tools).
- A link to the Contributor guide wiki page that describes these steps
(https://cwiki.apache.org/confluence/display/TRAFODION/Create+Build+Environment)
- What environment variables must be set before calling this script
- What optional environment variables can be set
- What directories are created by the script, and how they can be customized
Once this PR is merged, we can also update the wiki page and mention this command.
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158095765
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
--- End diff --
It's pretty common that the root directory of a server is small (at least on the OpenStack and Amazon VMs I have seen). Maybe add yet another variable like this one:
```
MY_SW_HOME=${MY_SW_HOME-${HOME}}
```
Then use $MY_SW_HOME instead of $HOME below.
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158091915
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
+ exit 1
+esac
+
+osver=`lsb_release -r | cut -d : -f 2-`
+osvermajor=`echo $osver | cut -d . -f 1-1`
+osverminor=`echo $osver | cut -d . -f 2-2`
+case ${osvermajor} in
+ 6|7)
+ echo "INFO: os version is [$osver]"
+ ;;
+ *)
+ echo "ERROR: OS version is [$osver]. Only 6.x versions are presently supported."
+ exit 1
+esac
+
+# install all libs
+dependlibs=(
+ epel-release alsa-lib-devel ant ant-nodeps apr-devel \
+ apr-util-devel boost-devel cmake device-mapper-multipath \
+ dhcp doxygen flex gcc-c++ gd git glibc-devel \
+ glibc-devel.i686 graphviz-perl gzip ${MY_JAVA_VER}-devel \
+ libX11-devel libXau-devel libaio-devel libcurl-devel \
+ libibcm.i686 libibumad-devel libibumad-devel.i686 libiodbc \
+ libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
+ libxml2-devel lua-devel lzo-minilzo net-snmp-devel \
+ net-snmp-perl openldap-clients openldap-devel \
+ openldap-devel.i686 openmotif openssl-devel \
+ openssl-devel.i686 perl-Config-IniFiles perl-Config-Tiny \
+ perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
+ perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
+ perl-Time-HiRes protobuf-compiler protobuf-devel \
+ readline-devel rpm-build saslwrapper sqlite-devel unixODBC \
+ unixODBC-devel uuid-perl wget xerces-c-devel xinetd \
+ ncurses-devel)
+faillibs=()
+echo "INFO: install dependent library start"
+for dependlib in ${dependlibs[@]}
--- End diff --
I wonder whether it would be faster to install all the yum items (except epel-release?) in a single command. Yum has pretty good error messages, so I don't think this script really needs to diagnose the yum output. Also, I would recommend running yum update as the first command, before installing any of the packages. We may also need to run yum install epel-release as a separate command.
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158090237
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
--- End diff --
Typo: "has an error when running"
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158091099
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
--- End diff --
As far as I know we have also tried on the Oracle and Amazon distributions, which are similar to RedHat, and they may work as well (possibly with some small modifications). Many of the other Linux distros don't have yum, so they would have given an error above. Maybe you want to allow the user to proceed, at their own risk?
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158094093
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
+ exit 1
+esac
+
+osver=`lsb_release -r | cut -d : -f 2-`
+osvermajor=`echo $osver | cut -d . -f 1-1`
+osverminor=`echo $osver | cut -d . -f 2-2`
+case ${osvermajor} in
+ 6|7)
+ echo "INFO: os version is [$osver]"
+ ;;
+ *)
+ echo "ERROR: OS version is [$osver]. Only 6.x versions are presently supported."
+ exit 1
+esac
+
+# install all libs
+dependlibs=(
+ epel-release alsa-lib-devel ant ant-nodeps apr-devel \
+ apr-util-devel boost-devel cmake device-mapper-multipath \
+ dhcp doxygen flex gcc-c++ gd git glibc-devel \
+ glibc-devel.i686 graphviz-perl gzip ${MY_JAVA_VER}-devel \
+ libX11-devel libXau-devel libaio-devel libcurl-devel \
+ libibcm.i686 libibumad-devel libibumad-devel.i686 libiodbc \
+ libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
+ libxml2-devel lua-devel lzo-minilzo net-snmp-devel \
+ net-snmp-perl openldap-clients openldap-devel \
+ openldap-devel.i686 openmotif openssl-devel \
+ openssl-devel.i686 perl-Config-IniFiles perl-Config-Tiny \
+ perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
+ perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
+ perl-Time-HiRes protobuf-compiler protobuf-devel \
+ readline-devel rpm-build saslwrapper sqlite-devel unixODBC \
+ unixODBC-devel uuid-perl wget xerces-c-devel xinetd \
+ ncurses-devel)
+faillibs=()
+echo "INFO: install dependent library start"
+for dependlib in ${dependlibs[@]}
+do
+ (${MY_YUM} install ${dependlib}) >>${LOGFILE}2>&1
+ if [ "x$?" != "x0" ]; then
+ faillibs=("${faillibs[@]}" "${dependlib}")
+ echo "ERROR: install dependent library [${dependlib}] fail"
+ else
+ echo "INFO: install dependent library [${dependlib}] success"
+ fi
+done
+echo "INFO: install dependent library finish"
+
+# remove pdsh and qt-dev
+echo "INFO: remove pdsh and qt-dev trafodion scripts get confused."
+(${MY_YUM} erase pdsh) >>${LOGFILE}2>&1
+(${MY_YUM} erase qt-dev) >>${LOGFILE}2>&1
+
+# check and set the java
+echo "INFO: check and set java environment"
+javadir=`\ls -L ${MY_JVM_PATH} | grep "${MY_JAVA_VER}-"`
+javapath="${MY_JVM_PATH}/${javadir}"
+dirs="ASSEMBLY_EXCEPTION bin include jre jre-abrt lib LICENSE" \
+ " tapset THIRD_PARTY_README"
+if [ ! -d ${javapath} ]; then
+ echo "ERROR: java dir [${javapath}] isn't right"
+ exit 1
+fi
+
+javahome=`grep JAVA_HOME ~/.bashrc | wc -l`
+if [ "x${javahome}" = "x0" ]; then
+ echo -en "export JAVA_HOME=${javapath}\n" >> $HOME/.bashrc
+ echo -en "export PATH=\$PATH:\$JAVA_HOME/bin\n" >> $HOME/.bashrc
+fi
+
+# check and set locale
+local_locale=`locale | grep -v "xen_US.UTF-8"`
+if [ "${local_locale}" != "x" ]; then
+ echo "WARN: locale is not right, this script modify the locale to "\
+ "\"en_US.UTF-8\" from "
+ echo "[${local_locale}]"
+ lang_set=`grep LANG ~/.bashrc | wc -l`
+ if [ "x${lang_set}" = "x0" ]; then
+ echo -en "export LANG=\"en_US.UTF-8\"\n" >> $HOME/.bashrc
+ fi
+ lc_all_set=`grep LC_ALL ~/.bashrc | wc -l`
+ if [ "x${lc_all_set}" = "x0" ]; then
+ echo -en "export LC_ALL=\"en_US.UTF-8\"\n" >> $HOME/.bashrc
+ fi
+fi
+
+# check error
--- End diff --
See above.
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158090483
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
--- End diff --
Typo: "exists"
---
[GitHub] incubator-trafodion pull request #1353: [TRAFODION-2802] Prepare the build e...
Posted by xiaozhongwang <gi...@git.apache.org>.
Github user xiaozhongwang commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1353#discussion_r158179961
--- Diff: install/traf_checkset_env.sh ---
@@ -0,0 +1,243 @@
+#!/bin/bash
+#
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+# make sure the environment can build the code of trafodion or not.
+# must configure the yum repo right before execute this script.
+# run this script with normal user, while must has sudo permission.
+
+#default path
+MY_JVM_PATH=${MY_JVM_PATH-"/usr/lib/jvm"}
+MY_JAVA_VER=${MY_JAVA_VER-"java-1.7.0-openjdk"}
+MY_SUDO=${MY_SUDO-"sudo"}
+MY_YUM=${MY_YUM-"${MY_SUDO} yum -y"}
+
+# for setup tools
+MY_LOCAL_SW_DIST=${MY_LOCAL_SW_DIST-${HOME}/local_software_tools}
+MY_INSTALL_SW_DIST=${MY_INSTALL_SW_DIST-${HOME}/installed_software_tools}
+MY_DOWNLOAD_SW_DIST=${MY_DOWNLOAD_SW_DIST-${HOME}/download_software_tools}
+
+CHECKLOG=${LOGFILE-$(pwd)/$0.log}
+local_sws=(udis llvm mpich bison icu zookeeper thrift apache-maven protobuf apache-log4cxx hadoop)
+http_sws=(
+http://sourceforge.net/projects/udis86/files/udis86/1.7/udis86-1.7.2.tar.gz
+http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
+http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
+http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
+http://download.icu-project.org/files/icu4c/4.4/icu4c-4_4-src.tgz
+https://archive.apache.org/dist/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz
+http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gz
+http://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
+https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
+https://dist.apache.org/repos/dist/release/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz
+http://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz
+)
+
+# check the local software directory
+if [ ! -d ${MY_LOCAL_SW_DIST} ]; then
+ echo "WARNING: Local software tools aren't present. Will download all tools from the internet. This will be very slow. If you do have the local software tools present, set the environment variable MY_LOCAL_SW_DIST to point to them and run this script again. The default local software directory is [${MY_LOCAL_SW_DIST}]. Do you want to continue? Enter y/n (default: n):"
+ read YN
+ case ${YN} in
+ Y|y|Yes|YES)
+ ;;
+ *)
+ echo "Downloading the following build tools from the internet:"
+ for i in `seq ${#local_sws[@]}`
+ do
+ printf "%2d.%15s: %s\n" ${i} ${local_sws[${i}-1]} ${http_sws[${i}-1]}
+ done
+ exit 1
+ ;;
+ esac
+else
+ # check the local software's source exist or not
+ for local_sw in ${local_sws[@]}
+ do
+ local_file=`ls ${MY_LOCAL_SW_DIST} | grep ${local_sw}`
+ if [ "x${local_file}" = "x" ]; then
+ echo "WARNING: [${local_sw}] source file does not exist in directory [${MY_LOCAL_SW_DIST}]"
+ fi
+ done
+fi
+
+# check the permission.
+(${MY_SUDO} touch /etc/trafpermise) >>${LOGFILE}2>&1
+if [ "x$?" != "x0" ]; then
+ echo "ERROR: you must run this script with sudo without password permission."
+ exit 1
+fi
+
+# check the based command
+basecmds=(yum lsb_release awk cut uname)
+for basecmd in ${basecmds[@]}
+do
+ basecmdpath=`which ${basecmd}`
+ if [ "x$?" != "x0" ]; then
+ case ${basecmd} in
+ yum)
+ echo "ERROR: You must first install yum."
+ exit 1
+ ;;
+ lsb_release)
+ (${MY_YUM} install redhat-lsb) >>${LOGFILE}2>&1
+ if [ "x$?" = "x0" ]; then
+ echo "ERROR: yum repo server has a error when run command [${MY_YUM} install redhat-lsb]."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "ERROR: command [${basecmd}] not exist. Make sure you have installed it, and have added it to the command path."
+ exit 1
+ esac
+ fi
+ echo "INFO: command ${basecmd} exist"
+done
+
+osname=`uname -o`
+cpuarch=`uname -m`
+echo "INFO: os is [${osname}], cpu architecture is [${cpuarch}]"
+
+osdistributor=`lsb_release -i | cut -d : -f 2-`
+case ${osdistributor} in
+ *RedHat*|*CentOS*)
+ echo "INFO: os distributor id is [${osdistributor}]"
+ ;;
+ *)
+ echo "ERROR: The OS distribution is [${osdistributor}], but Trafodion only supports RedHat and CentOS presently."
+ exit 1
+esac
+
+osver=`lsb_release -r | cut -d : -f 2-`
+osvermajor=`echo $osver | cut -d . -f 1-1`
+osverminor=`echo $osver | cut -d . -f 2-2`
+case ${osvermajor} in
+ 6|7)
+ echo "INFO: os version is [$osver]"
+ ;;
+ *)
+ echo "ERROR: OS version is [$osver]. Only 6.x versions are presently supported."
+ exit 1
+esac
+
+# install all libs
+dependlibs=(
+ epel-release alsa-lib-devel ant ant-nodeps apr-devel \
+ apr-util-devel boost-devel cmake device-mapper-multipath \
+ dhcp doxygen flex gcc-c++ gd git glibc-devel \
+ glibc-devel.i686 graphviz-perl gzip ${MY_JAVA_VER}-devel \
+ libX11-devel libXau-devel libaio-devel libcurl-devel \
+ libibcm.i686 libibumad-devel libibumad-devel.i686 libiodbc \
+ libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
+ libxml2-devel lua-devel lzo-minilzo net-snmp-devel \
+ net-snmp-perl openldap-clients openldap-devel \
+ openldap-devel.i686 openmotif openssl-devel \
+ openssl-devel.i686 perl-Config-IniFiles perl-Config-Tiny \
+ perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
+ perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
+ perl-Time-HiRes protobuf-compiler protobuf-devel \
+ readline-devel rpm-build saslwrapper sqlite-devel unixODBC \
+ unixODBC-devel uuid-perl wget xerces-c-devel xinetd \
+ ncurses-devel)
+faillibs=()
+echo "INFO: install dependent library start"
+for dependlib in ${dependlibs[@]}
--- End diff --
When we ware creating build environment recently, there are a lot error caused by installing software by one command. there are no error messages when installing, but make an error when compiling. so it's necessary I think.
---