Re: Building 0.10.22.3 fails with error: 'use_speed_' was not declared in this scope

781 views
Skip to first unread message

Maksim Orlovich

unread,
Aug 8, 2012, 11:16:38 AM8/8/12
to mod-pagesp...@googlegroups.com
It's quite possible that patching in
http://code.google.com/p/modpagespeed/source/detail?spec=svn1764&r=1677
will help with this. (Actually, it's probably a good idea w/gcc-4.7.1
regardless, perhaps I should backport it).


On Tue, Aug 7, 2012 at 5:38 PM, Robert Munteanu
<robert....@gmail.com> wrote:
> Hi,
>
> I'm trying to build an updated RPM package for OpenSUSE, and to be a good
> citizen in RPM-land I'm using system dependencies. The build fails for me
> with
>
> [ 185s] CXX(target)
> out/Release/obj.target/instaweb_rewriter_image/net/instaweb/rewriter/webp_optimizer.o
> [ 185s] CXX(target)
> out/Release/obj.target/instaweb_rewriter_javascript/net/instaweb/rewriter/javascript_code_block.o
> [ 185s] In file included from /usr/include/opencv2/flann/lsh_index.h:49:0,
> [ 185s] from /usr/include/opencv2/flann/all_indices.h:42,
> [ 185s] from /usr/include/opencv2/flann/flann_base.hpp:44,
> [ 185s] from /usr/include/opencv2/flann/flann.hpp:50,
> [ 185s] from /usr/include/opencv/cv.h:69,
> [ 185s] from net/instaweb/rewriter/image.cc:43:
> [ 185s] /usr/include/opencv2/flann/lsh_table.h: In member function 'void
> cvflann::lsh::LshTable<ElementType>::add(cvflann::Matrix<T>)':
> [ 185s] /usr/include/opencv2/flann/lsh_table.h:196:14: error: 'use_speed_'
> was not declared in this scope
> [ 186s] make: ***
> [out/Release/obj.target/instaweb_rewriter_image/net/instaweb/rewriter/image.o]
> Error 1
> [ 186s] make: *** Waiting for unfinished jobs....
> [ 187s] error: Bad exit status from /var/tmp/rpm-tmp.MKwlb8 (%build)
> [ 187s]
> [ 187s]
> [ 187s] RPM build errors:
> [ 187s] Bad exit status from /var/tmp/rpm-tmp.MKwlb8 (%build)
>
> I'm using gcc 4.7.1 and opencv 2.4.1 . My knowledge of C/C++ is close to
> zero, but I'm able to apply patches and tweak build scripts.
>
> What can I try to fix the build for OpenSUSE?
>
> Thanks,
>
> Robert
>
>

Maksim Orlovich

unread,
Aug 9, 2012, 5:12:34 PM8/9/12
to mod-pagesp...@googlegroups.com
Odd. Could you add V=1 to the make command line and paste that command
it uses to link?
Also, what's the output of:
pkg-config --libs-only-L --libs-only-other opencv
pkg-config --libs-only-l opencv



