BeGlad / pam-face-authentication

Automatically exported from code.google.com/p/pam-face-authentication
0 stars 0 forks source link

Can't build with opencv 2.2.0 #75

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Trying to build version 0.3 on Arch Linux, which sports OpenCV library version 
2.2.0. I get the following message:

-- Checking GNUCXX version 3/4 to determine  OpenCV /opt/net/ path
CMake Error at cmake/modules/FindOpenCV.cmake:239 (MESSAGE):
  OpenCV required but some headers or libs not found.  Please specify it's
  location with OpenCV_ROOT_DIR env.  variable.
Call Stack (most recent call first):
  CMakeLists.txt:75 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!

Downgrading to OpenCV 2.1.0 solves this issue.

Original issue reported on code.google.com by giancarl...@gmail.com on 18 Dec 2010 at 1:52

GoogleCodeExporter commented 8 years ago
Its probably because the pam-face-authentication package contains 
FindOpenCV.cmake which is compatible with only 2.1.0 and lower in 
extracteddir/cmake/modules/  you can delete that, remove the build directory 
and try again. It should work. let us know if it works.

Original comment by rohan.a...@gmail.com on 18 Dec 2010 at 2:16

GoogleCodeExporter commented 8 years ago
It worked, but now I get a bunch of error messages when compiling 
qt-facetrainer.
You'll find them attached.

Thanks

Original comment by giancarl...@gmail.com on 18 Dec 2010 at 2:38

Attachments:

GoogleCodeExporter commented 8 years ago
you have not installed highgui opencv module

Original comment by rohan.a...@gmail.com on 18 Dec 2010 at 2:52

GoogleCodeExporter commented 8 years ago
mmm... it seems it's actually installed. Did APIs change between 2.1.0 and 
2.2.0?

Original comment by giancarl...@gmail.com on 18 Dec 2010 at 4:28

GoogleCodeExporter commented 8 years ago
exaclty the same problem/errors on my archlinux.

Original comment by bernd.mi...@googlemail.com on 12 Jan 2011 at 6:15

GoogleCodeExporter commented 8 years ago
APIs changes between 2.1.0 and 2.2.0 are massive. see: 
http://opencv.willowgarage.com/wiki/OpenCV%20Change%20Logs

Original comment by Ni.E...@gmail.com on 22 Feb 2011 at 4:18

GoogleCodeExporter commented 8 years ago
OpenCV API changes might be massive, but I was able to compile the today's svn 
revision (340) with OpenCV 2.2.9 without any problems.

At first, I replaced the trunk/qtbranch/cmake/modules/FindOpenCV.cmake with 
OpenCVConfig.cmake from my OpenCV build folder, because the provided 
FindOpenCV.cmake was not working.

Then I needed to change two lines in the trunk/qtbranch/CMakeLists.txt, so that 
it used OpenCV_LIBS variable instead of OPENCV_LIBRARIES (diff attached)

and after that, the compilation was successful.

Original comment by pbasi...@gmail.com on 18 May 2011 at 6:54

Attachments:

GoogleCodeExporter commented 8 years ago
I would suggest this thread can be change to "Can't build with opencv >=2.2.0."
Yes, there is OpenCV 2.3. And there is no update, even latest svn does not 
build.

Original comment by sbbg...@gmail.com on 23 Sep 2011 at 4:32

GoogleCodeExporter commented 8 years ago
I'll take care of this issue very soon... :-)

Original comment by feichtne...@gmail.com on 23 Sep 2011 at 8:30

GoogleCodeExporter commented 8 years ago
Hi, I tried out the suggestion in #7.
It builds & works for openCV 2.3.0. 

Original comment by sbbg...@gmail.com on 27 Sep 2011 at 4:07

GoogleCodeExporter commented 8 years ago
Update: I've tried to investigate and fix this issue. Sadly I can't come up 
with a solution because it's weird somehow.

OpenCV 2.3 has it's own OpenCVConfig.cmake which replaces FindOpenCV.cmake (as 
correctly stated above). Nevertheless we have to keep backward compatibility 
with lower version, so the question is how to integrate a universal(!) 
FindOpenCV.cmake AND support the old way.

I got some infos from http://opencv.willowgarage.com/wiki/FindOpenCV.cmake
but what was bothering me is the fact that the old OpenCV 2.1 had all header 
includes in /usr/include/opencv, OpenCV 2.3 suddenly expected them to be in 
/usr/include/opencv2. 

In OpenCV 2.3 the variable OpenCV_LIBRARIES isn't used any longer, right now 
it's named OpenCV_LIBS. Sadly I can't simply change it for backward 
compatibility reasons.

You see...awkward situation :-/
Any help is greatly appreciated!

Original comment by feichtne...@gmail.com on 9 Oct 2011 at 10:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I know it sounds dirty.
But I used the patched CMakeList.txt and the FindOpenCV.cmake from OpenCV 2.2 .
They work both in OpenCV 2.2&2.3.
May someone try with earlier version?

Original comment by sbbg...@gmail.com on 10 Oct 2011 at 12:43

