Skip to content
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

The parser generates lines that are not standard compliant (too long) #12

Open
simonrp84 opened this issue Nov 1, 2018 · 13 comments
Open
Assignees
Labels

Comments

@simonrp84
Copy link
Collaborator

The parser for the pre-processor has a habit of generating lines that are substantially longer than the fortran standard allows. This should be corrected.
For example:
GF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 30)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 30)
PGF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 34)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 34)
PGF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 38)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 38)
PGF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 42)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 42)
PGF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 44)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 44)
PGF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 50)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 50)
PGF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 54)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 54)
PGF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 58)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 58)
PGF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 62)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 62)
PGF90-S-0285-Source line too long (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 130)
PGF90-S-0023-Syntax error - unbalanced parentheses (/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f_pri.inc: 130)
0 inform, 0 warnings, 20 severes, 0 fatal for print_ctrl
../common/Makefile_struct_parser:69: recipe for target '/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f.o' failed
make[1]: *** [/media/eum/MAIN/ORAC/orac/obj/read_ctrl.f.o] Error 2
make[1]: Leaving directory '/media/eum/MAIN/ORAC/orac/src'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2

@adamcpovey
Copy link
Collaborator

How urgently do you need that fixed? I tried to get around that problem when I first wrote it and there was no straightforward solution.

@simonrp84
Copy link
Collaborator Author

It's fairly urgent, to be honest - the generated files have to be manually edited every time that part of ORAC is recompiled, which takes a lot of time.

@simonrp84
Copy link
Collaborator Author

I have hacked a fix by using an external python script, which I can make available to others if needed. I will not commit it, though, as it's not a proper solution (I still have to manually edit the parser-generated code).

@gmcgarragh
Copy link
Collaborator

Is this because you are using pgf90? I can't imagine that there is not a compiler option you can use to extend the line length to unlimited.

@simonrp84
Copy link
Collaborator Author

simonrp84 commented Nov 15, 2018

Unfortunately pgfortran has a hard limit on the line length. It can be expanded (to 232 characters I think) with a compiler option but the limit cannot be removed all together.

@gmcgarragh
Copy link
Collaborator

I feel responsible as read_ctrl.f_pri.inc is for the printing support that I added and the lines are going out to 320. Essentially all that is needed is a wrapper for fprintf() that wraps lines to a specified width. Adam, is this not the right solution? I will volunteer to do this unless Adam feels especially bored.

@adamcpovey
Copy link
Collaborator

Oh, is that all that's wrong? I thought this was related to warnings about excessively long variable names, which would have been complicated.

If it's just line length, go ahead and add a wrapper! I'm the opposite of bored atm.

@gmcgarragh
Copy link
Collaborator

OK, will go ahead and do.

@simonrp84
Copy link
Collaborator Author

Thanks both, that'd be great.

@simonrp84
Copy link
Collaborator Author

Interestingly, the latest version of the PGI compilers (18.10, release last Friday) now support line lengths up to 1000 characters. That means that the problem in this bugreport is 'solved', or at least no longer a problem, compilation is successful out-of-the-box on the 18.10 build.

If you still want to fix this problem then feel free, otherwise just close.

@simonrp84
Copy link
Collaborator Author

I presume that no-one is bothered about this?

@adamcpovey
Copy link
Collaborator

Greg's fix doesn't sound too complicated but I'm not that fussed.

@simonrp84
Copy link
Collaborator Author

If it's easy then let's do it, will save problems if anyone is using a legacy compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants