openucx/ucx

Configure/compile: cflags/cxxflags and compiler invocation

tonycurtis opened this issue · 9 comments

Describe the bug

I was building UCX with different compiler options (.e.g. ARM SVE), and was confused/frustrated about why my CFLAGS/CXXFLAGS settings were not reported in the configure output at the end. Suggest that the output

configure:           C compiler:   nvc -O3 -g -Wall -Werror -fno-omit-frame-pointer --display_error_number --diag_suppress 1 --diag_suppress 68 --diag_suppress 111 --diag_suppress 167 --diag_suppress 181 --diag_suppress 188 --diag_suppress 381 --diag_suppress 1215 --diag_suppress 1626 --diag_suppress 1901 --diag_suppress 1902 -Wno-unused-parameter -Wno-long-long -Wno-sign-compare -Wno-deprecated-declarations -Wnested-externs -Wshadow -Werror=declaration-after-statement

etc. should be split into the compiler name (gcc, nvc, clang and so on) and what the CFLAGS etc. are

I see the extra CFLAGS from the environment variable only when I compile.

Seems information found in config.log addresses your concern?

## ----------------- ##
## Output variables. ##
## ----------------- ##
...
BASE_CFLAGS='-O3 -g -Wall -Werror -fno-omit-frame-pointer -funwind-tables -Wframe-larger-than=8192 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-label -Wno-long-long -Wno-endif-labels -Wno-sign-compare -Wno-multichar -Wno-deprecated-declarations -Winvalid-pch -Wno-pointer-sign -Werror-implicit-function-declaration -Wno-format-zero-length -Wnested-externs -Wshadow -Werror=declaration-after-statement'
BASE_CPPFLAGS='-DCPU_FLAGS="" -I${abs_top_srcdir}/src -I${abs_top_builddir} -I${abs_top_builddir}/src'
BASE_CXXFLAGS='-O3 -g -Wall -Werror -fno-omit-frame-pointer -funwind-tables -Wframe-larger-than=8192 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-label -Wno-long-long -Wno-endif-labels -Wno-sign-compare -Wno-multichar -Wno-deprecated-declarations -Winvalid-pch'
BFD_CPPFLAGS=''
BFD_DEPS='-lz -ldl '
BFD_LDFLAGS=''
BFD_LIBS='-lbfd -ldl -lz '
CC='gcc'
CCAS='gcc'
CCASDEPMODE='depmode=gcc3'
CCASFLAGS=''
CCDEPMODE='depmode=gcc3'
CFLAGS=''
CFLAGS_NO_DEPRECATED='-Wno-deprecated-declarations'
CFLAGS_PEDANTIC=' -pedantic'
CPP='gcc -E'
CPPFLAGS=' -I/usr/include
...

Yes, but I thought it might be nicer to include the extra flags in the summary output

I am assuming we wanted to keep console output synthetic, @yosefe wdyt?

I guess we can print the extra flags in a separate line

@tonycurtis, can you please mention the list of flags you would like to see in configure output?

I was thinking it would be nice to see the same command-line that shows up in make V=1.

Although I appreciate this could vary between certain modules?

I was thinking it would be nice to see the same command-line that shows up in make V=1.

Although I appreciate this could vary between certain modules?

Yes i think it could depend. What about we try to add like below?

CC=gcc
BASE_CFLAGS='-O3 -g -Wall -Werror -fno-omit-frame-pointer -funwind-tables -Wframe-larger-than=8192 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-label -Wno-long-long -Wno-endif-labels -Wno-sign-compare -Wno-multichar -Wno-deprecated-declarations -Winvalid-pch -Wno-pointer-sign -Werror-implicit-function-declaration -Wno-format-zero-length -Wnested-externs -Wshadow -Werror=declaration-after-statement'
BASE_CPPFLAGS='-DCPU_FLAGS="" -I${abs_top_srcdir}/src -I${abs_top_builddir} -I${abs_top_builddir}/src'
BASE_CXXFLAGS='-O3 -g -Wall -Werror -fno-omit-frame-pointer -funwind-tables -Wframe-larger-than=8192 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-label -Wno-long-long -Wno-endif-labels -Wno-sign-compare -Wno-multichar -Wno-deprecated-declarations -Winvalid-pch'
CFLAGS=''

Looks ok!

Can you please check #10378?