Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conan install fails creating Makefile on Fedora 35 #141

Closed
alextairbekov opened this issue Apr 3, 2022 · 14 comments
Closed

Conan install fails creating Makefile on Fedora 35 #141

alextairbekov opened this issue Apr 3, 2022 · 14 comments

Comments

@alextairbekov
Copy link

alextairbekov commented Apr 3, 2022

System information:

hostname = fedora
uname -m = x86_64
uname -r = 5.16.16-200.fc35.x86_64
uname -s = Linux
uname -v = #1 SMP PREEMPT Sat Mar 19 13:52:41 UTC 2022

/usr/bin/uname -p = x86_64
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /home/alex/.cargo/bin
PATH: /home/alex/.local/bin
PATH: /home/alex/bin
PATH: /usr/local/bin
PATH: /usr/local/sbin
PATH: /usr/bin
PATH: /usr/sbin

g++ version: g++ (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)
Python version: Python 3.10.4
conan version: Conan version 1.47.0
OpenSSL version: OpenSSL 1.1.1n FIPS 15 Mar 2022
cmake version: cmake version 3.22.2

Build log attached below.

hobbits-fedora-conan-build.log

My guess is that it's failing to build the Makefile properly, perhaps some values are not included. I know one of the errors is that python cannot locate g++ in ./configure even though it's installed so CXX=/usr/bin/g++ took care of that, but didn't change the error much.

@hello-adam
Copy link
Member

I saw '\r' bring referenced in a few of the error lines, and I know there were some errors in the hobbits CPython conanfile recently that required dos2unix, so it could be something along the same lines.

@hello-adam
Copy link
Member

hello-adam commented Apr 7, 2022

I tried to add those Modules files to the dos2unix part of the conan file, so it might work (or might just differently fail) if you try again after the repackaging pushes: https://github.com/hello-adam/cpython/runs/5877652246

@jakecrowley
Copy link

jakecrowley commented May 12, 2022

Conan still failing on latest commit on Fedora 35, same error. I was able to build it with pure cmake, however.

@wereii
Copy link

wereii commented May 19, 2022

Same problem here on Manjaro Linux (with zsh shell)
I traced the problem to the cpython package containing CLRF line endings.

I had to run this:
find . -type f -exec dos2unix {} \; in $HOME/.conan/data/hobbits-cpython/3.9.10/_/_/source
to fix it.

@hello-adam
Copy link
Member

Ok, thanks for the confirmation. I will try to patch that hobbits CPython stuff soon.

I'm really sorry for how bad these Python bindings are - I should have just used pybind11 😑

@hello-adam
Copy link
Member

I just got it to build on fresh Fedora 36. I added some stuff to the README based on problems I encountered.

If someone can confirm that it works for them I'll close this ticket.

@jakecrowley
Copy link

jakecrowley commented Jun 3, 2022

I just got it to build on fresh Fedora 36. I added some stuff to the README based on problems I encountered.

If someone can confirm that it works for them I'll close this ticket.

Still getting a make error on conan install .. --build=missing running Fedora 35. Different error, though. It seems to be a build error on libpcap about recompiling with -fPIC, theres a bunch of lines similar to this one:
/usr/bin/ld: /usr/local/lib/librte_eal.a(eal_common_hexdump.o): relocation R_X86_64_32 against '.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

Here's the entire build log:
conanbuild.log

EDIT: i see you have "fPIC": True in the conanfile, no clue why its not following that.

@hello-adam
Copy link
Member

yeah, that's weird. I'm not sure if I've ever had an issue with libpcap before. Does changing it to version 1.10.1 instead of 1.10.0 change/fix anything?

@jakecrowley
Copy link

Nope, still getting the same error with 1.10.1.

