openaicellular / srsRAN-e2

srsRAN cellular stack enabled with the E2 agent
GNU Affero General Public License v3.0
8 stars 3 forks source link

Build errors #3

Closed jgaeddert closed 2 years ago

jgaeddert commented 2 years ago

When running with 37577922475aa50c625999d997a4a1e1ccbea786 and compiling with the following cmake config,

    cd srsRAN-e2
    mkdir build
    export SRS=`realpath .`
    cd build
    cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DRIC_GENERATED_E2AP_BINDING_DIR=${SRS}/e2_bindings/E2AP-v01.01 \
        -DRIC_GENERATED_E2SM_KPM_BINDING_DIR=${SRS}/e2_bindings/E2SM-KPM \
        -DRIC_GENERATED_E2SM_NI_BINDING_DIR=${SRS}/e2_bindings/E2SM-NI \
        -DRIC_GENERATED_E2SM_GNB_NRT_BINDING_DIR=${SRS}/e2_bindings/E2SM-GNB-NRT
    make -j4 

I am hitting this error:

[ 63%] Building CXX object srsenb/src/ric/CMakeFiles/srsenb_ric.dir/e2sm_kpm.cc.o
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc: In constructor ‘ric::kpm_model::metrics::metrics(srsenb::enb_metrics_t*)’:
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc:65:38: error: ‘struct srsenb::stack_metrics_t’ has no member named ‘pdcp_kpm’
   65 |   for (uint16_t i = 0; i < em->stack.pdcp_kpm.n_ues && i < SRSENB_MAX_UES; ++i) {
      |                                      ^~~~~~~~
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc:67:39: error: ‘struct srsenb::stack_metrics_t’ has no member named ‘pdcp_kpm’
   67 |       dl_bytes_by_qci[j] += em->stack.pdcp_kpm.ues[i].dl_bytes_by_qci[j];
      |                                       ^~~~~~~~
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc:68:39: error: ‘struct srsenb::stack_metrics_t’ has no member named ‘pdcp_kpm’
   68 |       ul_bytes_by_qci[j] += em->stack.pdcp_kpm.ues[i].ul_bytes_by_qci[j];
      |                                       ^~~~~~~~
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc: In member function ‘virtual void ric::kpm_model::stop()’:
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc:282:36: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class ric::kpm_model::metrics’; use assignment or value-initialization instead [-Wclass-memaccess]
  282 |     sizeof(periods[i].last_metrics));
      |                                    ^
In file included from /home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc:10:
/home/srsran1/src/oaic/srsRAN-e2/srsenb/hdr/ric/e2sm_kpm.h:30:9: note: ‘class ric::kpm_model::metrics’ declared here
   30 |   class metrics
      |         ^~~~~~~
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc: In member function ‘virtual int ric::kpm_model::handle_subscription_add(ric::subscription_t*)’:
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc:366:82: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class ric::kpm_model::metrics’; use assignment or value-initialization instead [-Wclass-memaccess]
  366 |       memset(&periods[period].last_metrics,0,sizeof(periods[period].last_metrics));
      |                                                                                  ^
In file included from /home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc:10:
/home/srsran1/src/oaic/srsRAN-e2/srsenb/hdr/ric/e2sm_kpm.h:30:9: note: ‘class ric::kpm_model::metrics’ declared here
   30 |   class metrics
      |         ^~~~~~~
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc: In member function ‘void ric::kpm_model::send_indications(int)’:
/home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc:471:26: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct srsenb::enb_metrics_t’ with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]
  471 |   memset(&em,0,sizeof(em));
      |                          ^
In file included from /home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2sm_kpm.cc:2:
/home/srsran1/src/oaic/srsRAN-e2/lib/include/srsran/interfaces/enb_metrics_interface.h:66:8: note: ‘struct srsenb::enb_metrics_t’ declared here
   66 | struct enb_metrics_t {
      |        ^~~~~~~~~~~~~
make[2]: *** [srsenb/src/ric/CMakeFiles/srsenb_ric.dir/build.make:4379: srsenb/src/ric/CMakeFiles/srsenb_ric.dir/e2sm_kpm.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:12358: srsenb/src/ric/CMakeFiles/srsenb_ric.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Tagging @pratheeksu for support.

bondadakumarsai commented 2 years ago

Hello Joe,

I have pushed a fix for that. Thank you for identifying.

Best regards Kumar

jgaeddert commented 2 years ago

Now I'm getting the following error:

/usr/bin/ld: CMakeFiles/enb_metrics_test.dir/__/src/metrics_stdout.cc.o:(.bss+0x0): multiple definition of `srsenb::pdcp_kpm'; CMakeFiles/enb_metrics_test.dir/enb_metrics_test.cc.o:(.bss+0x20): first defined here
/usr/bin/ld: CMakeFiles/enb_metrics_test.dir/__/src/metrics_csv.cc.o:(.bss+0x0): multiple definition of `srsenb::pdcp_kpm'; CMakeFiles/enb_metrics_test.dir/enb_metrics_test.cc.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [srsenb/test/CMakeFiles/enb_metrics_test.dir/build.make:121: srsenb/test/enb_metrics_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:12388: srsenb/test/CMakeFiles/enb_metrics_test.dir/all] Error 2
jgaeddert commented 2 years ago

This is a linker error that is showing duplicate symbols. I'm guessing we need to remove either metrics_std.cc or metrics_csv.cc

bondadakumarsai commented 2 years ago

Fixed the issue. Please try to rebuild and let me know if you face any issues.

jgaeddert commented 2 years ago
[ 84%] Building CXX object srsenb/src/ric/CMakeFiles/srsenb_ric.dir/e2ap_encode.cc.o
In file included from /home/srsran1/src/oaic/srsRAN-e2/srsenb/src/ric/e2ap_encode.cc:2:
/home/srsran1/src/oaic/srsRAN-e2/srsenb/hdr/ric/e2ap_encode.h:4:10: fatal error: E2AP_E2AP-PDU.h: No such file or directory
    4 | #include "E2AP_E2AP-PDU.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [srsenb/src/ric/CMakeFiles/srsenb_ric.dir/build.make:63: srsenb/src/ric/CMakeFiles/srsenb_ric.dir/e2ap_encode.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:12358: srsenb/src/ric/CMakeFiles/srsenb_ric.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
jgaeddert commented 2 years ago

This is odd because it's clearly visible in e2_bindings/E2AP-v01.01/E2AP_E2AP-PDU.h

jgaeddert commented 2 years ago

I'm also getting a warning when running cmake:

CMake Warning:
  Manually-specified variables were not used by the project:

    RIC_GENERATED_E2SM_NI_BINDING_DIR

-- Build files have been written to: /home/srsran1/src/oaic/srsRAN-e2/build
bondadakumarsai commented 2 years ago

For the CMake Warning: We can remove the parameter -DRIC_GENERATED_E2SM_NI_BINDING_DIR=${SRS}/e2_bindings/E2SM-NI \ when doing cmake

jgaeddert commented 2 years ago

Well, I re-built it successfully. Not sure what the issue was. Closing this out. Will open new issues as they arise