May I have better Linux Skia build directions?

1,876 views
Skip to first unread message

Joshua Olson

unread,
Dec 21, 2016, 11:38:01 PM12/21/16
to skia-discuss
I tried virtualenv and symlink hacks on Manjaro Linux so python refers to python2, but gn gen out/{Static|Release} encounter errors. I ran Ubuntu 16.10 in VirtualBox but the 'python bin/fetch-gn' step from https://skia.org/user/build seems to be missing some python path logic.

1. Did I miss an isolate/downloadable build from https://status.skia.org/ ?
2. Is there a better way to ask for changes to skia.org than posting here?
3. Do I need Ubuntu 14.04 to build Skia with the provided directions? What information do you need to be able to help me?

Thank you,
Josh

Cary Clark

unread,
Dec 22, 2016, 7:25:23 AM12/22/16
to skia-d...@googlegroups.com
Hi Josh

What version of  python are you running?

$ python -V

It should be around 2.7.x ; the scripts won't work with Python 3.

What python errors are you seeing?

To answer your questions:
1. There's no build one can download from status.skia.org.
The instructions at https://skia.org/user/download and
https://skia.org/user/build are current and correct.

2. This is the right place to ask.

3. I am using Ubuntu 14.04 but folks have been successful on other distros.
Did depot tools install successfully?

More information will help us debug your specific setup.

Cary

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

Joshua Olson

unread,
Dec 22, 2016, 11:52:12 AM12/22/16
to skia-discuss
Thanks, Cary. I'll try with Manjaro first. I can make python -V show 2.7.12, then from the downloaded skia directory I run:

gn gen out/Static --args='is_official_build=true is_debug=false skia_use_vulkan=true'
...
gn gen
out/Release --args='is_official_build=true is_debug=false skia_use_vulkan=true'
...
ninja
-C out/Static (or Release)
ninja
: Entering directory `out/Static`
[682/2283] compile ../../src/gpu/text/GrTextUtils.cpp
FAILED
: obj/src/gpu/text/gpu.GrTextUtils.o
c
++ -MMD -MF obj/src/gpu/text/gpu.GrTextUtils.o.d -DNDEBUG -DSK_SAMPLES_FOR_X -DSK_GAMMA_APPLY_TO_A8 -DSK_INTERNAL -DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0 -DSKIA_IMPLEMENTATION=1 -DSK_VULKAN -I../../include/android -I../../include/c -I../../include/codec -I../../include/config -I../../include/core -I../../include/effects -I../../include/gpu -I../../include/gpu/gl -I../../include/images -I../../include/pathops -I../../include/ports -I../../include/svg -I../../include/utils -I../../include/utils/mac -I../../include/xml -I../../include/private -I../../src/c -I../../src/codec -I../../src/core -I../../src/effects -I../../src/effects/gradients -I../../src/fonts -I../../src/gpu -I../../src/image -I../../src/images -I../../src/lazy -I../../src/opts -I../../src/pathops -I../../src/pdf -I../../src/ports -I../../src/sfnt -I../../src/sksl -I../../src/utils -I../../src/utils/win -I../../third_party/etc1 -I../../third_party/gif -I../../third_party/ktx -fstrict-aliasing -fPIC -fvisibility=hidden -Werror -Wall -Wextra -Winit-self -Wpointer-arith -Wsign-compare -Wvla -Wno-deprecated-declarations -Wno-maybe-uninitialized -Wno-unused-parameter -O3 -momit-leaf-frame-pointer -std=c++11 -fno-threadsafe-statics -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Wnon-virtual-dtor -c ../../src/gpu/text/GrTextUtils.cpp -o obj/src/gpu/text/gpu.GrTextUtils.o
In file included from ../../src/gpu/text/GrTextUtils.cpp:19:0:
../../src/core/SkFindAndPlaceGlyph.h:498:17: error: SkPoint SkFindAndPlaceGlyph::GlyphFindAndPlaceFullPixel<ProcessOneGlyph, kTextAlignment, kUseKerning>::findAndPositionGlyph(const char**, SkPoint, ProcessOneGlyph&&) [with ProcessOneGlyph = GrTextUtils::DrawBmpText(GrAtlasTextBlob*, int, GrAtlasGlyphCache*, const SkSurfaceProps&, const SkPaint&, GrColor, uint32_t, const SkMatrix&, const char*, size_t, SkScalar, SkScalar)::<lambda(const SkGlyph&, SkPoint, SkPoint)>; SkPaint::Align kTextAlignment = (SkPaint::Align)2u; SkFindAndPlaceGlyph::SelectKerning kUseKerning = (SkFindAndPlaceGlyph::SelectKerning)0u]’ declared static but never defined [-Werror=unused-function]
         
