Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_pcre_version() and check_pcre() #3873

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ function _start()
fdwatcher_reinit()
# Initialize RNG
Random.librandom_init()
# Check that pcre is the correct version
check_pcre()
# Check that BLAS is correctly built
check_blas()
LinAlg.init()
Expand Down
17 changes: 17 additions & 0 deletions base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,22 @@ function check_blas()
end
end

# Returns the PCRE version as a string, in an attempt to avoid using PCRE itself
function get_pcre_version()
version_string = bytestring( ccall((:pcre_version, "libpcre"), Ptr{Uint8}, () ))
return version_string[1:search( version_string, " ")[1]-1]
end

function check_pcre()
required_version = "8.31"
linked_version = get_pcre_version()
# Check to see if it's a new enough pcre version, without actually using pcre
if float(linked_version) < float(required_version)
println("ERROR: The linked PCRE is too old! PCRE $required_version or higher is required, currently linked against $linked_version")
quit()
end
end

# system information

function versioninfo(io::IO=STDOUT, verbose::Bool=false)
Expand Down Expand Up @@ -288,6 +304,7 @@ function versioninfo(io::IO=STDOUT, verbose::Bool=false)
println(io, " LAPACK: ",liblapack_name)
println(io, " LIBM: ",libm_name)
if verbose
println(io, " libpcre: libpcre (Version $(get_pcre_version()))")
println(io, "Environment:")
for (k,v) in ENV
if !is(match(r"JULIA|PATH|FLAG|^TERM$|HOME",k), nothing)
Expand Down