LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   problems in building opencv on ubuntu (https://www.linuxquestions.org/questions/linux-software-2/problems-in-building-opencv-on-ubuntu-4175541785/)

savio 05-06-2015 11:28 AM

problems in building opencv on ubuntu
 
Hi all,

I have problems in installing opencv 2.4 on the following ubuntu machine
(Linux 2.6.32-24-generic #43-Ubuntu SMP ... x86_64 GNU/Linux).

Firstly I use cmake and then after I use make there are the following messages:

/shared/sav/opencv-2.4.11/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:75:18: zlib.h: No such file or directory
...
...
...
make[1]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2
make: *** [all] Error 2

Does anyone know what is the problem? I am completly stuck.

thanks in advance,
Saverio

knudfl 05-07-2015 03:58 AM

Welcome to LQ.

" zlib.h: No such file " : 'zlib.h' is a basic file in a development environment.
And 'zlib1g-dev' is actually mentioned in the opencv24 "build-depends"
http://packages.ubuntu.com/source/trusty/opencv

Please do : $ sudo apt-get build-dep opencv



-

savio 05-07-2015 05:29 AM

Unfortunately I am working on a shared and important machine, so I have to install all on my local directory as well as by source without using any package utility.

During the cmake execution I can see the message:

-- ZLib: /usr/lib64/libz.so (ver 1.2.3.3)

In addition, zlib.h is in /usr/include/zlib.h but when I run make, the output is:

[ 0%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfPxr24Compressor.cpp.o
/shared/sav/opencv-2.4.11/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:75:18: zlib.h: No such file or directory
...
...
make[2]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfPxr24Compressor.cpp.o] Error 1
make[1]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2
make: *** [all] Error 2

I have to install and configure all in my local directory /shared/myname

What could be the problem?

knudfl 05-07-2015 08:22 AM

Re #3.

Looks like you have the zlib headers.

Suggest : Copy { zlib.h, zconf.h } to opencv-2.4.11/<??>
.. or to a "/home/<name>"/include/ folder, and add the new "include" to the cmake command,
like $ cmake -DCMAKE_CXX_FLAGS="-I /path/to/dir" ../
http://stackoverflow.com/questions/1...ional-includes


Tracing all the zlib headers : $ dpkg -L zlib1g-dev
/usr/include/x86_64-linux-gnu/zconf.h
/usr/include/zlib.h


Important : You can confuse 'cmake' if you are compiling in opencv-2.4.11/.
The common way is to use a build folder : opencv-2.4.11/build/, and :
$ cd build/
$ cmake ../
( You may have to start from scratch, with a new unpacked opencv-2.4.11.tar.gz ).
... Also be aware that the current stable version is opencv-2.4.9 ( or 2.4.8 ) :
2.4.9 : See Debian Sid / Ubuntu Vivid / Fedora 23.


-

John VV 05-07-2015 04:16 PM

also do you have ALL of the openCV build dependencies already installed

as i recall from the last time i built it
it NEEDS a ton of extra tools
unfortunately opencv website dose NOT work in firefox/seamonkey/chrome
so i am unable to READ the install instructions

http://docs.opencv.org
is a DEAD LINK

looking as the output or cmake
you need a ton of things and the DEV deb files

ZLib
PNG
TIFF:
JPEG 2000:
OpenEXR:
FFMPEG:
GStreamer:
OpenNI:
OpenNI PrimeSensor Modules:
PvAPI:
GigEVisionSDK:
UniCap:
UniCap ucil:
V4L/V4L2:
XIMEA:
Xine:

IPP:
Eigen:
TBB:
OpenMP:
GCD
Concurrency
C=:
Cuda:
OpenCL:
numpy:
FFT
BLAS


All times are GMT -5. The time now is 05:50 AM.