Discussion:
[Freetel-codec2] Building FreeDV on Gentoo/AMD64: fails to pick up hamlib
Stuart Longland
2015-09-19 23:16:52 UTC
Permalink
Completed installing hamlib-1.2.15.3-r1 into /tmp/portage/media-libs/hamlib-1.2.15.3-r1/image/
Fixing .la files
usr/lib64/hamlib/hamlibtcl.la
usr/lib64/hamlib/hamlib/hamlib-jrc.la
usr/lib64/hamlib/hamlib/hamlib-wj.la
usr/lib64/hamlib/hamlib/hamlib-aor.la
usr/lib64/hamlib/hamlib/hamlib-rpcrot.la
usr/lib64/hamlib/hamlib/hamlib-alinco.la
usr/lib64/hamlib/hamlib/hamlib-skanti.la
usr/lib64/hamlib/hamlib/hamlib-ts7400.la
usr/lib64/hamlib/hamlib/hamlib-racal.la
usr/lib64/hamlib/hamlib/hamlib-dummy.la
usr/lib64/hamlib/hamlib/hamlib-icom.la
usr/lib64/hamlib/hamlib/hamlib-tuner.la
usr/lib64/hamlib/hamlib/hamlib-flexradio.la
usr/lib64/hamlib/hamlib/hamlib-celestron.la
usr/lib64/hamlib/hamlib/hamlib-heathkit.la
usr/lib64/hamlib/hamlib/hamlib-kit.la
usr/lib64/hamlib/hamlib/hamlib-pcr.la
usr/lib64/hamlib/hamlib/hamlib-drake.la
usr/lib64/hamlib/hamlib/hamlib-m2.la
usr/lib64/hamlib/hamlib/hamlib-rpcrig.la
usr/lib64/hamlib/hamlib/hamlib-lowe.la
usr/lib64/hamlib/hamlib/hamlib-ars.la
usr/lib64/hamlib/hamlib/hamlib-adat.la
usr/lib64/hamlib/hamlib/hamlib-amsat.la
usr/lib64/hamlib/hamlib/hamlib-kachina.la
usr/lib64/hamlib/hamlib/hamlib-tapr.la
usr/lib64/hamlib/hamlib/hamlib-spid.la
usr/lib64/hamlib/hamlib/hamlib-easycomm.la
usr/lib64/hamlib/hamlib/hamlib-uniden.la
usr/lib64/hamlib/hamlib/hamlib-rotorez.la
usr/lib64/hamlib/hamlib/hamlib-prm80.la
usr/lib64/hamlib/hamlib/hamlib-gs232a.la
usr/lib64/hamlib/hamlib/hamlib-yaesu.la
usr/lib64/hamlib/hamlib/hamlib-winradio.la
usr/lib64/hamlib/hamlib/hamlib-rft.la
usr/lib64/hamlib/hamlib/hamlib-kenwood.la
usr/lib64/hamlib/hamlib/hamlib-rs.la
usr/lib64/hamlib/hamlib/hamlib-sartek.la
usr/lib64/hamlib/hamlib/hamlib-tentec.la
usr/lib64/hamlib/hamlib/hamlib-fodtrack.la
usr/lib64/python2.7/site-packages/_Hamlib.la
* QA Notice: Package triggers severe warnings which indicate that it
* may exhibit random runtime failures.
* /tmp/portage/media-libs/hamlib-1.2.15.3-r1/work/hamlib-1.2.15.3/kenwood/elecraft.c:251:32: warning: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
* Please do not file a Gentoo bug and instead report the above QA
* issues directly to the upstream developers of this software.
* Homepage: http://sourceforge.net/apps/mediawiki/hamlib
strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
usr/sbin/rpc.rotd
usr/sbin/rpc.rigd
usr/lib64/hamlib/libhamlib.so.2.0.16

