cookiecutter-cppyy-cmake icon indicating copy to clipboard operation
cookiecutter-cppyy-cmake copied to clipboard

cmake of cookiecutter-cppyy-cmake project fails on Windows 10

Open tjorda01 opened this issue 2 years ago • 0 comments

First of all thank you for creating this project. I've used cookiecutter-cppyy-cmake to create Python bindings for our C++ project successfully on Linux (Ubuntu and CentOS). I found it very easy to use and maintain the Python bindings as our C++ code evolves.

However, we now need to create Python bindings for Windows 10 deployments. Issue: After successfully running this command ...

    $ conda install -c conda-forge cookiecutter

... the cmake command fails because it can't find *.so files.

It appears that these files list *.so files instead of DLLs: FindCppyy.cmake, ROOTConfig-targets-release.cmake, and modules\RootNewMacros.cmake

I believe the following DLLs correspond to the *.so files listed in ROOTConfig-targets-release.cmake. However, I couldn't find a DLL to match the libMathCore.so:

    libCling.so    -> <my_venv home>\Lib\site-packages\cppyy_backend\bin\libCling.dll
    libThread.so   -> <my_venv home>\Lib\site-packages\cppyy_backend\bin\libThreadLegacy.dll
    libCore.so     -> <my_venv home>\Lib\site-packages\cppyy_backend\bin\libCoreLegacy.dll
    libRIO.so      -> <my_venv home>\Lib\site-packages\cppyy_backend\bin\libRIOLegacy.dll
    libMathCore.so -> ??? **Can't find a corresponding DLL for this *.so file** ???

Can you provide a version of cookiecutter-cppyy-cmake that works on Windows? If not, can you provide guidance on what steps are needed to build it on Windows? If I can't get this to work on Windows I have to scrap all the work I did using this project on Linux and find an alternate solution that works on both Linux and Windows.

Installed Software

  • Microsoft Windows 10 [Version 20H2]
  • Anaconda3-2021.11-Windows-x86_64.exe
  • Microsoft Visual Studio 2019
  • CMake 3.22.2

Detailed steps:

    (base) $ conda create --name my_venv python=3.8

    (base) $ conda activate my_venv

	NOTE: must be administrator for the following command
    (my_venv) $ conda update -n base -c defaults conda

	NOTE: running the following as adminstrator fails, so run as regular user
    (my_venv) $ pip3 install cppyy
                    ...
                    Successfully built cppyy CPyCppyy
                    Installing collected packages: cppyy-cling, cppyy-backend, CPyCppyy, cppyy
                    Successfully installed CPyCppyy-1.12.8 cppyy-2.2.0 cppyy-backend-1.14.7 cppyy-cling-6.25.2

    (my_venv) $ pip3 install cookiecutter

    (my_venv) $ cookiecutter gh:camillescott/cookiecutter-cppyy-cmake
                    full_name [Your name]: Tom Jordan
                    email [Your address email (eq. [email protected])]: [email protected]
                    github_username [Your github username]: tjorda01
                    project_name [cppyy test bindings]: project_name
                    repo_name [project_name]: repo_name
                    pkg_name [repo_name]: pkg_name
                    cpp_lib_name [cppproject]: cpp_lib_name
                    cpp_namespace [cpp_lib_name]: cpp_namespace
                    project_short_description [cppyy-generated bindings for cpp_lib_name]: A cookiecutter template for using cppyy
                    project_url [https://github.com/tjorda01/repo_name]:
                    release_date [2022-02-04]:
                    version [0.1.0]:
                    cpp_version [14]: 17
                    Select year_from:
                    1 - 2019
                    2 - 2018
                    3 - 2017
                    4 - 2016
                    5 - 2015
                    6 - 2014
                    7 - 2013
                    8 - 2012
                    9 - 2011
                    10 - 2010
                    11 - 2009
                    12 - 2008
                    13 - 2007
                    14 - 2006
                    15 - 2005
                    Choose from 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 [1]: 1
                    year_to [2022]:
                    Select license:
                    1 - MIT license
                    2 - BSD 2-Clause License
                    3 - BSD 3-Clause License
                    4 - ISC license
                    5 - Apache Software License 2.0
                    Choose from 1, 2, 3, 4, 5 [1]:

    (my_venv) $ cd repo_name
    (my_venv) $ mkdir build
    (my_venv) $ cd build

    (my_venv) $ pip3 install clang libclang

    (my_venv) $ cmake ..    <----- This fails!

Thanks in advance for your help.

tjorda01 avatar Mar 20 '22 16:03 tjorda01