Skip to content

Runtime error from executable built by LFortran #11

Closed

Description

@bonachea

Using LFortran 0.64:

cgpu$ fpm run --compiler lfortran --profile debug --flag '--cpp --realloc-lhs-arrays --separate-compilation' -- fiats
Project is up to date
Runtime Error: End of file
<ERROR> Execution for object " fpm-find " returned exit code  1
<ERROR> *cmd_run*:stopping due to failed executions
STOP 1

Activity

  1. rouson commented on Aug 16, 2026

    @rouson
    Collaborator

    @bonachea I just tried

    ./fpm-0.13.0-linux-x86_64-gcc-12 --compiler=/app/bin/lfortran test --profile debug --flag "-g --cpp --realloc-lhs-arrays --separate-compilation" --verbose
    

    which produced the following trailing output

    [100%] Project compiled successfully.
     + build/lfortran_B7317DA6590B517A/test/driver
    
    The fpm 'find' plugin
      passes on searching without optional arguments
      passes on searching on case-sensitive URL text via the options `--url --case`
      passes on searching on package-name text via the option `--name`
      passes on finding nothing for an unlisted package
      passes on finding two matching packages
    ______ 5 of 5 tests passed. ______
    
    5 of 5 tests passed in total. ____
    

    However, switching to --profile release yields

    [ 93%]                       fpm-find
     + mkdir -p build/lfortran_CAC51126F3D307ED/app/
     + /app/bin/lfortran     -g --cpp --realloc-lhs-arrays --separate-compilation  flag_lfortran_opt -I././include -Ijulienne/include -Iassert/include   build/lfortran_0B06C8833CFD0477/fpm-find/app_fpm-find.F90.o  build/lfortran_0B06C8833CFD0477/fpm-find/libfpm-find.a -o build/lfortran_CAC51126F3D307ED/app/fpm-find
    error: no such file or directory: 'flag_lfortran_opt'
    [ 95%]                       fpm-find  done.
    
    error: no such file or directory: 'flag_lfortran_opt'
    <ERROR> Compilation failed for object " fpm-find "
    <ERROR> stopping due to failed compilation
    STOP 1
    

    which looks to me like an fpm bug.

  2. rouson commented on Aug 16, 2026

    @rouson
    Collaborator

    Yep. Browsing the fpm source code turns up the line

    flag_lfortran_opt = " --fast", &
    

    When I remove --profile release and insert --fast into my --flag argument, all tests pass.

  3. bonachea commented on Aug 16, 2026

    @bonachea
    MemberAuthor

    When I remove --profile release and insert --fast into my --flag argument, all tests pass.

    @rouson You're describing the well-known fpm 0.13.0 bug with lfortran --profile release (which is already fixed upstream). That is NOT the topic of this issue.

    Also this issue has nothing to do with fpm-find unit tests.

    Please try the command in the original report, which is fpm run:

    fpm run --compiler lfortran --profile debug --flag '--cpp --realloc-lhs-arrays --separate-compilation' -- fiats
    
  4. rouson commented on Aug 19, 2026

    @rouson
    Collaborator

    Fixed by PR #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions