Seagate / cortx-hare

CORTX Hare configures Motr object store, starts/stops Motr services, and notifies Motr of service and device faults.
https://github.com/Seagate/cortx
Apache License 2.0
13 stars 80 forks source link

Compiling cortx-hare shows an error #2036

Closed kevinxyliu closed 2 years ago

kevinxyliu commented 2 years ago

Hi,

I am following the Hare User Guide to compile it on a CentOS 7.8 bare metal machine, and the steps are as follows:

  1. Compile cortx-motr. The compilation seems to be successful, as all unit tests have passed.

  2. Compile cortx-utils from the guide: https://github.com/Seagate/cortx-utils/blob/main/py-utils/README.md. The compilation seems to be successful, as I was able to run the commands in the Usage section of that page.

  3. Follow the steps in the Hare User Guide to build from source. In particular, I ran the following commands sequentially:

    git clone https://github.com/Seagate/cortx-hare.git hare
    cd hare
    sudo yum -y install python3 python3-devel
    facter -v
    sudo yum localinstall -y https://yum.puppetlabs.com/puppet/el/7/x86_64/puppet-agent-7.0.0-1.el7.x86_64.rpm
    sudo ln -sf /opt/puppetlabs/bin/facter /usr/bin/facter
    sudo yum -y install yum-utils
    sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
    sudo yum -y install consul-1.9.1 
    cd cortx-motr && sudo scripts/install-motr-service --link
    export M0_SRC_DIR=$PWD
    cd -
    make

The error messages I got are the following:

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DM0_INTERNAL= -DM0_EXTERN=extern -I/home/cc/cortx-motr -I/home/cc/cortx-motr/extra-libs/galois/include/ -I/home/cc/hare/.py3venv/include -I/usr/include/python3.6m -c hax/motr/hax.c -o build/temp.linux-x86_64-3.6/hax/motr/hax.o -g -Werror -Wall -Wextra -Wno-attributes -Wno-unused-parameter -include config.h -fPIC
hax/motr/hax.c: In function ‘m0_ha_proc_counters_fetch’:
hax/motr/hax.c:223:25: error: storage size of ‘count_stats’ isn’t known
  struct m0_proc_counter count_stats;
                         ^
hax/motr/hax.c:227:6: error: implicit declaration of function ‘m0_spiel_proc_counters_fetch’ [-Werror=implicit-function-declaration]
      m0_spiel_proc_counters_fetch(spiel, proc_fid, &count_stats);
      ^
hax/motr/hax.c:223:25: error: unused variable ‘count_stats’ [-Werror=unused-variable]
  struct m0_proc_counter count_stats;
                         ^
hax/motr/hax.c: In function ‘m0_ha_pver_status’:
hax/motr/hax.c:279:27: error: storage size of ‘pver_info’ isn’t known
  struct m0_conf_pver_info pver_info;
                           ^
hax/motr/hax.c:284:6: error: implicit declaration of function ‘m0_spiel_conf_pver_status’ [-Werror=implicit-function-declaration]
      m0_spiel_conf_pver_status(spiel, pver_fid, &pver_info);
      ^
In file included from hax/motr/hax.c:50:0:
/home/cc/cortx-motr/lib/trace.h:594:48: error: missing initializer for field ‘v’ of ‘const struct t_body’ [-Werror=missing-field-initializers]
  m0_trace_allot(&__trace_descr, &(const struct t_body){ __VA_ARGS__ });\
                                                ^
/home/cc/cortx-motr/lib/trace.h:696:4: note: in expansion of macro ‘M0_TRACE_POINT’
 ({ M0_TRACE_POINT(level, 6,      \
    ^
/home/cc/cortx-motr/lib/misc.h:378:23: note: in expansion of macro ‘M0_LOG6’
 #define M0_CAT2(A, B) A ## B
                       ^
/home/cc/cortx-motr/lib/misc.h:377:22: note: in expansion of macro ‘M0_CAT2’
 #define M0_CAT(A, B) M0_CAT2(A, B)
                      ^
/home/cc/cortx-motr/lib/trace.h:168:2: note: in expansion of macro ‘M0_CAT’
  M0_CAT(M0_LOG, M0_COUNT_PARAMS(__VA_ARGS__))(level, __VA_ARGS__)
  ^
hax/motr/hax.c:292:2: note: in expansion of macro ‘M0_LOG’
  M0_LOG(M0_INFO, "FID:"FID_F", Status:%d, attributes:N=%d"
  ^
/home/cc/cortx-motr/lib/trace.h:697:21: note: ‘v0’ declared here
    { LOG_TYPEOF(a0, v0); LOG_TYPEOF(a1, v1); LOG_TYPEOF(a2, v2); \
                     ^
/home/cc/cortx-motr/lib/trace.h:574:16: note: in definition of macro ‘M0_TRACE_POINT’
  struct t_body DECL;      \
                ^
/home/cc/cortx-motr/lib/trace.h:697:6: note: in expansion of macro ‘LOG_TYPEOF’
    { LOG_TYPEOF(a0, v0); LOG_TYPEOF(a1, v1); LOG_TYPEOF(a2, v2); \
      ^
/home/cc/cortx-motr/lib/misc.h:378:23: note: in expansion of macro ‘M0_LOG6’
 #define M0_CAT2(A, B) A ## B
                       ^
/home/cc/cortx-motr/lib/misc.h:377:22: note: in expansion of macro ‘M0_CAT2’
 #define M0_CAT(A, B) M0_CAT2(A, B)
                      ^
/home/cc/cortx-motr/lib/trace.h:168:2: note: in expansion of macro ‘M0_CAT’
  M0_CAT(M0_LOG, M0_COUNT_PARAMS(__VA_ARGS__))(level, __VA_ARGS__)
  ^
hax/motr/hax.c:292:2: note: in expansion of macro ‘M0_LOG’
  M0_LOG(M0_INFO, "FID:"FID_F", Status:%d, attributes:N=%d"
  ^
hax/motr/hax.c:279:27: error: unused variable ‘pver_info’ [-Werror=unused-variable]
  struct m0_conf_pver_info pver_info;
                           ^
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
make: *** [hax/dist/hax-2.0.0-cp36-cp36m-linux_x86_64.whl] Error 1

Can anyone help me with this issue? Thanks!

cortx-admin commented 2 years ago

For the convenience of the Seagate development team, this issue has been mirrored in a private Seagate Jira Server: https://jts.seagate.com/browse/CORTX-29703. Note that community members will not be able to access that Jira server but that is not a problem since all activity in that Jira mirror will be copied into this GitHub issue.

cortx-admin commented 2 years ago

Vaibhav Prakash Paratwar commented in Jira Server:

[~931950] can you help here?

supriyachavan4398 commented 2 years ago

Hi @kevinxyliu, We have one dg_bytecount branch, which was merged into the main 2 days back. So because of this changes, we faced the above issue in the make command. Could you please try to build motr and hare once again with the latest main? Before that, please remove all old RPMs from VM. Thanks!

vaibhavparatwar commented 2 years ago

Closing this ticket. If seen again with correct branch, please raise a separate issue.

cortx-admin commented 2 years ago

Vaibhav Prakash Paratwar commented in Jira Server:

No work as it may be that user is using wrong branch

cortx-admin commented 2 years ago

Vaibhav Prakash Paratwar commented in Jira Server:

,

cortx-admin commented 2 years ago

Vaibhav Prakash Paratwar commented in Jira Server:

.