Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUBST/DSUBST

Status
Not open for further replies.

ns2455

Technical User
Oct 2, 2012
3
US
Hi,

I am new to FORTRAN and trying to debug/compile some code passed on to me.
2 questions:

- What purpose does SUBST or DSUBST serve?
- When I run my Makefile I keep getting the following error:
'PGF90-S-0026-Unmatched quote'
According to the PG manual this translates to 'Integer constant is too large for 32 bit word'
I have tried a bunch of different things but the issue is still unresolved. Any insight on this?

Thanks!
 
Can you show us the lines of the makefile that are causing the error?

subst is a GNU make feature for substituting one sequence with another. Some of the makefiles in other systems may implement it but you have to check the documentation. No idea what dsubst does. Where did the original source come from? Was it a GFortran project that you are converting to PGI Fortran?

Code:
srcstr:= [COLOR=red]abr[/color]
dststr:= [COLOR=blue]n[/color]
src:= ba[COLOR=red]abr[/color]a[COLOR=red]abr[/color]a
dst:= $(subst $(srcstr),$(dststr),$(src))
# dst is now ba[COLOR=blue]n[/color]a[COLOR=blue]n[/color]a

 
'PGF90-S-0026-Unmatched quote'
According to the PG manual this translates to 'Integer constant is too large for 32 bit word'

These two lines do not sound compatible to me.
From the message itself I would take a guess that there is a typo in your code in that you skipped one quote like

cText = 'abcde

which should be

cText = 'abcde'

Maybe what the manual says is a secondary error. As the text is not closed by the second quote it may not be recognised as such. If it then has more than 4 letters, then a 32 bit word would not be sufficient to save it completely. But I would look for a missing quote in your code as above.

Norbert


The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
Thanks for the tips, I understand better the purpose of subst.

Norbert, I got confused in the manual and the description actually refers to the error code below the one I was looking for, they were bunched up together.
Sounds like there should be missing quotes, have been going over the code to find them, still no luck. Will keep looking.

Thanks!
 
Are you using fixed format fortran ?
Then the closing quote might be behind col. 72 and in that truncated from the line. Effect is, you see the quote in your code but it is not recognised by the compiler. Nasty thing, this bug.

Don't you get a line number with the rrror message ?

Norbert


The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
Hey!

Fixed the problem. It was an inconsistency with the capitalization with the .f and corresponding .o file. So it wasn't reading the -Mextend flag.

Thanks all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top