facebookresearch / nocturne

A data-driven, fast driving simulator for multi-agent coordination under partial observability.
MIT License
258 stars 29 forks source link

Build Error: error: ld returned 1 exit status (libudev.so.0) #12

Closed zhangdongkun98 closed 2 years ago

zhangdongkun98 commented 2 years ago

Running python setup.py develop failed and here's the error message:

/usr/bin/ld: warning: libudev.so.0, needed by /home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1, not found (try using -rpath or -rpath-link)
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_get_devnode'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_monitor_enable_receiving'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_new_from_syspath'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_unref'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_monitor_new_from_netlink'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_enumerate_get_list_entry'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_get_syspath'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_monitor_unref'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_enumerate_add_match_subsystem'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_monitor_filter_add_match_subsystem_devtype'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_get_property_value'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_monitor_receive_device'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_enumerate_scan_devices'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_get_sysattr_value'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_monitor_get_fd'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_get_parent_with_subsystem_devtype'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_unref'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_get_action'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_list_entry_get_name'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_enumerate_new'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_list_entry_get_next'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_new'
/home/zdk/miniconda3/envs/nocturne/lib/libsfml-window.so.2.5.1: undefined reference to `udev_enumerate_unref'
collect2: error: ld returned 1 exit status
cpp/tests/CMakeFiles/nocturne_test.dir/build.make:234: recipe for target 'cpp/tests/nocturne_test' failed
make[2]: *** [cpp/tests/nocturne_test] Error 1
CMakeFiles/Makefile2:378: recipe for target 'cpp/tests/CMakeFiles/nocturne_test.dir/all' failed
make[1]: *** [cpp/tests/CMakeFiles/nocturne_test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Built target nocturne_cpp
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2
Aborting due to errors when running command ['cmake', '--build', '.', '--config', 'Release', '--', '-j16']

I'm using cmake 3.24.0-rc1 and sfml 2.5.1.

nathanlct commented 2 years ago

It seems the libudev.so.0 file is missing.

Could you please check if you have the following file instead: /usr/lib/x86_64-linux-gnu/libudev.so.1?

If so, you can create a symbolic link between that file and the missing file:

ln -s /usr/lib/x86_64-linux-gnu/libudev.so.1 /usr/lib/x86_64-linux-gnu/libudev.so.0

Then the error should be gone. If it still doesn't find the file, try adding /usr/lib/x86_64-linux-gnu/ to the LD_LIBRARY_PATH.

Note: the library path /usr/lib/x86_64-linux-gnu/ might differ based on your system.

(ref: ImportError: libudev.so.0: cannot open shared object file)

zhangdongkun98 commented 2 years ago

@nathanlct That works! Thanks a lot! For more details, I installed libudev by running

sudo apt-get install -y libudev-dev

and libudev.so.1 is installed at /lib/x86_64-linux-gnu/, then link

ln -s /lib/x86_64-linux-gnu/libudev.so.1 /usr/lib/x86_64-linux-gnu/libudev.so.0
eugenevinitsky commented 2 years ago

Thanks for bringing this issue up! We're going to work on seeing if there's a way to prevent this from happening again but in the meantime I'll close this issue if it's resolved. Feel free to re-open it if further issues arise.