SkPoint findAndPositionGlyph(
                 
^~~~~~~~~~~~~~~~~~~~
../../src/core/SkFindAndPlaceGlyph.h:498:17: error: SkPoint SkFindAndPlaceGlyph::GlyphFindAndPlaceFullPixel<ProcessOneGlyph, kTextAlignment, kUseKerning>::findAndPositionGlyph(const char**, SkPoint, ProcessOneGlyph&&) [with ProcessOneGlyph = GrTextUtils::DrawBmpText(GrAtlasTextBlob*, int, GrAtlasGlyphCache*, const SkSurfaceProps&, const SkPaint&, GrColor, uint32_t, const SkMatrix&, const char*, size_t, SkScalar, SkScalar)::<lambda(const SkGlyph&, SkPoint, SkPoint)>; SkPaint::Align kTextAlignment = (SkPaint::Align)1u; SkFindAndPlaceGlyph::SelectKerning kUseKerning = (SkFindAndPlaceGlyph::SelectKerning)0u]’ declared static but never defined [-Werror=unused-function]
../../src/core/SkFindAndPlaceGlyph.h:498:17: error: SkPoint SkFindAndPlaceGlyph::GlyphFindAndPlaceFullPixel<ProcessOneGlyph, kTextAlignment, kUseKerning>::findAndPositionGlyph(const char**, SkPoint, ProcessOneGlyph&&) [with ProcessOneGlyph = GrTextUtils::DrawBmpText(GrAtlasTextBlob*, int, GrAtlasGlyphCache*, const SkSurfaceProps&, const SkPaint&, GrColor, uint32_t, const SkMatrix&, const char*, size_t, SkScalar, SkScalar)::<lambda(const SkGlyph&, SkPoint, SkPoint)>; SkPaint::Align kTextAlignment = (SkPaint::Align)0u; SkFindAndPlaceGlyph::SelectKerning kUseKerning = (SkFindAndPlaceGlyph::SelectKerning)0u]’ declared static but never defined [-Werror=unused-function]
../../src/core/SkFindAndPlaceGlyph.h:437:17: error: SkPoint SkFindAndPlaceGlyph::GlyphFindAndPlaceSubpixel<ProcessOneGlyph, kTextAlignment, kAxisAlignment>::findAndPositionGlyph(const char**, SkPoint, ProcessOneGlyph&&) [with ProcessOneGlyph = GrTextUtils::DrawBmpText(GrAtlasTextBlob*, int, GrAtlasGlyphCache*, const SkSurfaceProps&, const SkPaint&, GrColor, uint32_t, const SkMatrix&, const char*, size_t, SkScalar, SkScalar)::<lambda(const SkGlyph&, SkPoint, SkPoint)>; SkPaint::Align kTextAlignment = (SkPaint::Align)2u; SkAxisAlignment kAxisAlignment = (SkAxisAlignment)2u]’ declared static but never defined [-Werror=unused-function]
         
SkPoint findAndPositionGlyph(
                 
^~~~~~~~~~~~~~~~~~~~
../../src/core/SkFindAndPlaceGlyph.h:437:17: error: SkPoint SkFindAndPlaceGlyph::GlyphFindAndPlaceSubpixel<ProcessOneGlyph, kTextAlignment, kAxisAlignment>::findAndPositionGlyph(const char**, SkPoint, ProcessOneGlyph&&) [with ProcessOneGlyph = GrTextUtils::DrawBmpText(GrAtlasTextBlob*, int, GrAtlasGlyphCache*, const SkSurfaceProps&, const SkPaint&, GrColor, uint32_t, const SkMatrix&, const char*, size_t, SkScalar, SkScalar)::<lambda(const SkGlyph&, SkPoint, SkPoint)>; SkPaint::Align kTextAlignment = (SkPaint::Align)2u; SkAxisAlignment kAxisAlignment = (SkAxisAlignment)1u]’ declared static but never defined [-Werror=unused-function]
../../src/core/SkFindAndPlaceGlyph.h:437:17: error: SkPoint SkFindAndPlaceGlyph::GlyphFindAndPlaceSubpixel<ProcessOneGlyph, kTextAlignment, kAxisAlignment>::findAndPositionGlyph(const char**, SkPoint, ProcessOneGlyph&&) [with ProcessOneGlyph = GrTextUtils::DrawBmpText(GrAtlasTextBlob*, int, GrAtlasGlyphCache*, const SkSurfaceProps&, const SkPaint&, GrColor, uint32_t, const SkMatrix&, const char*, size_t, SkScalar, SkScalar)::<lambda(const SkGlyph&, SkPoint, SkPoint)>; SkPaint::Align kTextAlignment = (SkPaint::Align)2u; SkAxisAlignment kAxisAlignment = (SkAxisAlignment)0u]’ declared static but never defined [-Werror=unused-function]
../../src/core/SkFindAndPlaceGlyph.h:437:17: error: SkPoint SkFindAndPlaceGlyph::GlyphFindAndPlaceSubpixel<ProcessOneGlyph, kTextAlignment, kAxisAlignment>::findAndPositionGlyph(const char**, SkPoint, ProcessOneGlyph&&) [with ProcessOneGlyph = GrTextUtils::DrawBmpText(GrAtlasTextBlob*, int, GrAtlasGlyphCache*, const SkSurfaceProps&, const SkPaint&, GrColor, uint32_t, const SkMatrix&, const char*, size_t, SkScalar, SkScalar)::<lambda(const SkGlyph&, SkPoint, SkPoint)>; SkPaint::Align kTextAlignment = (SkPaint::Align)1u; SkAxisAlignment kAxisAlignment = (SkAxisAlignment)2u]’ declared static but never defined [-Werror=unused-function]
../../src/core/SkFindAndPlaceGlyph.h:437:17: error: SkPoint SkFindAndPlaceGlyph::GlyphFindAndPlaceSubpixel<ProcessOneGlyph, kTextAlignment, kAxisAlignment>::findAndPositionGlyph(const char**, SkPoint, ProcessOneGlyph&&) [with ProcessOneGlyph = GrTextUtils::DrawBmpText(GrAtlasTextBlob*, int, GrAtlasGlyphCache*, const SkSurfaceProps&, const SkPaint&, GrColor, uint32_t, const SkMatrix&, const char*, size_t, SkScalar, SkScalar)::<lambda(const SkGlyph&, SkPoint, SkPoint)>; SkPaint::Align kTextAlignment = (SkPaint::Align)1u; SkAxisAlignment kAxisAlignment = (SkAxisAlignment)1u]’ declared static but never defined [-Werror=unused-function]
../../src/core/SkFindAndPlaceGlyph.h:437:17: error: SkPoint SkFindAndPlaceGlyph::GlyphFindAndPlaceSubpixel<ProcessOneGlyph, kTextAlignment, kAxisAlignment>::findAndPositionGlyph(const char**, SkPoint, ProcessOneGlyph&&) [with ProcessOneGlyph = GrTextUtils::DrawBmpText(GrAtlasTextBlob*, int, GrAtlasGlyphCache*, const SkSurfaceProps&, const SkPaint&, GrColor, uint32_t, const SkMatrix&, const char*, size_t, SkScalar, SkScalar)::<lambda(const SkGlyph&, SkPoint, SkPoint)>; SkPaint::Align kTextAlignment = (SkPaint::Align)1u; SkAxisAlignment kAxisAlignment = (SkAxisAlignment)0u]’ declared static but never defined [-Werror=unused-function]
cc1plus
: all warnings being treated as errors
...
ninja: build stopped: subcommand failed.

Joshua Olson

unread,
Dec 22, 2016, 12:39:13 PM12/22/16
to skia-discuss
I was being stupid with 'python path logic', but now Ubuntu gives me the exact same error without the vulkan argument. IIRC, using git clone -b chrome/m56 works no better than master.

Greg Daniel

unread,
Dec 22, 2016, 12:44:26 PM12/22/16
to skia-discuss
I'm not sure what the actual bug is, but removing the use_vulkan probably did nothing. If you have the env. variable VULKAN_SDK set it will automatically see that and build the vulkan backend. If you don't have it set, then you need to set skia_vulkan_sdk to the path to vulkan sdk to build the vulkan backend. I believe the skia_use_vulkan is used more often to disable the use of vulkan explicitly so it doesn't automatically read the VULKAN_SDK to know whether to enable it.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

Joshua Olson

unread,
Dec 22, 2016, 1:20:03 PM12/22/16
to skia-discuss
If it helps, I set skia_use_vulkan=false and the same error happens on the same file.

Ben Wagner

unread,
Dec 22, 2016, 2:16:50 PM12/22/16
to skia-d...@googlegroups.com
What compiler are you using? There is no 'findAndPositionGlyph' which is even close to being static, they're all virtual and defined inline. However, we have run into compiler bugs with it before.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

Joshua Olson

unread,
Dec 22, 2016, 3:26:12 PM12/22/16
to skia-discuss
c++ -v (Manjaro)
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 6.2.1 20160830 (GCC)

c++ -v (Ubuntu)
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
6.2.0-5ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++
--prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu-
--enable-shared --enable-linker-build-id --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --libdir=/usr/lib
--enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin
--enable-default-pie --with-system-zlib --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre
--enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64
--with-arch-directory=amd64
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12)


On Thursday, December 22, 2016 at 12:16:50 PM UTC-7, bungeman wrote:
What compiler are you using? There is no 'findAndPositionGlyph' which is even close to being static, they're all virtual and defined inline. However, we have run into compiler bugs with it before.
On Thu, Dec 22, 2016 at 1:20 PM, Joshua Olson <0joshua...@gmail.com> wrote:
If it helps, I set skia_use_vulkan=false and the same error happens on the same file.

On Thursday, December 22, 2016 at 10:44:26 AM UTC-7, Greg Daniel wrote:
I'm not sure what the actual bug is, but removing the use_vulkan probably did nothing. If you have the env. variable VULKAN_SDK set it will automatically see that and build the vulkan backend. If you don't have it set, then you need to set skia_vulkan_sdk to the path to vulkan sdk to build the vulkan backend. I believe the skia_use_vulkan is used more often to disable the use of vulkan explicitly so it doesn't automatically read the VULKAN_SDK to know whether to enable it.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

Joshua Olson

unread,
Dec 22, 2016, 3:35:23 PM12/22/16
to skia-discuss
The build system can't use clang 3.9 yet:

error: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Werror,-Wunknown-warning-option]

