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

Enable build of manifpy on Windows #13

Merged
merged 42 commits into from
Jul 26, 2021

Conversation

traversaro
Copy link
Contributor

@traversaro traversaro commented Jul 21, 2021

Fix #7 .

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@traversaro
Copy link
Contributor Author

The relevant error seems:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 506:

I wonder if there strange character somewhere in conf files.

@traversaro traversaro force-pushed the enable_python_windows branch from 243805c to da967f2 Compare July 22, 2021 13:49
@traversaro
Copy link
Contributor Author

The relevant error seems:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 506:

I wonder if there strange character somewhere in conf files.

This is probably related to the strange character in the README files that then is read in the setup.py . As this problem was removed upstream in artivis/manif#233, we can just temporay avoid providing a long description in Windows, via the patch b0010c2 .

@traversaro
Copy link
Contributor Author

New error:

2021-07-22T14:24:35.4007728Z   -- Building for: Visual Studio 15 2017 Win64
2021-07-22T14:24:35.4872797Z   CMake Error at CMakeLists.txt:4 (project):
2021-07-22T14:24:35.4875010Z     Generator
2021-07-22T14:24:35.4876071Z 
2021-07-22T14:24:35.4877289Z       Visual Studio 15 2017 Win64
2021-07-22T14:24:35.4878251Z 
2021-07-22T14:24:35.4883091Z     does not support platform specification, but platform
2021-07-22T14:24:35.4884676Z 
2021-07-22T14:24:35.4887398Z       x64
2021-07-22T14:24:35.4888448Z 
2021-07-22T14:24:35.4890326Z     was specified.

@traversaro
Copy link
Contributor Author

@conda-forge-admin, please rerender

@traversaro
Copy link
Contributor Author

@conda-forge-admin, please rerender

@traversaro
Copy link
Contributor Author

With VS2017, the compilation fails with:

