Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling error #7618

Closed
jchensw opened this issue Nov 2, 2021 · 45 comments · Fixed by #7619
Closed

compiling error #7618

jchensw opened this issue Nov 2, 2021 · 45 comments · Fixed by #7619

Comments

@jchensw
Copy link

jchensw commented Nov 2, 2021

make install
Making install in src/ucm
make[1]: Entering directory '/home/jinchen/TEST/ucx-1.11.2/src/ucm'
Making install in .
make[2]: Entering directory '/home/jinchen/TEST/ucx-1.11.2/src/ucm'
CC event/libucm_la-event.lo
CC malloc/libucm_la-malloc_hook.lo
CC mmap/libucm_la-install.lo
CC util/libucm_la-replace.lo
CC util/libucm_la-log.lo
CC util/libucm_la-reloc.lo
CC util/libucm_la-sys.lo
CC bistro/libucm_la-bistro.lo
CC bistro/libucm_la-bistro_x86_64.lo
CC bistro/libucm_la-bistro_aarch64.lo
CC bistro/libucm_la-bistro_ppc64.lo
"bistro/bistro_ppc64.c", line 157: error #1144: arithmetic on pointer to void or function type
func += 8;
^

"bistro/bistro_ppc64.c", line 158: error #1144: arithmetic on pointer to void or function type
hook += 8;
^

2 errors detected in the compilation of "bistro/bistro_ppc64.c".

@jchensw
Copy link
Author

jchensw commented Nov 2, 2021

would you please take a look and give me a hint to fix it?''

Thanks,

-- Jin

@dmitrygx
Copy link
Member

dmitrygx commented Nov 2, 2021

@jchensw this is a compilation problem in UCM/PPC64-related code.
could you verify if #7619 PR fixes the issue, please?

@jchensw
Copy link
Author

jchensw commented Nov 2, 2021

@dmitrygx Thanks. it's fixed. But now I'm getting the following errors. Do you have any idea?

make[2]: Entering directory '/home/jinchen/TEST/ucx-1.11.2/src/tools/info'
CC ucx_info-build_info.o
CC ucx_info-proto_info.o
CC ucx_info-sys_info.o
CC ucx_info-tl_info.o
CC ucx_info-type_info.o
CC ucx_info-ucx_info.o
CCLD ucx_info
ucx_info-proto_info.o: In function print_ucp_info': /home/jinchen/TEST/ucx-1.11.2/src/tools/info/proto_info.c:66: undefined reference to __builtin_ppc_get_timebase'
/home/jinchen/TEST/ucx-1.11.2/src/tools/info/proto_info.c:66: undefined reference to __builtin_ppc_get_timebase' /home/jinchen/TEST/ucx-1.11.2/src/tools/info/proto_info.c:83: undefined reference to __builtin_ppc_get_timebase'
/home/jinchen/TEST/ucx-1.11.2/src/tools/info/proto_info.c:83: undefined reference to __builtin_ppc_get_timebase' ucx_info-sys_info.o: In function print_sys_info':
/home/jinchen/TEST/ucx-1.11.2/src/tools/info/sys_info.c:72: undefined reference to __builtin_ppc_get_timebase' ucx_info-sys_info.o:/home/jinchen/TEST/ucx-1.11.2/src/tools/info/sys_info.c:75: more undefined references to __builtin_ppc_get_timebase' follow
make[2]: *** [Makefile:563: ucx_info] Error 2
make[2]: Leaving directory '/home/jinchen/TEST/ucx-1.11.2/src/tools/info'
make[1]: *** [Makefile:783: install] Error 2
make[1]: Leaving directory '/home/jinchen/TEST/ucx-1.11.2/src/tools/info'
make: *** [Makefile:735: install-recursive] Error 1

@dmitrygx
Copy link
Member

dmitrygx commented Nov 2, 2021

@dmitrygx Thanks. it's fixed. But now I'm getting the following errors. Do you have any idea?