On Wednesday, December 21, 2016 at 9:38:01 PM UTC-7, Joshua Olson wrote:

Joshua Olson

unread,
Dec 22, 2016, 4:24:25 PM12/22/16
to skia-discuss
I have a different problem using gcc 5.4.0 (Manjaro):
ninja: Entering directory `out/Static'
[943/1596] compile ../../tests/RecordOptsTest.cpp
FAILED: obj/tests/tests.RecordOptsTest.o 
c++ -MMD -MF obj/tests/tests.RecordOptsTest.o.d -DNDEBUG -DSK_GAMMA_APPLY_TO_A8 -DSK_INTERNAL -DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0 -DSK_VULKAN -DSK_HAS_JPEG_LIBRARY -DSK_PDF_USE_SFNTLY -DSK_HAS_PNG_LIBRARY -DSK_CODEC_DECODES_RAW -DSK_HAS_WEBP_LIBRARY -DSK_XML -DSK_SAMPLES_FOR_X -I../../tests -I../../include/private -I../../src/c -I../../src/codec -I../../src/core -I../../src/effects -I../../src/effects/gradients -I../../src/fonts -I../../src/gpu -I../../src/image -I../../src/images -I../../src/lazy -I../../src/opts -I../../src/pathops -I../../src/pdf -I../../src/ports -I../../src/sfnt -I../../src/sksl -I../../src/utils -I../../src/utils/win -I../../third_party/etc1 -I../../third_party/gif -I../../third_party/ktx -I../../experimental/svg/model -I../../tools/flags -I../../tools/gpu -I../../include/android -I../../include/c -I../../include/codec -I../../include/config -I../../include/core -I../../include/effects -I../../include/gpu -I../../include/gpu/gl -I../../include/images -I../../include/pathops -I../../include/ports -I../../include/svg -I../../include/utils -I../../include/utils/mac -I../../include/xml -I../../tools -I../../tools/debugger -I../../tools/timer -I../../third_party/externals/jsoncpp/include -I../../third_party/libpng -I../../third_party/externals/zlib -fstrict-aliasing -fPIC -fvisibility=hidden -Werror -Wall -Wextra -Winit-self -Wpointer-arith -Wsign-compare -Wvla -Wno-deprecated-declarations -Wno-maybe-uninitialized -Wno-unused-parameter -O3 -momit-leaf-frame-pointer -std=c++11 -fno-threadsafe-statics -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Wnon-virtual-dtor -c ../../tests/RecordOptsTest.cpp -o obj/tests/tests.RecordOptsTest.o
In file included from ../../tests/RecordOptsTest.cpp:9:0:
../../tests/RecordTestUtils.h: In function ‘const T* assert_type(skiatest::Reporter*, const SkRecord&, int) [with T = SkRecords::NoOp]’:
../../tests/RecordTestUtils.h:36:19: error: function may return address of local variable [-Werror=return-local-addr]
     return reader.ptr;
                   ^
In file included from ../../tests/RecordTestUtils.h:11:0,
                 from ../../tests/RecordOptsTest.cpp:9:
../../src/core/SkRecord.h:173:21: note: declared here
             return f(SkRecords::NoOp());
                     ^

Joshua Olson

unread,
Dec 22, 2016, 11:40:59 PM12/22/16
to skia-discuss
The same error with gcc 5.4.1 (Ubuntu), and clang 3.5 has the same unrecognized flag problem.

Joshua Olson

unread,
Dec 23, 2016, 9:55:15 AM12/23/16
to skia-discuss
I was curious how Chromium is built, but its version of Skia seems to be different/behind:

(chromium.googlesource.com/chromium/src/+/master/docs/clang.md) We don't have bots that test this, but building with gcc4.8+ should still work on Linux.

Joshua Olson

unread,
Dec 23, 2016, 12:08:01 PM12/23/16
to skia-discuss
I failed to notice https://github.com/google/skia/tree/master/site before. No need to simply ask for improvements.

Can gn/gn_to_cmake.py or something from infra/bots be used by end users?

Hal Canary

unread,
Dec 23, 2016, 12:55:41 PM12/23/16
to skia-d...@googlegroups.com
On Fri, Dec 23, 2016 at 9:55 AM, Joshua Olson <0joshua...@gmail.com> wrote:
I was curious how Chromium is built, but its version of Skia seems to be different/behind:
 
That repository is out of date.  As you can see here:
    https://chromium.googlesource.com/chromium/src/+/master/DEPS
Chromium now points at
 


Joshua Olson

unread,
Dec 23, 2016, 2:02:24 PM12/23/16
to skia-discuss
Oh, right. And Skia is statically linked in after its build process, so the clang note doesn't help.

I'll try clang with -Wno-maybe-uninitialized removed. Meanwhile (gcc 4.9, maybe it's using a gcc instead of g++ linker?):
ninja: Entering directory `out/Release'
[3/26] link get_images_from_skps
FAILED: get_images_from_skps 
c++ -rdynamic -Wl,-rpath,\$ORIGIN obj/tools/get_images_from_skps.get_images_from_skps.o obj/tools/flags/flags.SkCommandLineFlags.o obj/third_party/externals/jsoncpp/src/lib_json/jsoncpp.json_reader.o obj/third_party/externals/jsoncpp/src/lib_json/jsoncpp.json_value.o obj/third_party/externals/jsoncpp/src/lib_json/jsoncpp.json_writer.o libskia.a  -lpthread -lGL -lGLU -lX11 -lfreetype -lfontconfig -ldl -o get_images_from_skps
obj/tools/get_images_from_skps.get_images_from_skps.o: In function `main':
get_images_from_skps.cpp:(.text.startup+0x4d9): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
get_images_from_skps.cpp:(.text.startup+0x566): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
get_images_from_skps.cpp:(.text.startup+0x7de): undefined reference to `Json::StyledWriter::write[abi:cxx11](Json::Value const&)'
obj/tools/get_images_from_skps.get_images_from_skps.o: In function `Sniffer::sniff(void const*, unsigned long)':
get_images_from_skps.cpp:(.text._ZN7Sniffer5sniffEPKvm[_ZN7Sniffer5sniffEPKvm]+0xf22): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
get_images_from_skps.cpp:(.text._ZN7Sniffer5sniffEPKvm[_ZN7Sniffer5sniffEPKvm]+0x103c): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
collect2: error: ld returned 1 exit status
[4/26] link fiddle
FAILED: fiddle 
c++ -rdynamic -Wl,-rpath,\$ORIGIN obj/tools/fiddle/fiddle.draw.o obj/tools/fiddle/fiddle.fiddle_main.o libskia.a  -lOSMesa -lpthread -lGL -lGLU -lX11 -lfreetype -lfontconfig -ldl -o fiddle
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/../../../../lib/libOSMesa.so: undefined reference to `operator delete[](void*, unsigned long)@CXXABI_1.3.9'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/../../../../lib/libOSMesa.so: undefined reference to `operator delete(void*, unsigned long)@CXXABI_1.3.9'
collect2: error: ld returned 1 exit status

Joshua Olson

unread,
Dec 23, 2016, 2:52:12 PM12/23/16
to skia-discuss
Clang 3.9 (using GCC 6.2) almost works beautifully when I remove -Wno-maybe-uninitialized from gn/BUILD.gn:
ninja: Entering directory `out/Release`
[1690/1736] link get_images_from_skps
FAILED
: get_images_from_skps
c
++ -rdynamic -Wl,-rpath,\$ORIGIN obj/tools/get_images_from_skps.get_images_from_skps.o obj/tools/flags/flags.SkCommandLineFlags.o obj/third_party/externals/jsoncpp/src/lib_json/jsoncpp.json_reader.o obj/third_party/externals/jsoncpp/src/lib_json/jsoncpp.json_value.o obj/third_party/externals/jsoncpp/src/lib_json/jsoncpp.json_writer.o libskia.a  -lpthread -lvulkan -lGL -lGLU -lX11 -lfreetype -lfontconfig -ldl -o get_images_from_skps
obj
/tools/get_images_from_skps.get_images_from_skps.o: In function `main':
../../tools/get_images_from_skps.cpp:(.text+0x479): undefined reference to `
Json::StyledWriter::write[abi:cxx11](Json::Value const&)'
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)

Joshua Olson

unread,
Dec 23, 2016, 4:40:42 PM12/23/16
to skia-discuss
I ended up using the out/Clang target without problems, but I hope the errors I came across will be helpful for documenting or reducing compilation assumptions.

