Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compiling with the IBM compiler fails #763

Open
rouson opened this issue Sep 25, 2022 · 3 comments
Open

Compiling with the IBM compiler fails #763

rouson opened this issue Sep 25, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@rouson
Copy link
Contributor

rouson commented Sep 25, 2022

Description

I'm reporting the errors generated by compiling fpm-0.6.0.F90 with the IBM XL Fortran compiler just for informational purposes. I think most or all of the errors are false positives, but I'm not very familiar with edit descriptors so I'm hoping someone else can confirm whether these are bugs in the code or bugs in the compiler. My guess is that these are post-2003 features that the compiler doesn't support. Could someone who recognizes what's going on at the cited lines confirm that the lines are standard-conforming and close this issue?

Expected Behaviour

I expected fpm-0.6.0.F90 to compile.

Version of fpm

0.6.0

Platform and Architecture

AIX

Additional Information

The compilation command and output are below:

$ xlf2003_r -o xlf-fpm fpm-0.6.0.F90 
"fpm-0.6.0.F90", line 228.37: 1513-209 (S) The result of an elemental function must be a nonpointer, nonallocatable scalar, and its type parameters must be constant expressions.
** fpm_strings   === End of Compilation 1 ===
** fpm_backend_console   === End of Compilation 2 ===
"fpm-0.6.0.F90", line 1284.0: 1515-010 (S) String is missing a closing delimiter.  Closing delimiter assumed at end of line.
** tomlf_constants   === End of Compilation 3 ===
** tomlf_version   === End of Compilation 4 ===
"fpm-0.6.0.F90", line 1811.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 1813.23: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 1814.23: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 1815.23: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 2325.33: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 2675.42: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3096.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3143.33: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3146.33: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3157.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3166.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3171.33: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3175.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3196.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3223.14: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3238.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3243.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3249.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3252.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3254.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3267.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3271.20: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3288.20: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3321.23: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3348.20: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3351.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3485.0: 1515-010 (S) String is missing a closing delimiter.  Closing delimiter assumed at end of line.
"fpm-0.6.0.F90", line 3485.31: 1515-019 (S) Syntax is incorrect.
"fpm-0.6.0.F90", line 3486.0: 1515-010 (S) String is missing a closing delimiter.  Closing delimiter assumed at end of line.
"fpm-0.6.0.F90", line 3487.3: 1511-017 (S) ELSEIF statement appears outside of IF block.
"fpm-0.6.0.F90", line 3489.3: 1511-017 (S) ELSE statement appears outside of IF block.
"fpm-0.6.0.F90", line 3494.0: 1515-010 (S) String is missing a closing delimiter.  Closing delimiter assumed at end of line.
"fpm-0.6.0.F90", line 3494.34: 1515-019 (S) Syntax is incorrect.
"fpm-0.6.0.F90", line 3495.0: 1515-010 (S) String is missing a closing delimiter.  Closing delimiter assumed at end of line.
"fpm-0.6.0.F90", line 3496.6: 1511-017 (S) ELSEIF statement appears outside of IF block.
"fpm-0.6.0.F90", line 3498.6: 1511-017 (S) ELSE statement appears outside of IF block.
"fpm-0.6.0.F90", line 3500.0: 1515-010 (S) String is missing a closing delimiter.  Closing delimiter assumed at end of line.
"fpm-0.6.0.F90", line 3514.6: 1511-017 (S) ENDIF statement appears outside of IF block.
"fpm-0.6.0.F90", line 3515.3: 1511-017 (S) ENDIF statement appears outside of IF block.
"fpm-0.6.0.F90", line 3588.0: 1515-010 (S) String is missing a closing delimiter.  Closing delimiter assumed at end of line.
"fpm-0.6.0.F90", line 3588.51: 1515-019 (S) Syntax is incorrect.
"fpm-0.6.0.F90", line 3589.0: 1515-010 (S) String is missing a closing delimiter.  Closing delimiter assumed at end of line.
"fpm-0.6.0.F90", line 3591.7: 1511-017 (S) ELSEIF statement appears outside of IF block.
"fpm-0.6.0.F90", line 3594.7: 1511-017 (S) ENDIF statement appears outside of IF block.
"fpm-0.6.0.F90", line 3598.0: 1515-010 (S) String is missing a closing delimiter.  Closing delimiter assumed at end of line.
"fpm-0.6.0.F90", line 3622.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3716.42: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3743.42: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3761.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 3950.23: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4469.34: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4886.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4894.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4898.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4900.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4926.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4927.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4933.65: 1512-045 (E) The field width specifier 0 for the G data edit descriptor in literal FMT specifier is incorrect. A default value is assumed.
"fpm-0.6.0.F90", line 4935.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4936.34: 1512-045 (E) The field width specifier 0 for the G data edit descriptor in literal FMT specifier is incorrect. A default value is assumed.
"fpm-0.6.0.F90", line 4939.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4942.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4943.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4945.69: 1512-045 (E) The field width specifier 0 for the G data edit descriptor in literal FMT specifier is incorrect. A default value is assumed.
"fpm-0.6.0.F90", line 4945.78: 1512-045 (E) The field width specifier 0 for the G data edit descriptor in literal FMT specifier is incorrect. A default value is assumed.
"fpm-0.6.0.F90", line 4947.30: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4998.67: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 4999.67: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5000.67: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5001.67: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5002.67: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5003.67: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5006.67: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5008.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5009.36: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5010.37: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5011.67: 1512-053 (E) Edit descriptor in literal FMT specifier is invalid and will be ignored.
"fpm-0.6.0.F90", line 5011.75: 1512-045 (E) The field width specifier 0 for the G data edit descriptor in literal FMT specifier is incorrect. A default value is assumed.
"fpm-0.6.0.F90", line 5011.84: 1512-045 (E) The field width specifier 0 for the G data edit descriptor in literal FMT specifier is incorrect. A default value is assumed.
"fpm-0.6.0.F90", 1513-083 (E) Internal or module function sgs was not set within the function.
"fpm-0.6.0.F90", 1513-083 (E) Internal or module function cgs was not set within the function.
"fpm-0.6.0.F90", 1513-083 (E) Internal or module function lgs was not set within the function.
"fpm-0.6.0.F90", 1513-083 (E) Internal or module function dgs was not set within the function.
"fpm-0.6.0.F90", 1513-083 (E) Internal or module function sget was not set within the function.
"fpm-0.6.0.F90", 1513-083 (E) Internal or module function igs was not set within the function.
"fpm-0.6.0.F90", 1513-083 (E) Internal or module function rgs was not set within the function.
** m_cli2   === End of Compilation 5 ===
"fpm-0.6.0.F90", line 7573.9: 1514-219 (S) Unable to access module symbol file for module fpm_strings. Check path and file permissions of file. Use association not done for this module.
1501-511  Compilation failed for file fpm-0.6.0.F90.
@rouson rouson added the bug Something isn't working label Sep 25, 2022
@awvwgk
Copy link
Member

