diff --git a/julia.spec b/julia.spec index 8daaab8..86b9db0 100644 --- a/julia.spec +++ b/julia.spec @@ -35,13 +35,13 @@ BuildRequires: libgit2-devel >= 0.21 BuildRequires: libunwind-devel BuildRequires: llvm-devel BuildRequires: mpfr-devel >= 3.0 -%ifarch %{arm} +%ifarch %{ix86} x86_64 +BuildRequires: openblas-devel +BuildRequires: openlibm-devel >= 0.4 +%else BuildRequires: blas-devel BuildRequires: lapack-devel -%else -BuildRequires: openblas-devel %endif -BuildRequires: openlibm-devel >= 0.4 BuildRequires: openspecfun-devel >= 0.4 BuildRequires: pcre2-devel BuildRequires: perl @@ -59,13 +59,13 @@ Requires: gmp >= 5.0 Requires: julia-common = %{version}-%{release} Requires: libgit2 >= 0.21 Requires: mpfr >= 3.0 -%ifarch %{arm} +%ifarch %{ix86} x86_64 +Requires: openblas-threads +Requires: openlibm >= 0.4 +%else Requires: blas Requires: lapack -%else -Requires: openblas-threads %endif -Requires: openlibm >= 0.4 Requires: openspecfun >= 0.4 Requires: pcre2 BuildRequires: utf8proc >= 1.3 @@ -141,23 +141,22 @@ popd %endif %ifarch %{arm} # gcc and LLVM do not support the same targets -%global march MARCH=$(echo %optflags | grep -Po 'march=\\K[^ ]*') JULIA_CPU_TARGET=generic +%global march MARCH=$(echo %optflags | grep -Po 'march=\\K[^ ]*') JULIA_CPU_TARGET=generic JCFLAGS="-fsigned-char -std=gnu99 -pipe -fPIC -fno-strict-aliasing -D_FILE_OFFSET_BITS=64" %endif %ifarch armv7hl -%global march MARCH=$(echo %optflags | grep -Po 'march=\\K[^ ]*') JULIA_CPU_TARGET=cortex-a8 +%global march MARCH=$(echo %optflags | grep -Po 'march=\\K[^ ]*') JULIA_CPU_TARGET=cortex-a8 JCFLAGS="-fsigned-char -std=gnu99 -pipe -fPIC -fno-strict-aliasing -D_FILE_OFFSET_BITS=64" %endif -# OpenBLAS is not available on ARM, and need to pass -fsigned-char there -%ifarch %{arm} -%global archspecific LIBBLAS=-lblas LIBBLASNAME=liblblas.so.3 LIBLAPACK=-llapack LIBLAPACKNAME=liblapack.so.3 JCFLAGS="-fsigned-char -std=gnu99 -pipe -fPIC -fno-strict-aliasing -D_FILE_OFFSET_BITS=64" %{march} +%ifarch %{ix86} x86_64 +%global archspecific USE_SYSTEM_LIBM=0 USE_SYSTEM_OPENLIBM=1 LIBBLAS=-lopenblasp LIBBLASNAME=libopenblasp.so.0 LIBLAPACK=-lopenblasp LIBLAPACKNAME=libopenblasp.so.0 %{?march} %else -%global archspecific LIBBLAS=-lopenblasp LIBBLASNAME=libopenblasp.so.0 LIBLAPACK=-lopenblasp LIBLAPACKNAME=libopenblasp.so.0 %{march} +%global archspecific USE_SYSTEM_LIBM=1 LIBBLAS=-lblas LIBBLASNAME=liblblas.so.3 LIBLAPACK=-llapack LIBLAPACKNAME=liblapack.so.3 %{?march} %endif # USE_BLAS64=0 means that BLAS was built with 32-bit integers, even if the library is 64 bits # About build, build_libdir and build_bindir, see https://github.com/JuliaLang/julia/issues/5063#issuecomment-32628111 %global julia_builddir %{_builddir}/%{name}/build -%global commonopts USE_SYSTEM_LLVM=1 USE_SYSTEM_LIBUNWIND=1 USE_SYSTEM_READLINE=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_OPENSPECFUN=1 USE_SYSTEM_OPENLIBM=1 USE_SYSTEM_BLAS=1 USE_SYSTEM_LAPACK=1 USE_SYSTEM_FFTW=1 USE_SYSTEM_GMP=1 USE_SYSTEM_MPFR=1 USE_SYSTEM_ARPACK=1 USE_SYSTEM_SUITESPARSE=1 USE_SYSTEM_ZLIB=1 USE_SYSTEM_GRISU=1 USE_SYSTEM_DSFMT=1 USE_SYSTEM_LIBUV=0 USE_SYSTEM_RMATH=0 USE_LLVM_SHLIB=1 USE_SYSTEM_UTF8PROC=1 USE_SYSTEM_LIBGIT2=1 USE_SYSTEM_PATCHELF=1 VERBOSE=1 USE_BLAS64=0 %{archspecific} prefix=%{_prefix} bindir=%{_bindir} libdir=%{_libdir} libexecdir=%{_libexecdir} datarootdir=%{_datarootdir} includedir=%{_includedir} sysconfdir=%{_sysconfdir} build_prefix=%{julia_builddir} build_bindir=%{julia_builddir}%{_bindir} build_libdir=%{julia_builddir}%{_libdir} build_private_libdir=%{julia_builddir}%{_libdir}/julia build_libexecdir=%{julia_builddir}%{_libexecdir} build_datarootdir=%{julia_builddir}%{_datarootdir} build_includedir=%{julia_builddir}%{_includedir} build_sysconfdir=%{julia_builddir}%{_sysconfdir} +%global commonopts USE_SYSTEM_LLVM=1 USE_SYSTEM_LIBUNWIND=1 USE_SYSTEM_READLINE=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_OPENSPECFUN=1 USE_SYSTEM_BLAS=1 USE_SYSTEM_LAPACK=1 USE_SYSTEM_FFTW=1 USE_SYSTEM_GMP=1 USE_SYSTEM_MPFR=1 USE_SYSTEM_ARPACK=1 USE_SYSTEM_SUITESPARSE=1 USE_SYSTEM_ZLIB=1 USE_SYSTEM_GRISU=1 USE_SYSTEM_DSFMT=1 USE_SYSTEM_LIBUV=0 USE_SYSTEM_RMATH=0 USE_LLVM_SHLIB=1 USE_SYSTEM_UTF8PROC=1 USE_SYSTEM_LIBGIT2=1 USE_SYSTEM_PATCHELF=1 VERBOSE=1 USE_BLAS64=0 %{archspecific} prefix=%{_prefix} bindir=%{_bindir} libdir=%{_libdir} libexecdir=%{_libexecdir} datarootdir=%{_datarootdir} includedir=%{_includedir} sysconfdir=%{_sysconfdir} build_prefix=%{julia_builddir} build_bindir=%{julia_builddir}%{_bindir} build_libdir=%{julia_builddir}%{_libdir} build_private_libdir=%{julia_builddir}%{_libdir}/julia build_libexecdir=%{julia_builddir}%{_libexecdir} build_datarootdir=%{julia_builddir}%{_datarootdir} build_includedir=%{julia_builddir}%{_includedir} build_sysconfdir=%{julia_builddir}%{_sysconfdir} %build make %{?_smp_mflags} CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" FFLAGS="%{optflags}" %commonopts release