ecompressdir: bzip2 -9 /usr/share/man
ecompressdir: bzip2 -9 /usr/share/doc
Done.
Installing (1 of 1) media-libs/hamlib-1.2.15.3-r1::gentoo
Auto-cleaning packages...
No outdated packages were found on your system.
* GNU info directory index is up-to-date.
package: media-video/ffmpeg-2.6.3
* - /usr/lib64/libavcodec.so.54
* - /usr/lib64/libavcodec.so.54.92.100
* used by /usr/bin/fpcalc (media-libs/chromaprint-1.1)
* used by /usr/bin/fpcollect (media-libs/chromaprint-1.1)
* used by /usr/bin/mencoder (media-video/mplayer-1.2_pre20130729)
* used by 21 other files
* - /usr/lib64/libswresample.so.0
* - /usr/lib64/libswresample.so.0.17.102
* used by /usr/bin/fpcalc (media-libs/chromaprint-1.1)
* - /usr/lib64/libpostproc.so.52
* - /usr/lib64/libpostproc.so.52.2.100
* used by /usr/bin/mencoder (media-video/mplayer-1.2_pre20130729)
* used by /usr/bin/mplayer (media-video/mplayer-1.2_pre20130729)
* used by /usr/lib64/xine/plugins/2.5/post/xineplug_post_planar.so (media-libs/xine-lib-1.2.6)
* used by /usr/lib64/xine/plugins/2.5/xineplug_decode_ff.so (media-libs/xine-lib-1.2.6)
* - /usr/lib64/libavutil.so.52
* - /usr/lib64/libavutil.so.52.18.100
* used by /usr/bin/fpcalc (media-libs/chromaprint-1.1)
* used by /usr/bin/fpcollect (media-libs/chromaprint-1.1)
* used by /usr/bin/mencoder (media-video/mplayer-1.2_pre20130729)
* used by 26 other files
* - /usr/lib64/libavformat.so.54
* - /usr/lib64/libavformat.so.54.63.104
* used by /usr/bin/fpcalc (media-libs/chromaprint-1.1)
* used by /usr/bin/fpcollect (media-libs/chromaprint-1.1)
* used by /usr/bin/mencoder (media-video/mplayer-1.2_pre20130729)
* used by 8 other files
* - /usr/lib64/libswscale.so.2
* - /usr/lib64/libswscale.so.2.2.100
* used by /usr/bin/mencoder (media-video/mplayer-1.2_pre20130729)
* used by /usr/bin/mplayer (media-video/mplayer-1.2_pre20130729)
* used by /usr/lib64/kde4/ffmpegthumbs.so (kde-apps/ffmpegthumbs-4.12.5)
* used by /usr/lib64/libmediastreamer.so.1.0.0 (media-libs/mediastreamer-2.8.2)
bash: __gen_ps1: command not found
RC=0 vk4msl-mb freedv-build $ exit
-- FreeDV version: 1.0.1
-- Build type not specified, defaulting to Release
-- Threads library flags: -lpthread
-- Will attempt static build of codec2.
-- Looking for portaudio...
-- portaudio library: portaudio;asound;m;pthread
-- Looking for hamlib...
-- Hamlib library: HAMLIB_LIBRARY-NOTFOUND
-- Hamlib headers: /usr/include
hamlib not found.
hamlib-devel (RPM based systems)
libhamlib-dev (DEB based systems)
-- Configuring incomplete, errors occurred!
See also "/home/stuartl/hamradio/projects/fdmdv/freedv-build/CMakeFiles/CMakeOutput.log".
See also "/home/stuartl/hamradio/projects/fdmdv/freedv-build/CMakeFiles/CMakeError.log".
total 1016
drwxr-xr-x 2 root root 4096 Sep 20 09:08 hamlib
-rwxr-xr-x 1 root root 823912 Sep 20 09:08 hamlibtcl-1.0.so
-rwxr-xr-x 1 root root 1007 Sep 20 09:08 hamlibtcl.la
lrwxrwxrwx 1 root root 16 Sep 20 09:08 hamlibtcl.so -> hamlibtcl-1.0.so
lrwxrwxrwx 1 root root 19 Sep 20 09:08 libhamlib.so -> libhamlib.so.2.0.16
lrwxrwxrwx 1 root root 21 Sep 20 09:08 libhamlib++.so -> libhamlib++.so.2.0.16
lrwxrwxrwx 1 root root 19 Sep 20 09:08 libhamlib.so.2 -> libhamlib.so.2.0.16
lrwxrwxrwx 1 root root 21 Sep 20 09:08 libhamlib++.so.2 -> libhamlib++.so.2.0.16
-rwxr-xr-x 1 root root 142688 Sep 20 09:08 libhamlib.so.2.0.16
-rwxr-xr-x 1 root root 51104 Sep 20 09:08 libhamlib++.so.2.0.16
drwxr-xr-x 2 root root 4096 Sep 20 09:08 pkgconfig
-rw-r--r-- 1 root root 81 Sep 20 09:08 pkgIndex.tcl
-L/usr/lib64/hamlib -lhamlib -lm
It seems the cmake files could use a little help finding where hamlib
has been put. AFAIK there is a cmake module that can make use of
pkg-config, as I was using it some time back to locate Qt libraries in a
project at work.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
...it's backed up on a tape somewhere.

