Skip to content

Commit 07b8132

Browse files
staticfloatvchuravy
authored andcommitted
Change Random to use dSFMT_jll
1 parent 3b59907 commit 07b8132

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

pkgimage.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ $(eval $(call sysimg_builder,nghttp2_jll,Artifacts Libdl))
8686
$(eval $(call pkgimg_builder,OpenLibm_jll,Artifacts Libdl))
8787
$(eval $(call pkgimg_builder,PCRE2_jll,Artifacts Libdl))
8888
$(eval $(call sysimg_builder,Zlib_jll,Artifacts Libdl))
89-
$(eval $(call pkgimg_builder,dSFMT_jll,Artifacts Libdl))
89+
$(eval $(call sysimg_builder,dSFMT_jll,Artifacts Libdl))
9090
$(eval $(call pkgimg_builder,libLLVM_jll,Artifacts Libdl))
9191
$(eval $(call sysimg_builder,libblastrampoline_jll,Artifacts Libdl))
9292
$(eval $(call sysimg_builder,OpenBLAS_jll,Artifacts Libdl))
9393
$(eval $(call sysimg_builder,Markdown,Base64))
9494
$(eval $(call sysimg_builder,Printf,Unicode))
95-
$(eval $(call sysimg_builder,Random,SHA))
9695
$(eval $(call sysimg_builder,Tar,ArgTools,SHA))
9796
$(eval $(call pkgimg_builder,DelimitedFiles,Mmap))
9897

9998
# 2-depth packages
99+
$(eval $(call sysimg_builder,Random,SHA dSFMT_jll))
100100
$(eval $(call pkgimg_builder,LLD_jll,Zlib_jll libLLVM_jll Artifacts Libdl))
101101
$(eval $(call sysimg_builder,LibSSH2_jll,Artifacts Libdl MbedTLS_jll))
102102
$(eval $(call pkgimg_builder,MPFR_jll,Artifacts Libdl GMP_jll))

stdlib/Random/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name = "Random"
22
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
33

44
[deps]
5+
dSFMT_jll = "05ff407c-b0c1-5878-9df8-858cc2e60c36"
56
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
67

78
[extras]

stdlib/Random/src/DSFMT.jl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module DSFMT
44

55
import Base: copy, copy!, ==, hash
66
using Base.GMP.MPZ
7+
using dSFMT_jll
78

89
export DSFMT_state, dsfmt_get_min_array_size, dsfmt_get_idstring,
910
dsfmt_init_gen_rand, dsfmt_init_by_array, dsfmt_gv_init_by_array,
@@ -44,36 +45,36 @@ hash(s::DSFMT_state, h::UInt) = hash(s.val, h)
4445
## wrapper functions
4546

4647
function dsfmt_get_idstring()
47-
idstring = ccall((:dsfmt_get_idstring,:libdSFMT),
48+
idstring = ccall((:dsfmt_get_idstring,libdSFMT),
4849
Ptr{UInt8},
4950
())
5051
return unsafe_string(idstring)
5152
end
5253

5354
function dsfmt_get_min_array_size()
54-
min_array_size = ccall((:dsfmt_get_min_array_size,:libdSFMT),
55+
min_array_size = ccall((:dsfmt_get_min_array_size,libdSFMT),
5556
Int32,
5657
())
5758
end
5859

5960
const dsfmt_min_array_size = dsfmt_get_min_array_size()
6061

6162
function dsfmt_init_gen_rand(s::DSFMT_state, seed::UInt32)
62-
ccall((:dsfmt_init_gen_rand,:libdSFMT),
63+
ccall((:dsfmt_init_gen_rand,libdSFMT),
6364
Cvoid,
6465
(Ptr{Cvoid}, UInt32,),
6566
s.val, seed)
6667
end
6768

6869
function dsfmt_init_by_array(s::DSFMT_state, seed::Vector{UInt32})
69-
ccall((:dsfmt_init_by_array,:libdSFMT),
70+
ccall((:dsfmt_init_by_array,libdSFMT),
7071
Cvoid,
7172
(Ptr{Cvoid}, Ptr{UInt32}, Int32),
7273
s.val, seed, length(seed))
7374
end
7475

7576
function dsfmt_gv_init_by_array(seed::Vector{UInt32})
76-
ccall((:dsfmt_gv_init_by_array,:libdSFMT),
77+
ccall((:dsfmt_gv_init_by_array,libdSFMT),
7778
Cvoid,
7879
(Ptr{UInt32}, Int32),
7980
seed, length(seed))
@@ -82,7 +83,7 @@ end
8283
function dsfmt_fill_array_close1_open2!(s::DSFMT_state, A::Ptr{Float64}, n::Int)
8384
@assert Csize_t(A) % 16 == 0 # the underlying C array must be 16-byte aligned
8485
@assert dsfmt_min_array_size <= n && iseven(n)
85-
ccall((:dsfmt_fill_array_close1_open2,:libdSFMT),
86+
ccall((:dsfmt_fill_array_close1_open2,libdSFMT),
8687
Cvoid,
8788
(Ptr{Cvoid}, Ptr{Float64}, Int),
8889
s.val, A, n)
@@ -91,7 +92,7 @@ end
9192
function dsfmt_fill_array_close_open!(s::DSFMT_state, A::Ptr{Float64}, n::Int)
9293
@assert Csize_t(A) % 16 == 0 # the underlying C array must be 16-byte aligned
9394
@assert dsfmt_min_array_size <= n && iseven(n)
94-
ccall((:dsfmt_fill_array_close_open,:libdSFMT),
95+
ccall((:dsfmt_fill_array_close_open,libdSFMT),
9596
Cvoid,
9697
(Ptr{Cvoid}, Ptr{Float64}, Int),
9798
s.val, A, n)

0 commit comments

Comments
 (0)