igorauad / gr-dvbs2rx

DVB-S2 Receiver Extensions for GNU Radio
https://igorauad.github.io/gr-dvbs2rx/
GNU General Public License v3.0
95 stars 23 forks source link

Fix build problem #4

Closed marcusmueller closed 2 years ago

marcusmueller commented 2 years ago

Addresses #3 far as I can tell, fixes problems with VLAs (which don't work like that in C++) and improper imports on gr 3.9

Now, builds with GR 3.9 for me! (yay!)

igorauad commented 2 years ago

Thanks for the PR, @marcusmueller ! Sorry, the workflow actions for pull request were requiring approval before, so they didn't run when you pushed. I've just allowed them.

So, I'm seeing the same error of https://github.com/igorauad/gr-dvbs2rx/runs/4574805810?check_suite_focus=true in my local environment, which is expected, since I develop using the gnuradio-oot-dev container env (same used on CI). I'm gonna try to find a solution, but if you know already, please let me know =)

The error in https://github.com/igorauad/gr-dvbs2rx/runs/4574805809?check_suite_focus=true is just a missing clang-format call.

igorauad commented 2 years ago

Ok, my bad. I was pretty certain libsndfile1-dev was installed because I was seeing it on the Dockerfile. However, I was missing the fact that I don't use this particular image on CI. Instead, I use the raw igorfreire/gnuradio-oot-dev:3.9.4-ubuntu-focal image (see the workflow config).

I've pushed a fix in 9243148. Also, I think 3.9.2 should remain flagged as REQUIRED because this implementation relies on the rotator message port I introduced in https://github.com/gnuradio/gnuradio/commit/9e24ad6d94e75827f2ea1fe0e7371dc16dc39db6, which is available since 3.9.2. Does that make sense?

igorauad commented 2 years ago

Hi @marcusmueller ,

So I've done a bit more work on fixing the clang build. The current state is on branch fix_clang_build. Now, I'm stuck on the error that you can see in this workflow: https://github.com/igorauad/gr-dvbs2rx/runs/4659271657, namely:

ImportError: generic_type: type "bbdeheader_bb" referenced unknown base type "gr::block"

I saw the two related issues below:

They mention a potential incompatibility between the local pybind11 version and the pybind11-dev version used to build the GR package from the gnuradio-releases PPA. However, I've checked, and I'm using the same version (2.4.3), namely the most recent pybind11-dev version available for Ubuntu 20.04. I've also tried manually removing the package and using a more recent pybind11 installed via pip install "pybind11[global]". That did not work either.

So I wonder how you got the build to work with clang? Could you describe your environment (OS and GR version)? Are you using GR compiled from source? If yes, was you GR also compiled with clang instead of gcc?

Here are the steps to reproduce, in case you are familiar with docker:

git clone https://github.com/igorauad/gr-dvbs2rx.git -b fix_clang_build
cd gr-dvbs2rx
docker run --rm -it -v $(pwd):/src/gr-dvbs2rx/ igorfreire/gnuradio-oot-dev:3.9.4-ubuntu-focal

Then, inside the container:

1) Install dependencies and switch the default compiler to clang:

apt install -y libsndfile1-dev clang
update-alternatives --set c++ /usr/bin/clang++
update-alternatives --set cc /usr/bin/clang

2) Build and test:

cd /src/gr-dvbs2rx/
mkdir build/ && cd $_ && cmake ../
make -j`nproc`
ctest -VV
igorauad commented 2 years ago

Update:

I've merged most changes related to the clang build already. However, I still haven't solved the problem mentioned in https://github.com/igorauad/gr-dvbs2rx/pull/4#issuecomment-1002704446. So, for now, the commit introducing a workflow for building with clang on CI is still pending: https://github.com/igorauad/gr-dvbs2rx/commit/5ef57d6c7e7aad8c3612b93009e7d0604d295f3e.