Skip to content

Compilation error when using -ipo flag with Intel Fortran Compiler (ifx) in fpm #1094

Open
@xinzhi-suoxiang

Description

@xinzhi-suoxiang

Description

When compiling a Fortran project using fpm with Intel Fortran Compiler (ifx), an error occurs when the -ipo flag is used.
Minimal Reproducible Example

# In a bash shell on Ubuntu 22.04 running under WSL2
> fpm new test
> cd test
> fpm run --compiler ifx --flag "-O3 -r8 -qopenmp -mprefer-vector-width=512 -xHost -ipo"
test.f90                               done.
libtest.a                              done.
main.f90                               done.
test                                   failed.
[100%] Compiling...
ld: build/ifx_1B8B1D3CC2C223B8/test/libtest.a: error adding symbols: archive has no index; run ranlib to add one
<ERROR> Compilation failed for object " test "
<ERROR> stopping due to failed compilation
STOP 1

Expected Behaviour

The program should compile successfully with the -ipo flag.

Version of fpm

0.10.1

Platform and Architecture

Ubuntu 22.04 running under WSL2

Additional Information

# in bash
>ifx -V
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.2.1 Build 20240711
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions