lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
980 stars 388 forks source link

Make results in error linking C shared module related to python 3.8 #349

Open dlee640 opened 3 years ago

dlee640 commented 3 years ago

Hello. I am getting an error I do not understand when I try to make during build. I have done some google search, but no fruitful results. I think this may be happening due to python version since I had this working before.

Is there a way that I can rebuild using python 2.7 instead of pythob 3.8? Or is there a way to solve this issue?

Thank you. I am attaching my cmake .. result and make result below.

dlee640@dlee640-ThinkPad-T580:~/lcm/build$ cmake ..
CMake Warning (dev) at /home/dlee640/.pyenv/versions/3.8.6/lib/python3.8/site-packages/cmake/data/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (GLib2_glib)
  does not match the name of the calling package (GLib2).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindGLib2.cmake:47 (find_package_handle_standard_args)
  cmake/FindGLib2.cmake:74 (_glib2_add_target)
  CMakeLists.txt:10 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Building LCM 1.4.0 (ABI v1)
CMake Warning at lcm-python/CMakeLists.txt:57 (message):
  epydoc was not found; Python documentation will not be generated

-- Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) 
Unable to parse the Go version string: 
-- Could NOT find Go (missing: GO_VERSION GO_PLATFORM GO_ARCH) 
-- CPack: Packages will be placed under /home/dlee640/lcm/build/packages
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dlee640/lcm/build
dlee640@dlee640-ThinkPad-T580:~/lcm/build$ make
[  1%] Built target lcm_use_file
[ 10%] Built target lcm
[ 19%] Built target lcm-static
[ 28%] Built target lcm-gen
[ 30%] Built target lcm-logger
[ 32%] Built target lcm-logplayer
[ 33%] Built target lcm-source
[ 35%] Built target lcm-buftest-sender
[ 36%] Built target lcm-example
[ 38%] Built target lcm-logfilter
[ 40%] Built target lcm-tester
[ 41%] Built target lcm-buftest-receiver
[ 43%] Built target lcm-sink
[ 43%] Linking C shared module ../lib/python3.8/site-packages/lcm/_lcm.so
/usr/bin/ld: /home/dlee640/.pyenv/versions/3.8.6/lib/libpython3.8.a(_warnings.o): relocation R_X86_64_PC32 against symbol `_PyRuntime' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
lcm-python/CMakeFiles/lcm-python.dir/build.make:150: recipe for target 'lib/python3.8/site-packages/lcm/_lcm.so' failed
make[2]: *** [lib/python3.8/site-packages/lcm/_lcm.so] Error 1
CMakeFiles/Makefile2:908: recipe for target 'lcm-python/CMakeFiles/lcm-python.dir/all' failed
make[1]: *** [lcm-python/CMakeFiles/lcm-python.dir/all] Error 2
Makefile:181: recipe for target 'all' failed
make: *** [all] Error 2
gaoboyi commented 1 month ago

have you solved it? i have the same problem