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

Get error when update vcpkg mujoco port to 3.2.6 and compile it. #2332

Closed
2 tasks done
talregev opened this issue Jan 7, 2025 · 6 comments · May be fixed by #2390
Closed
2 tasks done

Get error when update vcpkg mujoco port to 3.2.6 and compile it. #2332

talregev opened this issue Jan 7, 2025 · 6 comments · May be fixed by #2390
Labels
bug Something isn't working

Comments

@talregev
Copy link

talregev commented Jan 7, 2025

Intro

Hi!
I want to update mujoco to the latest release version on vcpkg (3.2.6)

My setup

I am using wsl2 ubuntu 22.04. using gcc and mujoco 3.2.6

What's happening? What did you expect?

I compile mujoco and get this error:

/home/tal/vcpkg/buildtrees/mujoco/src/3.2.6-7a23164287.clean/src/user/user_mesh.cc:1008:31: error: no match for ‘operator=’ (operand types are ‘std::vector<unsigned char>’ and ‘const std::vector<unsigned int>’)
 1008 |     num_face_vertices_ = mesh.num_face_vertices;
      |                               ^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/vector:72,
                 from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /home/tal/vcpkg/buildtrees/mujoco/src/3.2.6-7a23164287.clean/src/user/user_mesh.cc:15:
/usr/include/c++/11/bits/vector.tcc:198:5: note: candidate: ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’
  198 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/vector.tcc:199:42: note:   no known conversion for argument 1 from ‘const std::vector<unsigned int>’ to ‘const std::vector<unsigned char>&’
  199 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/11/vector:67,
                 from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /home/tal/vcpkg/buildtrees/mujoco/src/3.2.6-7a23164287.clean/src/user/user_mesh.cc:15:
/usr/include/c++/11/bits/stl_vector.h:709:7: note: candidate: ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’
  709 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:709:26: note:   no known conversion for argument 1 from ‘const std::vector<unsigned int>’ to ‘std::vector<unsigned char>&&’
  709 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_vector.h:730:7: note: candidate: ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’
  730 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:730:46: note:   no known conversion for argument 1 from ‘const std::vector<unsigned int>’ to ‘std::initializer_list<unsigned char>’
  730 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

Steps for reproduction

  1. I updated vcpkg port of mujoco to 3.2.6
  2. I added new dependencies port for mujoco (sdflib, marchingcubecpp)
  3. I install mujoco via vcpkg: `./vcpkg install mujoco'

Minimal model for reproduction

No response

Code required for reproduction

No response

Confirmations

@talregev talregev added the bug Something isn't working label Jan 7, 2025
@yuvaltassa
Copy link
Collaborator

This seems to be an issue with tiny_obj_loader. In their latest version they switched from unsigned_char to unsigned_int.

Your build is somehow not respecting this requirement.

@talregev
Copy link
Author

This seems to be an issue with tiny_obj_loader. In their latest version they switched from unsigned_char to unsigned_int.

Your build is somehow not respecting this requirement.

Thank you for your response!
I am trying to add mujoco to vcpkg.
vcpkg take the latest version.
Can mujoco adapt to that?

@yuvaltassa
Copy link
Collaborator

I'll look into it, but don't hold your breath 🙂

@talregev
Copy link
Author

talregev commented Jan 22, 2025

I'll look into it, but don't hold your breath 🙂

Also there is an easy change in mujoco that define the char that I can change to int?

@ethanmusser
Copy link

I'll look into it, but don't hold your breath 🙂

Just commenting to say that vcpkg support for recent versions of MuJoCo is something that I want as well.

As @talregev points out, this issue pops up due to a recent change in the tinyobjloader library. The issue is not present for the specified commit hash.

set(MUJOCO_DEP_VERSION_tinyobjloader
1421a10d6ed9742f5b2c1766d22faa6cfbc56248
CACHE STRING "Version of `tinyobjloader` to be fetched."

More generally, it would be nice to have looser dependency version constraints and permit use of system dependencies where possible. If nothing else, it would simplify integration with package managers.

# Build configuration for third party libraries used in MuJoCo.
set(MUJOCO_DEP_VERSION_lodepng
b4ed2cd7ecf61d29076169b49199371456d4f90b
CACHE STRING "Version of `lodepng` to be fetched."
)
set(MUJOCO_DEP_VERSION_tinyxml2
9a89766acc42ddfa9e7133c7d81a5bda108a0ade
CACHE STRING "Version of `tinyxml2` to be fetched."
)
set(MUJOCO_DEP_VERSION_tinyobjloader
1421a10d6ed9742f5b2c1766d22faa6cfbc56248
CACHE STRING "Version of `tinyobjloader` to be fetched."
)
set(MUJOCO_DEP_VERSION_MarchingCubeCpp
f03a1b3ec29b1d7d865691ca8aea4f1eb2c2873d
CACHE STRING "Version of `MarchingCubeCpp` to be fetched."
)
set(MUJOCO_DEP_VERSION_ccd
7931e764a19ef6b21b443376c699bbc9c6d4fba8 # v2.1
CACHE STRING "Version of `ccd` to be fetched."
)
set(MUJOCO_DEP_VERSION_qhull
0c8fc90d2037588024d9964515c1e684f6007ecc
CACHE STRING "Version of `qhull` to be fetched."
)
set(MUJOCO_DEP_VERSION_Eigen3
7f2377859377da6f22152015c28b12c04752af77
CACHE STRING "Version of `Eigen3` to be fetched."
)
set(MUJOCO_DEP_VERSION_abseil
4447c7562e3bc702ade25105912dce503f0c4010 # LTS 20240722.0
CACHE STRING "Version of `abseil` to be fetched."
)
set(MUJOCO_DEP_VERSION_gtest
b514bdc898e2951020cbdca1304b75f5950d1f59 # v1.15.2
CACHE STRING "Version of `gtest` to be fetched."
)
set(MUJOCO_DEP_VERSION_benchmark
24e0bd827a8bec8121b128b0634cb34402fb3259 # Incorporate fix for #1859
CACHE STRING "Version of `benchmark` to be fetched."
)
set(MUJOCO_DEP_VERSION_sdflib
1927bee6bb8225258a39c8cbf14e18a4d50409ae
CACHE STRING "Version of `SdfLib` to be fetched."
)

@talregev
Copy link
Author

@ethanmusser I have a PR that solve that. also I have a PR in vcpkg that update mujoco.

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
3 participants