-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Intro
I'm compiling Mujoco for different targets in a Linux-based CI.
My setup
- Ubuntu 24.04 amd64
- Mujoco 3.4.0
What's happening? What did you expect?
Building Mujoco with MinGW fails because stat is redefined.
[ 9%] Building CXX object CMakeFiles/mujoco.dir/src/user/user_resource.cc.obj
/home/user/mujoco/src/user/user_resource.cc:36: error: "stat" redefined [-Werror]
36 | #define stat _stat
|
In file included from /home/user/mujoco/src/user/user_resource.cc:19:
/usr/share/mingw-w64/include/sys/stat.h:279: note: this is the location of the previous definition
279 | #define stat _stat64
|
cc1plus: all warnings being treated as errors
I'd expect that it compiles without errors. This used to work with Mujoco 3.3.3.
As a workaround, I can comment out the define in line 36.
Steps for reproduction
- Building Mujoco with mingw:
cmake -DCMAKE_TOOLCHAIN_FILE=~/cmake-toolchain-mingw64-x86_64.cmake -DCMAKE_COMPILE_WARNING_AS_ERROR=false .. - Remove problematic section from
mujoco.rcfile (Issue Build fails with gcc and mingw makefiles : Syntax Error #839) - Workaround localtime issue Compiling mujoco with MinGW fails because of thread-safe localtime #3037
- Run
make
This is the content of the toolchain file:
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
find_program(CMAKE_C_LINKER NAMES x86_64-w64-mingw32-ld)
find_program(CMAKE_C_COMPILER NAMES x86_64-w64-mingw32-gcc)
find_program(CMAKE_CXX_COMPILER NAMES x86_64-w64-mingw32-g++)
### Minimal model for reproduction
This bug is independent of the model and code.
### Code required for reproduction
This bug is independent of the model and code.
### Confirmations
- [x] I searched the [latest documentation](https://mujoco.readthedocs.io/en/latest/overview.html) thoroughly before posting.
- [x] I searched previous [Issues](https://github.com/google-deepmind/mujoco/issues) and [Discussions](https://github.com/google-deepmind/mujoco/discussions), I am certain this has not been raised before.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working