Mike Klein

unread,
Dec 24, 2016, 2:36:37 PM12/24/16
to skia-discuss
Yes, if you want to have the smoothest build experience, you probably want to use Ubuntu 14.04.  That's what most Skia devs happen to be using, so it's the only Linux environment that receives any attention.  You definitely need to set up your path to make python be python2.  All our scripts assume Python 2, as do the gclient tools we use to sync dependencies.

It looks like you have sorted things out yourself, which is good.  You will need this adaptability to build Skia on any system other than Windows 10, Ubuntu 14.04, or Mac 10.12.  I do work on Skia from an Antergos based machine, which should be very similar to your Manjaro distribution, but Arch Linux in general is not something we care about or test.  I think some other folks use Fedora.  That is similarly unsupported.

We have no continuous builds using GCC 5 or 6.  If you'd like to build with GCC 6, you may want to turn off warnings, using extra_cflags = [ "-w" ], or at least set -Wno-error.  Ignoring warnings is a good idea unless you are working on a patch to Skia.  You may also want to double check that -Wno-unknown-warning-option is on your command line. I would have hoped that would make Clang ignore the presence of the GCC-specific -Wno-maybe-uninitialized flag.  It certainly works on our bots, my laptop, my desktop, etc.

It looks like several of the errors you encountered were in Skia's test tools.  You may want to limit what you build to just Skia, and not its test tools.  You can do that by running something like
   $ ninja -C out/Whatever skia

