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

Linemarkers with Intel oneAPI compilers #17

Open
awvwgk opened this issue Jun 7, 2021 · 1 comment
Open

Linemarkers with Intel oneAPI compilers #17

awvwgk opened this issue Jun 7, 2021 · 1 comment

Comments

@awvwgk
Copy link
Contributor

awvwgk commented Jun 7, 2021

I'm trying to debug a segfault for a new library in DFTB+ using Intel oneAPI. To get a meaningful traceback I would like to emit line markers with fypp but ifort likes non of the available options.

Using the cpp format the line markers are ignored due to bad format

ninja: Entering directory `_build'
[465/748] Building Fortran object prog/dftb+/CMakeFiles/dftbplus.dir/lib_common/status.f90.o
prog/dftb+/lib_common//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/include/common.fypp(1): warning #5117: Bad # preprocessor line
# 9 "prog/dftb+/lib_common//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_common/status.F90" 2 
-----------------------------------------------------------------------------------------------------^
[468/748] Building Fortran object prog/dftb+/CMakeFiles/dftbplus.dir/lib_common/globalenv.f90.o
prog/dftb+/lib_common//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/include/common.fypp(1): warning #5117: Bad # preprocessor line
# 9 "prog/dftb+/lib_common//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_common/globalenv.F90" 2 
--------------------------------------------------------------------------------------------------------^
[473/748] Building Fortran object prog/dftb+/CMakeFiles/dftbplus.dir/lib_common/assert.f90.o
prog/dftb+/lib_common//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/include/common.fypp(1): warning #5117: Bad # preprocessor line
# 9 "prog/dftb+/lib_common//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_common/assert.F90" 2 
-----------------------------------------------------------------------------------------------------^

While I get the an error with std formatted line markers

[502/764] Building Fortran object prog/dftb+/CMakeFiles/dftbplus.dir/lib_io/indexselection.f90.o
FAILED: prog/dftb+/CMakeFiles/dftbplus.dir/lib_io/indexselection.f90.o prog/dftb+/include/dftbp_io_indexselection.mod 
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/intel64/ifort  -Iprog/dftb+/lib_io -Iprog/dftb+/include -Iexternal/xmlf90/include -Iexternal/ddcosmo/include -I../prog/dftb+/../../external/dftd4refs -Iexternal/tblite/origin/include -I_deps/mctc-lib-build/include -I_deps/multicharge-build/include -I_deps/dftd4-build/include -I_deps/s-dftd3-build/include -traceback  -g -O2 -ip -module prog/dftb+/include -qopenmp -c prog/dftb+/CMakeFiles/dftbplus.dir/lib_io/indexselection.f90-pp.f90 -o prog/dftb+/CMakeFiles/dftbplus.dir/lib_io/indexselection.f90.o
prog/dftb+/lib_io//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90(229): error #5120: Unterminated character constant
#line 228 "/home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90"
--------------------------------------------------------------------------------------^
prog/dftb+/lib_io//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90(229): error #5144: Invalid character_kind_parameter. No underscore
#line 228 "/home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90"
---------------------------------------------------------------------------------------^
prog/dftb+/lib_io//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90(229): error #5082: Syntax error, found '/' when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ...
#line 228 "/home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90"
------------------------------------------------------------^
prog/dftb+/lib_io//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90(229): error #5082: Syntax error, found CHARACTER_CONSTANT '' when expecting one of: :: ) ( , : * <END-OF-STATEMENT> ; . (/ + - [ ] /) . ' ** / // ...
#line 228 "/home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90"
--------------------------------------------------------------------------------------^
prog/dftb+/lib_io//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90(230): error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ...
      &F90", 228)
-------^
prog/dftb+/lib_io//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90(230): error #5120: Unterminated character constant
      &F90", 228)
----------^
prog/dftb+/lib_io//home/awvwgk/projects/src/git/dftbplus/prog/dftb+/lib_io/indexselection.F90(230): error #5144: Invalid character_kind_parameter. No underscore
      &F90", 228)
-----------------^

Not sure what is going on here, but it seems to that fypp adding linebreaks in the line markers?

@aradi
Copy link
Owner

aradi commented Jun 7, 2021

No, fypp never adds line breaks to line markers. What can happen, that a line marker appears before a continuation line (as it is the case above), which ifort can not handle. You can switch this with the --line-numbering-mode=nocontlines option. Unfortunately, it will not eliminate all the cases, as it will still result in line markers in two cases:

  • #: directive appears after a continuation line:
    subroutine some_routine(some_arg,&
    #:if SOME_COND
        & conditional_arg,&
    #:endif
      &)
    
  • #:block / #:call statement has continuation lines in its argument:
    #:block DEBUG
     some_content&
         &with_continuation line
    #:endblock
    

Unfortunately, both cases seem to appear in DFTB+. The first one would have to big fixed in DFTB+, probably. The second one I would have to fix within fypp.

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

No branches or pull requests

2 participants