Gowerlabs / LibFTD2XX.jl

Julia wrapper for FTDI D2XX drivers.
Other
6 stars 1 forks source link

Windows 10: Generated build/deps.jl does not use downloaded ftd2xx.DLL #41

Closed ReubenHill closed 5 years ago

ReubenHill commented 5 years ago

The build/deps.jl file generated on my Windows 10 64 bit PC is below

# This is an auto-generated file; do not edit and do not check-in to version control

# Pre-hooks

if VERSION >= v"0.7.0-DEV.3382"
    using Libdl
end
# Macro to load a library
macro checked_lib(libname, path)
    if Libdl.dlopen_e(path) == C_NULL
        error("Unable to load \n\n$libname ($path)\n\nPlease ",
              "re-run Pkg.build(package), and restart Julia.")
    end
    quote
        const $(esc(libname)) = $path
    end
end

# Load dependencies
@checked_lib libFTD2XX "C:\\WINDOWS\\SYSTEM32\\ftd2xx.DLL"

# Load-hooks

Rather than explicitly loading the downloaded driver, it loads whatever is, by default, in the system folder (which may be a different version).

ReubenHill commented 5 years ago

@samuelpowell you implemented all the BinDeps stuff. Is the deps.jl file auto-generated? I.e. is this fixable or is this an issue with BinDeps?

samuelpowell commented 5 years ago

It is autogenerated so it will pick up whichever library it wants. Not sure how to enforce use of the downloaded version. Do the BSODs you've observed go away if you fix the library version to the downloaded one?

ReubenHill commented 5 years ago

running Pkg.build(LibFTD2XX) does not cause the driver to be downloaded to build/ directory. Also the build.log file that is generated is empty. I'm therefore unsure exactly where I'm meant to be pointing the driver...

samuelpowell commented 5 years ago

Actually, on Linux the installation is picking up another application's copy @checked_lib libFTD2XX "/usr/lib64/digilent/adept/libftd2xx.so" so there are two problems here.

samuelpowell commented 5 years ago

I think we need to #43.

If I have a shot at this for Linux are you able to test/refine for Windows @ReubenHill ?

ReubenHill commented 5 years ago

Sure can do. I'll need some pointers with the use of BinaryProviders. Also, does this warrant an issue in BinDeps.jl?

samuelpowell commented 5 years ago

I don't know what the intended behaviour is, and it seems deprecated, so I don't think so.

ReubenHill commented 5 years ago

I've come up with a windows-only test that can help with validation here:


using LibFTD2XX
using Test

@assert Sys.iswindows() # below will only work on windows...

@test libversion() == v"3.2.14" # True for my windows machine. Not clear how this relates to the actual driver package version.

# check that driver v"2.12.28" was downloaded...
devices = D2XXDevices()
@assert length(devices) > 0 # note that hardware is required
open.(devices)
ver = driverversion.(devices)
@test all(ver .== v"2.12.28")