-
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 it doesn't recognize thread safe localtime implementation.
[ 6%] Building C object CMakeFiles/mujoco.dir/src/engine/engine_util_errmem.c.obj
/home/user/mujoco/src/engine/engine_util_errmem.c: In function ‘mju_writeLog’:
/home/user/mujoco/src/engine/engine_util_errmem.c:107:6: error: #error "Thread-safe version of `localtime` is not present in the standard C library"
107 | #error "Thread-safe version of `localtime` is not present in the standard C library"
| ^~~~~
make[2]: *** [CMakeFiles/mujoco.dir/build.make:532: CMakeFiles/mujoco.dir/src/engine/engine_util_errmem.c.obj] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:1457: CMakeFiles/mujoco.dir/all] Fehler 2
make: *** [Makefile:146: all] Fehler 2
I'd expect that it compiles without errors.
As a workaround, add a || 1 to line 110 #elif _MSC_VER or comment out the block that gets localtime and logs it.
Steps for reproduction
- Building Mujoco with mingw:
cmake -DCMAKE_TOOLCHAIN_FILE=~/cmake-toolchain-mingw64-x86_64.cmake -DCMAKE_COMPILE_WARNING_AS_ERROR=false .. - Patch problematic section from
mujoco.rcfile (Issue Build fails with gcc and mingw makefiles : Syntax Error #839) - 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
- I searched the latest documentation thoroughly before posting.
- I searched previous Issues and 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