opencvsharp icon indicating copy to clipboard operation
opencvsharp copied to clipboard

Iconv Build Issue 4.6

Open leemorton opened this issue 3 years ago • 0 comments

Summary of your issue

Upgrading from 4.3 to 4.6 using Ubuntu 18.04 now errors because of IconV. I tried adding libc6 and libc6-dev but no luck. What do I need to do to fix the build?

Environment

Ubuntu 18.04

What did you do when you faced the problem?

Build using Docker

Example code:

FROM ubuntu:18.04

# DEPENDENCIES
RUN apt-get update &&\
    apt-get -y install wget unzip build-essential cmake git pkg-config libgtk-3-dev \
    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
    libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
    gfortran openexr libatlas-base-dev python3-dev python3-numpy \
    libtbb2 libtbb-dev libdc1394-22-dev libc6 libc6-dev

# BUILD AND INSTALL OPENCV AND OPENCV CONTRIB
ENV OPENCV_VERSION="4.6.0"
WORKDIR /opencv-src
RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip &&\
    wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip &&\
    unzip opencv.zip && mv opencv-${OPENCV_VERSION} opencv &&\
    unzip opencv_contrib.zip && mv opencv_contrib-${OPENCV_VERSION} opencv_contrib &&\
    mkdir opencv/build && cd opencv/build &&\
    cmake -D CMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_INSTALL_PREFIX=/usr/local \
        -D OPENCV_EXTRA_MODULES_PATH=/opencv-src/opencv_contrib/modules \
        -D WITH_OPENMP=ON \
        -D BUILD_TIFF=ON \
        -D WITH_FFMPEG=ON \
        -D WITH_GSTREAMER=ON \
        -D WITH_TBB=ON \
        -D BUILD_TBB=ON \
        -D BUILD_TESTS=OFF \
        -D WITH_EIGEN=OFF \
        -D WITH_V4L=ON \
        -D WITH_LIBV4L=ON \
        -D WITH_VTK=OFF \
        -D WITH_JASPER=OFF \
        -D OPENCV_EXTRA_EXE_LINKER_FLAGS=-latomic \
        -D OPENCV_ENABLE_NONFREE=ON \
        -D INSTALL_C_EXAMPLES=OFF \
        -D INSTALL_PYTHON_EXAMPLES=OFF \
        -D BUILD_NEW_PYTHON_SUPPORT=ON \
        -D BUILD_opencv_python3=ON \
        -D HAVE_opencv_python3=ON \
        -D PYTHON_DEFAULT_EXECUTABLE=$(which python3) \
        -D BUILD_opencv_python3=TRUE \
        -D OPENCV_GENERATE_PKGCONFIG=ON \
        -D BUILD_EXAMPLES=OFF .. &&\
    make -j$(grep -c ^processor /proc/cpuinfo) &&\
    make install &&\
    ldconfig &&\
    rm -rf /opencv-src

# BUILD AND INSTALL OPENCVSHARP
ENV OPENCV_SHARP_VERSION="4.6.0.20220608"
WORKDIR /opencvsharp-src
RUN git clone https://github.com/shimat/opencvsharp.git /opencvsharp-src &&\
    git fetch --all --tags --prune && git checkout ${OPENCV_SHARP_VERSION} &&\
    mkdir src/build && cd src/build &&\
    cmake -D CMAKE_INSTALL_PREFIX=/usr/local .. &&\
    make -j$(grep -c ^processor /proc/cpuinfo) &&\
    make install &&\
    ldconfig &&\
    cp OpenCvSharpExtern/libOpenCvSharpExtern.so /usr/lib &&\
    rm -rf /opencvsharp-src

CMD /bin/sh

Output:

#9 0.354 Cloning into '/opencvsharp-src'...                                                                                         
#9 30.44 Fetching origin
#9 31.36 Note: checking out '4.6.0.20220608'.
#9 31.36 
#9 31.36 You are in 'detached HEAD' state. You can look around, make experimental
#9 31.36 changes and commit them, and you can discard any commits you make in this
#9 31.36 state without impacting any branches by performing another checkout.
#9 31.36 
#9 31.36 If you want to create a new branch to retain commits you create, you may
#9 31.36 do so (now or later) by using -b with the checkout command again. Example:
#9 31.36 
#9 31.36   git checkout -b <new-branch-name>
#9 31.36 
#9 31.36 HEAD is now at df902f44 update samples
#9 31.45 -- The C compiler identification is GNU 7.5.0
#9 31.53 -- The CXX compiler identification is GNU 7.5.0
#9 31.53 -- Check for working C compiler: /usr/bin/cc
#9 31.61 -- Check for working C compiler: /usr/bin/cc -- works
#9 31.61 -- Detecting C compiler ABI info
#9 31.69 -- Detecting C compiler ABI info - done
#9 31.71 -- Detecting C compile features
#9 31.93 -- Detecting C compile features - done
#9 31.94 -- Check for working CXX compiler: /usr/bin/c++
#9 32.01 -- Check for working CXX compiler: /usr/bin/c++ -- works
#9 32.02 -- Detecting CXX compiler ABI info
#9 32.10 -- Detecting CXX compiler ABI info - done
#9 32.11 -- Detecting CXX compile features
#9 32.49 -- Detecting CXX compile features - done
#9 32.51 -- Found OpenCV: /usr/local (found version "4.6.0") 
#9 32.52 CMake Error at OpenCvSharpExtern/CMakeLists.txt:16 (find_package):
#9 32.52   By not providing "FindIconv.cmake" in CMAKE_MODULE_PATH this project has
#9 32.52   asked CMake to find a package configuration file provided by "Iconv", but
#9 32.52   CMake did not find one.
#9 32.52 
#9 32.52   Could not find a package configuration file provided by "Iconv" with any of
#9 32.52   the following names:
#9 32.52 
#9 32.52     IconvConfig.cmake
#9 32.52     iconv-config.cmake
#9 32.52 
#9 32.52   Add the installation prefix of "Iconv" to CMAKE_PREFIX_PATH or set
#9 32.52   "Iconv_DIR" to a directory containing one of the above files.  If "Iconv"
#9 32.52   provides a separate development package or SDK, be sure it has been
#9 32.52   installed.
#9 32.52 
#9 32.52 
#9 32.52 -- Configuring incomplete, errors occurred!
#9 32.52 See also "/opencvsharp-src/src/build/CMakeFiles/CMakeOutput.log".

What did you intend to be?

Build completed successfully

leemorton avatar Jul 01 '22 10:07 leemorton