On Thu, Aug 9, 2012 at 4:48 PM, Robert Munteanu
<robert....@gmail.com> wrote:
> Thanks for the link, the patch helps!
>
> Now the build fails later on, apparently still opencv-relatd
>
> [ 334s] LINK(target) out/Release/mod_pagespeed_speed_test
> [ 334s] CXX(target)
> out/Release/obj.target/mod_pagespeed/net/instaweb/apache/apache_cache.o
> [ 335s] CXX(target)
> out/Release/obj.target/mod_pagespeed/net/instaweb/apache/apache_config.o
> [ 336s]
> out/Release/obj.target/net/instaweb/../../instaweb_rewriter_image/net/instaweb/rewriter/image.o:
> In function `cv::Mat::~Mat()':
> [ 336s] image.cc:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x69): undefined
> reference to `cv::Mat::deallocate()'
> [ 336s] image.cc:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x54): undefined
> reference to `cv::fastFree(void*)'
> [ 336s]
> out/Release/obj.target/net/instaweb/../../instaweb_rewriter_image/net/instaweb/rewriter/image.o:
> In function `net_instaweb::ImageImpl::DrawImage(net_instaweb::Image*, int,
> int)':
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0xd4):
> undefined reference to `cv::Mat::Mat(_IplImage const*, bool)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0xe7):
> undefined reference to `cv::Mat::Mat(_IplImage const*, bool)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x12d):
> undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Range const&,
> cv::Range const&)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x165):
> undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Range const&,
> cv::Range const&)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x1e0):
> undefined reference to `cv::fastFree(void*)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x1f5):
> undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x207):
> undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x286):
> undefined reference to `cv::fastFree(void*)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x301):
> undefined reference to `cv::fastFree(void*)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x37c):
> undefined reference to `cv::fastFree(void*)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x3b9):
> undefined reference to `cv::Mat::deallocate()'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x3ce):
> undefined reference to `cv::Mat::deallocate()'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x3e9):
> undefined reference to `cv::Mat::deallocate()'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl9DrawImageEPNS_5ImageEii+0x401):
> undefined reference to `cv::Mat::deallocate()'
> [ 336s]
> out/Release/obj.target/net/instaweb/../../instaweb_rewriter_image/net/instaweb/rewriter/image.o:
> In function `net_instaweb::ImageImpl::CleanOpenCv()':
> [ 336s] image.cc:(.text._ZN12net_instaweb9ImageImpl11CleanOpenCvEv+0xc):
> undefined reference to `cvReleaseImage'
> [ 336s]
> out/Release/obj.target/net/instaweb/../../instaweb_rewriter_image/net/instaweb/rewriter/image.o:
> In function `net_instaweb::ImageImpl::LoadOpenCvEmpty()':
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl15LoadOpenCvEmptyEv+0x27):
> undefined reference to `cvCreateImage'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl15LoadOpenCvEmptyEv+0x33):
> undefined reference to `cvSetZero'
> [ 336s]
> out/Release/obj.target/net/instaweb/../../instaweb_rewriter_image/net/instaweb/rewriter/image.o:
> In function `net_instaweb::ImageImpl::LoadOpenCvFromBuffer(base::StringPiece
> const&)':
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl20LoadOpenCvFromBufferERKN4base11StringPieceE+0x45):
> undefined reference to `cvDecodeImage'
> [ 336s]
> out/Release/obj.target/net/instaweb/../../instaweb_rewriter_image/net/instaweb/rewriter/image.o:
> In function
> `net_instaweb::ImageImpl::SaveOpenCvToBuffer(std::vector<unsigned char,
> std::allocator<unsigned char> >*)':
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl18SaveOpenCvToBufferEPSt6vectorIhSaIhEE+0x36):
> undefined reference to `cv::Mat::Mat(_IplImage const*, bool)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl18SaveOpenCvToBufferEPSt6vectorIhSaIhEE+0x45):
> undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl18SaveOpenCvToBufferEPSt6vectorIhSaIhEE+0xa0):
> undefined reference to `cv::imencode(std::string const&, cv::_InputArray
> const&, std::vector<unsigned char, std::allocator<unsigned char> >&,
> std::vector<int, std::allocator<int> > const&)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl18SaveOpenCvToBufferEPSt6vectorIhSaIhEE+0x12a):
> undefined reference to `cv::fastFree(void*)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl18SaveOpenCvToBufferEPSt6vectorIhSaIhEE+0x1c6):
> undefined reference to `cv::Mat::deallocate()'
> [ 336s]
> out/Release/obj.target/net/instaweb/../../instaweb_rewriter_image/net/instaweb/rewriter/image.o:
> In function `net_instaweb::ImageImpl::ResizeTo(net_instaweb::ImageDim
> const&)':
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0x9c):
> undefined reference to `cvCreateImage'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0xc0):
> undefined reference to `cv::cvarrToMat(void const*, bool, bool, int)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0xda):
> undefined reference to `cv::cvarrToMat(void const*, bool, bool, int)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0x15e):
> undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0x16d):
> undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0x18f):
> undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray
> const&, cv::Size_<int>, double, double, int)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0x20a):
> undefined reference to `cv::fastFree(void*)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0x273):
> undefined reference to `cv::fastFree(void*)'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0x27c):
> undefined reference to `cvReleaseImage'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0x306):
> undefined reference to `cv::Mat::deallocate()'
> [ 336s]
> image.cc:(.text._ZN12net_instaweb9ImageImpl8ResizeToERKNS_8ImageDimE+0x319):
> undefined reference to `cv::Mat::deallocate()'
> [ 336s]
> out/Release/obj.target/net/instaweb/../../instaweb_rewriter_image/net/instaweb/rewriter/image.o:(.data.DW.ref._ZTIN2cv9ExceptionE[DW.ref._ZTIN2cv9ExceptionE]+0x0):
> undefined reference to `typeinfo for cv::Exception'
> [ 336s] collect2: error: ld returned 1 exit status
> [ 336s] make: *** [out/Release/mod_pagespeed_speed_test] Error 1
> [ 336s] make: *** Waiting for unfinished jobs....
> [ 336s] error: Bad exit status from /var/tmp/rpm-tmp.jclqlc (%build)
> [ 336s]
> [ 336s]
> [ 336s] RPM build errors:
> [ 336s] Bad exit status from /var/tmp/rpm-tmp.jclqlc (%build)