------------------------------------------------------------------------------
Stuart Longland
2015-09-19 23:36:32 UTC
Permalink
Post by Stuart Longland
-L/usr/lib64/hamlib -lhamlib -lm
It seems the cmake files could use a little help finding where hamlib
has been put. AFAIK there is a cmake module that can make use of
pkg-config, as I was using it some time back to locate Qt libraries in a
project at work.
-- FreeDV version: 1.0.1
-- Build type not specified, defaulting to Release
-- Threads library flags: -lpthread
-- Looking for codec2...
-- codec2 library: /usr/local/lib64/libcodec2.so
-- codec2 headers: /usr/local/include/codec2
-- Looking for portaudio...
-- portaudio library: portaudio;asound;m;pthread
-- Looking for hamlib...
-- Hamlib library: /usr/lib64/hamlib
-- Hamlib headers: /usr/include
-- Hamlib library found.
-- Looking for samplerate...
-- samplerate library: /usr/lib64/libsamplerate.so
-- samplerate headers: /usr/include
-- Looking for sox...
-- sox library: /usr/lib64/libsox.so
-- sox headers: /usr/include
-- Looking for sndfile...
-- sndfile library: /usr/lib64/libsndfile.so
-- sndfile headers: /usr/include
-- Looking for wxWidgets...
-- wxWidgets version: 3.0.0
-- Will attempt static build of speex.
-- Build type will be: Release
-- Configuring done
WARNING: Target "freedv" requests linking to directory "/usr/lib64/hamlib". Targets may link only to libraries. CMake is dropping the item.

