Source: julia
Version: 0.3.11-1
Severity: wishlist
Tags: patch

Hi Maintainer

Please consider uploading to experimental a version of Julia that
enables building on all architectures.

This will be useful for testing the packaging changes that will be
needed for the 0.4.0 release, but I think this can be useful now with
a version 0.3.11 in experimental.

The attached patch contains changes I have made to debian/control and
debian/rules, as well as a minor change to
debian/patches/require-sse2-on-i386.patch.

I will follow up this bug report with a series of cherry-picked
patches from upstream 0.4.0 which enable building on other
architectures and fix some issues on armhf.  These patches may cause
regressions, which is why I am requesting that this be uploaded to
experimental rather than unstable.

I would be happy to join the Debian Julia Team and make the changes in
an experimental branch on git myself, and to assist with maintenance
of Julia and related packages in Debian on an ongoing basis.

Regards
Graham
diff -Nru julia-0.3.11/debian/control julia-0.3.11/debian/control
--- julia-0.3.11/debian/control 2015-05-25 14:51:48.000000000 +0200
+++ julia-0.3.11/debian/control 2015-10-21 13:43:00.000000000 +0200
@@ -5,8 +5,8 @@
 Build-Depends: dpkg-dev (>= 1.16.2~), debhelper (>= 9), dh-exec, llvm-3.5-dev,
  libdouble-conversion-dev, libsuitesparse-dev (>= 1:4.2.1), libgmp-dev,
  libunwind8-dev, libfftw3-dev, libpcre3-dev, libarpack2-dev, libmpfr-dev,
- libopenblas-dev (>= 0.2.10-1~), libopenlibm-dev, libopenspecfun-dev (>= 0.4~),
- patchelf, python-sphinx, python-sphinx-rtd-theme, libjs-mathjax
+ libopenblas-dev (>= 0.2.10-1~) [!ppc64el], libopenlibm-dev [i386 amd64], 
libopenspecfun-dev (>= 0.4~),
+ python-sphinx, python-sphinx-rtd-theme, libjs-mathjax
 Standards-Version: 3.9.6
 Section: science
 Homepage: http://julialang.org
@@ -14,14 +14,14 @@
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-julia/julia.git
 
 Package: julia
-Architecture: amd64 i386
+Architecture: any
 Pre-Depends: ${misc:Pre-Depends}
 # NB: several shared libs have to be hardcoded because they are dlopen'd from
 # Julia scripts, and therefore dpkg-shlibdeps cannot detect them
 Depends: ${shlibs:Depends}, ${misc:Depends},
- libopenblas-base (>= 0.2.10-1~), libpcre3,
+ libopenblas-base (>= 0.2.10-1~) [!ppc64el], libpcre3,
  libfftw3-double3, libfftw3-single3, libcholmod2.1.2, libumfpack5.6.2,
- libgmp10, libarpack2, libmpfr4, libopenlibm1, libopenspecfun1
+ libgmp10, libarpack2, libmpfr4, libopenlibm1 [i386 amd64], libopenspecfun1
 Recommends: git
 Suggests: julia-doc, ess (>= 12.09-1~)
 Description: high-performance programming language for technical computing
@@ -60,7 +60,7 @@
 
 Package: julia-dbg
 Section: debug
-Architecture: amd64 i386
+Architecture: any
 Depends: julia (= ${binary:Version}), ${misc:Depends}
 Description: high-performance programming language for technical computing
  Julia is a high-level, high-performance dynamic programming language for
diff -Nru julia-0.3.11/debian/patches/require-sse2-on-i386.patch 
julia-0.3.11/debian/patches/require-sse2-on-i386.patch
--- julia-0.3.11/debian/patches/require-sse2-on-i386.patch      2015-07-17 
23:03:13.000000000 +0200
+++ julia-0.3.11/debian/patches/require-sse2-on-i386.patch      2015-09-16 
10:14:00.000000000 +0200
@@ -1,15 +1,17 @@
 Description: Julia requires SSE2 on i386
  This patch adds an explicit error message if the CPU does not support SSE2.
  By the way, it also enables SSE2 in dSFMT.
-Author: Sébastien Villemot <[email protected]>
 Bug: https://github.com/JuliaLang/julia/issues/7185
 Forwarded: no
+Author: Sébastien Villemot <[email protected]>
 Last-Update: 2014-09-17
+Author: Graham Inggs <[email protected]>
+Last-Update: 2015-09-16
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/src/codegen.cpp
 +++ b/src/codegen.cpp
-@@ -4494,6 +4494,16 @@ static void init_julia_llvm_env(Module *
+@@ -4494,6 +4494,16 @@
  
  extern "C" void jl_init_codegen(void)
  {
@@ -28,13 +30,13 @@
      cl::ParseCommandLineOptions(sizeof(argv)/sizeof(argv[0]), argv, 
"disable-copyprop\n");
 --- a/deps/Makefile
 +++ b/deps/Makefile
-@@ -690,9 +690,7 @@ DSFMT_CFLAGS += -finline-functions -fomi
+@@ -690,6 +690,9 @@
  else
  DSFMT_CFLAGS += -Wl,-dll
  endif
--ifeq ($(ARCH), x86_64)
++ifeq ($(ARCH), i386)
++DSFMT_CFLAGS += -msse2 -DHAVE_SSE2
++endif
+ ifeq ($(ARCH), x86_64)
  DSFMT_CFLAGS += -msse2 -DHAVE_SSE2
--endif
- 
- $(DSFMT_OBJ_SOURCE): dsfmt-$(DSFMT_VER)/config.status
-       cd dsfmt-$(DSFMT_VER) && \
+ endif
diff -Nru julia-0.3.11/debian/rules julia-0.3.11/debian/rules
--- julia-0.3.11/debian/rules   2015-05-25 15:47:36.000000000 +0200
+++ julia-0.3.11/debian/rules   2015-10-09 14:53:35.000000000 +0200
@@ -7,19 +7,26 @@
 COMMON_FLAGS = USE_SYSTEM_LIBUNWIND=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_BLAS=1      
\
        USE_SYSTEM_LAPACK=1 USE_BLAS64=0 USE_SYSTEM_FFTW=1 USE_SYSTEM_GMP=1     
\
        USE_SYSTEM_ARPACK=1 USE_SYSTEM_MPFR=1 USE_SYSTEM_SUITESPARSE=1          
\
-       USE_SYSTEM_GRISU=1 USE_SYSTEM_OPENSPECFUN=1 USE_SYSTEM_OPENLIBM=1       
\
+       USE_SYSTEM_GRISU=1 USE_SYSTEM_OPENSPECFUN=1 USE_SYSTEM_PATCHELF=1       
\
        USE_LLVM_SHLIB=1 USE_SYSTEM_LLVM=1 LLVM_VER=$(LLVM_VER)                 
\
        LLVM_CONFIG=/usr/bin/llvm-config-$(LLVM_VER) VERBOSE=1                  
\
-       LIBBLAS=-lopenblas LIBBLASNAME=libopenblas                              
\
-       LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas                          
\
        MULTIARCH_INSTALL=1 sysconfdir=/etc prefix=/usr DESTDIR=debian/tmp/
 
 ifeq ($(DEB_HOST_ARCH),amd64)
-COMMON_FLAGS += MARCH=x86-64
+COMMON_FLAGS += MARCH=x86-64 USE_SYSTEM_OPENLIBM=1
 else ifeq ($(DEB_HOST_ARCH),i386)
-COMMON_FLAGS += MARCH=pentium4
+COMMON_FLAGS += MARCH=pentium4 USE_SYSTEM_OPENLIBM=1
 else
-$(error Unsupported arch $(DEB_HOST_ARCH))
+COMMON_FLAGS += USE_SYSTEM_LIBM=1
+export DEB_BUILD_OPTIONS += nocheck
+endif
+
+ifeq ($(DEB_HOST_ARCH),ppc64el)
+COMMON_FLAGS += LIBBLAS=-lblas LIBBLASNAME=libblas \
+                LIBLAPACK=-llapack LIBLAPACKNAME=liblapack
+else 
+COMMON_FLAGS += LIBBLAS=-lopenblas LIBBLASNAME=libopenblas \
+                LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas
 endif
 
 %:

Reply via email to