build psol from source - why so complicated?

253 views
Skip to first unread message

dpt...@arcor.de

unread,
Aug 20, 2014, 6:17:47 AM8/20/14
to ngx-pagesp...@googlegroups.com
Hello,

Why do you can not release psol as a tarball, that I can unpack and patch easily? Using depot_tools and gclient seems for me really unnecessary and incompatibly with my build system because of necessary patching. I can not use the shipped binaries because I am not using glibc.

My goal is to have a ngx_pagespeed dso module package for tengine. But right now, I am willing to ditch that.

Regards,
dp

Gawain Lynch

unread,
Aug 20, 2014, 6:34:10 AM8/20/14
to ngx-pagesp...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.
Visit this group at http://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

dpt...@arcor.de

unread,
Aug 20, 2014, 7:14:03 AM8/20/14
to ngx-pagesp...@googlegroups.com
Hi Gawain,

as I said, I do not use glibc. If I use the psol binary tarball, I get following errors:

----------------------------------------
checking for psol

/home/dp/ngxpstest/ngx_pagespeed-release-1.8.31.4-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a(1.time.o.o): In function `base::Tim$
time.cc:(.text._ZN4base4Time11FromDoubleTEd+0x2a): undefined reference to `__isnan'
/home/dp/ngxpstest/ngx_pagespeed-release-1.8.31.4-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a(101.ucnv.o.o): In function `pagespe$
ucnv.c:(.text.ucnv_convertEx_46+0x6db): undefined reference to `__rawmemchr'
/home/dp/ngxpstest/ngx_pagespeed-release-1.8.31.4-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a(101.ucnv.o.o): In function `ucnv_in$
ucnv.c:(.text.ucnv_internalConvert+0x276): undefined reference to `__rawmemchr'
/home/dp/ngxpstest/ngx_pagespeed-release-1.8.31.4-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a(101.uloc.o.o): In function `pagespe$
uloc.c:(.text.uloc_acceptLanguageFromHTTP_46+0x214): undefined reference to `__strtod_internal'
uloc.c:(.text.uloc_acceptLanguageFromHTTP_46+0x452): undefined reference to `__strtod_internal'
/home/dp/ngxpstest/ngx_pagespeed-release-1.8.31.4-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a(101.uniset_props.o.o): In function $
uniset_props.cpp:(.text._ZN6icu_4610UnicodeSet18applyPropertyAliasERKNS_13UnicodeStringES3_R10UErrorCode+0x35e): undefined reference to `__$
uniset_props.cpp:(.text._ZN6icu_4610UnicodeSet18applyPropertyAliasERKNS_13UnicodeStringES3_R10UErrorCode+0x462): undefined reference to `__$
/home/dp/ngxpstest/ngx_pagespeed-release-1.8.31.4-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a(101.uresbund.o.o): In function `ini$
uresbund.c:(.text.init_resb_result+0x7ee): undefined reference to `__rawmemchr'
/home/dp/ngxpstest/ngx_pagespeed-release-1.8.31.4-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a(101.uresdata.o.o): In function `pag$
uresdata.c:(.text.res_findResource_46+0x15b): undefined reference to `__rawmemchr'
collect2: error: ld returned 1 exit status
----------

What I want is a psol source tarball without the need to use gclient.

Gawain Lynch

unread,
Aug 20, 2014, 7:24:04 AM8/20/14
to ngx-pagesp...@googlegroups.com
On 20 August 2014 12:14, <dpt...@arcor.de> wrote:
as I said, I do not use glibc. If I use the psol binary tarball, I get following errors:

Oops, I misread your email. My humble apology :-)​

Jeff Kaufman

unread,
Aug 20, 2014, 9:16:07 AM8/20/14
to ngx-pagesp...@googlegroups.com
mod_pagespeed actually does release experimental source tarballs that use system libraries as dependencies, and this includes PSOL:


We haven't documented these publicly yet because we're not confident that we've done them properly.  I believe the person who builds the SUSE binaries for mod_pagespeed is now using the tarball, though, which is promising.

If you try the tarball, and it works or doesn't work, could you post on mod_pagespeed issue #968 and let us know?


--

dpt...@arcor.de

unread,
Aug 20, 2014, 10:39:04 AM8/20/14
to ngx-pagesp...@googlegroups.com
Thanks.

I did some fixes for musl, but now hanging here:

  CXX(target) out/Release/obj.target/instaweb_rewriter_image/net/instaweb/rewriter/image.o
net/instaweb/rewriter/image.cc: In function 'pagespeed::image_compression::ScanlineWriterInterface* net_instaweb::{anonymous}::CreateUncompressedPngWriter(size_t, size_t, GoogleString*, net_instaweb::MessageHandler*, bool)':
net/instaweb/rewriter/image.cc:324:45: error: 'Z_NO_COMPRESSION' was not declared in this scope
   PngCompressParams config(PNG_FILTER_NONE, Z_NO_COMPRESSION);
                                             ^
net/instaweb/rewriter/image.cc: In member function 'virtual bool net_instaweb::ImageImpl::ResizeTo(const net_instaweb::ImageDim&)':
net/instaweb/rewriter/image.cc:925:55: error: 'Z_DEFAULT_STRATEGY' was not declared in this scope
         PngCompressParams png_config(PNG_FILTER_NONE, Z_DEFAULT_STRATEGY);
                                                       ^
net/instaweb/instaweb_rewriter_image.target.mk:331: recipe for target 'out/Release/obj.target/instaweb_rewriter_image/net/instaweb/rewriter/image.o' failed
make[1]: *** [out/Release/obj.target/instaweb_rewriter_image/net/instaweb/rewriter/image.o] Error 1
make[1]: Leaving directory '/home/dp/test/modpagespeed-1.8.31.4/src'
Makefile:199: recipe for target 'build_libraries' failed
make: *** [build_libraries] Error 2

There is only one occurrence of Z_DEFAULT_STRATEGY (in line 925). Do I miss something or is this a bug?

Jeff Kaufman

unread,
Aug 20, 2014, 11:28:46 AM8/20/14
to ngx-pagesp...@googlegroups.com
Could you paste the diffs of the musl fixes you made?

Z_NO_COMPRESSION and Z_DEFAULT_STRATEGY should be defined in zlib.h.  Do you have zlib-dev installed?


--

Maksim Orlovich

unread,
Aug 20, 2014, 11:36:32 AM8/20/14
to ngx-pagesp...@googlegroups.com
Maybe that file just needs an explicit zlib.h include? I could totally
see whatever libpng we normally use including it
transitively while some other version doesn't.

dpt...@arcor.de

unread,
Aug 20, 2014, 1:41:50 PM8/20/14
to ngx-pagesp...@googlegroups.com
That was it. An explicit zlib.h include solved the problem.

Next problem:
http://pastie.org/private/hdga8obrytmcrfauywt3fq

I need to figure out, if that is an error from pagespeed or libpng.

Jeff Kaufman

unread,
Aug 20, 2014, 2:01:54 PM8/20/14
to ngx-pagesp...@googlegroups.com
I vaguely remember something about us having a dependency on some internal detail of libpng 1.2, and I don't remember if anyone has fixed it.  Perhaps that's what you're running into?  Can you try to build pagespeed with libpng 1.2?  We normally use 1.2.50, but I think you're using 1.6.something?

We're expecting png_info to be defined by png.h, and at least in 1.2.50 it is.


--

dpt...@arcor.de

unread,
Aug 21, 2014, 2:46:42 AM8/21/14
to ngx-pagesp...@googlegroups.com
I used libpng 1.2.51. This worked. I will send my fixes later to you.

I am stuck here now:

cd /home/dp/test/modpagespeed-1.8.31.4/src && make CXXFLAGS=" -I/usr/include/apr-1 -I/home/dp/test/libpng/include -l/home/dp/test/libpng/lib" BUILDTYPE=Release
make[1]: Entering directory '/home/dp/test/modpagespeed-1.8.31.4/src'
  ACTION Extracting last change to /home/dp/test/modpagespeed-1.8.31.4/src/out/Release/obj/gen/build/LASTCHANGE out/Release/obj/gen/build/LASTCHANGE.always
  ACTION Generating version header file: "/home/dp/test/modpagespeed-1.8.31.4/src/out/Release/obj/gen/net/instaweb/public/version.h" out/Release/obj/gen/net/instaweb/public/version.h
  ACTION _home_dp_test_modpagespeed_1_8_31_4_src_build_install_gyp_linux_installer_configs_target_save_build_info out/Release/installer/version.txt
make[1]: Leaving directory '/home/dp/test/modpagespeed-1.8.31.4/src'
make examples
make[1]: Entering directory '/home/dp/test/modpagespeed-1.8.31.4/src/net/instaweb/automatic'
make[1]: *** No rule to make target '/home/dp/test/modpagespeed-1.8.31.4/src/out/Release/obj.target/third_party/apr/libapr.a', needed by '/home/dp/test/modpagespeed-1.8.31.4/src/net/instaweb/automatic/pagespeed_automatic.a'.  Stop.
make[1]: Leaving directory '/home/dp/test/modpagespeed-1.8.31.4/src/net/instaweb/automatic'
Makefile:231: recipe for target 'all' failed
make: *** [all] Error 2

In the documentation, you wrote:
While make all will always report an error, as long as it creates pagespeed_automatic.a you have what you need.

I still can not find the pagespeed_automatic.a, what is missing?

Maksim Orlovich

unread,
Aug 21, 2014, 9:55:16 AM8/21/14
to ngx-pagesp...@googlegroups.com
On Thu, Aug 21, 2014 at 2:46 AM, <dpt...@arcor.de> wrote:
> I used libpng 1.2.51. This worked. I will send my fixes later to you.
>
> I am stuck here now:
>

<snip>

> '/home/dp/test/modpagespeed-1.8.31.4/src/net/instaweb/automatic'
> make[1]: *** No rule to make target
> '/home/dp/test/modpagespeed-1.8.31.4/src/out/Release/obj.target/third_party/apr/libapr.a',
> needed by
> '/home/dp/test/modpagespeed-1.8.31.4/src/net/instaweb/automatic/pagespeed_automatic.a'.
> Stop.

OK, this one is easy, but annoying. Essentially
net/instaweb/automatic/Makefile assumes it will be
linking to static versions of a bunch of libraries you're linking
dynamically now.
If you look as it, it has a bunch of .a files in a list, and you'll
likely need to remove these:

third_party/apr/libapr.a \
third_party/aprutil/libaprutil.a \
third_party/icu/libicudata.a \
third_party/icu/libicuuc.a \
third_party/libjpeg_turbo/libjpeg.a \
third_party/libjpeg_turbo/src/libjpeg_turbo.a \
third_party/serf/libopenssl.a \
third_party/zlib/libzlib.a \

Maybe also giflib, not sure if that properly uses system one these days.

... Then you'll need to hack the config file in nginx_pagespeed to add
-l and -L lines for these.
Reply all
Reply to author
Forward
0 new messages