[Pkg-julia-devel] Bug#910784: Add optimized JULIA_CPU_TARGETs

Milan Bouchet-Valat nalimilan at club.fr
Thu Oct 11 08:53:25 BST 2018


Package: julia
Version: 0.7.0-2
Severity: normal

Hi,

I've noticed that the package currently builds a single sysimage for
the baseline CPU target (i.e. pentium4 and x86-64). Recent Julia
versions allow specifying multiple targets via JULIA_CPU_TARGET. This
allows building one image for the baseline which works on all machines,
and one or more additional images which are optimized for recent CPUs.
This can make a significant difference in code which can use e.g. AVX2.

Below is the code I use for the Fedora RPM package. The targets are
those used by upstream currently:

%ifarch %{ix86}
%global march MARCH=pentium4
%global cpu_target JULIA_CPU_TARGET="pentium4;sandybridge,-xsaveopt,clone_all"
%endif
%ifarch x86_64
%global march MARCH=x86-64
%global cpu_target JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"
%endif
%ifarch %{arm}
# gcc and LLVM do not support the same targets
%global march MARCH=$(echo %optflags | grep -Po 'march=\\K[^ ]*')
%global cpu_target JULIA_CPU_TARGET="generic"
%endif
%ifarch armv7hl
%global march MARCH=$(echo %optflags | grep -Po 'march=\\K[^ ]*')
%global cpu_target JULIA_CPU_TARGET="armv7-a;armv7-a,neon;armv7-a,neon,vfp4"
%endif
%ifarch aarch64
%global march MARCH=armv8-a
%global cpu_target JULIA_CPU_TARGET="generic"
%endif
%ifarch ppc64le
%global march %{nil}
%global cpu_target JULIA_CPU_TARGET="pwr8"
%endif



More information about the Pkg-julia-devel mailing list