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

join fails to run #107

Open
bkamins opened this issue May 5, 2018 · 12 comments
Open

join fails to run #107

bkamins opened this issue May 5, 2018 · 12 comments

Comments

@bkamins
Copy link

bkamins commented May 5, 2018

If you run a benchmark at https://github.com/bkamins/JuliaStrBenchmark

You see that join fails to run. The reason is that lines 411 and 413 have a typo in io.jl (d instead of delim).

But additionally - if you fix it - at least on my machine they still fail because wmemcpy function is not found (but maybe I do not have a proper version of Julia as it is a target that is moving fast).

PS. @ScottPJones Apart from this - again on my machine - Strs.jl is sometimes slower than strings from Base (I have noted in the test file where I find which case). This is an initial implementation of the benchmark - I have stopped here because of join bug.

@ScottPJones
Copy link
Member

Can you send the information about your machine (i.e. versioninfo())?
What exactly is the error you get about wmemcpy?

@bkamins
Copy link
Author

bkamins commented May 5, 2018

Standard install from precompiled nightlies (a bit old but I guess for Windows it is not updated very often)

julia> versioninfo()
Julia Version 0.7.0-DEV.4690
Commit 78c7d87369* (2018-03-23 22:25 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)

and the error is pretty standard

julia> join(ss,",");
ERROR: ccall: could not find function wmemcpy
Stacktrace:
 [1] _memcpy at Strs.jl\src\support.jl:869 [inlined]
 [2] macro expansion at Strs.jl\src\io.jl:337 [inlined]
 [3] macro expansion at .\gcutils.jl:82 [inlined]
 [4] _join(::Type{UCS2CSE}, ::Array{SubString{UCS2Str},1}, ::String) at Strs.jl\src\io.jl:323
 [5] join(::Array{SubString{UCS2Str},1}, ::String) at Strs.jl\src\io.jl:411
 [6] top-level scope

@ScottPJones
Copy link
Member

OK, although I do have tests for join (in strtest.jl and bench.jl), it didn't hit those two cases with substrings.
I'll have to make sure those get tested.
I may have to make a special case for Windows, wmemcpy is a fairly standard function, which should be in libc (along with wmemchr & wmemset).

@bkamins
Copy link
Author

bkamins commented May 6, 2018

As for wmemcpy - I agree but it seems not to be compiled into build that is distributed by default on Julia website.

@pszufe - have you encountered a similar issue (differences of available functions in libc across Julia builds) in the past?

@ScottPJones
Copy link
Member

Do the other ones work OK on your machine (that use wmemset and wmemcmp)?

@bkamins
Copy link
Author

bkamins commented May 6, 2018

Both fail (tested on repeat). And I have tested that they also both fail on 0.6.2 on Windows:

julia> versioninfo()
Julia Version 0.6.2
Commit d386e40c17* (2017-12-13 18:08 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)

@ScottPJones
Copy link
Member

That's funny, because I've used those functions on Windows before (years ago). It must be an issue of whatever Julia is using for libc on Windows then.
I'll change the constant flag to disable all of them (wmem*) on Windows for now.
Did join work for you know?

Also, have you tried my build / test / bench procedure?

f = "/j/Strs"  # This is where you have a local copy of the `Strs.jl` package
d = "$f/Strs.jl/test" # this is a path to the test subdirectory of the package
include("$d/strtest.jl")
loadall(f) # You can leave out the "f", and it will load everything from github
@usestr
testall() # This runs all of the package tests
include("$d/bench.jl") # This loads some verification functions and benchmarking functions
@time tst = checktests() # This runs a whole suite of tests that compare the results of using `String` vs. the different `Str` types, to make sure they are getting the same results
@time res = benchdir() # This runs a suite of benchmarks, for a list of text documents in different languages
save_results("/Users/scott/res0506_6.1", res) # This saves the benchmark results, so that they can be displayed (and hopefully plotted) later on)
dispbench(res) # This outputs a more readable summary of the results (can still be improved a lot though!)

@ScottPJones
Copy link
Member

I was going over old issues to close any that already had been taken care of - I tried to rerun this, but the link to randpl.txt is broken.

@bkamins
Copy link
Author

bkamins commented May 18, 2021

I do not see a link to randpl.txt. If you tell me the context I can re-create the file

@ScottPJones
Copy link
Member

It was http:/bogumilkaminski.pl/share/randpl.txt, the link was in the https://github.com/bkamins/JuliaStrBenchmark repo.

@bkamins
Copy link
Author

bkamins commented May 18, 2021

The file is there. Just use the direct link: http://bogumilkaminski.pl/share/randpl.txt

@ScottPJones
Copy link
Member

It turned out that it was failing due to the size - I've been able to download it using curl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants