kit-cel / gr-lte

GNU Radio LTE receiver
GNU General Public License v3.0
388 stars 149 forks source link

No module named lte_swig #18

Closed Davonter closed 6 years ago

Davonter commented 6 years ago

As the Title says, I ran the gnuradio-companion lte_bch_decoder.grc, the error ocurred. The branch I use is cmake-volk-fix, the version of gnuradio is 3.7.9.

Keskebeu commented 6 years ago

were you able to compile gr-lte in gnuradio 3.7.9?

Davonter commented 6 years ago

Yes. I delete gr-lte manually and re-compiled after re-clone. The error is disappear... It's strange!

Keskebeu commented 6 years ago

But you posted no module lte_swig how did you compile it without the module?

Davonter commented 6 years ago

Yes, I compiled gr-lte successfully and no error occurred. The error was occurred when I ran the gnuradio-companion. I follow the steps strictly.

  1. Get gr-lte from github

  2. Configure it using CMake
    Assuming you are already in the project folder
    mkdir build
    cp cmake_command.sh build/
    cd build
    ./cmake_command.sh

    This will just run a little script to aid with project setup for Code::Blocks
    Otherwise run cmake ..

  3. Compile and Install
    make -jX where X is a number of choice (Often the number of cores available)
    sudo make install (make it available in GRC)

Did you fail to compiled due to the module?

Keskebeu commented 6 years ago

What version gnuradio did you use? I am currently using 3.7.9 in linux mint.

Davonter commented 6 years ago

YES! I used ubuntu 16.04, the version of gnuradio is 3.7.9. What error is you met?

-- Wynter Wang


发件人: kit-cel/gr-lte 发送时间: 2018-01-05 21:52:06 收件人: kit-cel/gr-lte 抄送: wynter, Author 主题: Re: [kit-cel/gr-lte] No module named lte_swig (#18)

What version gnuradio did you use? I am currently using 3.7.9 in linux mint.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Keskebeu commented 6 years ago

It comes up with error: expected token in front of 'char'.

Keskebeu commented 6 years ago

Linux mint version i have is 16.04 in ubuntu because it uses the same mirrors. If you have gnuradio-core module file can you send that to me. I haven't had any luck downloading it from any source and its not available on apt nor pybombs. I even tried python and nothing has it.

Keskebeu commented 6 years ago

[ 18%] Building CXX object lib/CMakeFiles/gnuradio-lte.dir/crc_check_vbvb_impl.cc.o /usr/src/gr-lte/lib/crc_check_vbvb_impl.cc: In member function ‘virtual int gr::lte::crc_check_vbvb_impl::work(int, gr_vector_const_void_star&, gr_vector_void_star&)’: /usr/src/gr-lte/lib/crc_check_vbvb_impl.cc:89:12: error: expected primary-expression before ‘char’ GR_VLA(char, bytes, d_data_len / 8); ^ /usr/src/gr-lte/lib/crc_check_vbvb_impl.cc:89:18: error: ‘bytes’ was not declared in this scope GR_VLA(char, bytes, d_data_len / 8); ^ /usr/src/gr-lte/lib/crc_check_vbvb_impl.cc:89:39: error: ‘__GR_VLA’ was not declared in this scope __GR_VLA(char, bytes, d_data_len / 8); ^ lib/CMakeFiles/gnuradio-lte.dir/build.make:86: recipe for target 'lib/CMakeFiles/gnuradio-lte.dir/crc_check_vbvb_impl.cc.o' failed make[2]: [lib/CMakeFiles/gnuradio-lte.dir/crc_check_vbvb_impl.cc.o] Error 1 CMakeFiles/Makefile2:137: recipe for target 'lib/CMakeFiles/gnuradio-lte.dir/all' failed make[1]: [lib/CMakeFiles/gnuradio-lte.dir/all] Error 2 Makefile:138: recipe for target 'all' failed

Keskebeu commented 6 years ago

-- CPU missing xgetbv?

velichkov commented 6 years ago

Hi @Keskebeu,

/usr/src/gr-lte/lib/crc_check_vbvb_impl.cc:89:39: error: ‘__GR_VLA’ was not declared in this scope __GR_VLA(char, bytes, d_data_len / 8);

The __GR_VLA macro was added in gnuradio v3.7.9.3 which is still not available in Ubuntu 16.04 / Mint 18.02. If you add it in include/lte/api.h it should compiles

diff --git a/include/lte/api.h b/include/lte/api.h
index 1927bfd..c3a4175 100644
--- a/include/lte/api.h
+++ b/include/lte/api.h
@@ -30,4 +30,16 @@
 #  define LTE_API __GR_ATTR_IMPORT
 #endif

+#ifndef __GR_VLA
+////////////////////////////////////////////////////////////////////////
+// implement cross-compiler VLA macros
+////////////////////////////////////////////////////////////////////////
+#ifdef _MSC_VER
+#  define __GR_VLA(TYPE, buf, size) TYPE * buf = (TYPE *) alloca(sizeof(TYPE) * (size))
+#else
+#  define __GR_VLA(TYPE, buf, size) TYPE buf[size]
+#endif
+#endif //__GR_VLA
+
+
 #endif /* INCLUDED_LTE_API_H */

The definition comes from https://github.com/gnuradio/gnuradio/blob/a0adcd3347c7ffd6ef3c42ce7705a23978774d3b/gnuradio-runtime/include/gnuradio/attributes.h#L81-L88

Keskebeu commented 6 years ago

@Velichkov Thank you for your research and help. I knew it was incompability either gnu or linux. But I will include this file in my lte when i get home and will let you know.

Thank you again.

Keskebeu commented 6 years ago

@velichkov thank you so much for the patch. I was able to compile, import lte and test it. Now time to have some fun.

Keskebeu commented 6 years ago

This issue should now be closed

Davonter commented 6 years ago

Thanks a lot! @velichkov