Robert Munteanu

unread,
Aug 9, 2012, 5:32:29 PM8/9/12
to mod-pagesp...@googlegroups.com
On Fri, Aug 10, 2012 at 12:12 AM, Maksim Orlovich <morl...@google.com> wrote:
> Odd. Could you add V=1 to the make command line and paste that command
> it uses to link?

The build output gets quite large, I've uploaded the complete logs at

http://dl.dropbox.com/u/3160732/osc-build.log.gz

> Also, what's the output of:
> pkg-config --libs-only-L --libs-only-other opencv
> pkg-config --libs-only-l opencv

Seems to be empty :| . Please note that I'm using -Duse_system_libs=1
, it that makes any difference.
--
Sent from my (old) computer

Maksim Orlovich

unread,
Aug 10, 2012, 10:25:40 AM8/10/12
to mod-pagesp...@googlegroups.com
On Thu, Aug 9, 2012 at 5:32 PM, Robert Munteanu
<robert....@gmail.com> wrote:
> On Fri, Aug 10, 2012 at 12:12 AM, Maksim Orlovich <morl...@google.com> wrote:
>> Odd. Could you add V=1 to the make command line and paste that command
>> it uses to link?
>
> The build output gets quite large, I've uploaded the complete logs at
>
> http://dl.dropbox.com/u/3160732/osc-build.log.gz
>
>> Also, what's the output of:
>> pkg-config --libs-only-L --libs-only-other opencv
>> pkg-config --libs-only-l opencv
>
> Seems to be empty :| .

That would be the source of the problem then...
What does pkg-config --libs opencv say?
Also, any place I can grab the libopencv or whatever
RPMs you are building against? I want to peek at
what their opencv .pc files say...

> Please note that I'm using -Duse_system_libs=1
> , it that makes any difference.

I am aware --- your system OpenCV won't matter otherwise.

Robert Munteanu

unread,
Aug 11, 2012, 6:34:52 AM8/11/12
to mod-pagesp...@googlegroups.com
On Fri, Aug 10, 2012 at 5:25 PM, Maksim Orlovich <morl...@google.com> wrote:
> On Thu, Aug 9, 2012 at 5:32 PM, Robert Munteanu
> <robert....@gmail.com> wrote:
>> On Fri, Aug 10, 2012 at 12:12 AM, Maksim Orlovich <morl...@google.com> wrote:
>>> Odd. Could you add V=1 to the make command line and paste that command
>>> it uses to link?
>>
>> The build output gets quite large, I've uploaded the complete logs at
>>
>> http://dl.dropbox.com/u/3160732/osc-build.log.gz
>>
>>> Also, what's the output of:
>>> pkg-config --libs-only-L --libs-only-other opencv
>>> pkg-config --libs-only-l opencv
>>
>> Seems to be empty :| .
>
> That would be the source of the problem then...
> What does pkg-config --libs opencv say?