awvwgk commented Sep 26, 2022

Thanks for the report, I don't have an IBM XL installation ready at the moment to check. Could you run fpm on the full source version? I compiled a Linux/ppc64le version for conda-forge already so you don't have to bootstrap.

From the output it looks like M_CLI2 is producing the error. Maybe John @urbanjost has an idea.

@urbanjost
Copy link
Contributor

urbanjost commented Sep 27, 2022

On an IBM (which I no longer have access to; and could not find an online compiler to try some tests) the default is the non-standard treatment of backslash as a C-like escape character. You have to add -qnoescape to get standard behavior. That could easily be coded around by using achar() as well; but the compiler does not yet seem to support the G0 edit descriptor for both input and output, which could be resolved by creating a lot of individual formats and adding some conditional prints or inspecting the arguments to the I/O statements; but it would be a much more extensive change. Are there any newer versions of the compiler that support features past f2003?

The error in the LOWER function is either a compiler bug or a feature added after f2003, I do not remember which; but it would be easy to code around.

The errors reporting function values are not set is a compiler bug (the value is set, but via a call to a subroutine not an assignment statement) that I remember seeing before; it just takes a few lines to create an allocatable string and pass it and then assign the the function name to the value; I think something like setting the attributes in the called procedure to intent(out) or something else fixed that; and maybe using result (NAME) instead of the function name worked around it, but the assignment statement lets the compiler know it really is set.

  1 Error: Fortran 2008: Array specification required in ALLOCATE statement at (1)
  2 Error: Fortran 2008: BLOCK construct at (1)
 14 Error: Fortran 2008: EXIT statement with no do-construct-name at (1)
 45 Error: Fortran 2008: ‘G0’ in format at (1)
  2 Error: Fortran 2008: IMPURE procedure at (1)
  1 Error: Fortran 2008: NEWUNIT specifier at (1)
  2 Error: Fortran 2008: The symbol ‘int16’, referenced at (1), is not in the selected standard
  2 Error: Fortran 2008: The symbol ‘int32’, referenced at (1), is not in the selected standard
  2 Error: Fortran 2008: The symbol ‘int64’, referenced at (1), is not in the selected standard
  2 Error: Fortran 2008: The symbol ‘int8’, referenced at (1), is not in the selected standard
  2 Error: Fortran 2008: The symbol ‘real128’, referenced at (1), is not in the selected standard
  2 Error: Fortran 2008: The symbol ‘real32’, referenced at (1), is not in the selected standard
  3 Error: Fortran 2008: The symbol ‘real64’, referenced at (1), is not in the selected standard

Without an IBM compiler maybe compiling with the Intel or GNU compiler and using std=f2003 would be enough to make a version compile with that compiler. The format statement changes are mostly just busy work but the most extensive problem.

Since they are standard-conforming in post f2003 I am uncertain whether that is worth doing or not, if IBM XL has newer releases. From the sounds of it you have a newer gfortran or ifort/ifx that it does build with? If this is impacting distribution of fpm I can see if building an f2003-compliant version resolves it; and turn on the option to treat \ as a C escape on those compilers. It is a little less clear to say A=ACHAR(92) instead of A='' but it would avoid that switch. Most compilers default to standard-conforming; and most had added a switch to all the C-like usage where "\n" is a newline, etc. nvfortran is the only other one I know of that needs a switch to have default behavior. You have to use -Mbackslash; which is the default for the nvfortran compiler called from fpm; but inconsistently I do not think -qnoescape is the fpm default for xlf; which we should think about changing.

@urbanjost
Copy link
Contributor

Do you have the xlf2008 command on your system? What version of the compiler do you have? Not sure about allocating scalars, and G0 is not supported yet at least up to February of 2022; but it looks like several of the required f2008 features are supported.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants