acxz / pkgbuilds

PKGBUILDs for Arch Linux
25 stars 44 forks source link

[darknet-alexeyab-git] undefined references to opencv #193

Closed acxz closed 1 year ago

acxz commented 2 years ago

portion of errors:

/usr/bin/ld: /usr/lib/libopencv_highgui.so.4.5.5: undefined reference to `QString::arg(unsigned long long, int, int, QChar) const@Qt_5'
/usr/bin/ld: /usr/lib/libopencv_highgui.so.4.5.5: undefined reference to `QBoxLayout::QBoxLayout(QBoxLayout::Direction, QWidget*)@Qt_5'
/usr/bin/ld: /usr/lib/libopencv_highgui.so.4.5.5: undefined reference to `QGraphicsView::staticMetaObject@Qt_5'
/usr/bin/ld: /usr/lib/libopencv_highgui.so.4.5.5: undefined reference to `QFutureInterfaceBase::QFutureInterfaceBase(QFutureInterfaceBase const&)@Qt_5'
collect2: error: ld returned 1 exit status
acxz commented 2 years ago

Previous workaround when nvcc host compiler was gcc8:

In order to successfully build this package, you will need to use an opencv version that is compiled with gcc-8, due to the following bug: https://bugs.archlinux.org/task/63408

This can be done as follows (Fix courtesy of @Archrumbz https://bbs.archlinux.org/viewtopic.php?pid=1883912#p1883912):

1/2) Obtain gcc-8 compiled ilmbase, openexr, opencv:

wget https://archive.archlinux.org/packages/i/ilmbase/ilmbase-2.3.0-1-x86_64.pkg.tar.xz
wget https://archive.archlinux.org/packages/o/openexr/openexr-2.3.0-1-x86_64.pkg.tar.xz
wget https://archive.archlinux.org/packages/o/opencv/opencv-4.1.0-2-x86_64.pkg.tar.xz

2/2) Install gcc-8 compiled ilmbase, openexr, opencv:

sudo pacman -U ilmbase-2.3.0-1-x86_64.pkg.tar.xz openexr-2.3.0-1-x86_64.pkg.tar.xz opencv-4.1.0-2-x86_64.pkg.tar.xz

Note: Keep in mind, you will have to ensure these packages do not get upgraded with a pacman -Syu. See: https://wiki.archlinux.org/index.php/Pacman#Skip_package_from_being_upgraded

You may then proceed to install this package like so: yay -S darknet-alexeyab-git

acxz commented 2 years ago

Upstream issue: https://github.com/AlexeyAB/darknet/issues/4173

acxz commented 2 years ago

Solution mentioned by archlinux TU on above linked archlinux bug report: https://bugs.archlinux.org/task/63408

Closed by  [Sven-Hendrik Haase (Svenstaro)](https://bugs.archlinux.org/user/4209)
Friday, 06 September 2019, 22:20 GMT
Reason for closing:  Fixed
Additional comments about closing:  Closing as this is now confirmed to be an issue of mixing gcc8 and gcc9 ABI. Can be solved using cuda by building native code using gcc9 and then use gcc8 as the nvcc host compiler only.
acxz commented 1 year ago

Looks like this issue doesn't occur as of this comment. Closing this issue back up for now.