LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Trying to build opencv picks up wrong library (32bit not 64bit) (https://www.linuxquestions.org/questions/slackware-14/trying-to-build-opencv-picks-up-wrong-library-32bit-not-64bit-4175578324/)

TarFile 04-25-2016 09:40 PM

Trying to build opencv picks up wrong library (32bit not 64bit)
 
Using sbopkg opencv errors with wrong version

Code:

/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstbase-1.0.so when searching for -lgstbase-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstbase-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstreamer-1.0.so when searching for -lgstreamer-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstreamer-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstvideo-1.0.so when searching for -lgstvideo-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstvideo-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstbase-1.0.so when searching for -lgstbase-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstbase-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstreamer-1.0.so when searching for -lgstreamer-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstreamer-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstapp-1.0.so when searching for -lgstapp-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstapp-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstbase-1.0.so when searching for -lgstbase-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstbase-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstreamer-1.0.so when searching for -lgstreamer-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstreamer-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstriff-1.0.so when searching for -lgstriff-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstriff-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstreamer-1.0.so when searching for -lgstreamer-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstreamer-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstpbutils-1.0.so when searching for -lgstpbutils-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstpbutils-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: skipping incompatible /usr/lib/libgstreamer-1.0.so when searching for -lgstreamer-1.0
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../x86_64-slackware-linux/bin/ld: cannot find -lgstreamer-1.0
collect2: error: ld returned 1 exit status
modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:253: recipe for target 'lib/libopencv_videoio.so.3.1.0' failed
make[2]: *** [lib/libopencv_videoio.so.3.1.0] Error 1
make[2]: Leaving directory '/tmp/SBo/opencv-3.1.0/build'
CMakeFiles/Makefile2:3880: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make[1]: Leaving directory '/tmp/SBo/opencv-3.1.0/build'
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

The correct one is in /usr/lib64.

How do i tell sbopkg to use the /usr/lib64?

I know this is probably easy but I am drawing a blank here.

I need to put something in the options but what?

Daedra 04-25-2016 09:56 PM

Quote:

I have problems compiling with my unofficial and unsupported multilib setup.

If you are using multilib packages from somewhere and also have some 32bit packages installed, then you might run into problems with the build process trying to link 32bit libraries instead of 64bit libraries. If this occurs, it can probably be solved by placing the following line:
LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \
after the lines for CFLAGS and CXXFLAGS passed to the configure script. In other words, make it look something like this:
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \
./configure \
Beyond that, you are on your own. This is an unsupported setup.
From the SBo FAQ. I have to do this sometimes.

TarFile 04-25-2016 10:21 PM

I can't seem to find the SBo FAQ.

Do you happen to have a link?

I must be having a bad day :doh:

TarFile 04-25-2016 10:50 PM

I am using sbopkg and I don't exactly understand which file I am supposed to edit.

I tried to modify the opencv.SlackBuild but that does not look like the example so where should I be looking?

Daedra 04-25-2016 11:41 PM

edit the opencv.SlackBuild file and change it like below...

From

Quote:

mkdir -p build
cd build
cmake \

To

Quote:

mkdir -p build
cd build
LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \
cmake \
then compile and see if that fixes the build

TarFile 04-26-2016 12:24 AM

Well so far that did not make any difference. This should not be such a pain I hope I don't have to uninstall multilib to get this to go.

Daedra 04-26-2016 12:34 AM

I wouldn't do that, If all else fails just install a clean 64bit Slackware in a virtual machine and built it there. I do this to test all my slackbuilds against a clean install before I submit. Plus on that rare occasion I have your problem this is a way around it. Qemu or virtualbox work great, I use Virtualbox because its easy to get going, but I believe qemu has more options.

TarFile 04-26-2016 12:44 AM

Well I got virt-machine installed. I had to do that for QT5 for some reason it would not build on my 14.1 system. I'll give that a shot.

TarFile 04-26-2016 12:51 AM

OK building current now on a VM.

Daedra 04-26-2016 12:53 AM

cool, let us know if it builds ok :thumbsup:

TarFile 04-26-2016 01:20 AM

Downloading and building now.

TarFile 04-26-2016 02:06 AM

That worked.

ml4711 04-26-2016 02:24 AM

As a last resort you can always hide that 32bit lib path
Just find an empty directory t.ex. /home/ftp and then do this:

Code:

mount --bind /home/ftp /usr/lib
compile your stuff
umount /usr/lib

Cheers

TarFile 04-26-2016 11:24 AM

I considered doing that but it was late and I was not sure if there would be unexpected consequences. I'll give that a shot if it happens again which it probably will.

TarFile 04-26-2016 12:34 PM

Not sure the problem was solved but the workarounds did the trick.


All times are GMT -5. The time now is 05:47 PM.