Skip to content

Commit

Permalink
Introduce USE_GPL_LIBS Makefile flag to build Julia without GPL libra…
Browse files Browse the repository at this point in the history
…ries

USE_GPL_LIBS=1 by default
Disable Rmath, FFTW, and SuiteSparse builds if USE_GPL_LIBS=0
Remove inclusion of julia bindings in sysimg if USE_GPL_LIBS=0
  • Loading branch information
ViralBShah committed Apr 17, 2015
1 parent ed020a5 commit 1033668
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ else
JULIA_COMMIT = $(JULIA_VERSION)
endif

# Whether to use GPL libraries or not.
USE_GPL_LIBS ?= 1

# Directories where said libraries get installed to
prefix ?= $(abspath julia-$(JULIA_COMMIT))
bindir = $(prefix)/bin
Expand Down
5 changes: 5 additions & 0 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ ifeq ($(USE_BLAS64), 1)
@echo "const USE_BLAS64 = true" >> $@
else
@echo "const USE_BLAS64 = false" >> $@
endif
ifeq ($(USE_GPL_LIBS), 1)
@echo "const USE_GPL_LIBS = true" >> $@
else
@echo "const USE_GPL_LIBS = false" >> $@
endif
@echo "const libfftw_name = \"$(LIBFFTWNAME)\"" >> $@
@echo "const libfftwf_name = \"$(LIBFFTWFNAME)\"" >> $@
Expand Down
4 changes: 4 additions & 0 deletions base/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ keywords[:immutable] = doc"""
push!([1,2,3], 4) == [1,2,3,4]
""" push!

if Base.USE_GPL_LIBS

@doc doc"""
fft(A[, dims])
Expand All @@ -347,6 +349,8 @@ keywords[:immutable] = doc"""
processors.
""" fft

end # USE_GPL_LIBS

@doc doc"""
include("file.jl")
Expand Down
8 changes: 5 additions & 3 deletions base/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ include("sparse/sparsematrix.jl")
include("sparse/csparse.jl")

include("sparse/linalg.jl")
include("sparse/umfpack.jl")
include("sparse/cholmod.jl")
include("sparse/spqr.jl")
if Base.USE_GPL_LIBS
include("sparse/umfpack.jl")
include("sparse/cholmod.jl")
include("sparse/spqr.jl")
end

end # module SparseMatrix
8 changes: 5 additions & 3 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,11 @@ include("sparse.jl")
importall .SparseMatrix

# signal processing
include("fftw.jl")
include("dsp.jl")
importall .DSP
if USE_GPL_LIBS
include("fftw.jl")
include("dsp.jl")
importall .DSP
end

# system information
include("sysinfo.jl")
Expand Down
10 changes: 10 additions & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,15 @@ MAKE_COMMON = DESTDIR="" prefix=$(build_prefix) bindir=$(build_bindir) libdir=$(
# prevent installing libs into usr/lib64 on opensuse
unexport CONFIG_SITE

ifeq ($(USE_GPL_LIBS), 1)
STAGE1_DEPS =
STAGE2_DEPS = Rmath-julia
STAGE3_DEPS = suitesparse-wrapper
else
STAGE1_DEPS =
STAGE2_DEPS =
STAGE3_DEPS =
endif

ifeq ($(USE_SYSTEM_LIBUV), 0)
STAGE1_DEPS += libuv
Expand Down Expand Up @@ -121,9 +127,11 @@ endif
endif
endif

ifeq ($(USE_GPL_LIBS), 1)
ifeq ($(USE_SYSTEM_FFTW), 0)
STAGE1_DEPS += fftw
endif
endif

ifeq ($(USE_SYSTEM_GMP), 0)
STAGE1_DEPS += gmp
Expand All @@ -149,9 +157,11 @@ ifeq ($(USE_SYSTEM_ARPACK), 0)
STAGE2_DEPS += arpack
endif

ifeq ($(USE_GPL_LIBS), 1)
ifeq ($(USE_SYSTEM_SUITESPARSE), 0)
STAGE2_DEPS += suitesparse
endif
endif

ifeq ($(USE_SYSTEM_UTF8PROC), 0)
STAGE2_DEPS += utf8proc
Expand Down
6 changes: 5 additions & 1 deletion test/choosetests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function choosetests(choices = [])
"linalg", "core", "keywordargs", "numbers", "strings",
"dates", "dict", "hashing", "remote", "iobuffer", "staged",
"arrayops", "tuple", "subarray", "reduce", "reducedim", "random",
"intfuncs", "simdloop", "blas", "fft", "dsp", "sparse",
"intfuncs", "simdloop", "blas", "sparse",
"bitarray", "copy", "math", "fastmath", "functional",
"operators", "path", "ccall",
"bigint", "sorting", "statistics", "spawn", "backtrace",
Expand All @@ -31,6 +31,10 @@ function choosetests(choices = [])
"enums", "cmdlineargs", "i18n"
]

if Base.USE_GPL_LIBS
testnames = [testnames, "fft", "dsp"; ]
end

if isdir(joinpath(JULIA_HOME, Base.DOCDIR, "examples"))
push!(testnames, "examples")
end
Expand Down
8 changes: 5 additions & 3 deletions test/sparse.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include("sparsedir/sparse.jl")
include("sparsedir/umfpack.jl")
include("sparsedir/cholmod.jl")
include("sparsedir/spqr.jl")
if Base.USE_GPL_LIBS
include("sparsedir/umfpack.jl")
include("sparsedir/cholmod.jl")
include("sparsedir/spqr.jl")
end

0 comments on commit 1033668

Please sign in to comment.