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

On Windows, the docopt dll ends up in the wrong directory #4

Closed
1 task done
kordejong opened this issue Oct 4, 2022 · 3 comments
Closed
1 task done

On Windows, the docopt dll ends up in the wrong directory #4

kordejong opened this issue Oct 4, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@kordejong
Copy link
Contributor

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

After installing the docopt.cpp package, the dll is stored in Library/lib, instead of Library/bin. Client applications that depend on docopt.cpp therefore cannot be executed. Windows shows an error message with "The code execution cannot proceed because docopt.dll was not found. Reinstalling the program may fix this problem."

I think all that is needed to fix this problem is to install the Windows dll in the Conda environment's Library/bin directory. This is what other Conda packages do as well.

BTW, thanks for packaging docopt!

Installed packages

# packages in environment at E:\conda3\envs\lue_test:
#
# Name                    Version                   Build  Channel
blosc                     1.21.1               h74325e0_3    conda-forge
boost-cpp                 1.78.0               h9f4b32c_1    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2022.9.24            h5b45459_0    conda-forge
cairo                     1.16.0            hd694305_1014    conda-forge
cfitsio                   4.1.0                h5a969a9_0    conda-forge
curl                      7.85.0               heaf79c2_0    conda-forge
docopt.cpp                0.6.3                h5362a0b_0    conda-forge
expat                     2.4.9                h1537add_0    conda-forge
fmt                       9.1.0                h181d51b_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.0               h720f74d_1    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               h546665d_0    conda-forge
freexl                    1.0.6                h67ca5e6_1    conda-forge
geos                      3.11.0               h39d44d4_0    conda-forge
geotiff                   1.7.1                h714bc5f_3    conda-forge
gettext                   0.19.8.1          h5728263_1009    conda-forge
glfw                      3.3.8                h8ffe710_0    conda-forge
hdf4                      4.2.15               h0e5069d_4    conda-forge
hdf5                      1.12.2          nompi_h57737ce_100    conda-forge
icu                       70.1                 h0e60522_0    conda-forge
intel-openmp              2022.1.0          h57928b3_3787    conda-forge
jpeg                      9e                   h8ffe710_2    conda-forge
kealib                    1.4.15               hdf81f3a_1    conda-forge
krb5                      1.19.3               hc8ab02b_0    conda-forge
lcms2                     2.12                 h2a16943_0    conda-forge
lerc                      4.0.0                h63175ca_0    conda-forge
libblas                   3.9.0              16_win64_mkl    conda-forge
libcblas                  3.9.0              16_win64_mkl    conda-forge
libcurl                   7.85.0               heaf79c2_0    conda-forge
libdeflate                1.14                 hcfcfb64_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libgdal                   3.5.2                hec59f66_1    conda-forge
libglib                   2.74.0               h79619a9_0    conda-forge
libhwloc                  2.8.0                h039e092_1    conda-forge
libiconv                  1.17                 h8ffe710_0    conda-forge
libkml                    1.3.0             hf2ab4e4_1015    conda-forge
liblapack                 3.9.0              16_win64_mkl    conda-forge
libnetcdf                 4.8.1           nompi_h85765be_104    conda-forge
libpng                    1.6.38               h19919ed_0    conda-forge
libpq                     14.5                 h1ea2d34_0    conda-forge
librttopo                 1.1.0               h2842628_11    conda-forge
libspatialite             5.0.1               hd9530bf_19    conda-forge
libsqlite                 3.39.4               hcfcfb64_0    conda-forge
libssh2                   1.10.0               h9a1e1f7_3    conda-forge
libtiff                   4.4.0                h8e97e67_4    conda-forge
libwebp-base              1.2.4                h8ffe710_0    conda-forge
libxml2                   2.10.2               h99b13fb_1    conda-forge
libzip                    1.9.2                h519de47_1    conda-forge
libzlib                   1.2.12               hcfcfb64_4    conda-forge
lue                       0.3.3           py310h81a1900_0    conda-forge
lz4-c                     1.9.3                h8ffe710_1    conda-forge
mkl                       2022.1.0           h6a75c08_874    conda-forge
numpy                     1.23.3          py310h4a8f9c9_0    conda-forge
openjpeg                  2.5.0                hc9384bd_1    conda-forge
openssl                   3.0.5                hcfcfb64_2    conda-forge
pcre                      8.45                 h0e60522_0    conda-forge
pcre2                     10.37                hdfff0fc_1    conda-forge
pip                       22.2.2             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h8ffe710_0    conda-forge
poppler                   22.04.0              hb57f792_3    conda-forge
poppler-data              0.4.11               hd8ed1ab_0    conda-forge
postgresql                14.5                 he353ca9_0    conda-forge
proj                      9.0.1                h1cfcee9_1    conda-forge
pthreads-win32            2.9.1                hfa6e2cd_3    conda-forge
python                    3.10.6          hcf16a7b_0_cpython    conda-forge
python_abi                3.10                    2_cp310    conda-forge
setuptools                65.4.1             pyhd8ed1ab_0    conda-forge
snappy                    1.1.9                h82413e6_1    conda-forge
sqlite                    3.39.4               hcfcfb64_0    conda-forge
tbb                       2021.6.0             h91493d7_0    conda-forge
tiledb                    2.11.3               h3132609_0    conda-forge
tk                        8.6.12               h8ffe710_0    conda-forge
tzdata                    2022d                h191b570_0    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
vc                        14.2                 hb210afc_7    conda-forge
vs2015_runtime            14.29.30139          h890b9b1_7    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xerces-c                  3.2.3                h0e60522_5    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge
zlib                      1.2.12               hcfcfb64_4    conda-forge
zstd                      1.5.2                h7755175_4    conda-forge

Environment info

active environment : None
       user config file : C:\Users\user\.condarc
 populated config files :
          conda version : 4.14.0
    conda-build version : 3.22.0
         python version : 3.9.12.final.0
       virtual packages : __win=0=0
                          __archspec=1=x86_64
       base environment : E:\conda3  (writable)
      conda av data dir : E:\conda3\etc\conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : E:\conda3\pkgs
                          C:\Users\user\.conda\pkgs
                          C:\Users\user\AppData\Local\conda\conda\pkgs
       envs directories : E:\conda3\envs
                          C:\Users\user\.conda\envs
                          C:\Users\user\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.14.0 requests/2.27.1 CPython/3.9.12 Windows/10 Windows/10.0.19044
          administrator : False
             netrc file : None
           offline mode : False
@kordejong kordejong added the bug Something isn't working label Oct 4, 2022
@tdegeus
Copy link
Member

tdegeus commented Oct 4, 2022

Thanks @kordejong . I'm far from a Windows expert. From afar bin seems not the right directory. However, if other feedstocks do it too it is probably reasonable. Do you have some reference(s) to cite here? Would you be willing to open a PR?

@kordejong
Copy link
Contributor Author

Here is an example of another Conda package in which the dlls are moved to the Conda bin directory. Notice the step on line 35.
https://github.com/conda-forge/boost-cpp-feedstock/blob/main/recipe/bld.bat.
Using a well configured CMake project the Windows dlls should end up in the correct directory automatically, though. There should be no need to move dlls after an install.

Here are the docs about the location of dlls on Windows:
https://docs.conda.io/projects/conda-build/en/latest/resources/use-shared-libraries.html#shared-libraries-in-windows

I just noticed that the upstream docopt project contains a relevant commit:
docopt/docopt.cpp@d6a0987

It seems to me that using a version of docopt containing that commit is all it takes to make the docopt.cpp Conda package useful on Windows. The install step in your bld.bat will then put the Windows dlls in the bin directory instead of the lib directory.

@kordejong
Copy link
Contributor Author

I think this PR fixes this issue: #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants