Skip to content

Commit 1033668

Browse files
committed
Introduce USE_GPL_LIBS Makefile flag to build Julia without GPL libraries
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
1 parent ed020a5 commit 1033668

File tree

8 files changed

+42
-10
lines changed

8 files changed

+42
-10
lines changed

Make.inc

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ else
9191
JULIA_COMMIT = $(JULIA_VERSION)
9292
endif
9393

94+
# Whether to use GPL libraries or not.
95+
USE_GPL_LIBS ?= 1
96+
9497
# Directories where said libraries get installed to
9598
prefix ?= $(abspath julia-$(JULIA_COMMIT))
9699
bindir = $(prefix)/bin

base/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ ifeq ($(USE_BLAS64), 1)
4949
@echo "const USE_BLAS64 = true" >> $@
5050
else
5151
@echo "const USE_BLAS64 = false" >> $@
52+
endif
53+
ifeq ($(USE_GPL_LIBS), 1)
54+
@echo "const USE_GPL_LIBS = true" >> $@
55+
else
56+
@echo "const USE_GPL_LIBS = false" >> $@
5257
endif
5358
@echo "const libfftw_name = \"$(LIBFFTWNAME)\"" >> $@
5459
@echo "const libfftwf_name = \"$(LIBFFTWFNAME)\"" >> $@

base/basedocs.jl

+4
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ keywords[:immutable] = doc"""
321321
push!([1,2,3], 4) == [1,2,3,4]
322322
""" push!
323323

324+
if Base.USE_GPL_LIBS
325+
324326
@doc doc"""
325327
fft(A[, dims])
326328
@@ -347,6 +349,8 @@ keywords[:immutable] = doc"""
347349
processors.
348350
""" fft
349351

352+
end # USE_GPL_LIBS
353+
350354
@doc doc"""
351355
include("file.jl")
352356

base/sparse.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ include("sparse/sparsematrix.jl")
2020
include("sparse/csparse.jl")
2121

2222
include("sparse/linalg.jl")
23-
include("sparse/umfpack.jl")
24-
include("sparse/cholmod.jl")
25-
include("sparse/spqr.jl")
23+
if Base.USE_GPL_LIBS
24+
include("sparse/umfpack.jl")
25+
include("sparse/cholmod.jl")
26+
include("sparse/spqr.jl")
27+
end
2628

2729
end # module SparseMatrix

base/sysimg.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,11 @@ include("sparse.jl")
261261
importall .SparseMatrix
262262

263263
# signal processing
264-
include("fftw.jl")
265-
include("dsp.jl")
266-
importall .DSP
264+
if USE_GPL_LIBS
265+
include("fftw.jl")
266+
include("dsp.jl")
267+
importall .DSP
268+
end
267269

268270
# system information
269271
include("sysinfo.jl")

deps/Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,15 @@ MAKE_COMMON = DESTDIR="" prefix=$(build_prefix) bindir=$(build_bindir) libdir=$(
6161
# prevent installing libs into usr/lib64 on opensuse
6262
unexport CONFIG_SITE
6363

64+
ifeq ($(USE_GPL_LIBS), 1)
6465
STAGE1_DEPS =
6566
STAGE2_DEPS = Rmath-julia
6667
STAGE3_DEPS = suitesparse-wrapper
68+
else
69+
STAGE1_DEPS =
70+
STAGE2_DEPS =
71+
STAGE3_DEPS =
72+
endif
6773

6874
ifeq ($(USE_SYSTEM_LIBUV), 0)
6975
STAGE1_DEPS += libuv
@@ -121,9 +127,11 @@ endif
121127
endif
122128
endif
123129

130+
ifeq ($(USE_GPL_LIBS), 1)
124131
ifeq ($(USE_SYSTEM_FFTW), 0)
125132
STAGE1_DEPS += fftw
126133
endif
134+
endif
127135

128136
ifeq ($(USE_SYSTEM_GMP), 0)
129137
STAGE1_DEPS += gmp
@@ -149,9 +157,11 @@ ifeq ($(USE_SYSTEM_ARPACK), 0)
149157
STAGE2_DEPS += arpack
150158
endif
151159

160+
ifeq ($(USE_GPL_LIBS), 1)
152161
ifeq ($(USE_SYSTEM_SUITESPARSE), 0)
153162
STAGE2_DEPS += suitesparse
154163
endif
164+
endif
155165

156166
ifeq ($(USE_SYSTEM_UTF8PROC), 0)
157167
STAGE2_DEPS += utf8proc

test/choosetests.jl

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function choosetests(choices = [])
1616
"linalg", "core", "keywordargs", "numbers", "strings",
1717
"dates", "dict", "hashing", "remote", "iobuffer", "staged",
1818
"arrayops", "tuple", "subarray", "reduce", "reducedim", "random",
19-
"intfuncs", "simdloop", "blas", "fft", "dsp", "sparse",
19+
"intfuncs", "simdloop", "blas", "sparse",
2020
"bitarray", "copy", "math", "fastmath", "functional",
2121
"operators", "path", "ccall",
2222
"bigint", "sorting", "statistics", "spawn", "backtrace",
@@ -31,6 +31,10 @@ function choosetests(choices = [])
3131
"enums", "cmdlineargs", "i18n"
3232
]
3333

34+
if Base.USE_GPL_LIBS
35+
testnames = [testnames, "fft", "dsp"; ]
36+
end
37+
3438
if isdir(joinpath(JULIA_HOME, Base.DOCDIR, "examples"))
3539
push!(testnames, "examples")
3640
end

test/sparse.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
include("sparsedir/sparse.jl")
2-
include("sparsedir/umfpack.jl")
3-
include("sparsedir/cholmod.jl")
4-
include("sparsedir/spqr.jl")
2+
if Base.USE_GPL_LIBS
3+
include("sparsedir/umfpack.jl")
4+
include("sparsedir/cholmod.jl")
5+
include("sparsedir/spqr.jl")
6+
end

0 commit comments

Comments
 (0)