linux-kvpn:/> pkg-config --libs opencv
/usr/lib64/libopencv_calib3d.so /usr/lib64/libopencv_contrib.so
/usr/lib64/libopencv_core.so /usr/lib64/libopencv_features2d.so
/usr/lib64/libopencv_flann.so /usr/lib64/libopencv_gpu.so
/usr/lib64/libopencv_highgui.so /usr/lib64/libopencv_imgproc.so
/usr/lib64/libopencv_legacy.so /usr/lib64/libopencv_ml.so
/usr/lib64/libopencv_nonfree.so /usr/lib64/libopencv_objdetect.so
/usr/lib64/libopencv_photo.so /usr/lib64/libopencv_stitching.so
/usr/lib64/libopencv_ts.so /usr/lib64/libopencv_video.so
/usr/lib64/libopencv_videostab.so

> Also, any place I can grab the libopencv or whatever
> RPMs you are building against? I want to peek at
> what their opencv .pc files say...

That would be opencv-devel-2.4.2-1.2.x86_64 from openSUSE 12.2, that is

https://build.opensuse.org/package/show?project=openSUSE%3A12.2&package=opencv

Direct download link

http://download.opensuse.org/factory-snapshot/repo/oss/suse/x86_64/opencv-devel-2.4.1-2.1.2.x86_64.rpm

Thanks,

Robert

>
>> Please note that I'm using -Duse_system_libs=1
>> , it that makes any difference.
>
> I am aware --- your system OpenCV won't matter otherwise.



Maksim Orlovich

unread,
Aug 13, 2012, 11:16:17 AM8/13/12
to mod-pagesp...@googlegroups.com
Aha, thanks for the data. Does applying the attached patch help things?
try_to_fix_opencv_gyp.diff

Robert Munteanu

unread,
Aug 13, 2012, 4:04:59 PM8/13/12
to mod-pagesp...@googlegroups.com
On Mon, Aug 13, 2012 at 6:16 PM, Maksim Orlovich <morl...@google.com> wrote:
> Aha, thanks for the data. Does applying the attached patch help things?

Sorry, still fails in the same way.

http://dl.dropbox.com/u/3160732/osc-build-2.log.gz

Also, in case it matters

linux-kvpn:/> pkg-config --libs-only-other opencv
/usr/lib64/libopencv_calib3d.so /usr/lib64/libopencv_contrib.so
/usr/lib64/libopencv_core.so /usr/lib64/libopencv_features2d.so
/usr/lib64/libopencv_flann.so /usr/lib64/libopencv_gpu.so
/usr/lib64/libopencv_highgui.so /usr/lib64/libopencv_imgproc.so
/usr/lib64/libopencv_legacy.so /usr/lib64/libopencv_ml.so
/usr/lib64/libopencv_nonfree.so /usr/lib64/libopencv_objdetect.so
/usr/lib64/libopencv_photo.so /usr/lib64/libopencv_stitching.so
/usr/lib64/libopencv_ts.so /usr/lib64/libopencv_video.so
/usr/lib64/libopencv_videostab.so
linux-kvpn:/> pkg-config --libs-only-L opencv

Maksim Orlovich

unread,
Aug 13, 2012, 4:52:59 PM8/13/12
to mod-pagesp...@googlegroups.com
Hmm, how about the attached? (This is getting quite brittle, though..)
opencv-try2.diff

Robert Munteanu

unread,
Aug 13, 2012, 5:22:47 PM8/13/12
to mod-pagesp...@googlegroups.com
I'm afraid it still fails _however_ I did make one change which should
help. The build by default used -j4, as in


which messed up the results a bit. With just one job the resulting error is

