'emerge -v opencv' fails with: ... -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE CMake Error at /usr/share/cmake/Modules/FindBLAS.cmake:471 (message): A required library with BLAS API not found. Please specify library location. Call Stack (most recent call first): /usr/share/cmake/Modules/FindLAPACK.cmake:138 (find_package) CMakeLists.txt:199 (find_package) -- Configuring incomplete, errors occurred! * ERROR: media-libs/opencv-2.2.0-r10 failed (configure phase): * cmake failed
root@orca:/usr/local/portage(237)# emerge --info =media-libs/opencv-2.2.0-r10 Portage 2.1.10.3 (default/linux/amd64/10.0/desktop, gcc-4.5.2, glibc-2.13-r2, 2.6.39-gentoo-r1 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-2.6.39-gentoo-r1-x86_64-Intel-R-_Xeon-R-_CPU_W3520_@_2.67GHz-with-gentoo-2.0.3 Timestamp of tree: Thu, 30 Jun 2011 07:00:01 +0000 app-shells/bash: 4.2_p10 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.7.2, 3.2 dev-util/cmake: 2.8.4-r1 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.0.3 sys-apps/openrc: 0.8.3-r1 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.9.6-r3, 1.10.3, 1.11.1-r1 sys-devel/binutils: 2.21.1 sys-devel/gcc: 4.4.5, 4.5.2 sys-devel/gcc-config: 1.4.1-r1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r1 sys-kernel/linux-headers: 2.6.38 (virtual/os-headers) sys-libs/glibc: 2.13-r2 Repositories: gentoo x11 java-overlay sunrise science bicatali x-portage x-cpan g-octave ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1 skype-eula googleearth AdobeFlash-10.1 cadsoft" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /usr/share/openvpn/easy-rsa /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.2/ext-active/ /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.2/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.2/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="de fr" MAKEOPTS="-j9" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/x11 /var/lib/layman/java-overlay /var/lib/layman/sunrise /var/lib/layman/science /var/lib/layman/bicatali /usr/local/portage /var/lib/cpan /var/lib/g-octave" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="64bit R X Xaw3d a52 aac abiword acl acpi admin afs alsa amd64 ao apache2 applet archive arpack asf aspell assistant atlas audacious audiofile automap automount bash-completion berkdb blas blast bluetooth boo boost branding bzip2 cairo cdda cddb cdf cdio cdparanoia cdr cg cgi chm cli consolekit corba cracklib crypt css cuda cups curl cxx daap db dbase dbi dbm dbus declarative designer devhelp device-mapper dga dia djvu doc dri ds2490 ds9097 ds9097u dts dv dvb dvd dvdr dvi dynamicplugin eds elf emacs emboss emf encode epiphany evo examples exif expat extensions extra extras fam fame ffmpeg fftw firefox fits flac fltk fontconfig foomaticdb fortran fortran95 fpx fts3 fuse galago gcj gd gdal gdbm gdu gedit geoip geolocation geos gfortran gif gimp ginac git glade glib gml gmp gmtsuppl gnome gnome-keyring gnome-print gnuplot gnutls gphoto2 gpm grammar graphics graphtft graphviz grass gs gsl gsm gstreamer gtk gudev guile harness hddtemp hdf hdf5 hdri http httpd hvm hwdb iconv icq icu id3 ide imagemagick imap innodb inotify ipod ipv6 ithreads jabber jadetex java java6 jbig john jpeg jpeg2k kdrive kerberos kpathsea kqemu kvm ladspa lame lapack latex latex3 lcms ldap lensfun libffi libgda libnotify libsamplerate lm_sensors lua lzo mad mail maildir mapnik math matroska mkl mmx mmxext mng modules mono moonlight motif mozilla mp3 mp4 mpeg mpi mpi-threads mplayer mtp mudflap multilib musicbrainz mysql mysqli nautilus ncurses neXt netcdf netpbm network networking networkmanager nfs nls nntp nptl nptlonly nsplugin ntfs ntp numpy nvidia obex objc ocaml octave odbc ogdi ogg ole openexr opengl openmp overview pae pam pango pcre pda pdf perl plotutils plugins png podcast policykit portaudio posix postgres postscript ppds pppd preview-latex proj projectx pstricks pulseaudio python python-bindings q16 q32 qemu qhull qt3support qt4 quicktime readline reiserfs reports rle romio rpc rrdcgi rrdtool samba sasl science sdk sdl secure-delete semantic-desktop server session sip slang slp smbclient smp sms sndfile snmp soup sox speex spell sql sqlite sse sse2 sse4 ssl ssse3 startup-notification stlport subtitles subversion suexec svg svm swig sysfs szip t1lib tcl tcpd tex tex4ht texmacs tgif theora thinkpad threads thunderbird tidy tiff tk tntc tools truetype udev unicode usb userlocales utempter v4l2 virtualbox vorbis wav webdav webdav-serf webkit wmf wxwidgets x264 xattr xcb xemacs xext xine xml xmlreader xmlrpc xorg xpm xulrunner xv xvid xvmc yaml zlib zvbi" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de fr" NETBEANS_MODULES="apisupport cnd dlight enterprise ergonomics groovy gsf harness ide identity j2ee java mobility nb php profiler ruby websvccommon xml" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386 ppc ppc64 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv nouveau vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
root@orca:/usr/local/portage(238)# emerge -pqv =media-libs/opencv-2.2.0-r10 [ebuild N ] media-libs/opencv-2.2.0-r10 USE="doc examples ffmpeg gstreamer gtk jpeg jpeg2k openexr opengl png python qt4 sse sse2 ssse3 tiff xine -cuda -eigen -ieee1394 -ipp -sse3 -test -v4l"
Created attachment 278677 [details] /var/tmp/portage/media-libs/opencv-2.2.0-r10/temp/build.log
Did you eselect a valid blas implementation? What is the result of "eselect blas list"?
root@orca:/root(2)# eselect blas list Available providers for blas: [1] atlas * [2] atlas-threads [3] reference root@orca:/root(3)# emerge -uvDN opencv These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] media-libs/opencv-2.2.0-r10 USE="doc examples ffmpeg gstreamer gtk jpeg jpeg2k openexr opengl png python qt4 sse sse2 ssse3 tiff xine -cuda -eigen -ieee1394 -ipp -sse3 -test -v4l" 0 kB Total: 1 package (1 new), Size of downloads: 0 kB >>> Verifying ebuild manifests >>> Emerging (1 of 1) media-libs/opencv-2.2.0-r10 * OpenCV-2.2.0.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ] * Package: media-libs/opencv-2.2.0-r10 * Repository: gentoo * Maintainer: dilfridge@gentoo.org kde@gentoo.org * USE: amd64 doc elibc_glibc examples ffmpeg gstreamer gtk jpeg jpeg2k kernel_linux multilib openexr opengl png python qt4 sse sse2 ssse3 tiff userland_GNU xine * FEATURES: sandbox >>> Unpacking source... >>> Unpacking OpenCV-2.2.0.tar.bz2 to /var/tmp/portage/media-libs/opencv-2.2.0-r10/work >>> Source unpacked in /var/tmp/portage/media-libs/opencv-2.2.0-r10/work >>> Preparing source in /var/tmp/portage/media-libs/opencv-2.2.0-r10/work/OpenCV-2.2.0 ... * Applying opencv-2.2.0-convert_sets_to_options.patch ... [ ok ] * Applying opencv-2.2.0-fortran.patch ... [ ok ] * Applying opencv-2.2.0-ffmpeg01.patch ... [ ok ] * Applying opencv-2.2.0-ffmpeg02.patch ... [ ok ] * Applying opencv-2.2.0-gcc46.patch ... [ ok ] * Applying opencv-2.2.0-libpng1.5.patch ... [ ok ] * Applying opencv-2.2.0-numpy.patch ... [ ok ] * Applying opencv-2.2.0-ptrcvcapture.patch ... [ ok ] * Applying opencv-2.2.0-use_system_libs.patch ... [ ok ] * Applying opencv-2.2.0-v4l_2.6.38.patch ... [ ok ] * Applying opencv-2.2.0-findnpp.patch ... [ ok ] >>> Source prepared. >>> Configuring source in /var/tmp/portage/media-libs/opencv-2.2.0-r10/work/OpenCV-2.2.0 ... >>> Working in BUILD_DIR: "/var/tmp/portage/media-libs/opencv-2.2.0-r10/work/opencv-2.2.0_build" cmake --no-warn-unused-cli -C /var/tmp/portage/media-libs/opencv-2.2.0-r10/temp/gentoo_common_config.cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DOXYGEN_DOCS=ON -DBUILD_examples=ON -DBUILD_EXAMPLES=ON -DBUILD_Examples=ON -DINSTALL_C_EXAMPLES=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DBUILD_TESTS=OFF -DENABLE_SSE=ON -DENABLE_SSE2=ON -DENABLE_SSE3=OFF -DENABLE_SSSE3=ON -DUSE_ipp=OFF -DUSE_IPP=OFF -DUSE_Ipp=OFF -DWITH_1394=OFF -DWITH_cuda=OFF -DWITH_CUDA=OFF -DWITH_Cuda=OFF -DWITH_eigen=OFF -DWITH_EIGEN=OFF -DWITH_Eigen=OFF -DWITH_ffmpeg=ON -DWITH_FFMPEG=ON -DWITH_Ffmpeg=ON -DWITH_gstreamer=ON -DWITH_GSTREAMER=ON -DWITH_Gstreamer=ON -DWITH_gtk=ON -DWITH_GTK=ON -DWITH_Gtk=ON -DWITH_JASPER=ON -DWITH_openexr=ON -DWITH_OPENEXR=ON -DWITH_Openexr=ON -DWITH_png=ON -DWITH_PNG=ON -DWITH_Png=ON -DWITH_QT=ON -DWITH_QT_OPENGL=ON -DWITH_tiff=ON -DWITH_TIFF=ON -DWITH_Tiff=ON -DWITH_V4L=OFF -DWITH_xine=ON -DWITH_XINE=ON -DWITH_Xine=ON -DINSTALL_PYTHON_EXAMPLES=ON -DUSE_OMIT_FRAME_POINTER=OFF -DOPENCV_BUILD_3RDPARTY_LIBS=OFF -DOPENCV_WARNINGS_ARE_ERRORS=OFF -DBUILD_LATEX_DOCS=OFF -DENABLE_POWERPC=OFF -DBUILD_PACKAGE=OFF -DENABLE_PROFILING=OFF -DUSE_O2=OFF -DUSE_O3=OFF -DUSE_FAST_MATH=OFF -DENABLE_SSE41=OFF -DENABLE_SSE42=OFF -DWITH_PVAPI=OFF -DWITH_UNICAP=OFF -DWITH_TBB=OFF -DCMAKE_SKIP_RPATH=ON -DBUILD_SHARED_LIBS=ON -DOPENCV_DOC_INSTALL_PATH=/usr/share/doc/opencv-2.2.0-r10 -DCUDA_NPP_LIBRARY_ROOT_DIR=/opt/cuda -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_DO_STRIP=OFF -DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/media-libs/opencv-2.2.0-r10/temp/gentoo_rules.cmake /var/tmp/portage/media-libs/opencv-2.2.0-r10/work/OpenCV-2.2.0 Not searching for unused variables given on the command line. loading initial cache file /var/tmp/portage/media-libs/opencv-2.2.0-r10/temp/gentoo_common_config.cmake Re-run cmake no build system arguments -- The Fortran compiler identification is GNU -- Check for working Fortran compiler: /usr/bin/x86_64-pc-linux-gnu-gfortran -- Check for working Fortran compiler: /usr/bin/x86_64-pc-linux-gnu-gfortran -- works -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Checking whether /usr/bin/x86_64-pc-linux-gnu-gfortran supports Fortran 90 -- Checking whether /usr/bin/x86_64-pc-linux-gnu-gfortran supports Fortran 90 -- yes -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ -- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Extracting svn version, please wait... -- SVNVERSION: -- Detected version of GNU GCC: 45 (405) -- Looking for include files CMAKE_HAVE_PTHREAD_H -- Looking for include files CMAKE_HAVE_PTHREAD_H - found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE CMake Error at /usr/share/cmake/Modules/FindBLAS.cmake:471 (message): A required library with BLAS API not found. Please specify library location. Call Stack (most recent call first): /usr/share/cmake/Modules/FindLAPACK.cmake:138 (find_package) CMakeLists.txt:199 (find_package) -- Configuring incomplete, errors occurred! * ERROR: media-libs/opencv-2.2.0-r10 failed (configure phase): * cmake failed * * Call stack: * ebuild.sh, line 56: Called src_configure * environment, line 5413: Called cmake-utils_src_configure * environment, line 1564: Called _execute_optionaly 'src_configure' * environment, line 558: Called enable_cmake-utils_src_configure * environment, line 1868: Called die * The specific snippet of code: * "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"; * * If you need support, post the output of 'emerge --info =media-libs/opencv-2.2.0-r10', * the complete build log and the output of 'emerge -pqv =media-libs/opencv-2.2.0-r10'. * The complete build log is located at '/var/tmp/portage/media-libs/opencv-2.2.0-r10/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/media-libs/opencv-2.2.0-r10/temp/environment'. * S: '/var/tmp/portage/media-libs/opencv-2.2.0-r10/work/OpenCV-2.2.0' >>> Failed to emerge media-libs/opencv-2.2.0-r10, Log file: >>> '/var/tmp/portage/media-libs/opencv-2.2.0-r10/temp/build.log' Did confgure script use pkg-config to detect blas? Compare https://bugs.gentoo.org/show_bug.cgi?id=373553. There is no more /usr/lib/libblas.a etc with atlas-3.9.41.
Adding the guys who know more about this...
packages always need to use pkg-config I am not sure how to fix that in cmake, but that could befigured out. the reason is, that not all implementations use libblas and liblapack but other names. So if the buildsystem tries to find or link with lblas it fails. pkg-config --libs blas tells you the right one.
(In reply to comment #7) > packages always need to use pkg-config > I am not sure how to fix that in cmake, but that could befigured out. Dont bother, I can do that while sleeping. Just give me a few days...
Should be fixed, please test and reopen if not.
It still fails for me with: root@orca:/root(19)# emerge -uvDN opencv ... -- A library with BLAS API found. CMake Error at /usr/share/cmake/Modules/FindLAPACK.cmake:292 (message): A required library with LAPACK API not found. Please specify library location.
Not fixed yet. I've pushed an (untested) dev-util/cmake-2.8.5-r1 into the *SCI* overlay where FindBLAS.cmake is patched - it first checks for PkgConfig settings for BLAS, and if they are found, all other checks are skipped. Please install this cmake version and try again. If this helps, we'll move it in the main tree, submit the patch upstream and add similar patches to other cmake files (FindLAPACK comes to my mind).
(In reply to comment #11) > Not fixed yet. > > I've pushed an (untested) dev-util/cmake-2.8.5-r1 into the *SCI* overlay where > FindBLAS.cmake is patched - it first checks for PkgConfig settings for BLAS, > and if they are found, all other checks are skipped. > > Please install this cmake version and try again. If this helps, we'll move it > in the main tree, submit the patch upstream and add similar patches to other > cmake files (FindLAPACK comes to my mind). Thanks, I was about to do the same. FindBlas.cmake and FindLAPACK.cmake are not really sufficient, also for HPC machines. I guess the new version of cmake will also help for bug #373559.
I have also added a copy of cmake-utils.eclass to the *SCI* overlay which removes in the default setting any occurrence of FindBLAS.cmake in ${S} (in case some package brings their own version which could override). Maybe that will help as well, please test...
Please sync your tree and update cmake to revision 2.8.5-r2. This problem should be fixed then (and opencv-2.2.0-r10 for now requires at least that cmake version).
Thanks Andreas, works for me. What about an upgrade to opencv-2.3?
(In reply to comment #15) > Thanks Andreas, works for me. What about an upgrade to opencv-2.3? Working on it, soon :)
Bad approach. Add the modified blas/lapack finder to the modules folder for the package, so you dont have to depend on named version of cmake. And for second the patches in the current look will be unacceptable for the upstream as they need to work on platforms where the pkgconfig is not present. Possible is also modifying the cmake file for the opencv to use the pkgconfig instead of finder eg.: find_package(PkgConfig REQUIRED) pkg_check_modules(BLAS REQUIRED blas>=1.2.3.4)
(In reply to comment #17) > Bad approach. > Add the modified blas/lapack finder to the modules folder for the package, so > you dont have to depend on named version of cmake. > > And for second the patches in the current look will be unacceptable for the > upstream as they need to work on platforms where the pkgconfig is not present. > > Possible is also modifying the cmake file for the opencv to use the pkgconfig > instead of finder eg.: > find_package(PkgConfig REQUIRED) > pkg_check_modules(BLAS REQUIRED blas>=1.2.3.4) Using pkg-config to find blas/lapack is a bit special to gentoo, but as there are at least 5 package having problems with finding blas/lapack we should think about some global solution. I thought about something like adding "-DBLA_VENDOR=Generic -DBLAS_blas_LIBRARY:STRING='$(pkg-config --libs blas)'" to the cmake options.
(In reply to comment #17) > Bad approach. > Add the modified blas/lapack finder to the modules folder for the package, so > you dont have to depend on named version of cmake. No. Talked through with sci guys. We remain with this approach, or even replace CMake's FindXXX files completely with a Gentoo version that uses only PkgConfig alone. > And for second the patches in the current look will be unacceptable for the > upstream as they need to work on platforms where the pkgconfig is not present. Yes, and I'm willing to improve that and send it upstream at some point. However the present version can tell us how well this approach works. If upstream does not accept it, well then the replacement approach remains, is simple and should also work on all future cmake versions. As for all the other comments I originally wanted to write here, I'll probably better wait until I catch you on IRC sometime... :)