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 2020/01/27 17:53:39 UTC
[GitHub] [incubator-mxnet] leezu opened a new pull request #17448: cmake:
staticbuild for binary distribution
leezu opened a new pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448
## Description ##
Add staticbuild scripts for binary distribution based on CMake.
## Checklist ##
### Essentials ###
Please feel free to remove inapplicable items for your PR.
- [X] Changes are complete (i.e. I finished coding on this PR)
- [X] All changes have test coverage:
- Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
- Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
- Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
- [X] Code is well-documented:
- For user-facing API changes, API doc string has been updated.
- For new C++ functions in header files, their functionalities and arguments are documented.
- For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
- Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
- [X] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
### Changes ###
- [X] cmake: staticbuild for binary distribution
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r372657276
##########
File path: ci/docker/install/ubuntu_publish.sh
##########
@@ -57,14 +57,33 @@ mv apache-maven-3.3.9/ /usr/local/maven/
update-alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
update-ca-certificates -f
-apt-get install -y python python3
+# patchelf available starting Ubuntu 16.04; compile from source for Ubuntu 14.04
+mkdir /usr/local/patchelf
+cd /usr/local/patchelf
+curl -L -o patchelf-0.10.tar.gz https://github.com/NixOS/patchelf/archive/0.10.tar.gz
+tar xzf patchelf-0.10.tar.gz
+cd /usr/local/patchelf/patchelf-0.10
+./bootstrap.sh
+./configure
+make
+sudo make install
+cd /
+
+apt-get install -y python python-pip python3 python3-pip
# the version of the pip shipped with ubuntu may be too lower, install a recent version here
-wget -nv https://bootstrap.pypa.io/get-pip.py
-python3 get-pip.py
-python2 get-pip.py
+# Restrict pip version to <19 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade 'pip<19'
+python3 -m pip install --upgrade 'pip<19'
-apt-get remove -y python3-urllib3
+# Restrict numpy version to <1.18 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 'numpy>1.16.0,<1.17' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+python3 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<1.18' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip2 install nose cpplint==1.3.0 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip3 install nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+# CMake 3.13.2+ is required
+mkdir /opt/cmake && cd /opt/cmake
+wget -nv https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.sh
+sh cmake-3.13.5-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
+ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
+rm cmake-3.13.5-Linux-x86_64.sh
Review comment:
Right, but shall we try to aim to make the two environments as similar as possible? I think we want to avoid running into issues caused by diverging environment
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] szha commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
szha commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r376051723
##########
File path: tools/dependencies/openblas.sh
##########
@@ -33,12 +34,24 @@ if [[ ! -e $DEPS_PATH/lib/libopenblas.a ]]; then
# Adding NO_DYNAMIC=1 flag causes make install to fail
$MAKE DYNAMIC_ARCH=1 USE_OPENMP=1
+
+ if [[ -v CMAKE_STATICBUILD ]]; then
+ # We link and redistribute libopenblas.so for cmake staticbuild
+ # cf https://gitlab.kitware.com/cmake/cmake/issues/16221#note_143330
+ patchelf --set-rpath '$ORIGIN' --force-rpath libopenblas.so
Review comment:
why not link with the static library?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r372646342
##########
File path: ci/docker/install/ubuntu_publish.sh
##########
@@ -57,14 +57,33 @@ mv apache-maven-3.3.9/ /usr/local/maven/
update-alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
update-ca-certificates -f
-apt-get install -y python python3
+# patchelf available starting Ubuntu 16.04; compile from source for Ubuntu 14.04
+mkdir /usr/local/patchelf
+cd /usr/local/patchelf
+curl -L -o patchelf-0.10.tar.gz https://github.com/NixOS/patchelf/archive/0.10.tar.gz
+tar xzf patchelf-0.10.tar.gz
+cd /usr/local/patchelf/patchelf-0.10
+./bootstrap.sh
+./configure
+make
+sudo make install
+cd /
+
+apt-get install -y python python-pip python3 python3-pip
# the version of the pip shipped with ubuntu may be too lower, install a recent version here
-wget -nv https://bootstrap.pypa.io/get-pip.py
-python3 get-pip.py
-python2 get-pip.py
+# Restrict pip version to <19 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade 'pip<19'
+python3 -m pip install --upgrade 'pip<19'
-apt-get remove -y python3-urllib3
+# Restrict numpy version to <1.18 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 'numpy>1.16.0,<1.17' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+python3 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<1.18' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip2 install nose cpplint==1.3.0 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip3 install nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+# CMake 3.13.2+ is required
+mkdir /opt/cmake && cd /opt/cmake
+wget -nv https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.sh
+sh cmake-3.13.5-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
+ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
+rm cmake-3.13.5-Linux-x86_64.sh
Review comment:
Ubuntu 14.04 is used for static build
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r376145040
##########
File path: tools/dependencies/opencv.sh
##########
@@ -161,7 +161,7 @@ if [[ ! -f $DEPS_PATH/lib/libopencv_core.a ]] || [[ ! -f $DEPS_PATH/lib/libopenc
-D BUILD_opencv_gpuoptflow=OFF \
-D BUILD_opencv_gpustereo=OFF \
-D BUILD_opencv_gpuwarping=OFF \
- -D BUILD_opencv_highgui=OFF \
+ -D BUILD_opencv_highgui=ON \
Review comment:
Ok. Let's also remove it from the Makefile build then.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r372646065
##########
File path: ci/docker/install/ubuntu_publish.sh
##########
@@ -57,14 +57,33 @@ mv apache-maven-3.3.9/ /usr/local/maven/
update-alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
update-ca-certificates -f
-apt-get install -y python python3
+# patchelf available starting Ubuntu 16.04; compile from source for Ubuntu 14.04
+mkdir /usr/local/patchelf
+cd /usr/local/patchelf
+curl -L -o patchelf-0.10.tar.gz https://github.com/NixOS/patchelf/archive/0.10.tar.gz
+tar xzf patchelf-0.10.tar.gz
+cd /usr/local/patchelf/patchelf-0.10
+./bootstrap.sh
+./configure
+make
+sudo make install
+cd /
+
+apt-get install -y python python-pip python3 python3-pip
# the version of the pip shipped with ubuntu may be too lower, install a recent version here
-wget -nv https://bootstrap.pypa.io/get-pip.py
-python3 get-pip.py
-python2 get-pip.py
+# Restrict pip version to <19 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade 'pip<19'
+python3 -m pip install --upgrade 'pip<19'
-apt-get remove -y python3-urllib3
+# Restrict numpy version to <1.18 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 'numpy>1.16.0,<1.17' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+python3 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<1.18' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip2 install nose cpplint==1.3.0 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip3 install nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+# CMake 3.13.2+ is required
+mkdir /opt/cmake && cd /opt/cmake
+wget -nv https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.sh
+sh cmake-3.13.5-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
+ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
+rm cmake-3.13.5-Linux-x86_64.sh
Review comment:
Not on the machines testing static build pipeline. It's installed in ubuntu_core.sh, but that's not executed for static build pipeline.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r372645071
##########
File path: ci/docker/install/ubuntu_publish.sh
##########
@@ -57,14 +57,33 @@ mv apache-maven-3.3.9/ /usr/local/maven/
update-alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
update-ca-certificates -f
-apt-get install -y python python3
+# patchelf available starting Ubuntu 16.04; compile from source for Ubuntu 14.04
+mkdir /usr/local/patchelf
+cd /usr/local/patchelf
+curl -L -o patchelf-0.10.tar.gz https://github.com/NixOS/patchelf/archive/0.10.tar.gz
+tar xzf patchelf-0.10.tar.gz
+cd /usr/local/patchelf/patchelf-0.10
+./bootstrap.sh
+./configure
+make
+sudo make install
+cd /
+
+apt-get install -y python python-pip python3 python3-pip
# the version of the pip shipped with ubuntu may be too lower, install a recent version here
-wget -nv https://bootstrap.pypa.io/get-pip.py
-python3 get-pip.py
-python2 get-pip.py
+# Restrict pip version to <19 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade 'pip<19'
+python3 -m pip install --upgrade 'pip<19'
-apt-get remove -y python3-urllib3
+# Restrict numpy version to <1.18 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 'numpy>1.16.0,<1.17' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+python3 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<1.18' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip2 install nose cpplint==1.3.0 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip3 install nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+# CMake 3.13.2+ is required
+mkdir /opt/cmake && cd /opt/cmake
+wget -nv https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.sh
+sh cmake-3.13.5-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
+ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
+rm cmake-3.13.5-Linux-x86_64.sh
Review comment:
Don't we already install cmake somewhere else?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] szha commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
szha commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r376052297
##########
File path: tools/dependencies/opencv.sh
##########
@@ -161,7 +161,7 @@ if [[ ! -f $DEPS_PATH/lib/libopencv_core.a ]] || [[ ! -f $DEPS_PATH/lib/libopenc
-D BUILD_opencv_gpuoptflow=OFF \
-D BUILD_opencv_gpustereo=OFF \
-D BUILD_opencv_gpuwarping=OFF \
- -D BUILD_opencv_highgui=OFF \
+ -D BUILD_opencv_highgui=ON \
Review comment:
highgui is only needed for very old opencv. we now link with opencv 3.4 in which it should not be needed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r376172564
##########
File path: tools/dependencies/opencv.sh
##########
@@ -161,7 +161,7 @@ if [[ ! -f $DEPS_PATH/lib/libopencv_core.a ]] || [[ ! -f $DEPS_PATH/lib/libopenc
-D BUILD_opencv_gpuoptflow=OFF \
-D BUILD_opencv_gpustereo=OFF \
-D BUILD_opencv_gpuwarping=OFF \
- -D BUILD_opencv_highgui=OFF \
+ -D BUILD_opencv_highgui=ON \
Review comment:
Probably because we use "very old" OpenCV on CI. Thus let's keep `-D BUILD_opencv_highgui=ON`. Unused symbols can be deleted from the library later anyways.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on issue #17448: cmake:
staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#issuecomment-580483610
Rebase after https://github.com/apache/incubator-mxnet/pull/17474
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r376142791
##########
File path: tools/dependencies/openblas.sh
##########
@@ -33,12 +34,24 @@ if [[ ! -e $DEPS_PATH/lib/libopenblas.a ]]; then
# Adding NO_DYNAMIC=1 flag causes make install to fail
$MAKE DYNAMIC_ARCH=1 USE_OPENMP=1
+
+ if [[ -v CMAKE_STATICBUILD ]]; then
+ # We link and redistribute libopenblas.so for cmake staticbuild
+ # cf https://gitlab.kitware.com/cmake/cmake/issues/16221#note_143330
+ patchelf --set-rpath '$ORIGIN' --force-rpath libopenblas.so
Review comment:
The outcome is equivalent and the current solution is easier to support in cmake, as `libopenblas.so` declares it's dependencies correctly unlike `.a` files.
We could reconsider after fixing https://gitlab.kitware.com/cmake/cmake/issues/16221
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17448: cmake:
staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#issuecomment-579425990
Addresses #17457
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on issue #17448: cmake:
staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#issuecomment-582560982
Ping @szha. Finally CI. 7 days stuck on flaky CI... Please review / merge once you have time.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu merged pull request #17448: cmake:
staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu merged pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r376171808
##########
File path: tools/dependencies/opencv.sh
##########
@@ -161,7 +161,7 @@ if [[ ! -f $DEPS_PATH/lib/libopencv_core.a ]] || [[ ! -f $DEPS_PATH/lib/libopenc
-D BUILD_opencv_gpuoptflow=OFF \
-D BUILD_opencv_gpustereo=OFF \
-D BUILD_opencv_gpuwarping=OFF \
- -D BUILD_opencv_highgui=OFF \
+ -D BUILD_opencv_highgui=ON \
Review comment:
`im2rec` linking fails when removing `highgui`. Need to check the cause
```
[2020-02-07T01:08:50.550Z] /tmp/im2rec-923f97.o: In function `main':
[2020-02-07T01:08:50.550Z] tools/im2rec.cc:(.text+0x222c): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.550Z] tools/im2rec.cc:(.text+0x2db8): undefined reference to `cv::imencode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
[2020-02-07T01:08:50.550Z] build/src/io/iter_image_det_recordio.o: In function `mxnet::io::ImageDetRecordIOParser<float>::ParseNext(std::vector<mxnet::io::InstVector<float>, std::allocator<mxnet::io::InstVector<float> > >*)::{lambda()#1}::operator()() const':
[2020-02-07T01:08:50.550Z] src/io/iter_image_det_recordio.cc:(.text._ZZN5mxnet2io22ImageDetRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EEENKUlvE_clEv[_ZZN5mxnet2io22ImageDetRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EEENKUlvE_clEv]+0x22f): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.550Z] src/io/iter_image_det_recordio.cc:(.text._ZZN5mxnet2io22ImageDetRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EEENKUlvE_clEv[_ZZN5mxnet2io22ImageDetRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EEENKUlvE_clEv]+0x311): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.550Z] src/io/iter_image_det_recordio.cc:(.text._ZZN5mxnet2io22ImageDetRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EEENKUlvE_clEv[_ZZN5mxnet2io22ImageDetRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EEENKUlvE_clEv]+0x3fe): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.550Z] build/src/io/image_io.o: In function `mxnet::io::ImdecodeImpl(int, bool, void*, unsigned long, mxnet::NDArray*)':
[2020-02-07T01:08:50.550Z] src/io/image_io.cc:(.text+0x728): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.550Z] src/io/image_io.cc:(.text+0x839): undefined reference to `cv::imdecode(cv::_InputArray const&, int, cv::Mat*)'
[2020-02-07T01:08:50.550Z] build/src/io/iter_image_recordio.o: In function `mxnet::io::ImageRecordIOParser<float>::ParseNext(std::vector<mxnet::io::InstVector<float>, std::allocator<mxnet::io::InstVector<float> > >*)':
[2020-02-07T01:08:50.551Z] src/io/iter_image_recordio.cc:(.text._ZN5mxnet2io19ImageRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EE[_ZN5mxnet2io19ImageRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EE]+0x2c0): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.551Z] src/io/iter_image_recordio.cc:(.text._ZN5mxnet2io19ImageRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EE[_ZN5mxnet2io19ImageRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EE]+0x39e): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.551Z] src/io/iter_image_recordio.cc:(.text._ZN5mxnet2io19ImageRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EE[_ZN5mxnet2io19ImageRecordIOParserIfE9ParseNextEPSt6vectorINS0_10InstVectorIfEESaIS5_EE]+0x47b): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.551Z] build/src/io/iter_image_recordio.o: In function `mxnet::io::ImageRecordIOParser<unsigned char>::ParseNext(std::vector<mxnet::io::InstVector<unsigned char>, std::allocator<mxnet::io::InstVector<unsigned char> > >*)':
[2020-02-07T01:08:50.551Z] src/io/iter_image_recordio.cc:(.text._ZN5mxnet2io19ImageRecordIOParserIhE9ParseNextEPSt6vectorINS0_10InstVectorIhEESaIS5_EE[_ZN5mxnet2io19ImageRecordIOParserIhE9ParseNextEPSt6vectorINS0_10InstVectorIhEESaIS5_EE]+0x2bc): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.551Z] src/io/iter_image_recordio.cc:(.text._ZN5mxnet2io19ImageRecordIOParserIhE9ParseNextEPSt6vectorINS0_10InstVectorIhEESaIS5_EE[_ZN5mxnet2io19ImageRecordIOParserIhE9ParseNextEPSt6vectorINS0_10InstVectorIhEESaIS5_EE]+0x3ae): undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
[2020-02-07T01:08:50.551Z] build/src/io/iter_image_recordio.o:src/io/iter_image_recordio.cc:(.text._ZN5mxnet2io19ImageRecordIOParserIhE9ParseNextEPSt6vectorINS0_10InstVectorIhEESaIS5_EE[_ZN5mxnet2io19ImageRecordIOParserIhE9ParseNextEPSt6vectorINS0_10InstVectorIhEESaIS5_EE]+0x49b): more undefined references to `cv::imdecode(cv::_InputArray const&, int)' follow
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on issue #17448: cmake:
staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#issuecomment-583181180
What instruction set would you like to target by default? I added the code to target `-mno-avx` now
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r372655933
##########
File path: ci/docker/install/ubuntu_publish.sh
##########
@@ -57,14 +57,33 @@ mv apache-maven-3.3.9/ /usr/local/maven/
update-alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
update-ca-certificates -f
-apt-get install -y python python3
+# patchelf available starting Ubuntu 16.04; compile from source for Ubuntu 14.04
+mkdir /usr/local/patchelf
+cd /usr/local/patchelf
+curl -L -o patchelf-0.10.tar.gz https://github.com/NixOS/patchelf/archive/0.10.tar.gz
+tar xzf patchelf-0.10.tar.gz
+cd /usr/local/patchelf/patchelf-0.10
+./bootstrap.sh
+./configure
+make
+sudo make install
+cd /
+
+apt-get install -y python python-pip python3 python3-pip
# the version of the pip shipped with ubuntu may be too lower, install a recent version here
-wget -nv https://bootstrap.pypa.io/get-pip.py
-python3 get-pip.py
-python2 get-pip.py
+# Restrict pip version to <19 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade 'pip<19'
+python3 -m pip install --upgrade 'pip<19'
-apt-get remove -y python3-urllib3
+# Restrict numpy version to <1.18 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 'numpy>1.16.0,<1.17' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+python3 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<1.18' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip2 install nose cpplint==1.3.0 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip3 install nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+# CMake 3.13.2+ is required
+mkdir /opt/cmake && cd /opt/cmake
+wget -nv https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.sh
+sh cmake-3.13.5-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
+ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
+rm cmake-3.13.5-Linux-x86_64.sh
Review comment:
I think it's sensible to separate Ubuntu 14.04 and "recent" Ubuntu code. Many workarounds are needed on Ubuntu 14.04, see for example https://github.com/apache/incubator-mxnet/pull/17474
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r372072523
##########
File path: tools/staticbuild/build_lib_cmake.sh
##########
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
Review comment:
This is alike `build_lib.sh` for the make build. Let's set `set -eo pipefail` in both scripts?
With respect to having a bash script: We can migrate to a package manager (conan, vcpk, ...) based solution in the future.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] larroy commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
larroy commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r372069842
##########
File path: tools/staticbuild/build_lib_cmake.sh
##########
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
Review comment:
set -eo pipefail . ?
maybe better in python?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] szha commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
szha commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r376055187
##########
File path: config/distribution/linux_cpu.cmake
##########
@@ -0,0 +1,28 @@
+# 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.
+
+set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type")
+
+set(USE_CUDA OFF CACHE BOOL "Build with CUDA support")
+set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support")
+set(USE_OPENMP ON CACHE BOOL "Build with Openmp support")
+set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found")
+set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support")
+set(USE_LAPACK ON CACHE BOOL "Build with lapack support")
+set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.")
+set(USE_SSE OFF CACHE BOOL "Build with x86 SSE instruction support")
Review comment:
`USE_SSE` was on before.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r372654257
##########
File path: ci/docker/install/ubuntu_publish.sh
##########
@@ -57,14 +57,33 @@ mv apache-maven-3.3.9/ /usr/local/maven/
update-alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
update-ca-certificates -f
-apt-get install -y python python3
+# patchelf available starting Ubuntu 16.04; compile from source for Ubuntu 14.04
+mkdir /usr/local/patchelf
+cd /usr/local/patchelf
+curl -L -o patchelf-0.10.tar.gz https://github.com/NixOS/patchelf/archive/0.10.tar.gz
+tar xzf patchelf-0.10.tar.gz
+cd /usr/local/patchelf/patchelf-0.10
+./bootstrap.sh
+./configure
+make
+sudo make install
+cd /
+
+apt-get install -y python python-pip python3 python3-pip
# the version of the pip shipped with ubuntu may be too lower, install a recent version here
-wget -nv https://bootstrap.pypa.io/get-pip.py
-python3 get-pip.py
-python2 get-pip.py
+# Restrict pip version to <19 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade 'pip<19'
+python3 -m pip install --upgrade 'pip<19'
-apt-get remove -y python3-urllib3
+# Restrict numpy version to <1.18 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 'numpy>1.16.0,<1.17' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+python3 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<1.18' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip2 install nose cpplint==1.3.0 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip3 install nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+# CMake 3.13.2+ is required
+mkdir /opt/cmake && cd /opt/cmake
+wget -nv https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.sh
+sh cmake-3.13.5-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
+ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
+rm cmake-3.13.5-Linux-x86_64.sh
Review comment:
Shall we maybe extract that part into an own script so we can install the same cmake version for publishing as well as ci?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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
[GitHub] [incubator-mxnet] leezu commented on a change in pull request
#17448: cmake: staticbuild for binary distribution
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17448: cmake: staticbuild for binary distribution
URL: https://github.com/apache/incubator-mxnet/pull/17448#discussion_r372666201
##########
File path: ci/docker/install/ubuntu_publish.sh
##########
@@ -57,14 +57,33 @@ mv apache-maven-3.3.9/ /usr/local/maven/
update-alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
update-ca-certificates -f
-apt-get install -y python python3
+# patchelf available starting Ubuntu 16.04; compile from source for Ubuntu 14.04
+mkdir /usr/local/patchelf
+cd /usr/local/patchelf
+curl -L -o patchelf-0.10.tar.gz https://github.com/NixOS/patchelf/archive/0.10.tar.gz
+tar xzf patchelf-0.10.tar.gz
+cd /usr/local/patchelf/patchelf-0.10
+./bootstrap.sh
+./configure
+make
+sudo make install
+cd /
+
+apt-get install -y python python-pip python3 python3-pip
# the version of the pip shipped with ubuntu may be too lower, install a recent version here
-wget -nv https://bootstrap.pypa.io/get-pip.py
-python3 get-pip.py
-python2 get-pip.py
+# Restrict pip version to <19 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade 'pip<19'
+python3 -m pip install --upgrade 'pip<19'
-apt-get remove -y python3-urllib3
+# Restrict numpy version to <1.18 due to use of Python 3.4 on Ubuntu 14.04
+python2 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 'numpy>1.16.0,<1.17' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+python3 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<1.18' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip2 install nose cpplint==1.3.0 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
-pip3 install nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<2.0.0' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
+# CMake 3.13.2+ is required
+mkdir /opt/cmake && cd /opt/cmake
+wget -nv https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.sh
+sh cmake-3.13.5-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
+ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
+rm cmake-3.13.5-Linux-x86_64.sh
Review comment:
I agree, let's tackle it in a separate PR though once the CI runs stable again. (Refactoring the CI build scripts may introduce bugs at first and it's hard to find them if a lot of pipelines fail randomly as currently)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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