1 |
On Tuesday, 12 June 2018 19:31:32 BST Ian Zimmerman wrote: |
2 |
> I have had it with compiling stuff from source on my laptop. It is just |
3 |
> too slow. So I would like to create binary packages on my desktop and |
4 |
> then just tell the laptop to use them. |
5 |
> |
6 |
> Simple enough, except that the desktop is AMD Phenom, and the laptop is |
7 |
> Intel 64 bit Atom. Up to now, each system had unique CFLAGS to squeeze |
8 |
> as much performance as possible. |
9 |
> |
10 |
> On the desktop: |
11 |
> CFLAGS="-march=barcelona --param l1-cache-size=64 --param |
12 |
> l1-cache-line-size=64 --param l2-cache-size=512 -O2 -pipe" |
13 |
> |
14 |
> On the laptop: |
15 |
> CFLAGS="-march=ivybridge --param l1-cache-size=32 --param |
16 |
> l1-cache-line-size=64 --param l2-cache-size=4096 -O2 -pipe" |
17 |
> |
18 |
> I don't want to give up these tunings, but from the wiki page [1] I can |
19 |
> see no straightforward way to have different CFLAGS when compiling binary |
20 |
> packages, from the normal CFLAGS when installing directly from source on |
21 |
> the host system. Is the only way of doing this to set up a full-blown |
22 |
> cross-development environment? |
23 |
> |
24 |
> [1] |
25 |
> https://wiki.gentoo.org/wiki/Binary_package_guide |
26 |
|
27 |
On the desktop you could just use -march=native for its own compiles, not sure |
28 |
if there is a benefit or good reason to use '-march=barcelona', but I'm |
29 |
digressing. |
30 |
|
31 |
If you are compiling binary packages for the laptop with a single stanza on |
32 |
the CLI, then you can run: |
33 |
|
34 |
CFLAGS="-march=ivybridge ..." CXXFLAGS="-march=ivybridge ..." |
35 |
FEATURES="buildpkg" PKGDIR="/tmp/binpkg_dir emerge -uaNDv --buildpkg world |
36 |
|
37 |
I understand you will need the complete CFLAGS & CXXFLAGS for the guest's |
38 |
hardware - others should confirm if this is so. |
39 |
|
40 |
I find it neater/easier to copy the guest's fs over to the faster host, then |
41 |
chroot into it, sync portage and emerge with --buildpkg world. There are |
42 |
other solutions, NFS mounts of the guest over the network, using a VM |
43 |
mirroring the laptop build on the host, but they are more complicated for my |
44 |
use case of a single guest. |
45 |
|
46 |
-- |
47 |
Regards, |
48 |
Mick |