/usr/bin/ld: /usr/local/lib/librte_eal.a(eal_common_hexdump.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/librte_eal.a(eal_log.o): warning: relocation against `stdout@@GLIBC_2.2.5' in read-only section `.text'
ranlib libpcap.a
collect2: error: ld returned 1 exit status
make: *** [Makefile:429: libpcap.so] Error 1
make: *** Waiting for unfinished jobs....
libpcap/1.10.1: 
libpcap/1.10.1: ERROR: Package '1748639999ed79b998e4fe4a6d292ed8e874736a' build failed
libpcap/1.10.1: WARN: Build folder /home/users/jacobc/.conan/data/libpcap/1.10.1/_/_/build/1748639999ed79b998e4fe4a6d292ed8e874736a
ERROR: libpcap/1.10.1: Error in build() method, line 144
	autotools.make()
	ConanException: Error 2 while executing make -j48

@jakecrowley
Copy link

I was able to get it to build by changing "libpcap:shared": True, to "libpcap:shared": False, in the conan file, however, the packet capture plugin fails to load after doing so..

@hello-adam
Copy link
Member

I wonder if there is just some problem with the libpcap conan package on your system and/or Fedora 35. I'm not sure if there's much else I can do here, especially because I can't reproduce the problem on Fedora 36. I think the originally reported issue caused by DOS line endings has been resolved.

@jakecrowley
Copy link

jakecrowley commented Jun 6, 2022

I have confirmed that the original build issue has been resolved as I was able to build it successfully without libpcap. I'm fine with closing this issue because it seems to be a weird isolated case to my system. I'm not sure why it's even trying to build libpcap since I have the exact version it's targeting already installed..

If anyone else is having the same issue, just install the dependencies manually and build without conan:

mkdir build && cd build
cmake ..
cmake --build ..

@matzipan
Copy link

matzipan commented Mar 12, 2023

hobbits commit id: 1a6d569ad2309fed6d4ec7e74b45f73b076ecf86

Seeing a similar issue on Fedora 35. I am not building with conan. But instead of libpcap, this time it's related to libpffft. I'm using the bundled pffft:

[matzipan@matzipan-ryzen hobbits]$ cmake -G Ninja -B build .
Attempting to get build version from Git
Building hobbits version: dev-1a6d569
-- Found PCAP: /usr/lib64/libpcap.so  
-- Using bundled pffft
-- Disabling SIMD support for pffft
-- Found Python3: /usr/bin/python3.10 (found suitable version "3.10.8", minimum required is "3.9") found components: Interpreter Development Development.Module Development.Embed 
Python3 Libs: /usr/lib64/libpython3.10.so
-- Processing analyzers module Find
-- Processing analyzers module Highlight
-- Processing analyzers module KaitaiStruct
-- Processing analyzers module Metadata
-- Processing analyzers module WidthFramer
-- Processing displays module Ascii
-- Processing displays module Binary
-- Processing displays module BitRaster
-- Processing displays module ByteRaster
-- Processing displays module DigraphPlot
-- Processing displays module DotPlot
-- Processing displays module FrequencyPlot
-- Processing displays module Hex
-- Processing displays module HilbertPlot
-- Processing displays module Spectrogram
-- Processing displays module SymbolRaster
-- Processing importerexporters module BitContainerData
-- Processing importerexporters module DisplayPrint
-- Processing importerexporters module FileData
-- Processing importerexporters module HexString
-- Processing importerexporters module HttpData
-- Processing importerexporters module Lfsr
-- Processing importerexporters module PacketCapture
-- Processing importerexporters module TcpData
-- Processing importerexporters module UdpData
-- Processing importerexporters module UsbDevice
-- Processing operators module BitsError
-- Processing operators module Edit
-- Processing operators module Extractor
-- Processing operators module HeaderFramer
-- Processing operators module PythonRunner
-- Processing operators module SymbolRemapper
-- Processing operators module TakeSkip
-- Configuring done
-- Generating done
-- Build files have been written to: /home/matzipan/Workspace/hobbits/build
[matzipan@matzipan-ryzen hobbits]$ cmake --build build 
[130/291] Linking CXX shared library plugins/analyzers/libhobbits-plugin-analyzers-WidthFramer.so
FAILED: plugins/analyzers/libhobbits-plugin-analyzers-WidthFramer.so 
: && /usr/bin/c++ -fPIC -fno-sized-deallocation  -Wl,--disable-new-dtags -shared -Wl,-soname,libhobbits-plugin-analyzers-WidthFramer.so -o plugins/analyzers/libhobbits-plugin-analyzers-WidthFramer.so src/hobbits-plugins/analyzers/WidthFramer/CMakeFiles/hobbits-plugin-analyzers-WidthFramer.dir/hobbits-plugin-analyzers-WidthFramer_autogen/mocs_compilation.cpp.o src/hobbits-plugins/analyzers/WidthFramer/CMakeFiles/hobbits-plugin-analyzers-WidthFramer.dir/peakselector.cpp.o src/hobbits-plugins/analyzers/WidthFramer/CMakeFiles/hobbits-plugin-analyzers-WidthFramer.dir/widthframer.cpp.o src/hobbits-plugins/analyzers/WidthFramer/CMakeFiles/hobbits-plugin-analyzers-WidthFramer.dir/widthframerform.cpp.o  -Wl,-rpath,/home/matzipan/Workspace/hobbits/build/lib:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  lib/libhobbits-widgets.so  external/libpffft.a  lib/libhobbits-core.so  /usr/lib64/libQt5Widgets.so.5.15.2  /usr/lib64/libQt5Gui.so.5.15.2  /usr/lib64/libQt5Core.so.5.15.2  -lm && :
/usr/bin/ld: external/libpffft.a(pffft.c.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
collect2: error: ld returned 1 exit status
[147/291] Building CXX object src/hobbits-plugins/displays/BitRaster/CMakeFiles/hobbits-plugin-displays-BitRaster.dir/bitrastercontrols.cpp.o
ninja: build stopped: subcommand failed.

The odd part is the c++ parameter in the logs above include -fPIC.

Finally, I managed to build by first configuring with cmake -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" -G Ninja -B build ..

@masatake
Copy link

@matzipan's instruction helps me to build hobbits on Fedora39. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants