From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041111 Firefox/1.0 Description of problem: Compiler optimizations make blas generate wrong results in at least one function, izamax. When compiling with -O0, correct results are generated, but anything above -O1 makes izamax behave slightly differently than it should. Version-Release number of selected component (if applicable): blas-3.0-25 How reproducible: Always Steps to Reproduce: 1. Download the official testing program: http://www.netlib.org/blas/zblat1 and save it to zblat1.f. 2. Compile the testing program and link with libblas: g77 -o zblat1 zblat1.f -lblas 3. Run the test: ./zblat1 Actual Results: Complex BLAS Test Program Results Test of subprogram number 1 ZDOTC ----- PASS ----- Test of subprogram number 2 ZDOTU ----- PASS ----- Test of subprogram number 3 ZAXPY ----- PASS ----- Test of subprogram number 4 ZCOPY ----- PASS ----- Test of subprogram number 5 ZSWAP ----- PASS ----- Test of subprogram number 6 DZNRM2 ----- PASS ----- Test of subprogram number 7 DZASUM ----- PASS ----- Test of subprogram number 8 ZSCAL ----- PASS ----- Test of subprogram number 9 ZDSCAL ----- PASS ----- Test of subprogram number 10 IZAMAX FAIL CASE N INCX INCY MODE COMP TRUE DIFFERENCE 10 4 1 9999 9999 3 2 1 10 4 2 9999 9999 3 2 1 Expected Results: Complex BLAS Test Program Results Test of subprogram number 1 ZDOTC ----- PASS ----- Test of subprogram number 2 ZDOTU ----- PASS ----- Test of subprogram number 3 ZAXPY ----- PASS ----- Test of subprogram number 4 ZCOPY ----- PASS ----- Test of subprogram number 5 ZSWAP ----- PASS ----- Test of subprogram number 6 DZNRM2 ----- PASS ----- Test of subprogram number 7 DZASUM ----- PASS ----- Test of subprogram number 8 ZSCAL ----- PASS ----- Test of subprogram number 9 ZDSCAL ----- PASS ----- Test of subprogram number 10 IZAMAX ----- PASS ----- Additional info: The problem lies with the dcabs1.f file. If only this file is compiled with -O0, then the results are correct even with optimization. The izamax routine searches a double-precision complex vector for the item with the largest absolute value and returns its index. The two cases that fail do so because of a comparison of (0.1,0.4) with (0.4,0.1). The unoptimized version returns the index of the number that comes first in the vector while the optimizations cause the index of the last one to be returned instead. By looking at the code, I can say that the correct behavior is indeed to return the first occurrence. This is a compiler bug and should be forwarded as such. However, a quick fix could be to compile dcabs1.f without optimizations.
Thank you for your notice. The problem was fixed. Ivana Varekova
could you please release this as an update ? without proper lapack libraries Fedora Core becomes useless for numerical calculations.
Thank you for your notice. Solved with -28, closing now.