[ 481s] g++ '-DPAGESPEED_SUPPORT_POSIX_SHARED_MEM'
'-D_LARGEFILE64_SOURCE' '-DHAVE_CONFIG_H' '-DLINUX=2' '-D_REENTRANT'
'-D_GNU_SOURCE' '-DGOOGLE_PROTOBUF_NO_RTTI' '-D__STDC_FORMAT_MACROS'
'-DNDEBUG' -Ithird_party/chromium/src
-Iout/Release/obj/gen/protoc_out/instaweb -I. -I/usr/include/apache2
-I/usr/include/apr-1 -Ithird_party/protobuf -Ithird_party/protobuf/src
-Ithird_party/gflags/gen/arch/linux/x64/include
-Ithird_party/gflags/src -Iout/Release/obj/gen -pthread
-fno-exceptions -Wall -Wno-unused-parameter
-Wno-missing-field-initializers -D_FILE_OFFSET_BITS=64
-fvisibility=hidden -pipe -fPIC -fno-strict-aliasing -fexceptions
-fasynchronous-unwind-tables -O2 -fno-ident -fdata-sections
-ffunction-sections -fno-rtti -fno-threadsafe-statics
-fvisibility-inlines-hidden -frtti -MMD -MF
out/Release/.deps/out/Release/obj.target/mod_pagespeed/net/instaweb/apache/apache_message_handler.o.d.raw
-c -o out/Release/obj.target/mod_pagespeed/net/instaweb/apache/apache_message_handler.o
net/instaweb/apache/apache_message_handler.cc
[ 481s] net/instaweb/apache/apache_message_handler.cc: In constructor
'net_instaweb::ApacheMessageHandler::ApacheMessageHandler(const
server_rec*, const base::StringPiece&, net_instaweb::Timer*)':
[ 481s] net/instaweb/apache/apache_message_handler.cc:51:42: error:
'getpid' was not declared in this scope
[ 481s] net/instaweb/apache/apache_message_handler.cc: In member
function 'virtual void
net_instaweb::ApacheMessageHandler::MessageVImpl(net_instaweb::MessageType,
const char*, __va_list_tag*)':
[ 481s] net/instaweb/apache/apache_message_handler.cc:89:72: error:
'getpid' was not declared in this scope
[ 481s] net/instaweb/apache/apache_message_handler.cc: In member
function 'virtual void
net_instaweb::ApacheMessageHandler::FileMessageVImpl(net_instaweb::MessageType,
const char*, int, const char*, __va_list_tag*)':
[ 481s] net/instaweb/apache/apache_message_handler.cc:112:72: error:
'getpid' was not declared in this scope
[ 481s] make: ***
[out/Release/obj.target/mod_pagespeed/net/instaweb/apache/apache_message_handler.o]
Error 1
[ 481s] error: Bad exit status from /var/tmp/rpm-tmp.afTzO7 (%build)
[ 481s]
[ 481s]
[ 481s] RPM build errors:
[ 481s] Bad exit status from /var/tmp/rpm-tmp.afTzO7 (%build)

Maksim Orlovich

unread,
Aug 13, 2012, 5:29:25 PM8/13/12
to mod-pagesp...@googlegroups.com
-j4 is fine, it just makes the log a little harder to build.

Anyway, the problem you mention here should be fixed by
http://code.google.com/p/modpagespeed/source/detail?spec=svn1784&r=1680


On Mon, Aug 13, 2012 at 5:22 PM, Robert Munteanu

Robert Munteanu

unread,
Aug 13, 2012, 6:17:03 PM8/13/12
to mod-pagesp...@googlegroups.com
On Tue, Aug 14, 2012 at 12:29 AM, Maksim Orlovich <morl...@google.com> wrote:
> -j4 is fine, it just makes the log a little harder to build.
>

Right, I just tried to make the error clearer.

> Anyway, the problem you mention here should be fixed by
> http://code.google.com/p/modpagespeed/source/detail?spec=svn1784&r=1680
>

This, combined with opencv-try2.diff and
http://code.google.com/p/modpagespeed/source/detail?spec=svn1764&r=1677
allow the build to complete.

I'm going to test the resulting binary tomorrow.

Many thanks for your help!

Robert
Reply all
Reply to author
Forward
0 new messages