Post by Stuart Longland
[100%] Building C object src/CMakeFiles/freedv.dir/sox_biquad.c.o
Linking CXX executable freedv
hamlib.cpp:(.text+0x888): undefined reference to `rig_set_debug'
hamlib.cpp:(.text+0x88d): undefined reference to `rig_load_all_backends'
hamlib.cpp:(.text+0x89d): undefined reference to `rig_list_foreach'
hamlib.cpp:(.text+0x983): undefined reference to `rig_set_debug'
hamlib.cpp:(.text+0xa15): undefined reference to `rig_close'
hamlib.cpp:(.text+0xa1d): undefined reference to `rig_cleanup'
hamlib.cpp:(.text+0xb38): undefined reference to `rig_close'
hamlib.cpp:(.text+0xb40): undefined reference to `rig_cleanup'
hamlib.cpp:(.text+0xb56): undefined reference to `rig_init'
hamlib.cpp:(.text+0xb71): undefined reference to `rig_token_lookup'
hamlib.cpp:(.text+0xb7f): undefined reference to `rig_set_conf'
hamlib.cpp:(.text+0xb8f): undefined reference to `rig_open'
hamlib.cpp:(.text+0xbe8): undefined reference to `rig_set_ptt'
hamlib.cpp:(.text+0xc53): undefined reference to `rig_close'
hamlib.cpp:(.text+0xc5b): undefined reference to `rig_cleanup'
collect2: error: ld returned 1 exit status
src/CMakeFiles/freedv.dir/build.make:418: recipe for target 'src/freedv' failed
make[2]: *** [src/freedv] Error 1
CMakeFiles/Makefile2:113: recipe for target 'src/CMakeFiles/freedv.dir/all' failed
make[1]: *** [src/CMakeFiles/freedv.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2
I'll see if I can cook up a patch that uses pkg-config.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
...it's backed up on a tape somewhere.

------------------------------------------------------------------------------
Alexandru Csete
2015-09-20 08:35:39 UTC
Permalink
On Sun, Sep 20, 2015 at 1:36 AM, Stuart Longland
Post by Stuart Longland

WARNING: Target "freedv" requests linking to directory "/usr/lib64/hamlib". Targets may link only to libraries. CMake is dropping the item.
As I interpret this error, you have specified the hamlib directory but
you should have given the .so file, i.e. something like

-DHAMLIB_LIBRARY=/usr/lib64/hamlib/libhamlib.so

Alex

------------------------------------------------------------------------------
Stuart Longland
2015-09-20 21:57:30 UTC
Permalink
Post by Alexandru Csete
On Sun, Sep 20, 2015 at 1:36 AM, Stuart Longland
Post by Stuart Longland


WARNING: Target "freedv" requests linking to directory "/usr/lib64/hamlib". Targets may link only to libraries. CMake is dropping the item.
As I interpret this error, you have specified the hamlib directory but
you should have given the .so file, i.e. something like
-DHAMLIB_LIBRARY=/usr/lib64/hamlib/libhamlib.so
The trouble with that is there's also a libamlib++, and as it happens,
it is used too.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
...it's backed up on a tape somewhere.
Alexandru Csete
2015-09-20 22:27:37 UTC
Permalink
On Sun, Sep 20, 2015 at 11:57 PM, Stuart Longland
Post by Stuart Longland
Post by Alexandru Csete
As I interpret this error, you have specified the hamlib directory but
you should have given the .so file, i.e. something like
-DHAMLIB_LIBRARY=/usr/lib64/hamlib/libhamlib.so
The trouble with that is there's also a libamlib++, and as it happens,
it is used too.
I don't think so. Few weeks ago I have built freedv 1.0 from source
without having the libhamlib++ package installed and it built fine.

ldd freedv | grep hamlib gives:
libhamlib.so.2 => /usr/lib/libhamlib.so.2 (0x00007fad3f340000)

Alex

------------------------------------------------------------------------------
Richard Shaw
2015-09-20 12:06:53 UTC
Permalink
/usr/lib64/hamlib
total 1016
drwxr-xr-x 2 root root 4096 Sep 20 09:08 hamlib
-rwxr-xr-x 1 root root 823912 Sep 20 09:08 hamlibtcl-1.0.so
-rwxr-xr-x 1 root root 1007 Sep 20 09:08 hamlibtcl.la
lrwxrwxrwx 1 root root 16 Sep 20 09:08 hamlibtcl.so ->
hamlibtcl-1.0.so
lrwxrwxrwx 1 root root 19 Sep 20 09:08 libhamlib.so ->
libhamlib.so.2.0.16
lrwxrwxrwx 1 root root 21 Sep 20 09:08 libhamlib++.so ->
libhamlib++.so.2.0.16
lrwxrwxrwx 1 root root 19 Sep 20 09:08 libhamlib.so.2 ->
libhamlib.so.2.0.16
lrwxrwxrwx 1 root root 21 Sep 20 09:08 libhamlib++.so.2 ->
libhamlib++.so.2.0.16
-rwxr-xr-x 1 root root 142688 Sep 20 09:08 libhamlib.so.2.0.16
-rwxr-xr-x 1 root root 51104 Sep 20 09:08 libhamlib++.so.2.0.16
drwxr-xr-x 2 root root 4096 Sep 20 09:08 pkgconfig
-rw-r--r-- 1 root root 81 Sep 20 09:08 pkgIndex.tcl
pkg-config --libs hamlib
-L/usr/lib64/hamlib -lhamlib -lm
It seems the cmake files could use a little help finding where hamlib
has been put. AFAIK there is a cmake module that can make use of
pkg-config, as I was using it some time back to locate Qt libraries in a
project at work.
Any particular reason Gentoo installs like libraries to a private
directory? There's not likely to be a name clash of "libhamlib*" in
/usr/lib64. I'll see about adding /usr/lib64/hamlib to the search path.

Thanks,
Richard
Stuart Longland
2015-09-20 21:57:09 UTC
Permalink
Hi Richard,
Post by Richard Shaw
Any particular reason Gentoo installs like libraries to a private
directory? There's not likely to be a name clash of "libhamlib*" in
/usr/lib64. I'll see about adding /usr/lib64/hamlib to the search path.
That I do not know.

I thought it strange too when I first saw it, unless it's a "SLOT"-ed
package, in which case it may be that depending on the version you
install there might be a /usr/lib64/hamlibX where X represents some ABI
number; thus allowing two parallel installations of hamlib without clashes.

This is how wxWidgets is handled for example, so I have wx2.8 and 3.0
simultaneously on the machine, and there's a module for `eselect` that
lets me choose which one is active.

I had a bash at getting cmake to use what was reported from
`pkg-config`, but in the end gave up and just did the final link step
myself (after building with VERBOSE=1 to see what the link command was).
That gave me a FreeDV binary.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
...it's backed up on a tape somewhere.
Loading...