-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
AIX 7.1 with GCC/GFortran - Issue needing resolution #1803
Comments
Output/error/config.h/Makefile.conf as was requested in the other issue. Please let me know if you need anything else. |
Is there a specific reason why you would want to build 0.2.20 (which predates the fixes mentioned at the end of #463 ? Latest stable release is 0.3.3, you could also try a snapshot of the current "develop" branch.(And OSNAME gets defined by the c_check utility based on the output of gcc -E) |
I got 0.2.20 from this page - http://www.openblas.net - which I now realize is clearly no longer being maintained. I will pull the latest version and try. Will update this accordingly. Also, did try |
Sorry, |
Thank you. I confirmed that it recognize OS_AIX, and interestingly enough ARCH_POWER, not POWER8, even though prtconf indicates that Processor Type is PowerPC_POWER8. So I tried:
It went in a different direction, and produced the following message: zblat3.f:1447:0: Warning: 'REALPART_EXPR ' may be used uninitialized in this function [-Wmaybe-uninitialized] Results: 32bitcompile.zip I also tried:
Got thrown with a whole bunch of this: ar: 0707-126 dlasd3.o is not valid with the current object file mode. Results: 64bitcompile.zip I will grab the latest dev package after lunch, and will also investigate both results closely then to hopefully find a workaround. Hopefully this is something that have already been seen somewhere else. |
zblat ... undefined symbol 0707-126 ...
EDIT: it seems that gcc does not add -X32_64 option so AIX ar does not work. There are no AIX-specific fixes between 0.3.3 and develop, you can stay with release until any fix is posted in relation with this issue. |
Re: make clean: 364 vi error.txt I will look into whether we're referencing the right ar or even if we have a copy installed, and update this accordingly. |
I see one in AIX RPM collection. Probably you need to prepend that bin/ path so that GNU tools override AIX ones. |
At least in theory, identification of ARCH_POWER should lead to a call to cpuid_power that returns TARGET=POWER8, so specifying TARGET=POWER on the command line should not be necessary (and might even be detrimental). Unfortunately #463 was just lots of back and forth with the original poster leaving as soon as we got it to build "somehow", but the -X 64" argument to IBM ar should already be generated by Makefile.power. |
There is $CC invoked at the end twice, to link final shared library and to run linktest. |
From your logs it looks as if |
I can confirm that with the 0.3.3 release, the -x 64 issue is all properly resolved, so I did not need to do any modification to the Makefile.system. I installed binutils, and ran the following commands: $ export PATH=/opt/freeware/bin:$PATH This to trigger the use of GNU ar. $ make clean This threw an error for ar: ar -X 32 -ru ../libopenblas_power5p-r0.3.3.a saxpy.o sswap.o scopy.o sscal.o [blahblahblah] So whitespace between -X and the digit are verboten for this particular AR install. Version: $ ar -V I am digging around to find out where the -X 32 is triggered, and see if I can fix the whitespace myself. As I just wrote this, Martin responded with the fix which I addressed, and tried make again. Unfortunately, I still have to use FC=gfortran, as xlF is continued to be referenced to. So in summary, things that AIX needs that I have identified so far:
And it failed here: ranlib ../../libopenblas_power5p-r0.3.3.a Logs: 2-32bitcompile.zip Running BINARY=64 option after cleaning. |
What does |
I did a which ranlib which shows it's still referring to $ ranlib libopenblas_power5p-r0.3.3.a Then I looked into /opt/freeware/bin/ and discovered there's several ranlib files: $ ls -1 |grep ranlib granlib was set as read only, so I changed the permission to 755, and it rans: $ granlib libopenblas_power5p-r0.3.3.a So we need to update the makefiles to point to granlib, NOT ranlib, on AIX if using GNU programs (gcc/gfortran/gnu make, et cetera). I am currently investigating how to do this. |
It could be that you just need to set RANLIB=/opt/freeware/bin/granlib (however things will get complicated if granlib does not have execute permissions by default). |
https://www.unix.com/aix/116056-ar-0707-126-a.html |
Okay, I tried the following: $ make FC=gfortran RANLIB=granlib 1>result.txt 2>error.txt (running with PATH including /opt/freeware/bin first and using granlib and gnu ar) $ /opt/freeware/bin/make FC=gfortran 1>result.txt 2>error.txt (Running with default PATH, and using AIX ranlib and AIX ar). I need to check out for the day, but will investigate the first run closely tomorrow morning - it's spitting something about collect2 not seeing the .so file as a COFF file: collect2: fatal error: ../libopenblas_power5p-r0.3.3.a: not a COFF file Many thanks for the assistance you two have given me today on this. Made a lot of progress, and hopefully will have a working solution SciPy like tomorrow. |
Could be that the GNU binutils create an ELF archive and you are invoking the AIX ld in the last step, |
Current command line (with PATH setting to /opt/freeware/bin for the GNU stuff first):
I did the following command: $ gld libopenblas_power5p-r0.3.3.a and $ ld libopenblas_power5p-r0.3.3.a Time for me to crack out that google skills to figure out this error which still shows: collect2: fatal error: ../libopenblas_power5p-r0.3.3.a: not a COFF file |
gld error means that it fails to find some startup code (or more likely lacks LDFLAGS that would tell it where to get it from). ld error suggests that AIX ld can only handle its own variant of the COFF format and GNU ar produced something else (which is why I suggested trying to use the AIX ar one more time). Most google hits I found were at least ten years old and at best referred to some switch to a "large" format that broke archive compatibility between AIX 4.3 and earlier. Typical hits tend to be question only, the best I got was in the GCC installation document https://gcc.gnu.org/install/specific.html#x-ibm-aix where it states that "large" format allows both 32 and 64bit objects (so possibly what -X32_64 does) and one could use the "-g" option with ar to make it write the original, 32bit files only format. |
Probably @TeejIBM would need to copy full gld line. |
Guessing that we are at the "static :" target in exports/Makefile, this would appear to be |
I apologize for the radio silence. We continued to have issues with this particular package. With the advice of someone else within IBM, I was able to get lapack/BLAS to install successfully from the source with the following instruction: That worked for us. I do not know if the information provided is relevant here. When we find some time (dealing with deadlines here), we will circle back to this to try to close the loop on this. Is there a way to set a reminder for this? |
So if I read that thread correctly, you opted to go with the unoptimized netlib reference implementation of both BLAS and LAPACK instead, at least for now ? (This is also what OpenBLAS uses for - most of - its LAPACK component, but clearly the build system and dependencies are simpler with a fortran-only package). |
Okay, sorry for the delay. There turns out to be a need for 64 bit version of BLAS required for SciPy on AIX, and the BLAS/LAPACK are giving me issues in 64 bit compilation (missing pointers in shared object files). Back to OpenBLAS, then. I have replicated it on a new environment (same AIX 7.1), and ran this:
Because if I didn't I would get this:
Then I ran this:
And I got the same error:
See attached.
I am not quite sure what to do regarding the |
Perhaps try adding |
That produced this:
DuckDuckGo yielded absolutely nothing for that error message. Google did not find anything either. Here's the goods: |
Did you have binutils rpm installed ? If that is the case, please uninstall it and do a clean build. |
can you examine .a file with "file" command? Could you run PS One may record command outputs with |
Probably best to follow ayappanec's suggestion and try with the AIX ld again. (I am not even sure |
Err, I guess I should have looked at the code before mentioning this - cpuid_power.c just does a quick and dirty "return CPUID_POWER5" on AIX without bothering to find out the actual cpu model. |
Seems the AIX version of |
It is similar but different.... |
...and even bsdinstall does not understand the |
Okay, please let me know what I need to modify, so we can verify on our end, so you can complete your defect on this too. |
Tentative solution in #1845 |
Hopefully resolved by #1849 now. (Still might want to look at cpu identification under AIX, though perhaps for your case a POWER5 - and presumably "up" - library is more appropriate than one that requires POWER8, at least as long as OpenBLAS does not have "dynamic_arch" cpu support on all platforms ? |
@TeejIBM May be it's late but let me explain some common stuffs which one has to do for any opensource software build in AIX. |
@ayappanec - I am indeed setting /opt/freeware/bin first in my path. However, due to lack of knowledge and experience, I have not installed coreutils, findutils, automake, or autoconf (or anything else) for that matter. It would be great if there is a single core guideline for non-sysadmins like myself to gain a better insight on the recommended course of actions for installation. Note: This will have to be described in a non-internet-accessible manner, as our production servers are still being firewalled. Part of my task involves documenting for our sysadmins to follow and set up environments for us in the future, including those production servers, so references I can send them to would be wonderful. I will check on the the #1849 fix in a moment. |
Okay, one more issue:
This is because on AIX, all shared object files ends in .a, not .so. My quick and dirty fix:
Obviously, this is not the best way to do this. Will have to do an
I need to test this to confirm everything is behaving correctly by installing NumPy and SciPy. |
Okay, this may be getting out of bound in term of what this team could do to help me. However, I would like to give it a shot and see if anyone have an answer. Installing Numpy 1.15.3 using the script - I tweaked the site.cfg file to enable OpenBLAS. Then I did a In addition, even after
In addition, when doing an install of Scipy using numpy.distutils.system_info.NotFoundError: no lapack/blas resources found So, I am confused, is OpenBLAS successfully installed? How can I verify this outside Numpy/Scipy? Thank you for all the help you've done for us. |
In the numpy config.txt I think it found OpenBLAS initially, but then it apparently found an unrelated liblapack in /usr/lib64 (netlib reference implementation from your earlier build probably ?), and it did not find the OpenBLAS-provided cblas.h as it did not search /opt/OpenBLAS/include for headers. |
The clue on the /usr/lib64 actually solved a lot of the messy messages, and it narrowed down to ld not being able to spot certain references. Particularly:
I wonders if I need to just go ahead and install coreutils, et al that @ayappanec recommended even though I do not understand how it relates to this at this time. Updated output: Edit: Output from the requested command:
Note: I changed |
logf and lroundf are probably in libgfortran (or its companion libquadmath), the various omp functions are in libgomp (GNU OpenMP) or whatever other implementation of OpenMP you have available. |
libgomp is available in AIX Toolbox |
I can confirm that libgomp-6.3.0-1.aix7.1.ppc.rpm is already installed:
|
Doing |
Update: Found a way, just update CC env var to the proper settings (
Performance seems to be unchanged:
Pip_64 installation of SciPy failed with same error as NumPy, so looks like I will have to do the same thing for SciPy too. Will do that tomorrow morning. Got a family to take care of. |
Okay, with further tests and work (several issues were found with Numpy and Scipy and reported (or will be reported)) - I believe that OpenBLAS is mostly ready for AIX, except for the fix I noted in this update - #1803 (comment) - where Might also want to consider another ticket on pointing to the right Power CPU -- I am willing to be the guinea pig for this, if it help optimize the performance for OpenBLAS. Thank you so much for the help you have given us on this! |
The fix for Makefile.system is merged now; an untested solution for the cpu detection is now in #1868 |
Thank you for the head up. I will stand by for the time being before I need to remake this. I presume that we can go ahead and remake it without having to remake any dependents downstream, so this is a fairly simple task for us to do. BTW, if your timeline for 0.3.4 is by end of November, we can just absorb that then and rebuild with the Makefile.rule set (unless a fix is provided for that). |
Closing as all the fixes required for building are in 0.3.4, and any remaining issues with installation can be handled in #1896 |
I did review Issue 463.
I set up everything using the packages provided here. This includes the makefile, GCC and GFortran for AIX 7.1, Python 2.7, and so on. My objective is to get OpenBLAS set up to get SciPy module working (due to Lapack/BLAS dependency) for Python 2.7.
I updated Makefile.system to comment out the -m32/-m64 as noted in Issue 463:
#ifndef BINARY_DEFINED
#ifdef BINARY64
#CCOMMON_OPT += -m64
#else
#CCOMMON_OPT += -m32
#endif
#endif
I ran this:
/opt/freeware/bin/make FC=gfortran TARGET=POWER8 >result.txt 2>error.txt
But in the error.txt, I get this:
Assembler:
/home/fp/OpenBLAS-0.2.20/tmp/cc7zjwrP.s: line 71: Error In Syntax
/home/fp/OpenBLAS-0.2.20/tmp/cc7zjwrP.s: line 72: invalid opcode or pseudo-op
/home/fp/OpenBLAS-0.2.20/tmp/cc7zjwrP.s: line 73: Error In Syntax
/home/fp/OpenBLAS-0.2.20/tmp/cc7zjwrP.s: line 100: Error In Syntax
/home/fp/OpenBLAS-0.2.20/tmp/cc7zjwrP.s: line 101: Error In Syntax
make[1]: *** [Makefile.L1:622: sasum_k.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Assembler:
/home/fp/OpenBLAS-0.2.20/tmp/ccVmE6OQ.s: line 63: Error In Syntax
/home/fp/OpenBLAS-0.2.20/tmp/ccVmE6OQ.s: line 64: invalid opcode or pseudo-op
/home/fp/OpenBLAS-0.2.20/tmp/ccVmE6OQ.s: line 65: Error In Syntax
/home/fp/OpenBLAS-0.2.20/tmp/ccVmE6OQ.s: line 85: Error In Syntax
/home/fp/OpenBLAS-0.2.20/tmp/ccVmE6OQ.s: line 86: Error In Syntax
make[1]: *** [Makefile.L1:667: scopy_k.o] Error 1
make: *** [Makefile:139: libs] Error 1
How exactly should I address this?
As an aside, how exactly should $(OSNAME) get defined, so this would be correctly set:
ifeq ($(OSNAME), AIX)
BINARY_DEFINED = 1
endif
The text was updated successfully, but these errors were encountered: