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

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

Closed
ReubenHill opened this issue Apr 29, 2019 · 8 comments
Closed

Comments

@ReubenHill
Copy link
Collaborator

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
Copy link
Collaborator Author

@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
Copy link
Contributor

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
Copy link
Collaborator Author

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Collaborator Author

ReubenHill commented Apr 30, 2019

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

@samuelpowell
Copy link
Contributor

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

@ReubenHill
Copy link
Collaborator Author

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")

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