Skip to content

Instantly share code, notes, and snippets.

@beci
Last active March 7, 2025 03:37
Show Gist options
  • Save beci/c737c89685a667053fe02f986d59ca44 to your computer and use it in GitHub Desktop.
Save beci/c737c89685a667053fe02f986d59ca44 to your computer and use it in GitHub Desktop.
Speed up compiling of AUR packages in arch linux

Edit /etc/makepkg.conf

replace in CFLAGS and CXXFLAGS to use the native one

-march=x86-64 -mtune=generic to -march=native

speed up build by set multiple threads

MAKEFLAGS="-j$(nproc)"

### speedup package compression for XZ 1. use less aggressive compression. -0 is the faster, I prefer -2 (default is -6) 2. use all available thread -T0 (or -T8 for 8 threads)

COMPRESSXZ=(xz -c -z -) to COMPRESSXZ=(xz -c -z -2 -T0 -)

As the default package extension became zst PKGEXT='.pkg.tar.zst', the compression isn't hurt badly anymore, but it can be speed up by add the desired level to COMPRESSZST, like add -1:

COMPRESSZST=(zstd -1 -c -z -q -)
@notsatvrn
Copy link

Thanks!

@WATERMELOUN3
Copy link

Big thanks my man, is it still up to date ?

@beci
Copy link
Author

beci commented Oct 17, 2021

well, its up date but I should extend this description it with zstd

Copy link

ghost commented Feb 20, 2022

Big Thanks man ,I was installing gcc9 from aur it taking almost 90min and still it was builting ,Now after this process complete in few min.

@muradbu
Copy link

muradbu commented Aug 3, 2022

Thanks a lot!

@emilwojcik93
Copy link

emilwojcik93 commented May 23, 2023

Hi, I rewrited these params changes as shell script in this public repo

@Milor123
Copy link

Milor123 commented Oct 25, 2023

Hi, I rewrited these params changes as shell script in this public repo

Thanks man ❤️ ❤️ ❤️ ❤️

@Alois44623
Copy link

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment