You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compilation with target POWER8 fails in AIX 7.2 #1997
What does as --version return on that system ? (The most recent change to that file only replaced some comparison mnemonics so if there is anything problematic about the constraints it must have been in the code for the past eleven months already. Before that, the KERNEL.POWER8 file used to point to the generic C implementations of the two functions, i.e. ..arm/idamin.c and ../arm/idamax.c)
We are using AIX native assembler & linker and not GNU assembler and linker.
The reason being GNU assembler & linker is not ported well in AIX and it has issues.
And i am thinking most likely nobody would have tried AIX build (with TARGET=POWER8).
That issue mainly targets the problem with XLC compiler.
In this case, i use GCC compiler (version 8.1.0) and AIX native assembler & linker.
From a high level view, it looks like the error seems to be coming from gcc compiler (and not from the assembler itself) . But may be it's internally related ?
If it was gcc then I think @quickwritereader would have encountered the problem already(?).
Can you try changing the entries for IDAMINKERNEL and IDAMAXKERNEL in kernel/power/KERNEL.POWER8 so that they point at the generic C kernels ../arm/idamin.c and ../arm/idamax.c ,
just to see if any similar errors pop up with the other kernel files ?
I don't have any idea of that issue. gcc 7.2 did not complain when I used it.
If problem will not be handled by small modification and those kernels are in demand I could try to supply vector c version too
With the above mentioned changes, compilation proceeded further and finally stops with an assembler error. Debugging the error reveals that this instruction "xxswapd" is not understandable by AIX assembler.
After some searching , it appears to me that this instruction is used to convert BIG-ENDIAN word format to LITTLE-ENDIAN format. And AIX being a BIG-ENDIAN , it may not need this. So i am thinking to remove this line from all the files.
This could point to a bigger problem unfortunately. Actually I am not sure about the status of Power8BE support - I suspect all the recent work by quickwritereader was done on and for LITTLE-ENDIAN systems.
Actually looking at the code, the "xxswapd" instruction is used only in the older Power8 kernels written by wernsaar and only some of them have any if defined(AIX) - notably not those which use xxswapd.
Okay. Not sure why AIX assembler couldn't able to recognize "xxswapd" . May be the implementation is not there ? Will check with the AIX assembler guys.
Try to prepend gnu binutils in path. Or if you have idea about other assembler(s) around.
gcc may be only generating input that is correct only for its own backend (that is even outside openblas asm blocks)
I am trying to create a shared object in AIX using the library archive "libopenblas_power6p-r0.3.5.a" .
In linux , this is done in the Makefile using this linker option "--whole-archive". AIX linker won't understand this option so i went ahead with creating a export file using the "CreateExportList" utility from xlc. But then realized that some symbols are ignored and that cause problems while compiling scipy. Exploring other options.
Any ideas ?
Aix ld manual says it defaults to linking in all unique symbols from command line archives unless told otherwise. It is in local manual page just like in one ifound on the internet.
FYI, there is a similar segfault error as reported above
I took a different approach.
Tried building with TARGET=POWER8 in RHEL 7.4 Power8 Big-Endian machine to confirm whether it works there or not. It failed at this point.
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0x3fff95befab7 in ??? #1 0x3fff95ce0477 in ??? #2 0x100832a8 in ??? #3 0x100181b3 in ??? #4 0x1000f9c3 in ??? #5 0x10005b87 in dchk3_
at /root/OpenBLAS/OpenBLAS/test/dblat3.f:1059 #6 0x1000e777 in dblat3
at /root/OpenBLAS/OpenBLAS/test/dblat3.f:292 #7 0x10001a5b in main
at /root/OpenBLAS/OpenBLAS/test/dblat3.f:355
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./cblat2 < ./cblat2.dat
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./zblat2 < ./zblat2.dat
rm -f ?BLAT2.SUMM
OMP_NUM_THREADS=2 ./sblat2 < ./sblat2.dat
/bin/sh: line 1: 7779 Segmentation fault (core dumped) OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./dblat3 < ./dblat3.dat
make[1]: *** [level3] Error 139
Then i tried TARGET=POWER7 which fall back to POWER6 and the build is successful. It ran openblas_utest as part of the build and all tests passed.
I tried the same on AIX and the build is successful but openblas_utest is not running as part of the build. Manually invoking it , i don't see any tests run.
./openblas_utest
RESULTS: 0 tests (0 ok, 0 failed, 0 skipped) ran in 0 ms
I now remember that PPC64BE failure was also mentioned in passing in #1469 (RedHat/Fedora), I understood they normally build for POWER6 as least common denominator. This should probably be made the default in the build system for big-endian until the current power8 kernels are modified to work on big endian as well. (Can I rely on uname -m output not having le attached on big endian systems,
or is there a better, more general way to distinguish the two ?)
Aix ld manual says it defaults to linking in all unique symbols from command line archives unless told otherwise. It is in local manual page just like in one ifound on the internet.
I checked it and did some testing. It never worked. It always requires a export file if one needs to create a shared object from an archive containing object files in AIX. If no export file is given, then no symbols are exported. Even checked with the AIX linker team here.
Because of the above situation, i have to depend on scripts like "CreateExportList" to create the export file before in hand. And the AIX specific asm syntax in file common_power.h needs some changes for which i will create a PR.
Activity
martin-frbg commentedon Feb 4, 2019
What does
as --versionreturn on that system ? (The most recent change to that file only replaced some comparison mnemonics so if there is anything problematic about the constraints it must have been in the code for the past eleven months already. Before that, the KERNEL.POWER8 file used to point to the generic C implementations of the two functions, i.e. ..arm/idamin.c and ../arm/idamax.c)ayappanec commentedon Feb 4, 2019
We are using AIX native assembler & linker and not GNU assembler and linker.
The reason being GNU assembler & linker is not ported well in AIX and it has issues.
And i am thinking most likely nobody would have tried AIX build (with TARGET=POWER8).
martin-frbg commentedon Feb 4, 2019
Heh, sorry, did not recognise you right away. I suspect we never hit this in #1803 as TeejIBM kept building for POWER5
ayappanec commentedon Feb 4, 2019
Yes, that's right.
martin-frbg commentedon Feb 4, 2019
Could this be similar to #1699 (AIX native tools apparently not accepting register names "vs") ?
ayappanec commentedon Feb 4, 2019
That issue mainly targets the problem with XLC compiler.
In this case, i use GCC compiler (version 8.1.0) and AIX native assembler & linker.
From a high level view, it looks like the error seems to be coming from gcc compiler (and not from the assembler itself) . But may be it's internally related ?
martin-frbg commentedon Feb 4, 2019
If it was gcc then I think @quickwritereader would have encountered the problem already(?).
Can you try changing the entries for IDAMINKERNEL and IDAMAXKERNEL in kernel/power/KERNEL.POWER8 so that they point at the generic C kernels ../arm/idamin.c and ../arm/idamax.c ,
just to see if any similar errors pop up with the other kernel files ?
quickwritereader commentedon Feb 4, 2019
I don't have any idea of that issue. gcc 7.2 did not complain when I used it.
If problem will not be handled by small modification and those kernels are in demand I could try to supply vector c version too
If anyone have an idea here are constraints
ayappanec commentedon Feb 5, 2019
@martin-frbg There is no idamax.c & idamin.c inside kernel/arm.
martin-frbg commentedon Feb 5, 2019
Indeed these are ../arm/iamax.c and ../arm/iamin.c , sorry.
ayappanec commentedon Feb 5, 2019
With the above mentioned changes, compilation proceeded further and finally stops with an assembler error. Debugging the error reveals that this instruction "xxswapd" is not understandable by AIX assembler.
After some searching , it appears to me that this instruction is used to convert BIG-ENDIAN word format to LITTLE-ENDIAN format. And AIX being a BIG-ENDIAN , it may not need this. So i am thinking to remove this line from all the files.
martin-frbg commentedon Feb 5, 2019
This could point to a bigger problem unfortunately. Actually I am not sure about the status of Power8BE support - I suspect all the recent work by quickwritereader was done on and for LITTLE-ENDIAN systems.
martin-frbg commentedon Feb 5, 2019
Actually looking at the code, the "xxswapd" instruction is used only in the older Power8 kernels written by wernsaar and only some of them have any
if defined(AIX)- notably not those which use xxswapd.ayappanec commentedon Feb 5, 2019
Okay. Not sure why AIX assembler couldn't able to recognize "xxswapd" . May be the implementation is not there ? Will check with the AIX assembler guys.
brada4 commentedon Feb 5, 2019
Try to prepend gnu binutils in path. Or if you have idea about other assembler(s) around.
gcc may be only generating input that is correct only for its own backend (that is even outside openblas asm blocks)
15 remaining items
ayappanec commentedon Mar 12, 2019
I am trying to create a shared object in AIX using the library archive "libopenblas_power6p-r0.3.5.a" .
In linux , this is done in the Makefile using this linker option "--whole-archive". AIX linker won't understand this option so i went ahead with creating a export file using the "CreateExportList" utility from xlc. But then realized that some symbols are ignored and that cause problems while compiling scipy. Exploring other options.
Any ideas ?
brada4 commentedon Mar 12, 2019
Aix ld manual says it defaults to linking in all unique symbols from command line archives unless told otherwise. It is in local manual page just like in one ifound on the internet.
michelmno commentedon Mar 14, 2019
FYI, there is a similar segfault error as reported above
FYI, there is a similar segfault with linux gnu compiler for ppc64(BE) as reported with openSUSE
https://bugzilla.suse.com/show_bug.cgi?id=1129160
does it need another issue ?
ayappanec commentedon Mar 14, 2019
Checked the bugzilla . The stack trace looks similar.
brada4 commentedon Mar 14, 2019
the stack traces need function names. I can just guess 0x1 are program and 0x3f are something else, like vdso style stub or libc or kernel.
martin-frbg commentedon Mar 14, 2019
I now remember that PPC64BE failure was also mentioned in passing in #1469 (RedHat/Fedora), I understood they normally build for POWER6 as least common denominator. This should probably be made the default in the build system for big-endian until the current power8 kernels are modified to work on big endian as well. (Can I rely on
uname -moutput not havingleattached on big endian systems,or is there a better, more general way to distinguish the two ?)
ayappanec commentedon Mar 14, 2019
In AIX , uname -m shows Machine ID number.
From man page,
" Displays the machine ID number of the hardware running the system"
So not a good option. Checking on more generic options.
ayappanec commentedon Mar 14, 2019
How about this ?
gcc -E -dM - </dev/null | grep BIG_ENDIAN
#define __BIG_ENDIAN__ 1 #define __FLOAT_WORD_ORDER__ __ORDER_BIG_ENDIAN__ #define _BIG_ENDIAN 1 #define __VEC_ELEMENT_REG_ORDER__ __ORDER_BIG_ENDIAN__ #define __ORDER_BIG_ENDIAN__ 4321 #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__But this will support only gcc installed systems.
martin-frbg commentedon Mar 14, 2019
Sorry, I assume in AIX Big Endian is a given, so this would matter "only" for Linux (and perhaps any BSD) ?
ayappanec commentedon Mar 14, 2019
Okay. In that case , i think "uname -m" would be sufficient. Not sure about BSD though.
brada4 commentedon Mar 14, 2019
It is somewhere else like sysctl hw
https://www.freebsd.org/cgi/man.cgi?query=uname&sektion=1
ayappanec commentedon Mar 25, 2019
I checked it and did some testing. It never worked. It always requires a export file if one needs to create a shared object from an archive containing object files in AIX. If no export file is given, then no symbols are exported. Even checked with the AIX linker team here.
ayappanec commentedon Mar 25, 2019
Because of the above situation, i have to depend on scripts like "CreateExportList" to create the export file before in hand. And the AIX specific asm syntax in file common_power.h needs some changes for which i will create a PR.
martin-frbg commentedon Dec 9, 2019
This should be fixed now with kavanabhat's #2338