Closed DanielChaseButterfield closed 6 months ago
I tested on Ubuntu 18.04 WSL2 and it built successfully. A difference from your setup is I installed CMake with pip instead of from source. What version of WSL do you have, wsl --version
?
@ihilt My wsl version is 2 as well. This the output of running wsl --version
on the Windows Command Prompt:
WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22635.2841
You mentioned that you got it working by installing cmake with pip, so I also tried with that setup. I uninstalled cmake from source by running sudo make uninstall
in the source directory, and I also uninstalled an older version of cmake from apt by running sudo apt remove cmake
. I installed cmake again through Python3 pip with the command python3 -m pip install cmake
, which installed cmake 3.27. I ran hash -r
to forget the path to the previous cmake install, and when I run cmake --version
, I now get:
cmake version 3.27.9
This tells me that I've now replicated your cmake install. However, after deleting the build directory for lcm, and re-running the commands, I get the same error output:
...resuming near the end...
/usr/include/glib-2.0/glib/gnode.h:36:24: error: declaration for parameter ‘GNode’ but no such parameter
typedef struct _GNode GNode;
^~~~~
In file included from /usr/include/glib-2.0/glib/glist.h:32:0,
from /usr/include/glib-2.0/glib/ghash.h:33,
from /usr/include/glib-2.0/glib.h:50,
from /home/dnois/lcm-1.5.0/lcm/lcm.c:5:
/usr/include/glib-2.0/glib/gmem.h:362:19: error: declaration for parameter ‘g_mem_gc_friendly’ but no such parameter
GLIB_VAR gboolean g_mem_gc_friendly;
^~~~~~~~~~~~~~~~~
/home/dnois/lcm-1.5.0/lcm/lcm.c:508:1: error: expected ‘{’ at end of input
}
^
lcm/CMakeFiles/lcm-static.dir/build.make:89: recipe for target 'lcm/CMakeFiles/lcm-static.dir/lcm.c.o' failed
make[2]: *** [lcm/CMakeFiles/lcm-static.dir/lcm.c.o] Error 1
CMakeFiles/Makefile2:568: recipe for target 'lcm/CMakeFiles/lcm-static.dir/all' failed
make[1]: *** [lcm/CMakeFiles/lcm-static.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2
My cmake build process seems to work fine though:
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GLib2_glib: /mnt/c/msys64/mingw64/lib/libglib-2.0.a
-- Found GLib2: /mnt/c/msys64/mingw64/lib/libglib-2.0.a found components: glib
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__std_gnu99
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__std_gnu99 - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wall
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wall - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wshadow
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wshadow - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wuninitialized
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wuninitialized - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wunused_variable
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wunused_variable - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Werror_return_type
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Werror_return_type - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wno_unused_parameter
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wno_unused_parameter - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wno_format_zero_length
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wno_format_zero_length - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wall
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wall - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wshadow
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wshadow - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wuninitialized
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wuninitialized - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wunused_variable
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wunused_variable - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Werror_return_type
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Werror_return_type - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wno_unused_parameter
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wno_unused_parameter - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wno_format_zero_length
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wno_format_zero_length - Success
-- Building LCM 1.5.0 (ABI v1)
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found Python: /usr/bin/python3.6 (found version "3.6.9") found components: Interpreter
-- Found Python: /usr/bin/python3.6 (found version "3.6.9") found components: Interpreter Development Development.Module Development.Embed
-- Found Java: /usr/bin/java (found suitable version "11.0.19", minimum required is "1.8")
-- Found Lua: /usr/lib/x86_64-linux-gnu/liblua5.3.so;/mnt/c/msys64/mingw64/lib/libm.a (found version "5.3.3")
Unable to parse the Go version string:
-- Could NOT find Go (missing: GO_VERSION GO_PLATFORM GO_ARCH)
CMake Deprecation Warning at lcm-cmake/lcmUtilities.cmake:34 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
test/types/CMakeLists.txt:1 (include)
-- CPack: Packages will be placed under /home/dnois/lcm-1.5.0/build/packages
-- Configuring done (30.3s)
-- Generating done (0.1s)
-- Build files have been written to: /home/dnois/lcm-1.5.0/build
From this, I conclude that my cmake install is probably correct. Seeing as my WSL2 install also matches yours, I'm more or less at a loss of what could be the issue.
Interesting, CMake is finding GLib installed from MSYS.
-- Found GLib2: /mnt/c/msys64/mingw64/lib/libglib-2.0.a found components: glib
My output shows:
-- Found GLib2: /usr/lib/x86_64-linux-gnu/libglib-2.0.so found components: glib
I installed GLib with apt-get install libglib2.0-dev
.
Okay, that was it. I have a MSYS2 installed on my Windows Desktop. Somehow, cmake was able to see my glib installation for the windows side, and was using that instead of my libglib2.0-dev
install. I uninstalled MSYS2 on the Windows side, and I got the correct output in my cmake ..
command:
-- Found GLib2_glib: /usr/lib/x86_64-linux-gnu/libglib-2.0.so
-- Found GLib2: /usr/lib/x86_64-linux-gnu/libglib-2.0.so found components: glib
Now, it properly builds and installs! Thanks so much @ihilt.
Obviously, this is out of the scope of this project, but I wonder why cmake could see files from the Windows side while it was in WSL...
I am trying to build lcm-1.5.0 on Ubuntu 18.04 (in Windows Subsystem for Linux).
I have installed cmake-3.28 from source, as lcm requires a cmake version of 3.12+, and the default cmake version installed through apt was 3.10. I have also installed build-essential and libglib2.0-dev as required
I ran the following commands in the root of the lcm repository:
The make process get to about 2%, and then fails. Here is my standard output:
And here is a VERY SMALL SAMPLE of the 9000+ lines of error output:
Does anyone have any idea of what could be going wrong? There seems to be an incredible high number of glib errors, but since I've installed libglib2.0-dev with apt, I'm pretty confident that my installation is correct.