cyrusbehr opened a new issue #15327: Could not find OpenBlas - docker cross 
compile armv7
URL: https://github.com/apache/incubator-mxnet/issues/15327
 
 
   I am using docker to cross compile mxnet with the C++ package enabled for 
raspberry pi 3 b. I am using the following docker file:
   
   ```
   FROM dockcross/linux-armv7
   MAINTAINER Cyrus Behroozi [email protected]
   
   ENV DEFAULT_DOCKCROSS_IMAGE linux-armv7-rpi
   
   # OpenCV Dependencies
   
   RUN sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install 
-y \
        build-essential \
        cmake unzip pkg-config \
        libjpeg-dev \
        libpng-dev \
        libtiff-dev \
        libavcodec-dev \
        libavformat-dev \
        libswscale-dev \
        libv4l-dev \
        libxvidcore-dev \
        libx264-dev \
        libgtk-3-dev \
        libatlas-base-dev \
        gfortran \
        && sudo rm /usr/local/lib/libcurl.so.4 \
        && sudo ln -s /usr/lib/x86_64-linux-gnu/libcurl.so.4.3.0 
/usr/local/lib/libcurl.so.4
   
   # OpenCV Insallation
   
   ENV OPENCV_VERSION="4.1.0"
   RUN mkdir -p ~/opencv \
        && cd ~/opencv \
        && wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip \
        && unzip ${OPENCV_VERSION}.zip \
        && mkdir ~/opencv/opencv-${OPENCV_VERSION}/build \
        && cd ~/opencv/opencv-${OPENCV_VERSION}/build \
        && cmake -D CMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_INSTALL_PREFIX=/usr/local \
        -D INSTALL_C_EXAMPLES=OFF \
        -DBUILD_SHARED_LIBS=OFF \
        .. \
        && make -j8 \
        && sudo make install \
        && rm ~/opencv/${OPENCV_VERSION}.zip \
        && rm -r ~/opencv/opencv-${OPENCV_VERSION}
   
   # mxnet requirements 
   
   RUN  sudo apt-get -y install ninja-build \
   liblapack* \
   libblas* \
   libopenblas* \
   && cd ~ \
   && git clone https://github.com/apache/incubator-mxnet.git --recursive \
   && cd incubator-mxnet
   
   RUN cd ~/incubator-mxnet \
   && mkdir -p build \
   && cd build \
   && cmake \
        -DUSE_CPP_PACKAGE=1 \
           -DUSE_SSE=OFF \
           -DUSE_CUDA=OFF \
           -DUSE_OPENCV=ON \
           -DUSE_OPENMP=ON \
           -DUSE_MKL_IF_AVAILABLE=OFF \
           -DUSE_SIGNAL_HANDLER=ON \
           -DCMAKE_BUILD_TYPE=Release \
           -GNinja .. \
   && ninja -j8
   
   ```
   
   As it can be seen, in the step labeled `# mxnet requirements`, I am 
installing `libopenblas`. If I enter the docker container and perform a find 
operation, I can see that `libopenblas` is indeed installed:
   ```
   $ sudo find . | grep libopenblas
   ./usr/share/doc/libopenblas-dev
   ./usr/share/doc/libopenblas-dev/copyright
   ./usr/share/doc/libopenblas-base
   ./usr/share/doc/libopenblas-base/copyright
   ./usr/lib/libopenblas.a
   ./usr/lib/libopenblas.so.0
   ./usr/lib/libopenblasp-r0.2.19.so
   ./usr/lib/libopenblas.so
   ./usr/lib/libopenblasp-r0.2.19.a
   
   ```
   However, when I build my dockerfile, I get the following errors:
   
   ```
   -- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
   -- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
   CMake Error at cmake/Modules/FindOpenBLAS.cmake:82 (MESSAGE):
     Could not find OpenBLAS
   Call Stack (most recent call first):
     cmake/ChooseBlas.cmake:42 (find_package)
     CMakeLists.txt:323 (include)
   
   ```
   
   I am not sure why it is unable to find the package as the search path 
(specified in `cmake/Modules/FindOpenBLAS.cmake`) has '/usr/lib' as a search 
path:
   
   ```
   SET(Open_BLAS_LIB_SEARCH_PATHS
           /lib/
           /lib/openblas-base
           /lib64/
           /usr/lib
           /usr/lib/openblas-base
           /usr/lib64
           /usr/local/lib
           /usr/local/lib64
           /opt/OpenBLAS/lib
           /usr/local/opt/openblas/lib
           ${PROJECT_SOURCE_DIR}/3rdparty/OpenBLAS/lib
           ${PROJECT_SOURCE_DIR}/thirdparty/OpenBLAS/lib
        ${OpenBLAS_DIR}
        ${OpenBLAS_DIR}/lib
           ${OpenBLAS_HOME}
           ${OpenBLAS_HOME}/lib
    )
   
   ```
   
   
   
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to