thanks!
it seems that you're compiling UCX without glibc, right? do you use another C library - e.g. musl?
could you pool the latest changes from the PR and check if they help you?

@jchensw
Copy link
Author

jchensw commented Nov 2, 2021

I'm not using gnu c library. If I do want to use it, how to specify it on the configuration step? Thanks.

@dmitrygx
Copy link
Member

dmitrygx commented Nov 2, 2021

@jchensw e.g. specify CC=gcc when launching configure.

btw, did you check the PR without glibc?

@jchensw
Copy link
Author

jchensw commented Nov 2, 2021

Not yet. I will do it right now.

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

@dmitrygx It could not fix the issue. Maybe I missed something here. Would you please give me more specific suggestions? Thanks.

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

Maybe I missed something here. Would you please give me more specific suggestions?

did you run ./autogen.sh && ./configure prior to compiling the UCX when the changes from the PR were taken?

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

I checked out the master branch, and did

993 18:24 ./autogen.sh
994 18:24 ./contrib/configure-release --prefix=pwd/build/test
1013 9:40 make -j8 install

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

do you mean that you checked out changes from #7619 instead of the master branch?

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

$ git remote add dmitrygx https://github.com/dmitrygx/ucx.git
$ git fetch dmitrygx
$ git checkout dmitrygx/topic/ucm/bistro_ppc_fix
$ ./autogen.sh
$ ./contrib/configure-release --prefix=pwd/build/test
$ make -j8 install

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

I did followed #7619, but the error is still there. So I followed your instruction one more time to be sure. And I'm still getting them

make install-am
make[2]: Entering directory '/TEST/ucx/src/tools/info'
CC ucx_info-build_info.o
CC ucx_info-proto_info.o
CC ucx_info-sys_info.o
CC ucx_info-tl_info.o
CC ucx_info-type_info.o
CC ucx_info-ucx_info.o
CCLD ucx_info
ucx_info-proto_info.o: In function print_ucp_info': /TEST/ucx/src/tools/info/proto_info.c:66: undefined reference to __builtin_ppc_get_timebase'
/TEST/ucx/src/tools/info/proto_info.c:66: undefined reference to __builtin_ppc_get_timebase' /TEST/ucx/src/tools/info/proto_info.c:83: undefined reference to __builtin_ppc_get_timebase'
/TEST/ucx/src/tools/info/proto_info.c:83: undefined reference to __builtin_ppc_get_timebase' ucx_info-sys_info.o: In function print_sys_info':
/TEST/ucx/src/tools/info/sys_info.c:73: undefined reference to __builtin_ppc_get_timebase' ucx_info-sys_info.o:/TEST/ucx/src/tools/info/sys_info.c:76: more undefined references to __builtin_ppc_get_timebase' follow

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

~/TEST/ucx$git branch

  • (HEAD detached at dmitrygx/topic/ucm/bistro_ppc_fix)
    master

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

We have /usr/lib64/libc.so.6

But I'm not using gcc compiler. Then how do I let ucx know and use libc? Is there a way to specify at configuration?

Thanks,

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

Here is what I have

nm /usr/lib64/libc.a | grep -i ppc_get_timebase
0000000000000000 W __ppc_get_timebase_freq

@yosefe
Copy link
Contributor

yosefe commented Nov 3, 2021

@jchensw can you pls re-run ./autogen.sh after applying the changes in #7619 ?

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

I did and here is what I got:

~/TEST/ucx$./autogen.sh

autoreconf: Entering directory `.'

autoreconf: configure.ac: not using Gettext

autoreconf: running: aclocal -I config/m4

autoreconf: configure.ac: tracing

autoreconf: running: libtoolize --copy

autoreconf: running: /usr/bin/autoconf

autoreconf: running: /usr/bin/autoheader

autoreconf: running: automake --add-missing --copy --no-force

autoreconf: Leaving directory `.'

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

@jchensw could you pls share the output of the following command launched from UCX root directory:

$ grep "HAVE_DECL___PPC" ./config.h

@wlepera
Copy link

