Want to subscribe to topics you're interested in?
Become a Member

Featured Install Compiling Newer Versions of Clang 4.0

Discussion in 'Centmin Mod User Tutorials & Guides' started by Revenge, Jan 31, 2017.

Tags:
  1. Sunka

    Sunka Active Member

    910
    238
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +385
    Local Time:
    11:54 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    I am little confused.
    beside else stuff, I have this in /etc/centminmod/custom_config.inc
    Code (Text):
    NGINX_DEVTOOLSETGCC='y' # umjesto clang ide gcc kompilacija kod nginx
    CLANG='n' # potrebno za gcc kompilaciju nginx
    CRYPTO_DEVTOOLSETGCC='y' # newer Intel GCC


    Is it OK to add also and recompile nginx?
    Code (Text):
    NGX_LDGOLD='y'
    NGX_GSPLITDWARF='y'
    PHP_GSPLITDWARF='y'


    What about NGXEXTRA_LDOPT
    Should I add it too?
    Code (Text):
    NGXEXTRA_LDOPT='y'
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    that is a variable for adding LDFLAGs for compile time for nginx inserted into --with-ld-opt so if you don't know what you're doing don't set anything i.e. for --with-ld-opt
    Code (Text):
    --with-ld-opt='-ljemalloc -lpcre -Wl,-z,relro -Wl,-rpath,/usr/local/lib -fuse-ld=gold'
    

    so when you set NGX_LDGOLD='y' it auto populates NGXEXTRA_LDOPT=' -fuse-ld=gold' which is inserted into --with-ld-opt for Nginx compiles.

    this below Nginx -V output used the persistent config /etc/centminmod/custom_config.inc variables which are in installer-latest.sh version prepopulated
    Code (Text):
    NGINX_PAGESPEED=y
    ORESTY_LUANGINX=y
    NGINX_XSLT='n'
    NGINX_LIBBROTLI='y'
    NGXDYNAMIC_XSLT='n'
    NGXDYNAMIC_IMAGEFILTER='y'
    NGXDYNAMIC_GEOIP='y'
    NGXDYNAMIC_STREAM='y'
    NGXDYNAMIC_HEADERSMORE='y'
    NGXDYNAMIC_SETMISC='y'
    NGXDYNAMIC_ECHO='y'
    NGXDYNAMIC_SRCCACHE='y'
    NGXDYNAMIC_MEMC='y'
    NGXDYNAMIC_REDISTWO='y'
    NGXDYNAMIC_NGXPAGESPEED='y'
    NGXDYNAMIC_BROTLI='y'
    PHPMSSQL='y'
    PHP_PGO='y'
    PHP_PGO_CENTOSSIX='y'
    NGINX_DEVTOOLSETGCC='y'
    GENERAL_DEVTOOLSETGCC='y'
    CLANG='n'
    LIBRESSL_SWITCH='n'
    NGX_GSPLITDWARF='y'
    PHP_GSPLITDWARF='y'
    NGX_LDGOLD='y'
    

    yes so would be
    Code (Text):
    NGINX_DEVTOOLSETGCC='y' # umjesto clang ide gcc kompilacija kod nginx
    CLANG='n' # potrebno za gcc kompilaciju nginx
    CRYPTO_DEVTOOLSETGCC='y' # newer Intel GCC
    NGX_LDGOLD='y'
    NGX_GSPLITDWARF='y'
    PHP_GSPLITDWARF='y'
    
     
    Last edited: Feb 1, 2017
  3. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  4. Sunka

    Sunka Active Member

    910
    238
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +385
    Local Time:
    11:54 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    Nice.
    Will add those 3 variables and recompile nginx
    Btw, I do not need to recompile php too (because PHP_GSPLITDWARF variable)?
     
  5. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    NGX_GSPLITDWARF='y'
    PHP_GSPLITDWARF='y

    these 2 are only to help at nginx and php compile time to lower disk i/o, memory usage and linker speed up for install time benefits
     
    • Like Like x 1
  6. Sunka

    Sunka Active Member

    910
    238
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +385
    Local Time:
    11:54 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    So this is it

     
    • Like Like x 1
  7. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    yup

    FYI, Centmin Mod 123.09beta01 folks can use this one line command to check the nginx upgrade times logged for all nginx upgrade runs on server by date ascending order so latest at bottom
    Code (Text):
    for l in $(ls -rt /root/centminlogs/ | grep nginx_upgrade); do tail -1 "/root/centminlogs/$l"; done
    

    example on my i7 4790K server
    Code (Text):
    for l in $(ls -rt /root/centminlogs/ | grep nginx_upgrade); do tail -1 "/root/centminlogs/$l"; done
    Total Nginx Upgrade Time: 70.287198039 seconds
    Total Nginx Upgrade Time: 42.924489403 seconds
    Total Nginx Upgrade Time: 98.060515849 seconds
    Total Nginx Upgrade Time: 72.410885854 seconds
    Total Nginx Upgrade Time: 44.317865823 seconds
    Total Nginx Upgrade Time: 55.216688813 seconds
    Total Nginx Upgrade Time: 122.533740387 seconds
    Total Nginx Upgrade Time: 81.217850641 seconds
    Total Nginx Upgrade Time: 354.072969986 seconds
    Total Nginx Upgrade Time: 99.783633733 seconds
    Total Nginx Upgrade Time: 99.485019273 seconds
    Total Nginx Upgrade Time: 200.442686803 seconds
    Total Nginx Upgrade Time: 234.940905354 seconds
    Total Nginx Upgrade Time: 65.351012644 seconds
    Total Nginx Upgrade Time: 45.020657741 seconds
    Total Nginx Upgrade Time: 66.880617703 seconds
    Total Nginx Upgrade Time: 180.383646627 seconds
    Total Nginx Upgrade Time: 108.839499229 seconds
    Total Nginx Upgrade Time: 86.449011208 seconds
    Total Nginx Upgrade Time: 86.476131905 seconds
    Total Nginx Upgrade Time: 121.738955873 seconds
    Total Nginx Upgrade Time: 324.602539125 seconds
    Total Nginx Upgrade Time: 96.279803485 seconds
    Total Nginx Upgrade Time: 56.281070233 seconds
    Total Nginx Upgrade Time: 89.665278285 seconds
    Total Nginx Upgrade Time: 177.617867295 seconds
    Total Nginx Upgrade Time: 260.749728197 seconds
    Total Nginx Upgrade Time: 91.017729711 seconds
    Total Nginx Upgrade Time: 75.816537903 seconds
    Total Nginx Upgrade Time: 44.717890526 seconds
    Total Nginx Upgrade Time: 43.457008442 seconds
    Total Nginx Upgrade Time: 66.004865306 seconds
    Total Nginx Upgrade Time: 32.672139738 seconds
    Total Nginx Upgrade Time: 44.684276914 seconds
    Total Nginx Upgrade Time: 41.710089673 seconds
    Total Nginx Upgrade Time: 66.771043023 seconds
    Total Nginx Upgrade Time: 34.607679662 seconds
    Total Nginx Upgrade Time: 33.268681353 seconds
    Total Nginx Upgrade Time: 14.936353591 seconds
    Total Nginx Upgrade Time: 81.419049505 seconds
    Total Nginx Upgrade Time: 31.466292993 seconds
    Total Nginx Upgrade Time: 35.117987513 seconds
    Total Nginx Upgrade Time: 31.384081342 seconds
    Total Nginx Upgrade Time: 31.575658021 seconds
    Total Nginx Upgrade Time: 37.024433656 seconds
    Total Nginx Upgrade Time: 59.757963889 seconds
    Total Nginx Upgrade Time: 31.072155199 seconds
     
    Last edited: Feb 1, 2017
    • Like Like x 1
  8. Revenge

    Revenge Active Member

    287
    64
    28
    Feb 21, 2016
    Portugal
    Ratings:
    +227
    Local Time:
    10:54 AM
    1.9.x
    10.1.x
    • Like Like x 1
  9. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
  10. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    Getting more scientific in my appropriate logging sar statistics for resource usage at nginx compile time via centmin.sh menu option 4 on my OVH Core i7 4790K@4.0Ghz 32GB server

    This is will ccache cache cleared via
    Code (Text):
    ccache -C
    

    before running centmin.sh menu option 4 in 123.09beta01 which has enabled by default gsplit-dwarf and ld.gold linker
    Code (Text):
    NGX_LDGOLD='y'
    NGX_GSPLITDWARF='y'
    PHP_GSPLITDWARF='y'
    

    sar statistics during Nginx compile run

    loadaverage.png
    cpu.png
    ram.png
    iotransfer.png

    Probably should of started recording sar stats a few minutes before actual nginx run so get before stats :)

    hmm that mem chart looks a bit off - using forked custom version of sarviewer GitHub - centminmod/sarviewer: Generate graphs with gnuplot from sar data :)

    looks like formula is off on CentOS 7 for used memory sarviewer/ram.gplot at master · centminmod/sarviewer · GitHub
    Code (Text):
    plot '../data/ram.dat' using 1:($2/1024+$5/1024+$6/1024) title 'Free' with l ls 1, \
    '' using 1:($5/1024) title 'Buffers' with l ls 2, \
    '' using 1:($6/1024) title 'Cached' with l ls 3, \
    '' using 1:($3/1024-$6/1024-$5/1024-$2/1024) title 'Used' with l ls 4
    

    3rd column minus 6th minus 2nd
    Code (Text):
    cat data/ram.dat
    03:16:29     14082768  18825984     57.21    552952  14614432  12413540     35.46   6279684  10073504        48
    03:16:31     14082768  18825984     57.21    552952  14614432  12413540     35.46   6279760  10073504        48
    03:16:33     14082768  18825984     57.21    552960  14614432  12413540     35.46   6279820  10073504        84
    03:16:35     14082644  18826108     57.21    552960  14614432  12413540     35.46   6279820  10073512        84
    03:16:37     14082644  18826108     57.21    552960  14614432  12413540     35.46   6279820  10073512        76
    03:16:39     14082644  18826108     57.21    552960  14614432  12413540     35.46   6279820  10073512        52
    03:16:41     14082644  18826108     57.21    552960  14614432  12413540     35.46   6279820  10073512        52
    03:16:43     14082636  18826116     57.21    552960  14614432  12413540     35.46   6279820  10073512         0
    03:16:45     14082636  18826116     57.21    552960  14614432  12413540     35.46   6279820  10073512         0
    03:16:47     14083220  18825532     57.21    552960  14614432  12409348     35.45   6279820  10073512         0
    


    seems maybe a bug ram.png negative values ? · Issue #1 · juliojsb/sarviewer · GitHub :)
     
    Last edited: Feb 2, 2017
  11. Revenge

    Revenge Active Member

    287
    64
    28
    Feb 21, 2016
    Portugal
    Ratings:
    +227
    Local Time:
    10:54 AM
    1.9.x
    10.1.x
    I just did a little benchmark using a server with a E3-1245 V2 @ 3.40GHz. 4 cores / 8 threads.
    Three 120Gb SSD disks in Raid 0.

    Im compiling Nginx using Openssl 1.1.0, Clang 4.0.0, ld.gold and with/without ccache.

    Without ccache:
    1 Thread - 2m35.260s
    2 Threads - 1m22.059s
    3 Threads - 0m59.178s
    4 Threads - 0m48.888s
    5 Threads - 0m46.595s
    6 Threads - 0m44.523s
    7 Threads - 0m44.454s
    8 Threads - 0m44.380s
    With ccache
    1 Thread - 1m33.266s
    2 Threads - 0m48.783s
    3 Threads - 0m36.118s
    4 Threads - 0m32.257s
    5 Threads - 0m29.103s
    6 Threads - 0m27.196s
    7 Threads - 0m26.617s
    8 Threads - 0m25.600s
    [​IMG]

    Conclusion: Ccache gives an enormous boost when using few threads. With many threads, the boost is not that big, but still noticeable. It also seems that compiling nginx hits a block at 6 threads. There is no reason to use more, unless this is a limitation of the cpu because it only has 4 real cores. Can someone test with a real 8 core to check if there is any diference above 6 threads?
     
    • Informative Informative x 1
  12. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    Yup pretty much what i found hence Centmin Mod installs and uses ccache whenever possible :)

    I only have access to quad core + ht so 8 virtual threads max myself so hoping other folks can test :)
     
  13. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
  14. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    Revisiting LLVM/Clang 4 compiler install on CentOS 7.3 64bit based 2GB OpenVZ VPS server with 2 cpu threads on Intel Xeon E5-1650v3 @3.5Ghz = 7,877 seconds !
    Code (Text):
    tail -1 /root/centminlogs/centminmod_llvm_200717-004249.log
    Total LLVM 4 Build Time: 7877.894180898 seconds
    

    compared with 1313 seconds LLVM/Clang 4 compile times on OVH Core i7 4790K dedicated with 8 cpu threads.

    these compile times include llvmgold compilation too
    Code (Text):
    /usr/local/bin/ld -v
    GNU ld (GNU Binutils) 2.28
    

    Code (Text):
    /usr/local/bin/ld.gold -v
    GNU gold (GNU Binutils 2.28) 1.14
    

    Code (Text):
    /usr/local/bin/ld.bfd -v
    GNU ld (GNU Binutils) 2.28
    

    Code (Text):
    /opt/sbin/llvm/bin/clang -v
    clang version 4.0.1 (branches/release_40 308572)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm/bin
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Centmin Mod 123.09beta01's Nginx compiled with Clang 4.0.1
     
  15. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    Clang 5.0.0 test on same Xeon E5-1650v3 2 cpu thread OpenVZ VPS
    Code (Text):
    tail -1 /root/centminlogs/centminmod_llvm_200717-030705.log
    Total LLVM 5 Build Time: 8806.855697786 seconds
    

    Code (Text):
    /usr/local/bin/ld -v
    GNU ld (GNU Binutils) 2.28
    

    Code (Text):
    /usr/local/bin/ld.gold -v
    GNU gold (GNU Binutils 2.28) 1.14
    

    Code (Text):
    /usr/local/bin/ld.bfd -v
    GNU ld (GNU Binutils) 2.28
    

    Code (Text):
    /opt/sbin/llvm/bin/clang -v
    clang version 5.0.0 (branches/release_50 308581)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm/bin
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Clang / LLVM 5.0 is meant to include AMD Zen Scheduler model 'znver1' as well AMD Zen Scheduler Model Lands In LLVM, Makes It For LLVM 5.0 - Phoronix

    Clang 5 vs Clang 3.4.2 (CentOS default) benchmarks with Intel Xeon E5-1680v3 8 core / 16 thread server at GCC 5 Is Compiling Faster, But Still Falls Short Of Clang - Phoronix (and here) and with AMD Ryzen 1700 8 core / 16 thread server here. Notice the newer Clang compilers performing better for AMD Ryzen - hence why there's a neeed for Centmin Mod to support Clang 4/5 for newer processors in the future :)
     
    Last edited: Jul 21, 2017
    • Informative Informative x 2
  16. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    Re-worked Clang installer to install both Clang 4.0.1 and 5.0.0 side by side in one Centmin Mod CentOS 7 environment. Compiled on dedicated server - Intel Xeon E3-1270v1, 16GB 240GB SSD reviewed here. Compile time took ~67.48 minutes.
    Code (Text):
    tail -1 /root/centminlogs/centminmod_llvm_200717-201831.log
    Total LLVM 4 & 5 Build Time: 4049.480575677 seconds
    

    Clang 4.0.1
    Code (Text):
    /opt/sbin/llvm-release_40/bin/clang -v
    clang version 4.0.1 (branches/release_40 308665) (llvm/branches/release_40 308664)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm-release_40/bin
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Code (Text):
    ls -lah /opt/sbin/llvm-release_40/lib/LLVMgold.so
    -rwxr-xr-x 1 root root 41M Jul 20 20:50 /opt/sbin/llvm-release_40/lib/LLVMgold.so
    

    Clang 5.0.0
    Code (Text):
    /opt/sbin/llvm-release_50/bin/clang -v
    clang version 5.0.0 (branches/release_50 308670)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm-release_50/bin
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Code (Text):
    ls -lah /opt/sbin/llvm-release_50/lib/LLVMgold.so
    -rwxr-xr-x 1 root root 47M Jul 20 21:24 /opt/sbin/llvm-release_50/lib/LLVMgold.so
    

    Code (Text):
    /usr/local/bin/ld -v
    GNU ld (GNU Binutils) 2.28
    

    Code (Text):
    /usr/local/bin/ld.gold -v
    GNU gold (GNU Binutils 2.28) 1.14
    

    Code (Text):
    /usr/local/bin/ld.bfd -v
    GNU ld (GNU Binutils) 2.28
    

    disk usage
    Code (Text):
    du -sh /opt/sbin/llvm-release_*
    1.3G    /opt/sbin/llvm-release_40
    1.5G    /opt/sbin/llvm-release_50
    

    Also looking into Clang compilations against newer GCC 6.2.1 instead of CentOS 7's GCC 4.8.5
    Code (Text):
    /opt/sbin/llvm-release_50/bin/clang -v
    clang version 5.0.0 (branches/release_50 308686)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm-release_50/bin
    Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Found candidate GCC installation: /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    
     
    Last edited: Jul 21, 2017
  17. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    Added ccache compiler cache support to Clang installer which installs both Clang 4.0.1 and 5.0.0 side by side in one Centmin Mod CentOS 7 environment. Compiled on dedicated server - Intel Xeon E3-1270v1, 16GB 240GB SSD reviewed here. Recompile time due to ccache reduced dramatically by ~91% from ~67.48 minutes to ~6.06 minutes !
    Code (Text):
    tail -1 /root/centminlogs/centminmod_llvm_210717-092909.log
    Total LLVM 4 & 5 Build Time: 363.446991248 seconds
    

    Clang 4.0.1
    Code (Text):
    /opt/sbin/llvm-release_40/bin/clang -v
    clang version 4.0.1 (branches/release_40 308722)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm-release_40/bin
    Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Code (Text):
    ls -lah /opt/sbin/llvm-release_40/lib/LLVMgold.so
    -rwxr-xr-x 1 root root 24M Jul 21 09:31 /opt/sbin/llvm-release_40/lib/LLVMgold.so
    

    Clang 5.0.0
    Code (Text):
    /opt/sbin/llvm-release_50/bin/clang -v
    clang version 5.0.0 (branches/release_50 308722)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm-release_50/bin
    Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Found candidate GCC installation: /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Code (Text):
    ls -lah /opt/sbin/llvm-release_50/lib/LLVMgold.so
    -rwxr-xr-x 1 root root 27M Jul 21 09:34 /opt/sbin/llvm-release_50/lib/LLVMgold.so
    

    Code (Text):
    /usr/local/bin/ld -v
    GNU ld (GNU Binutils) 2.28
    

    Code (Text):
    /usr/local/bin/ld.gold -v
    GNU gold (GNU Binutils 2.28) 1.14
    

    Code (Text):
    /usr/local/bin/ld.bfd -v
    GNU ld (GNU Binutils) 2.28
    

    disk usage
    Code (Text):
    du -sh /opt/sbin/llvm-release_*
    1.1G    /opt/sbin/llvm-release_40
    1.2G    /opt/sbin/llvm-release_50
    
     
  18. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    Enabled GCC 6.2.1's Gold linker as default with Clang compilations + with ccache compiler cache support. The Clang installer which installs both Clang 4.0.1 and 5.0.0 side by side in one Centmin Mod CentOS 7 environment. Compiled on dedicated server - Intel Xeon E3-1270v1, 16GB 240GB SSD reviewed here.

    Recompile time due to ccache was reduced dramatically by ~91% from ~67.48 minutes to ~6.06 minutes without the GCC 6.2.1 Gold linker. With GCC 6.2.1 Gold linker enabled, further reduced Clang 4.0.1 + 5.0.0 + LLVMGold plugin recompiles from ~6.0.6 minutes to ~5.33 minutes :cool:. Definitely, more manageable recompile times :)
    Code (Text):
    tail -1 /root/centminlogs/centminmod_llvm_210717-200215.log
    Total LLVM 4 & 5 Build Time: 320.363621437 seconds
    

    Code (Text):
    -- Linker detection: GNU Gold
    -- Linker detection: GNU Gold
    -- Builtin supported architectures: x86_64
    

    Clang 4.0.1
    Code (Text):
    /opt/sbin/llvm-release_40/bin/clang -v
    clang version 4.0.1 (branches/release_40 308774)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm-release_40/bin
    Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Code (Text):
    ls -lah /opt/sbin/llvm-release_40/lib/LLVMgold.so
    -rwxr-xr-x 1 root root 24M Jul 21 20:05 /opt/sbin/llvm-release_40/lib/LLVMgold.so
    

    Clang 5.0.0
    Code (Text):
    /opt/sbin/llvm-release_50/bin/clang -v
    clang version 5.0.0 (branches/release_50 308774)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm-release_50/bin
    Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Found candidate GCC installation: /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Code (Text):
    ls -lah /opt/sbin/llvm-release_50/lib/LLVMgold.so
    -rwxr-xr-x 1 root root 27M Jul 21 20:07 /opt/sbin/llvm-release_50/lib/LLVMgold.so
    

    Code (Text):
    /usr/local/bin/ld -v
    GNU ld (GNU Binutils) 2.28
    

    Code (Text):
    /usr/local/bin/ld.gold -v
    GNU gold (GNU Binutils 2.28) 1.14
    

    Code (Text):
    /usr/local/bin/ld.bfd -v
    GNU ld (GNU Binutils) 2.28
    

    disk usage
    Code (Text):
    du -sh /opt/sbin/llvm-release_*
    1.1G    /opt/sbin/llvm-release_40
    1.2G    /opt/sbin/llvm-release_50
    

    Code (Text):
    Total Nginx Upgrade Time: 84.725326055 seconds
    
     
    Last edited: Jul 22, 2017
  19. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5
    Interesting with regards to AMD Ryzen Haswell-Tuned Binaries Are Still Sometimes Faster On AMD Ryzen Than Znver1 Tuning - Phoronix

     
  20. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    7:54 PM
    Nginx 1.13.x
    MariaDB 5.5

    Clang Compile with Ninja Build Instead Of Make



    Trying Clang / LLVM compilations replacing make with Ninja Build which is meant to speed up Clang compilation times as outlined here as well as combine previous ccache compiler caching + Gold linker for GCC 6.2.1. The end result was unexpected with recompile times increasing from ~5.33 minutes to ~7.57 minutes !

    Code (Text):
    tail -1 /root/centminlogs/centminmod_llvm_220717-015329.log
    Total LLVM 4 & 5 Build Time: 454.425261471 seconds
    

    Code (Text):
    /opt/sbin/llvm-release_40/bin/clang -v
    clang version 4.0.1 (branches/release_40 308819)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm-release_40/bin
    Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Code (Text):
    ls -lah /opt/sbin/llvm-release_40/lib/LLVMgold.so
    -rwxr-xr-x 1 root root 24M Jul 22 01:56 /opt/sbin/llvm-release_40/lib/LLVMgold.so
    

    Code (Text):
    /opt/sbin/llvm-release_50/bin/clang -v
    clang version 5.0.0 (branches/release_50 308820) (llvm/branches/release_50 308819)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /opt/sbin/llvm-release_50/bin
    Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1
    Found candidate GCC installation: /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
    Selected GCC installation: /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    

    Code (Text):
    ls -lah /opt/sbin/llvm-release_50/lib/LLVMgold.so
    -rwxr-xr-x 1 root root 27M Jul 22 01:59 /opt/sbin/llvm-release_50/lib/LLVMgold.so