How to Build Skia in Mac OS - skia

I'm beginner to Skia. So Just tried to build Skia in my machine ( macOS High Sierra 10.13.6 ).
I just followed the instructions Build.
Downloaded depot_tools
Downloaded Skia from git
bin/gn gen out/Static --args='is_official_build=false'
python2 tools/git-sync-deps
ninja -C out/Static
i did these instructions. But my xcode (version 9.2) doesnt support -std=c++17 so i replaced with -std=c++1z in all places.
But it throws error
Error
Please help to build skia for mac, and how to xcode project from this?

Skia makes use of C++17 language features (compiles with -std=c++17 flag) and thus requires a C++17 compatible compiler.
You'd better to update your xcode version.
Mac users may want to pass --ide=xcode to bin/gn gen to generate an Xcode project
You can check this.How to build skia

Related

Xcode not listed as CMake generator on Linux

Attempting to generate an Xcode project file from a simple hello world C++ source on Ubuntu 16.04.
$ cmake -G Xcode .. from empty subdirectory Xcode throws an error:
CMake Error: Could not create named generator Xcode
I used $ cmake --help to check the generators, but Xcode was not listed as a generator (Unix Makefiles, Ninja, Watcom WMake, etc. are listed). Currently using cmake version 3.8.0-rc1. Also tried with 3.5 to no avail.
Generators are only available for platforms, where the tool-chain exists. This is not specific to Xcode as Visual Studio is only provided on Windows.
The documentation states:
CMake Generators are platform-specific so each may be available only on certain platforms.

cross-compiling x264 for ARM

I'm novice in cross-compiling and just started to cross-compile packages on my linux machine (amd64) for host (NAS) with ARMv5 (linux kernel 2.6.31.8). I installed crosstool-ng and with it created toolchain for compilation for ARM. According to some tutorials online I succeeded to compile x264 package. But now when I try to run it, I was given the following error message
./x264: /lib/libm.so.6: version 'GLIBC_2.15' not found (required by ./x264)
Ok now I see that I need libm library but what it is and how to compile x264 with it?
From the error message: the version of x264 you built requires version of glibc 2.15. The Glibc is built as part of your cross compilation toolchain (through crosstool-ng).
You need to build a new toolchain with the same version of glibc found on your NAS root filesystem (or compatible).
(edited after #NotLikeThat comment)

Optimal way to install clang locally when GCC is outdated

I need to use tools that depend on clang on a Unix machine I remote onto at work. Anything I install is locally installed onto ~/local. I do not have root permissions.
/usr is pretty outdated, with gcc being at version 4.4.7. clang requires gcc 4.7+
I read on linux from scratch that a gcc 6.1 installation requires 8.4 gb. This is not something I can do, because that's huge.
Can someone advise me on the best workaround to install up to date clang on my ~/local?
Please and thanks.
Edit:
Courtesy of Nishant, here is the short answer:
Set up a personal machine running the same linux distro and cross compile using gcc to your specific architecture. For me, I will run a Redhat 6.5 VM and compile using gcc an arm x64 binary. Thanks Nishant!
You can get pre-build binaries for Unix system from LLVM's release website: http://llvm.org/releases/
You can then put the binaries in any local folder you want and source it using the PATH variable, which can be done by modifying your ~/.bashrc file by appending:
export PATH=$PATH:<clang-binary-directory>
Now you will able to use clang from the command line terminal as if it was installed.
If you want to build from source only, you can get older source code of clang which will use gcc 4.4.7 and build it and then use clang to build clang. Or get the latest clang binary and use it to build latest clang.

building cross-compiler with --- GTK+ & X11 libraries

I have made my cross compiler using crosstool-ng :--
http://www.bootc.net/archives/2012/05/26/how-to-build-a-cross-compiler-for-your-raspberry-pi/
Now i have to cross compile wxGTK using this cross compiler.
wxGTK requires GTK+ & X11 libraries to build. But my cross-compiler is
not build for the support of the same.
1> X11 library packages required are :----
wx2.8-headers
libwxgtk2.8-0
libwxgtk2.8-dev
2> X11 client requires following Package :---
libx11-dev
Please suggest to configure crosstool-ng for GTK+ & X11 support in
cross-compiler, this command is correct or not :-----
./configure --prefix=/opt/cross --with-x11 --with-libx11-dev
--with-wx2.8-headers --with-libwxgtk2.8-0 --with-libwxgtk2.8-dev
Regards,
//Allan
Why don't you use a solution such as Openembedded to build all the software you need? Compiling X, GTK and WX by hand is not trivial and time consuming
As I suggested yesterday, I'd rather use Openembedded

Compiling For 64bit Architecture in Ubuntu 32bit

I'm looking for tutorial how to compile project for 64bit architecture in ubuntu 32 bit architecture. I have to put this project on shared hosting machine which is x86_64 architecture. I can't compile this project on remote machine because I didn't have permissions to install some dependencies for this project.
When I try to put compiled project from my computer (ubuntu 32 bit) the execution fails because of floating point exceptions. The same scenario with simple hello_world application.
I'm total beginner with gcc, ld and I was always using compiled packages but now I have to compile for target machine different than mine.
For now I figured out that I need to install g++-multilib and add to CCFLAGS -m64 to the gcc.
Now I have errors like this:
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
Is there any way to compile dependency libraries inside aplication so I didn't have to resolve dependency libraries on the remote machine.
You need to install a 64-bit library pack.
apt-get install ibc6-dev-amd64
or something close to that (I used to have an Ubuntu machine at work, but I'm using Fedora at home, so can't even attempt to try what I'm suggesting - I know the principle is correct, but the exact detail is a bit vague)

Resources