You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/31 15:51:50 UTC

[GitHub] marcoabreu closed pull request #9617: Remove uneeded gtest dependency, build with verbosely with CMake & ni?

marcoabreu closed pull request #9617: Remove uneeded gtest dependency, build with verbosely with CMake & ni?
URL: https://github.com/apache/incubator-mxnet/pull/9617
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/Jenkinsfile b/Jenkinsfile
index 05cda74066..03f829e890 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -89,19 +89,18 @@ def make(docker_type, make_flag) {
 // Run cmake. First try to do an incremental build from a previous workspace in hope to
 // accelerate the compilation. If something wrong, clean the workspace and then
 // build from scratch.
-def cmake(docker_type, cmake_defines, make_flags) {
+def cmake(docker_type, cmake_defines, flags) {
   timeout(time: max_time, unit: 'MINUTES') {
     try {
-      sh "${docker_run} ${docker_type} --dockerbinary docker mkdir build"
-      sh "WORKDIR=/workspace/build ${docker_run} ${docker_type} --dockerbinary docker cmake ${cmake_defines} .."
-      sh "WORKDIR=/workspace/build ${docker_run} ${docker_type} --dockerbinary docker make ${make_flags}"
+      sh "${docker_run} ${docker_type} --dockerbinary docker mkdir -p build"
+      sh "WORKDIR=/workspace/build ${docker_run} ${docker_type} --dockerbinary docker cmake ${cmake_defines} -G Ninja .."
+      sh "WORKDIR=/workspace/build ${docker_run} ${docker_type} --dockerbinary docker ninja ${flags}"
     } catch (exc) {
       echo 'Incremental compilation failed with ${exc}. Fall back to build from scratch'
-      sh "${docker_run} ${docker_type} --dockerbinary docker sudo make clean"
-      sh "${docker_run} ${docker_type} --dockerbinary docker sudo make -C amalgamation/ clean"
-      sh "${docker_run} ${docker_type} --dockerbinary docker mkdir build"
-      sh "WORKDIR=/workspace/build ${docker_run} ${docker_type} --dockerbinary docker cmake ${cmake_defines} .."
-      sh "WORKDIR=/workspace/build ${docker_run} ${docker_type} --dockerbinary docker make ${make_flags}"
+      sh "${docker_run} ${docker_type} --dockerbinary docker git clean -fdx"
+      sh "${docker_run} ${docker_type} --dockerbinary docker mkdir -p build"
+      sh "WORKDIR=/workspace/build ${docker_run} ${docker_type} --dockerbinary docker cmake ${cmake_defines} -G Ninja .."
+      sh "WORKDIR=/workspace/build ${docker_run} ${docker_type} --dockerbinary docker ninja ${flags}"
     }
   }
 }
@@ -270,10 +269,8 @@ try {
             -DUSE_CUDNN=1              \
             -DCMAKE_BUILD_TYPE=Release \
             """
-            def flag = """             \
-            -j\$(nproc)
-            """
-          cmake("build_cuda", defines, flag)
+            def flag = "-v"
+            cmake("build_cuda", defines, flag)
           pack_lib('cmake_gpu', mx_cmake_lib)
         }
       }
diff --git a/src/operator/optimizer_op-inl.h b/src/operator/optimizer_op-inl.h
index 60981aa6d2..89d27e17ec 100644
--- a/src/operator/optimizer_op-inl.h
+++ b/src/operator/optimizer_op-inl.h
@@ -917,7 +917,6 @@ inline void AdamStdUpdateRspRspRspImpl(const AdamParam& param,
   using namespace mxnet_op;
   using namespace rowsparse;
   CHECK_RSP_ALL_ROWS_NON_ZERO(weight, "AdamStdUpdate", "weights");
-  mshadow::Stream<xpu>* s = ctx.get_stream<xpu>();
   TBlob out_blob = out->data();
   // reuse dns rsp implementation when storage_shape == shape
   AdamStdUpdateDnsRspDnsImpl<xpu>(param, ctx, weight.data(), grad, mean.data(),
diff --git a/tests/ci_build/install/install_julia.sh b/tests/ci_build/install/install_julia.sh
index 5007c94953..e36dfb533b 100644
--- a/tests/ci_build/install/install_julia.sh
+++ b/tests/ci_build/install/install_julia.sh
@@ -16,9 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-
 set -e
+set -x
 
 wget https://julialang.s3.amazonaws.com/bin/linux/x64/0.5/julia-0.5.0-linux-x86_64.tar.gz
 mv julia-0.5.0-linux-x86_64.tar.gz /tmp/
diff --git a/tests/ci_build/install/install_library.sh b/tests/ci_build/install/install_library.sh
index 399f6a0937..f3d78682d4 100644
--- a/tests/ci_build/install/install_library.sh
+++ b/tests/ci_build/install/install_library.sh
@@ -16,6 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+set -e
+set -x
 
 
 yum install graphviz
diff --git a/tests/ci_build/install/install_maven.sh b/tests/ci_build/install/install_maven.sh
index 666ebde062..f1241864c7 100644
--- a/tests/ci_build/install/install_maven.sh
+++ b/tests/ci_build/install/install_maven.sh
@@ -16,9 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-
 set -e
+set -x
 
 wget http://mirrors.ocf.berkeley.edu/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
 mv apache-maven-3.3.9-bin.tar.gz /tmp/
diff --git a/tests/ci_build/install/install_openblas.sh b/tests/ci_build/install/install_openblas.sh
index 2ec5eeb449..5c9282359e 100644
--- a/tests/ci_build/install/install_openblas.sh
+++ b/tests/ci_build/install/install_openblas.sh
@@ -16,9 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-
 set -e
+set -x
 
 git clone https://github.com/xianyi/OpenBLAS
 cd OpenBLAS
diff --git a/tests/ci_build/install/install_opencv.sh b/tests/ci_build/install/install_opencv.sh
index 08a4d9b53c..9364a5613c 100644
--- a/tests/ci_build/install/install_opencv.sh
+++ b/tests/ci_build/install/install_opencv.sh
@@ -16,9 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-
 set -e
+set -x
 
 yum groupinstall -y "Development Tools"
 yum install -y cmake python27 python27-setuptools
diff --git a/tests/ci_build/install/install_python2.sh b/tests/ci_build/install/install_python2.sh
index ec4bbb9a9b..5c7c453809 100644
--- a/tests/ci_build/install/install_python2.sh
+++ b/tests/ci_build/install/install_python2.sh
@@ -16,9 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-
 set -e
+set -x
 
 yum groupinstall -y "Development Tools"
 yum install -y mlocate python27 python27-setuptools python27-tools python27-numpy python27-scipy python27-nose python27-matplotlib unzip
diff --git a/tests/ci_build/install/install_python3.sh b/tests/ci_build/install/install_python3.sh
index ee89161da7..0df12eb085 100644
--- a/tests/ci_build/install/install_python3.sh
+++ b/tests/ci_build/install/install_python3.sh
@@ -16,9 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-
 set -e
+set -x
 
 wget https://bootstrap.pypa.io/get-pip.py || exit 1
 mkdir py3
diff --git a/tests/ci_build/install/install_testdeps.sh b/tests/ci_build/install/install_testdeps.sh
index c777348053..26da186dd2 100644
--- a/tests/ci_build/install/install_testdeps.sh
+++ b/tests/ci_build/install/install_testdeps.sh
@@ -16,25 +16,11 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-
 set -e
+set -x
 
 pip install cpplint 'pylint==1.4.4' 'astroid==1.3.6'
 
-git clone https://github.com/google/googletest.git
-cd googletest/googletest/make
-make PREFIX=/usr/local
-cd ..
-export GTEST_DIR=${PWD}
-g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} -pthread -c ${GTEST_DIR}/src/gtest-all.cc
-ar -rv libgtest.a gtest-all.o
-mkdir -p /usr/local/gtest/include
-mkdir -p /usr/local/gtest/lib
-cp libgtest.a /usr/local/gtest/lib
-cp -r include/ /usr/local/gtest/
-export LD_LIBRARY_PATH=/usr/local/gtest/lib:$LD_LIBRARY_PATH
-
 pip3 install nose
 ln -s -f /opt/bin/nosetests /usr/local/bin/nosetests3
 ln -s -f /opt/bin/nosetests-3.4 /usr/local/bin/nosetests-3.4
diff --git a/tests/ci_build/install/ubuntu_install_core.sh b/tests/ci_build/install/ubuntu_install_core.sh
index eefd7590cd..74fb05a159 100755
--- a/tests/ci_build/install/ubuntu_install_core.sh
+++ b/tests/ci_build/install/ubuntu_install_core.sh
@@ -16,14 +16,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+set -e
+set -x
 
 # install libraries for building mxnet c++ core on ubuntu
 
 apt-get update && apt-get install -y \
     build-essential git libopenblas-dev liblapack-dev libopencv-dev \
-    libcurl4-openssl-dev libgtest-dev cmake wget unzip sudo  
+    libcurl4-openssl-dev cmake wget unzip sudo ninja-build
 
 # Link Openblas to Cblas as this link does not exist on ubuntu16.04
 ln -s /usr/lib/libopenblas.so /usr/lib/libcblas.so
-
-cd /usr/src/gtest && cmake CMakeLists.txt && make && cp *.a /usr/lib
diff --git a/tests/ci_build/install/ubuntu_install_nvidia.sh b/tests/ci_build/install/ubuntu_install_nvidia.sh
index 71fde8e800..d34980946e 100755
--- a/tests/ci_build/install/ubuntu_install_nvidia.sh
+++ b/tests/ci_build/install/ubuntu_install_nvidia.sh
@@ -19,6 +19,8 @@
 
 # install nvidia libraries to compile and run CUDA without
 # the necessity of nvidia-docker and a GPU
+set -e
+set -x
 
 # Needed to run add-apt-repository
 apt update && apt install -y software-properties-common
@@ -28,4 +30,4 @@ add-apt-repository -y ppa:graphics-drivers
 # Retrieve ppa:graphics-drivers and install nvidia-drivers.
 # Note: DEBIAN_FRONTEND required to skip the interactive setup steps
 apt update && \
-    DEBIAN_FRONTEND=noninteractive apt install -y nvidia-384
+    DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends cuda-8-0
diff --git a/tests/ci_build/install/ubuntu_install_perl.sh b/tests/ci_build/install/ubuntu_install_perl.sh
index af49952f97..217f322353 100755
--- a/tests/ci_build/install/ubuntu_install_perl.sh
+++ b/tests/ci_build/install/ubuntu_install_perl.sh
@@ -16,6 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+set -e
+set -x
 
 # install libraries for mxnet's perl package on ubuntu
 apt-get update && apt-get install -y libmouse-perl pdl cpanminus swig libgraphviz-perl
diff --git a/tests/ci_build/install/ubuntu_install_python.sh b/tests/ci_build/install/ubuntu_install_python.sh
index db4e9c4e0c..0ba98004a3 100755
--- a/tests/ci_build/install/ubuntu_install_python.sh
+++ b/tests/ci_build/install/ubuntu_install_python.sh
@@ -16,9 +16,10 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+set -e
+set -x
 
 # install libraries for mxnet's python package on ubuntu
-
 apt-get update && apt-get install -y python-dev python3-dev
 
 # the version of the pip shipped with ubuntu may be too lower, install a recent version here
diff --git a/tests/ci_build/install/ubuntu_install_r.sh b/tests/ci_build/install/ubuntu_install_r.sh
index 6d34441b29..6855b33a45 100755
--- a/tests/ci_build/install/ubuntu_install_r.sh
+++ b/tests/ci_build/install/ubuntu_install_r.sh
@@ -16,6 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+set -e
+set -x
 
 # install libraries for mxnet's r package on ubuntu
 
diff --git a/tests/ci_build/install/ubuntu_install_scala.sh b/tests/ci_build/install/ubuntu_install_scala.sh
index 169ece036d..7dd343acde 100755
--- a/tests/ci_build/install/ubuntu_install_scala.sh
+++ b/tests/ci_build/install/ubuntu_install_scala.sh
@@ -16,6 +16,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+set -e
+set -x
 
 # install libraries for mxnet's scala package on ubuntu
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services