GoogleCodeExporter commented 8 years ago
That's a perfectly valid way of solving this issue. Nevertheless 
FindOpenCV.cmake might be different on every system, so sadly we can't just 
integrate it. And of course there's still the compatibility issue.

IMHO the most appropriate way of dealing with this is a generalized 
FindOpenCV.cmake which handles OpenCV 2.2 & 2.3 as well as the old 2.1 (or 
lower).

Original comment by feichtne...@gmail.com on 10 Oct 2011 at 10:14

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I couldn't help but consider this kind of backward compatibility could not be 
always worthy, especially as the time flies by. 
More & more user are likely switched to newer version of OpenCV by now even 
without their attention. 

And also, I think OpenCV 2.1 couldn't be built with libpng 1.5 by now, which 
suggests it might be deprecated enough.

So please allow me to ask boldly: would you please move on to support newer 
version of OpenCV?

Personally, I'm not good at CMake, and trying to find the old remedy 
FindOpenCV.cmake which worked for me by now.

Original comment by sbbg...@gmail.com on 22 Feb 2012 at 2:07

GoogleCodeExporter commented 8 years ago
For ubuntu 12.04:
cd /tmp && wget 
http://pam-face-authentication.googlecode.com/files/pam-face-authentication-0.3.
tar.gz
tar zxf pam-face-authentication-0.3.tar.gz && cd pam-face-authentication-*
cp /usr/share/OpenCV/OpenCVConfig.cmake ./cmake/modules/FindOpenCV.cmake
nano /cmake/modules/FindOpenCV.cmake
  --SET(OpenCV_INCLUDE_DIRS "${OpenCV_INSTALL_PATH}/include/opencv;${OpenCV_INSTALL_PATH}/include")
  ++SET(OpenCV_INCLUDE_DIRS "/usr/include/opencv;/usr/include")

  --SET(OpenCV_LIB_DIR "${OpenCV_INSTALL_PATH}/lib")
  ++SET(OpenCV_LIB_DIR "/usr/lib")

 nano ./CMakeLists.txt 
  --INCLUDE_DIRECTORIES(${OPENCV_INCLUDE_DIR})
  ++INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})

  --TARGET_LINK_LIBRARIES( pam_face_authentication  ${PAM_LIBRARIES} ${OPENCV_LIBRARIES})
  --TARGET_LINK_LIBRARIES( qt-facetrainer ${QT_LIBRARIES} ${OPENCV_LIBRARIES})
  ++TARGET_LINK_LIBRARIES( pam_face_authentication  ${PAM_LIBRARIES} ${OpenCV_LIBS})
  ++TARGET_LINK_LIBRARIES( qt-facetrainer ${QT_LIBRARIES} ${OpenCV_LIBS})

mkdir build && cd build
cmake -D CMAKE_INSTALL_PREFIX=/usr ..
make
sudo checkinstall --pkgname=pam-authentication-face-auth

It work!

Original comment by sam002d on 30 Mar 2012 at 12:50

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for providing this patch. 
I was able to build current SVN with the fixed root CMakeLists.txt.
But 2 faulty link.txt generated:
./CMakeFiles/qt-facetrainer.dir/link.txt
./CMakeFiles/pam_face_authentication.dir/link.txt

These files wouldn't be able to link the object file properly.
I have to manually add my OpenCV related so file to the -rdynamic arguments.

I will try your new FindOpenCV soon. 
Could you merge your patch into official branch? That would be great help for 
some other distros as well.

Thank you again.

Original comment by sbbg...@gmail.com on 30 Mar 2012 at 5:36

GoogleCodeExporter commented 8 years ago
Could we get the correct patches put into here please:

http://gpo.zugaina.org/sys-auth/kdm-plugin-pam-face-authentication

Original comment by dand...@gmail.com on 13 May 2012 at 1:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Ubuntu 12.64 lts 64bits :/tmp/pam-face-authentication-0.3/build$ cmake -D 
CMAKE_INSTALL_PREFIX=/usr ..
CMake Error at cmake/modules/FindOpenCV.cmake:49 (include):
  include could not find load file:

    /tmp/pam-face-authentication-0.3/cmake/modules/OpenCVModules.cmake
Call Stack (most recent call first):
  CMakeLists.txt:75 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!

Original comment by jardelda...@gmail.com on 18 May 2014 at 6:27

GoogleCodeExporter commented 8 years ago
Ubuntu 12.64 lts 64bits :

-- Checking GNUCXX version 3/4 to determine  OpenCV /opt/net/ path
CMake Error at cmake/modules/FindOpenCV.cmake:239 (MESSAGE):
  OpenCV required but some headers or libs not found.  Please specify it's
  location with OpenCV_ROOT_DIR env.  variable.
Call Stack (most recent call first):
  CMakeLists.txt:75 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!

Original comment by jardelda...@gmail.com on 18 May 2014 at 6:56

GoogleCodeExporter commented 8 years ago
The .deb on post #17 work fine in Linux mint 17 (cinnamon edition) later the 
installation i only have to create symbolic link of opencv library, this 
because qt-facetrainer looks for version 2.3 and in mint 17 are installed 
opencv version 2.4, later symbolic link added all works fine

Original comment by vaschett...@gmail.com on 12 Jul 2014 at 11:50