 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
HaymoKutschbach
Joined: 16 Mar 2012 Posts: 13
|
Posted: Fri Mar 16, 2012 5:36 pm Post subject: Error: ',' found where ')' was expected |
|
|
I am evaluating the FTN95 .NET compiler and got very promising results. Unfortunately I am not able to get around the following error message:
CALL CLA_HERFSX_EXTENDED( PREC_TYPE, UPLO, N,
$ NRHS, A, LDA, AF, LDAF, IPIV, RCEQU, S, B,
$ LDB, X, LDX, BERR, N_NORMS, ERR_BNDS_NORM, ERR_BNDS_COMP,
$ WORK, RWORK, WORK(N+1),
$ TRANSFER (RWORK(1:2*N),DATA / (ZERO, ZERO) /, N), RCOND,
$ ITHRESH, RTHRESH, UNSTABLE_THRESH, IGNORE_CWISE,
$ INFO )
Error: ',' found where ')' was expected E:\dev\lapack-3.4.0\SRC\zgbrfsx.F
Its a piece of netlibs Lapack. Any idea? |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Sat Mar 17, 2012 10:44 am Post subject: |
|
|
Hi HaymoKutschbach
There are two issues here (I think).
First, I think there used to be an issue with TRANSFER and complex values in FTN95 but this works in the latest version so make sure you have an up to date copy (6.2 is the latest).
Second, the syntax in your code is not correct.
TRANSFER (RWORK(1:2*N),DATA / (ZERO, ZERO) /, N)
should be
TRANSFER (RWORK(1:2*N), (/ (ZERO, ZERO) /) , N)
All this does is copy the values in RWORK two at a time to a temporary array of complex values, which is passed to the subroutine in your example.
I had a quick look at the documentation for LAPACK and the call looks like mine in the Documentation. See the link below and scroll to line 600.
http://www.netlib.org/lapack/explore-html/d7/de8/cherfsx_8f_source.html
You may have changed the source code. Any original error you were getting is almost certainly due to you using an older version of FTN95.
David. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
HaymoKutschbach
Joined: 16 Mar 2012 Posts: 13
|
Posted: Mon Mar 19, 2012 9:32 pm Post subject: |
|
|
Thanks davidb!
you are right: I changed the code, trying to circumvent the (/ extension. It didn't work out and I accidently posted the wrong example code. Sorry.
Unfortunately, the correct code does not compile either and produces the same error.
Now I try to find out the version I have installed. Where do I find a version information? I downloaded the personal edition from this website:
http://silverfrost.com/32/ftn95/ftn95_personal_edition.aspx only a couple of days ago. Did I miss something?
(Offtopic: It appears, the forum email notifications are not working?) |
|
Back to top |
|
 |
HaymoKutschbach
Joined: 16 Mar 2012 Posts: 13
|
Posted: Mon Mar 19, 2012 10:16 pm Post subject: |
|
|
The file version of ftn95.exe installed is 6.2.0.0. Last change: 2011-11-19.
Any hints? Thanks in advance. It seems to be the only error so far which is pretty impressive. But nevertheless, this could be a showstopper ... I hope, I overlooked something? |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Wed Mar 21, 2012 4:51 pm Post subject: |
|
|
It could be a specific problem with compiling for .NET
I have successfully compiled LAPACK for windows 32 using FTN95 (I don't use .NET so haven't tried to compile for it).
Can you post some simple code which includes the call but doesn't compile, then the people at Silverfrost can take a look at it? _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Mar 21, 2012 5:57 pm Post subject: |
|
|
If you post the corrected version of your code we might be able to comment on it. |
|
Back to top |
|
 |
HaymoKutschbach
Joined: 16 Mar 2012 Posts: 13
|
Posted: Wed Mar 21, 2012 6:26 pm Post subject: |
|
|
Here comes the original code. It compiles with GCC:
CALL CLA_GERFSX_EXTENDED( PREC_TYPE, TRANS_TYPE, N,
$ NRHS, A, LDA, AF, LDAF, IPIV, COLEQU, C, B,
$ LDB, X, LDX, BERR, N_NORMS, ERR_BNDS_NORM,
$ ERR_BNDS_COMP, WORK, RWORK, WORK(N+1),
$ TRANSFER (RWORK(1:2*N), (/ (ZERO, ZERO) /), N),
$ RCOND, ITHRESH, RTHRESH, UNSTABLE_THRESH, IGNORE_CWISE,
$ INFO )
The code is part of the official netlib LAPACK distribution (netlib.org). The example above comes from the file cgerfsx.f and marks one of 15 places, where this error occours as well. They all relate to a similar function call.
Here comes the declaration part of the called function:
SUBROUTINE CLA_GERFSX_EXTENDED( PREC_TYPE, TRANS_TYPE, N, NRHS, A,
$ LDA, AF, LDAF, IPIV, COLEQU, C, B,
$ LDB, Y, LDY, BERR_OUT, N_NORMS,
$ ERRS_N, ERRS_C, RES, AYB, DY,
$ Y_TAIL, RCOND, ITHRESH, RTHRESH,
$ DZ_UB, IGNORE_CWISE, INFO )
*
* -- LAPACK computational routine (version 3.4.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
* November 2011
*
* .. Scalar Arguments ..
INTEGER INFO, LDA, LDAF, LDB, LDY, N, NRHS, PREC_TYPE,
$ TRANS_TYPE, N_NORMS
LOGICAL COLEQU, IGNORE_CWISE
INTEGER ITHRESH
REAL RTHRESH, DZ_UB
* ..
* .. Array Arguments
INTEGER IPIV( * )
COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
$ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * )
REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ),
$ ERRS_N( NRHS, * ), ERRS_C( NRHS, * )
* ..
The full code is somehow lengthy. But I can post it here as well for reference if you need it. Thanks! |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Mar 21, 2012 9:06 pm Post subject: |
|
|
You still have unexpected brackets. The following code does compile but may not do anything sensible...
Code: | REAL RWORK(100)
CALL CLA_GERFSX_EXTENDED( PREC_TYPE, TRANS_TYPE, N,
$ NRHS, A, LDA, AF, LDAF, IPIV, COLEQU, C, B,
$ LDB, X, LDX, BERR, N_NORMS, ERR_BNDS_NORM,
$ ERR_BNDS_COMP, WORK, RWORK, WORK(N+1),
$ TRANSFER (RWORK(1:2*N), (/ ZERO, ZERO /), N),
$ RCOND, ITHRESH, RTHRESH, UNSTABLE_THRESH, IGNORE_CWISE,
$ INFO )
END |
|
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Wed Mar 21, 2012 10:41 pm Post subject: |
|
|
Paul, your sample code just needs WORK to be declared as an array and then it is fine, just a little quirky!
I can compile this for win 32 and .net with no errors.
I also downloaded and succesfully compiled CGERFSX for .NET, so I don't know what is wrong for the OP. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
HaymoKutschbach
Joined: 16 Mar 2012 Posts: 13
|
Posted: Fri Mar 23, 2012 3:29 pm Post subject: |
|
|
Removing the parentheses around
(ZERO, ZERO)
from the TRANSFER arguments will make it compile without errors. But the output will not be complex which is what is needed according to the subroutine definition. So I changed the expression to this:
(/ cmplx(0) /) and this works as expected.
@davidb: have you been able to compile the full LAPACK package without any manual change to the code? With the brackets mentioned above, compiling for .NET still gives compilation errors here?
Since there are only 15 places, changing them manually is not a big deal. But in order to automate the conversion process for future updates, it would be great to get around this anyhow? |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Sun Mar 25, 2012 12:26 pm Post subject: |
|
|
I should first say that I do not use .net, but I am puzzled why the need for TRANSFER in an argument list.
You could simply replace
TRANSFER (RWORK(1:2*N),DATA / (ZERO, ZERO) /, N),
with
RWORK
as all that is expected in a fortran argument list is the address of each argment.
If, for .net, there is also the need for the argument to be a complex array, then why not use
COMPLEX CWORK(100)
then replace the TRANSFER(... with
CWORK
I do not know of the routine CLA_HERFSX_EXTENDED to know of the argument relationship.
I am surprised to see TRANSFER in the argument list and would not expect the type and size of the array to be interpreted by Lapack in this "fortran 90" way.
John |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Mon Mar 26, 2012 5:58 pm Post subject: |
|
|
I have not had time to try compiling LAPACK for .NET. It does compile for win32.
If I get time I will try and compile the full library for .NET at the weekend.
I think it is likely there is an issue with the compiler under .NET which might be able to be fixed. But we will need to find a simpler code example that makes the error more obvious.
Meanwhile, the OP has a workaround. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|