[ 12%] Building CXX object python/CMakeFiles/manifpy.dir/bindings_rn.cpp.obj
bindings_rn.cpp
d:\bld\manif-split_1627205228927\_h_env\library\include\pybind11\detail/common.h(694): error C2825: 'F': must be a class or namespace when followed by '::'
d:\bld\manif-split_1627205228927\_h_env\library\include\pybind11\detail/common.h(706): note: see reference to class template instantiation 'pybind11::detail::strip_function_object<F>' being compiled
        with
        [
            F=manif::Rn<double,1> (__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const
        ]
D:\bld\manif-split_1627205228927\_h_env\Library\include\pybind11/pybind11.h(86): note: see reference to alias template instantiation 'pybind11::detail::function_signature_t<manif::Rn<double,1>(__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const,manif::Rn<double,1>(__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const>' being compiled
D:\bld\manif-split_1627205228927\_h_env\Library\include\pybind11/pybind11.h(1341): note: see reference to function template instantiation 'pybind11::cpp_function::cpp_function<_Ty,pybind11::name,pybind11::is_method,pybind11::sibling,pybind11::arg,pybind11::arg_v,pybind11::arg_v,char[358],void>(Func &&,const pybind11::name &,const pybind11::is_method &,const pybind11::sibling &,const pybind11::arg &,const pybind11::arg_v &,const pybind11::arg_v &,const char (&)[358])' being compiled
        with
        [
            _Ty=manif::Rn<double,1> (__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const,
            Func=manif::Rn<double,1> (__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const
        ]
d:\bld\manif-split_1627205228927\work\python\bindings_lie_group_base.h(122): note: see reference to function template instantiation 'pybind11::class_<manif::R1d,manif::LieGroupBase<manif::R1d>> &pybind11::class_<manif::R1d,manif::LieGroupBase<manif::R1d>>::def<manif::Rn<double,1>(__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const,pybind11::arg,pybind11::arg_v,pybind11::arg_v,char[358]>(const char *,Func &&,const pybind11::arg &,const pybind11::arg_v &,const pybind11::arg_v &,const char (&)[358])' being compiled
        with
        [
            Func=manif::Rn<double,1> (__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const
        ]
d:\bld\manif-split_1627205228927\work\python\bindings_lie_group_base.h(104): note: see reference to function template instantiation 'pybind11::class_<manif::R1d,manif::LieGroupBase<manif::R1d>> &pybind11::class_<manif::R1d,manif::LieGroupBase<manif::R1d>>::def<manif::Rn<double,1>(__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const,pybind11::arg,pybind11::arg_v,pybind11::arg_v,char[358]>(const char *,Func &&,const pybind11::arg &,const pybind11::arg_v &,const pybind11::arg_v &,const char (&)[358])' being compiled
        with
        [
            Func=manif::Rn<double,1> (__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const
        ]
D:\bld\manif-split_1627205228927\work\python\bindings_rn.cpp(23): note: see reference to function template instantiation 'void wrap_lie_group_base<manif::R1d,manif::LieGroupBase<manif::R1d>>(pybind11::class_<manif::R1d,manif::LieGroupBase<manif::R1d>> &)' being compiled
d:\bld\manif-split_1627205228927\_h_env\library\include\pybind11\numpy.h(47): note: see reference to class template instantiation 'pybind11::detail::descr<13>' being compiled
d:\bld\manif-split_1627205228927\_h_env\library\include\pybind11\cast.h(759): note: see reference to class template instantiation 'pybind11::detail::descr<8>' being compiled

@traversaro
Copy link
Contributor Author

@conda-forge-admin, please rerender

@traversaro
Copy link
Contributor Author

Failure on VS2019:

[ 12%] Building CXX object python/CMakeFiles/manifpy.dir/bindings_rn.cpp.obj
bindings_rn.cpp
D:\bld\manif-split_1627232881217\_h_env\Library\include\pybind11/pybind11.h(1340): error C2661: 'pybind11::cpp_function::cpp_function': no overloaded function takes 8 arguments
D:\bld\manif-split_1627232881217\work\python\bindings_lie_group_base.h(122): note: see reference to function template instantiation 'pybind11::class_<manif::R1d,manif::LieGroupBase<manif::R1d>> &pybind11::class_<manif::R1d,manif::LieGroupBase<manif::R1d>>::def<manif::Rn<double,1>(__cdecl manif::Rn<double,1>::* )(const manif::LieGroupBase<manif::R1d> &,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>,tl::optional<Eigen::Ref<Eigen::Matrix<double,1,1,1,1,1>,0,Eigen::InnerStride<1>>>) const,pybind11::arg,pybind11::arg_v,pybind11::arg_v,char[358]>(const char *,Func &&,const pybind11::arg &,const pybind11::arg_v &,const pybind11::arg_v &,const char (&)[358])' being compiled
D:\bld\manif-split_1627232881217\work\python\bindings_rn.cpp(23): note: see reference to function template instantiation 'void wrap_lie_group_base<manif::R1d,manif::LieGroupBase<manif::R1d>>(pybind11::class_<manif::R1d,manif::LieGroupBase<manif::R1d>> &)' being compiled
NMAKE : fatal error U1077: 'D:\bld\manif-split_1627232881217\_build_env\Library\bin\cmake.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
Traceback (most recent call last):
  File "C:\Miniconda\Scripts\conda-build-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Miniconda\lib\site-packages\conda_build\cli\main_build.py", line 481, in main
    execute(sys.argv[1:])
  File "C:\Miniconda\lib\site-packages\conda_build\cli\main_build.py", line 472, in execute
    verify=args.verify, variants=args.variants, cache_dir=args.cache_dir)
  File "C:\Miniconda\lib\site-packages\conda_build\api.py", line 195, in build
    variants=variants
  File "C:\Miniconda\lib\site-packages\conda_build\build.py", line 3073, in build_tree
    notest=notest,
  File "C:\Miniconda\lib\site-packages\conda_build\build.py", line 2351, in build
    newly_built_packages = bundlers[pkg_type](output_d, m, env, stats)
  File "C:\Miniconda\lib\site-packages\conda_build\build.py", line 1597, in bundle_conda
    cwd=metadata.config.work_dir, env=env_output, stats=bundle_stats)
  File "C:\Miniconda\lib\site-packages\conda_build\utils.py", line 412, in check_call_env
    return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
  File "C:\Miniconda\lib\site-packages\conda_build\utils.py", line 392, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['C:\\Windows\\system32\\cmd.exe', '/d', '/c', 'D:\\bld\\manif-split_1627232881217\\work\\bld_py.bat']' returned non-zero exit status 1.

@traversaro
Copy link
Contributor Author

Error when using clang-cl:

CMake Error at D:/bld/manif-split_1627282894564/_build_env/Library/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python3 (missing: Development NumPy Development.Module
  Development.Embed) (found version "3.6.13")
Call Stack (most recent call first):
  D:/bld/manif-split_1627282894564/_build_env/Library/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  D:/bld/manif-split_1627282894564/_build_env/Library/share/cmake-3.21/Modules/FindPython/Support.cmake:3165 (find_package_handle_standard_args)
  D:/bld/manif-split_1627282894564/_build_env/Library/share/cmake-3.21/Modules/FindPython3.cmake:485 (include)
  CMakeLists.txt:64 (find_package)


-- Configuring incomplete, errors occurred!

@traversaro
Copy link
Contributor Author

Error when using clang-cl:

It seems that this was happening because I was not installing clang in the correct environemt (it was installed for the build environment of manif, not of manifpy, and this was confusing in some way CMake.

@traversaro
Copy link
Contributor Author

Error when using clang-cl:

It seems that this was happening because I was not installing clang in the correct environemt (it was installed for the build environment of manif, not of manifpy, and this was confusing in some way CMake.

That was not the problem. Even with proper clang-cl, for some reason the Python in the base environment is found, creating version problems.

@traversaro
Copy link
Contributor Author

Finally. All the cross-talking and finding the wrong Python version was not related specifically to clang-cl, but we noticed it simply with clang-cl as with proper VS the build was failing, and the problem of wrong Python version was that for some reason the CMake cache on one variant was found again when building with a different Python version. Switching to out-of-source build with the build directory name different for each variant fixed the issue.

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

Successfully merging this pull request may close these issues.

Enable manifpy on Windows
2 participants