empiredan opened a new issue, #1391:
URL: https://github.com/apache/incubator-pegasus/issues/1391
While building pegasus in debug mode in command `./run.sh build --test -t
debug -v -c`, errors are reported as follows:
```
[ 17%] Building CXX object src/nfs/CMakeFiles/dsn_nfs.dir/nfs_node.cpp.o
cd /data/sa_cluster/src/empiredan-pegasus-new/src/debug__builder/src/nfs &&
/opt/rh/devtoolset-7/root/usr/bin/g++ -DDSN_BUILD_HOSTNAME=10-120-69-237
-DDSN_BUILD_TYPE=Release -DDSN_ENABLE_GPERF -D__STDC_FORMAT_MACROS
-D__FILENAME__=\"nfs_node.cpp\" -I/dat
a/sa_cluster/src/empiredan-pegasus-new/thirdparty/output/include
-I/data/sa_cluster/src/empiredan-pegasus-new/src/debug__builder/thrift-gen
-I/data/sa_cluster/src/empiredan-pegasus-new/src
-I/data/sa_cluster/src/empiredan-pegasus-new/src/common/serializat
ion_helper -I/data/sa_cluster/src/empiredan-pegasus-new/src/include
-I/data/sa_cluster/src/empiredan-pegasus-new/src/builder/output/include
-std=c++1y -gdwarf-4 -g -g -O2 -Wall -Werror -Wno-sign-compare
-Wno-strict-aliasing -Wuninitialized -Wno-unused-
variable -Wno-deprecated-declarations -Wno-inconsistent-missing-override
-Wno-attributes -fno-omit-frame-pointer -Wno-deprecated-register
-Wno-implicit-float-conversion -fPIC -o CMakeFiles/dsn_nfs.dir/nfs_node.cpp.o
-c /data/sa_cluster/src/empiredan-pegas
us-new/src/nfs/nfs_node.cpp
In file included from
/data/sa_cluster/src/empiredan-pegasus-new/src/utils/alloc.cpp:18:0:
/data/sa_cluster/src/empiredan-pegasus-new/src/utils/alloc.h: In function
‘dsn::cacheline_aligned_ptr<T> dsn::cacheline_aligned_alloc_array(size_t)’:
/data/sa_cluster/src/empiredan-pegasus-new/src/utils/alloc.h:57:26: error:
‘fmt’ has not been declared
fmt::ptr(array),
^~~
/data/sa_cluster/src/empiredan-pegasus-new/src/utils/alloc.h:60:26: error:
‘fmt’ has not been declared
fmt::ptr(elem),
^~~
/data/sa_cluster/src/empiredan-pegasus-new/src/utils/alloc.h:53:13: error:
there are no arguments to ‘CHECK_EQ_MSG’ that depend on a template parameter,
so a declaration of ‘CHECK_EQ_MSG’ must be available [-fpermissive]
CHECK_EQ_MSG((reinterpret_cast<const uintptr_t>(elem) &
(sizeof(T) - 1)),
^~~~~~~~~~~~
/data/sa_cluster/src/empiredan-pegasus-new/src/utils/alloc.h:53:13: note:
(if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of
an undeclared name is deprecated)
At global scope:
cc1plus: error: unrecognized command line option
‘-Wno-implicit-float-conversion’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-register’
[-Werror]
cc1plus: error: unrecognized command line option
‘-Wno-inconsistent-missing-override’ [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [src/utils/CMakeFiles/dsn_utils.dir/alloc.cpp.o] Error 1
make[2]: Leaving directory
`/data/sa_cluster/src/empiredan-pegasus-new/src/debug__builder'
make[1]: *** [src/utils/CMakeFiles/dsn_utils.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
```
However, there is not any error while building alloc.h in release mode (for
example, in github workflows). The reason is that `CHECK_EQ_MSG` and `fmt::ptr`
will be compiled once `#ifndef NDEBUG` is true, which means debug mode.
Therefore, `#ifndef NDEBUG` should also be used to control the including of
header files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]