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

ld cannot find -lvolk #1856

Closed
bijoutrouvaille opened this Issue Jun 28, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@bijoutrouvaille
Copy link

bijoutrouvaille commented Jun 28, 2018

Hello,

Over the last week or so, I've compiled GNU Radio several times on fresh installs of Ubuntu Xenial. Today, with the latest master of this repo, my process was broken. I was following this tutorial http://blog.reds.ch/?p=43, which shows how to compile a number of SDR related applications, including Volk and GNU Radio, into a custom prefix folder. The compile steps for GR look like this:

cmake -DENABLE_INTERNAL_VOLK=OFF -DCMAKE_INSTALL_PREFIX=$LIME_INSTALL -DCMAKE_PREFIX_PATH=$LIME_INSTALL ..
make -j4

where $LIME_INSTALL is my destination prefix folder. On the make step (at about 30% marker) I got the following error:

[  0%] Built target pmt_generated
[  1%] Built target gnuradio-pmt
[  4%] Built target gnuradio-runtime
[  4%] Linking CXX executable pmt_prims
/usr/bin/ld: cannot find -lvolk
collect2: error: ld returned 1 exit status
gnuradio-runtime/lib/CMakeFiles/pmt_prims.dir/build.make:108: recipe for target 'gnuradio-runtime/lib/pmt_prims' failed
make[2]: *** [gnuradio-runtime/lib/pmt_prims] Error 1
CMakeFiles/Makefile2:293: recipe for target 'gnuradio-runtime/lib/CMakeFiles/pmt_prims.dir/all' failed
make[1]: *** [gnuradio-runtime/lib/CMakeFiles/pmt_prims.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
make: *** [all] Error 2

Since the process worked before, I tried an older git revision of this repo (June 7, https://github.com/gnuradio/gnuradio/tree/351dfb8ec4b07dddbd921f994c2bfd89cc35eadf), and I was able to compile again without errors.

Is this a bug or should my compilation procedure now be updated?

Thanks

@marcusmueller

This comment has been minimized.

Copy link
Member

marcusmueller commented Jul 7, 2018

So, I'd simply not recommend following this guide in every detail.

Instead of cloning VOLK separately, just go into your gnuradio directory and do a git submodule update --init, which will clone VOLK into the gnuradio/volk subdirectory, but at specifically the version your current clone of GNU Radio needs. The rest works like the guide describes (though I don't even see that installing VOLK separately instead of letting GNU Radio's build system do that has any advantage at all).

You can't just clone non-releases of VOLK and GNU Radio and hope they're compatible.

@marcusmueller

This comment has been minimized.

Copy link
Member

marcusmueller commented Jul 7, 2018

Can you let us know whether cleaning your Prefix, and then not installing VOLK separately, but simply during the GNU Radio build (i.e. remove -DENABLE_INTERNAL_VOLK=OFF) works?

Oh, and also, really, unless you want to develop GNU Radio (as opposed to developing applications with GNU Radio), you really don't have build GNU Radio, VOLK, gr-osmosdr, rtl-sdr, gqrx from source: If you use a modern Ubuntu (i.e. 18.04 instead of 16.04, which is in out-of-full-support phase), you get a pretty recent version of GNU Radio simply via sudo apt install.

@bijoutrouvaille

This comment has been minimized.

Copy link
Author

bijoutrouvaille commented Jul 7, 2018

Thank you @marcusmueller. Your advice makes sense; I'll try it after the weekend.

The reason I'm compiling everything by hand is the enormous amount of time I've spent unsuccessfully getting various SDR components to work together when installed from apt. Compiling from source simply worked. As wonderful as it is, the SDR community isn't exactly known for clear documentation. The reason I'm working with Xenial is similar—most documentation is aimed at it. But I will try the latest LTS next time I'm doing this, as you advise.

I've documented my goals and process here, if you are interested to know more.

@bijoutrouvaille

This comment has been minimized.

Copy link
Author

bijoutrouvaille commented Jul 16, 2018

Hi @marcusmueller. I just tried it the way you recommended, and got gr to compile and run. Thanks again.

@noc0lour noc0lour closed this Jul 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment