IntelLabs / ParallelAccelerator.jl

The ParallelAccelerator package, part of the High Performance Scripting project at Intel Labs
BSD 2-Clause "Simplified" License
294 stars 32 forks source link

Pkg.add("ParallelAccelerator") throws error on Windows 10 #75

Open shivaramkrs opened 8 years ago

shivaramkrs commented 8 years ago

I get this build error while installing ParallelAccelarator. image

DrTodd13 commented 8 years ago

I can now generate the dll but the subsequent ccall into that dll is failing. find_library fails in many permutations and a direct dlopen also fails. I tried adding the directory the generated file is in to DL_LOAD_PATH and specified full path to dlopen but they all fail like this:

julia> Base.Libdl.dlopen("C:/Users/taanders/.julia/v0.5/ParallelAccelerator/deps
/generated/libcgen_output0.dll")
ERROR: could not load library "C:/Users/taanders/.julia/v0.5/ParallelAccelerator
/deps/generated/libcgen_output0.dll"
The operation completed successfully.

 in dlopen(::String, ::UInt32) at .\libdl.jl:90 (repeats 2 times)
 in eval(::Module, ::Any) at .\boot.jl:234
 in macro expansion at .\REPL.jl:92 [inlined]
 in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at .\event.jl:46

Edit...after some more digging:

Dependency walker shows 3 dependent DLLs: 1) libgcc_s_seh-1.dll 2) libgomp-1.dll 3) libstdc++-6.dll

The first DLL is in mingw/bin so probably not a problem. The other two don't seem to be found in the WinRPM file system. So, probably a DLL dependency was stopping our generated DLL from loading.

tkelman commented 8 years ago

I'm a little surprised it would link a C++ OpenMP library successfully without those. I'd think those should be dependencies of the gcc-c++ package, but maybe the library package names also need to be added explicitly?

DrTodd13 commented 8 years ago

Used -Wl,-static -lgomp and a couple other flags to statically link most of the libs. Abs.jl and lib.jl in the test directory now working! Probably a bunch of the other ones will work now as well but working my way through Pkg.test("ParallelAccelerator"), which is currently failing in the parfor test.

DrTodd13 commented 8 years ago

With the latest updates, the Windows status is as follows. If you've been waiting for something possibly working on Windows please give the latest version a try and report problems. Thanks.

Test file Status
abs Working
aug_assign Working
BitArray Working
cat Working
complex Working
const_promote Working
lib Working
mapreduce CGen: variable SSAValue(5) cannot have Any type.
misc Could not determine type for arg 1 to call .Base.transpose_f! with name Base.transpose.
parfor Working
print CGen output missing terminating ' character.
rand Could not determine type for arg 1 to call .Base.#print_to_string#140 with name Base.nothing.
range Working
ranges Working
seq Working
strings error: 'classASCIIString' has no member named 'ARRAYELEM'
test_at_mul_b.jl Could not determine type for arg 1 to call .Base.transpose_f! with name Base.transpose.
test_lr Could not determine type for arg 1 to call .Base.transpose_f! with name Base.transpose.
test_sum_maximum Working
test_update_w Working
blackscholes Working
pi Working
opt-flow Working
k-means Working
ninegua commented 8 years ago

Believe my latest commit fixed it for mapreduce. The other issues are either about strings, or transpose, and they also affect Linux too.

amellnik commented 8 years ago

I started tests without @ninegua's most recent commit, but I'm seeing roughly the same results at @DrTodd13 above -- looking into it more now. Great work!

Update: I see a few unlink: operation not permitted (EPERM) messages which appear to only be warnings, as well as a few billion Base.String deprecation warnings.

tkelman commented 8 years ago

unlink: operation not permitted (EPERM)

That's usually a sign that files are trying to be deleted before the handles are closed. Switching more open-close pairs to open(path) do f ... end blocks will likely help

amellnik commented 8 years ago

Thanks @tkelman!

One thing I've noticed is that while I have OpenBLAS installed and on my path, I still see a warning that OpenBLAS is not installed. When I Pkg.build("ParallelAccelerator") I don't see any messages related to it. Should this be supported yet or is that still pending?

DrTodd13 commented 8 years ago

Where does the warning come from about OpenBlas is not installed? Build.jl for Windows doesn't do anything with OpenBlas checking yet and I need to refresh my memory about what that was used for in the first place. Julia will naturally use it and the mainline of our code doesn't look for Blas nor convert to Blas so it may not be necessary that we do such a check.

amellnik commented 8 years ago

@DrTodd13: I think it's from this line.

ehsantn commented 8 years ago

We only use BLAS for matrix multiply (GEMM) calls and GEMV.

s-broda commented 8 years ago

Thanks for the great work @DrTodd13! On my Windows 10 machine, after Pkg.checkout("CompilerTools"), all tests pass. Apart from a few string deprecation warnings, Pkg.test(ParallelAccelerator) only complains about MKL/OpenBLAS not being installed. And I get a unlink: operation not permitted (EPERM) at the end. This is great!