fortran-lang/stdlib

Compilation failed for object " example_falseloc.exe " on Windows

Closed this issue · 2 comments

Description

On Windows, using GNU Fortran (GCC) 15.0.0 20241215 from equation.com,

python config/fypp_deployment.py --build

gave

...
[ 61%]                    libstdlib.a
[ 61%]                    libstdlib.a  done.
[ 61%]           example_falseloc.exe
[ 61%]           example_falseloc.exe  done.

C:/equation/bin/../lib/gcc/x86_64-w64-mingw32/15.0.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build\gfortran_354723F25F6374E2\stdlib\libstdlib.a: error adding symbols: archive has no index; run ranlib to add one
collect2.exe: error: ld returned 1 exit status
<ERROR> Compilation failed for object " example_falseloc.exe "
<ERROR> stopping due to failed compilation
STOP 1
Traceback (most recent call last):
  File "c:\fortran\public_domain\github\stdlib\config\fypp_deployment.py", line 174, in <module>
    fpm_build(args,unknown)
    ~~~~~~~~~^^^^^^^^^^^^^^
  File "c:\fortran\public_domain\github\stdlib\config\fypp_deployment.py", line 133, in fpm_build
    subprocess.run("fpm build"+
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^
                   " --compiler "+FPM_FC+
                   ^^^^^^^^^^^^^^^^^^^^^^
                   " --c-compiler "+FPM_CC+
                   ^^^^^^^^^^^^^^^^^^^^^^^^
                   " --cxx-compiler "+FPM_CXX+
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                   " --flag \"{}\"".format(flags), shell=True, check=True)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Programs\Python313\Lib\subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'fpm build --compiler gfortran --c-compiler gcc --cxx-compiler gcc --flag "-cpp "' returned non-zero exit status 1.

Expected Behaviour

to compile

Version of stdlib

current

Platform and Architecture

Windows

Additional Information

No response

@Beliavsky I tested the latest snapshop of version 15 from equation.com, and got a different error:
stdlib_linalg_pinv.fypp line 77

do concurrent (i=1:m,j=1:k); u(i,j) = s(j)*u(i,j); end do

after changing this into its 3 lines

do concurrent (i=1:m,j=1:k)
     u(i,j) = s(j)*u(i,j)
end do

it compiled and the tests passed.

It seems to me as an instability on the snapshop side, the latest stable version 14 has no issues.

I downloaded the latest version of fpm, and the problem has disappeared. So this issue can be closed.