wlepera commented Nov 3, 2021

I just completed two successful builds on Power9 ppc64le, first using dmitrygx/topic/ucm/bistro_ppc_fix and again using master. Not seeing these problems in either build

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

ls -ltr config.h
-rw-r--r--. 1 jinchen pppl 32449 Nov 3 10:21 config.h
~/TEST/ucx$grep "HAVE_DECL___PCC" ./config.h

No output.

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

No output.

hmm, interesting.
it should be:

$grep "HAVE_DECL___PPC" ./config.h
#define HAVE_DECL___PPC_GET_TIMEBASE 0
#define HAVE_DECL___PPC_GET_TIMEBASE_FREQ 0

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

@jchensw sorry, I made a mistake, it should be "HAVE_DECL___PPC" instead of "HAVE_DECL___PCC":

$grep "HAVE_DECL___PPC" ./config.h

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

~/TEST/ucx$grep "HAVE_DECL___PPC" ./config.h
#define HAVE_DECL___PPC_GET_TIMEBASE 1
#define HAVE_DECL___PPC_GET_TIMEBASE_FREQ 1

@yosefe
Copy link
Contributor

yosefe commented Nov 3, 2021

@jchensw can you pls the output of lscpu command on your machine?
@dmitrygx I think the issue is we check for decl but not the function (use AC_CHECK_FUNCS)

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

~/TEST/ucx$which lscpu
/usr/bin/lscpu
~/TEST/ucx$ lscpu
Architecture: ppc64le
Byte Order: Little Endian
CPU(s): 128
On-line CPU(s) list: 0-127
Thread(s) per core: 4
Core(s) per socket: 16
Socket(s): 2
NUMA node(s): 6
Model: 2.3 (pvr 004e 1203)
Model name: POWER9, altivec supported
CPU max MHz: 3800.0000
CPU min MHz: 2300.0000
L1d cache: 32K
L1i cache: 32K
L2 cache: 512K
L3 cache: 10240K
NUMA node0 CPU(s): 0-63
NUMA node8 CPU(s): 64-127
NUMA node252 CPU(s):
NUMA node253 CPU(s):
NUMA node254 CPU(s):
NUMA node255 CPU(s):

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

@dmitrygx I think the issue is we check for decl but not the function (use AC_CHECK_FUNCS)

yes, it sounds like a good suggestion

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

@jchensw could you pls pull the latest changes from the #7619 PR and check the compilation?
also, could share the output of the following command, pls:

$grep "HAVE___PPC" ./config.h

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

~/TEST/ucx$ git fetch dmitrygx
From https://github.com/dmitrygx/ucx
ac6bc97..45d5367 topic/ucm/bistro_ppc_fix -> dmitrygx/topic/ucm/bistro_ppc_fix

~/TEST/ucx$ git checkout dmitrygx/topic/ucm/bistro_ppc_fix
M src/ucm/bistro/bistro_ppc64.c
Previous HEAD position was ac6bc97 CONFIG/UCS/SYS: Check _ppc_get_timebase declaration
HEAD is now at 45d5367 CONFIG/UCS/ARCH: Check for __ppc_get_timebase/__ppc_get_timbase_freq functions too

~/TEST/ucx$ git branch

  • (HEAD detached at dmitrygx/topic/ucm/bistro_ppc_fix)
    master

~/TEST/ucx$ grep "HAVE___PPC" ./config.h

No output.

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

~/TEST/ucx$ grep "HAVE___PPC" ./config.h

No output.

this should be checked after ./autogen && ./configure

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

Here is what I have after ./autogen && ./configure

~/TEST/ucx$grep "HAVE___PPC" ./config.h
/* #undef HAVE___PPC_GET_TIMEBASE */
#define HAVE___PPC_GET_TIMEBASE_FREQ 1

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

I'm still getting the same error, but this time from a different file:

make[2]: Entering directory '/home/jinchen/TEST/ucx/src/tools/perf/lib'
CC libucxperf_la-libperf.lo
CC libucxperf_la-libperf_memory.lo
CC libucxperf_la-libperf_thread.lo
CXX libucxperf_la-uct_tests.lo
CXX libucxperf_la-ucp_tests.lo
"/usr/include/sys/platform/ppc.h", line 31: error #20: identifier "__builtin_ppc_get_timebase" is undefined
return __builtin_ppc_get_timebase ();
^

"/usr/include/sys/platform/ppc.h", line 31: error #20: identifier "__builtin_ppc_get_timebase" is undefined
return __builtin_ppc_get_timebase ();
^

1 error detected in the compilation of "ucp_tests.cc".

@wlepera
Copy link

wlepera commented Nov 3, 2021

my env:
glibc-2.28-151.el8.ppc64le
libgcc-8.4.1-1.el8.ppc64le
gcc-8.4.1-1.el8.ppc64le
gcc-c++-8.4.1-1.el8.ppc64le

lscpu
Architecture: ppc64le
Byte Order: Little Endian
CPU(s): 176
On-line CPU(s) list: 0-175
Thread(s) per core: 4
Core(s) per socket: 22
Socket(s): 2
NUMA node(s): 8
Model: 2.3 (pvr 004e 1203)
Model name: POWER9, altivec supported
CPU max MHz: 3800.0000
CPU min MHz: 2300.0000
L1d cache: 32K
L1i cache: 32K
L2 cache: 512K
L3 cache: 10240K
NUMA node0 CPU(s): 0-87
NUMA node8 CPU(s): 88-175
NUMA node250 CPU(s):
NUMA node251 CPU(s):
NUMA node252 CPU(s):
NUMA node253 CPU(s):
NUMA node254 CPU(s):
NUMA node255 CPU(s):

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

I'm using nvhpc compiler, not gcc compiler, but we do have glibc.

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

I'm using nvhpc compiler, not gcc compiler, but we do have glibc.

thanks for the additional information.

@jchensw could you pull the latest changes from my PR and try "./autogen && ./configure && make" again?
thanks in advance!

@wlepera
Copy link

wlepera commented Nov 3, 2021

@jchensw which nvhpc version are you using?

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

Sorry for the late response.

The errors are still there :

1028 17:25 git fetch dmitrygx
remote: Enumerating objects: 288, done.
remote: Counting objects: 100% (146/146), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 83 (delta 55), reused 63 (delta 41), pack-reused 0
Unpacking objects: 100% (83/83), 11.64 KiB | 170.00 KiB/s, done.
From https://github.com/dmitrygx/ucx
45d5367..96ac8b5 topic/ucm/bistro_ppc_fix -> dmitrygx/topic/ucm/bistro_ppc_fix

  • [new branch] topic/ucp/discard_invalid_ep -> dmitrygx/topic/ucp/discard_invalid_ep

1029 17:26 git checkout dmitrygx/topic/ucm/bistro_ppc_fix
M src/ucm/bistro/bistro_ppc64.c
Previous HEAD position was 45d5367 CONFIG/UCS/ARCH: Check for __ppc_get_timebase/__ppc_get_timbase_freq functions too
HEAD is now at 96ac8b5 PERF/UCP: Include UCS headers under extern 'C'

1030 17:26 git branch

  • (HEAD detached at dmitrygx/topic/ucm/bistro_ppc_fix)
    master

    1031 17:26 ls -ltr src/ucm/bistro/bistro_ppc64.*
    1032 17:27 diff src/ucm/bistro/bistro_ppc64.c src/ucm/bistro/bistro_ppc64.c_new
    1033 17:27 ./autogen.sh
    1034 17:28 history | grep trib
    1035 17:28 ./contrib/configure-release --prefix=pwd/build/test
    Making install in lib
    make[2]: Entering directory '/home/jinchen/TEST/ucx/src/tools/perf/lib'
    CC libucxperf_la-libperf.lo
    CC libucxperf_la-libperf_memory.lo
    CC libucxperf_la-libperf_thread.lo
    CXX libucxperf_la-uct_tests.lo
    CXX libucxperf_la-ucp_tests.lo
    "/usr/include/sys/platform/ppc.h", line 31: error Add performance testing framework #20: identifier "__builtin_ppc_get_timebase" is undefined
    return __builtin_ppc_get_timebase ();
    ^
    "/usr/include/sys/platform/ppc.h", line 31: error Add performance testing framework #20: identifier "__builtin_ppc_get_timebase" is undefined
    return __builtin_ppc_get_timebase ();
    ^
    1 error detected in the compilation of "ucp_tests.cc".

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