Would you have expected is_official_build to turn off warnings?  That's a default we could consider if it makes things easier.

On Fri, Dec 23, 2016 at 1:40 PM Joshua Olson <0joshua...@gmail.com> wrote:
I ended up using the out/Clang target without problems, but I hope the errors I came across will be helpful for documenting or reducing compilation assumptions.

--

Joshua Olson

unread,
Dec 24, 2016, 3:18:23 PM12/24/16
to skia-discuss
I'm less interested in the test tools, more the example programs. I don't have a preference whether GCC 6 or Clang compiles C++ code, but I used is_official_build assuming it would optimize the most for performance.

1. Can I PR a python=python2 tip and that the 'smoothest' way to obtain (static) builds is on Windows 10, Ubuntu 14.04, or Mac 10.12?
2. How can people get a list of ninja's targets? (heh)

Mike Klein

unread,
Dec 24, 2016, 4:01:24 PM12/24/16
to skia-discuss
Yep, the content of skia.org is under site/.  You can change it with a code reviewed CL just like any other Skia code.

You can list ninja targets using -t targets, like
  $ ninja -C out/Wherever -t targets

Or you can look at BUILD.gn, which is the GN source of those Ninja targets.

`ninja --help` and `ninja -t list` are pretty handy resources on how ninja works.  `gn help` is what you want for GN.

Joshua Olson

unread,
Jan 15, 2017, 4:56:32 PM1/15/17
to skia-discuss
From the discussion at https://skia-review.googlesource.com/c/6422/5/site/user/build.md, the suggestion:

We test with several recent Clangs and GCC 4.8 on Linux. Windows 10, Ubuntu 14.04, and Mac 10.12 are officially supported.

was replied with:

This seems like the sort of thing that'll get out of date really easily. Further, I don't think I'm willing to commit us to officially supporting any platform. How about we write something like this instead? You can visit [Skia Status](https://status.skia.org/?filter=all) to see our continuous builds.

to which I replied:

I'm not sure what pointing a hypothetical user to the continuous builds accomplishes. They might be/begin asking: Which version of MSVC should I use? Does success mean anything if 'NoBuildBot' is in the build's name? Can I download libskia.a? This interface looks too awkward for end users, is Skia not for me? Something is being supported: something like the system setups expected of Chromium/Android contributors? My own user story is wanting a good 2D library and not knowing those setups.
Reply all
Reply to author
Forward
0 new messages