@jchensw which nvhpc version are you using?

I'm using

  1. nvhpc/21.5 2) cudatoolkit/11.4 3) cmake/3.19.7

@dmitrygx
Copy link
Member

dmitrygx commented Nov 3, 2021

@jchensw could you try the latest state of the PR, pls?

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

I did a fresh start:
1066 18:40 git clone https://github.com/openucx/ucx.git
1067 18:40 cd ucx
1071 18:40 git remote add dmitrygx https://github.com/dmitrygx/ucx.git
1072 18:40 git fetch dmitrygx
1074 18:40 git checkout dmitrygx/topic/ucm/bistro_ppc_fix
1076 18:41 ./autogen.sh
1078 18:49 ./contrib/configure-release --prefix=pwd/build/test
1080 18:51 make -j8 install

and I'm still getting the same error:

Making install in lib
make[2]: Entering directory '/home/jinchen/TEST/ucx/src/tools/perf/lib'
CC libucxperf_la-libperf.lo
CC libucxperf_la-libperf_memory.lo
CC libucxperf_la-libperf_thread.lo
CXX libucxperf_la-uct_tests.lo
CXX libucxperf_la-ucp_tests.lo
"/usr/include/sys/platform/ppc.h", line 31: error #20: identifier "__builtin_ppc_get_timebase" is undefined
return __builtin_ppc_get_timebase ();
^
"/usr/include/sys/platform/ppc.h", line 31: error #20: identifier "__builtin_ppc_get_timebase" is undefined
return __builtin_ppc_get_timebase ();
^
1 error detected in the compilation of "ucp_tests.cc".

@jchensw
Copy link
Author

jchensw commented Nov 3, 2021

Should I try #7620?

@dmitrygx
Copy link
Member

dmitrygx commented Nov 4, 2021

@jchensw we got an answer from nvc++ compiler folks that it doesn't fully support some built-ins, especially on PPC.
can you pls use gcc/clang instead?

@wlepera
Copy link

wlepera commented Nov 4, 2021

fyi, this is my build config (from the tail of the configure output):

configure: =========================================================
configure: UCX build configuration:
configure:         Build prefix:   /smpi_dev/lepera/ucx_7618a/install
configure:    Configuration dir:   ${prefix}/etc/ucx
configure:   Preprocessor flags:   -DCPU_FLAGS="" -I${abs_top_srcdir}/src -I${abs_top_builddir} -I${abs_top_builddir}/src
configure:           C compiler:   gcc -O3 -g -Wall -Werror -funwind-tables -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
configure:         C++ compiler:   g++ -O3 -g -Wall -Werror -funwind-tables -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
configure:         Multi-thread:   disabled
configure:         NUMA support:   enabled
configure:            MPI tests:   disabled
configure:          VFS support:   no
configure:        Devel headers:   no
configure: io_demo CUDA support:   no
configure:             Bindings:   < >
configure:          UCS modules:   < >
configure:          UCT modules:   < ib rdmacm cma knem >
configure:         CUDA modules:   < >
configure:         ROCM modules:   < >
configure:           IB modules:   < >
configure:          UCM modules:   < >
configure:         Perf modules:   < >
configure: =========================================================

@jchensw
Copy link
Author

jchensw commented Nov 4, 2021

Thanks. gcc works.

@dmitrygx
Copy link
Member

dmitrygx commented Nov 4, 2021

Thanks. gcc works.

thanks for confirming it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants