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

fpm fails at building projects with too many files #991

Open
davidpfister opened this issue Jan 26, 2024 · 2 comments
Open

fpm fails at building projects with too many files #991

davidpfister opened this issue Jan 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@davidpfister
Copy link
Contributor

Description

The original issue appeared when building the project feq-parse with the following configuration

Version:     0.10.0, alpha
Program:     fpm(1)
Description: A Fortran package manager and build system
Home Page:   https://github.com/fortran-lang/fpm
License:     MIT
OS Type:     Windows

The test project has a quite large number of files (170), which results in a very long command line for the final linking. On Windows, command lines are limited in size and the present build exceeds the limit. This has been tested with cmd, msys2 and powershell without any difference.

FWIW, Visual Studio creates temporary files (e.g. "RSP1.rsp") with the content of the command line and ifort is invoked as ifort @".\RSP1.rsp

Expected Behaviour

The project should build on Windows without having to split the files to 2 or more subprojects.

Version of fpm

0.10.0, alpha

Platform and Architecture

Windows 10

Additional Information

The end of the build log is:

gfortran    -O3 -funroll-loops -Wimplicit-interface -fPIC -fmax-errors=1 -fcoarray=single -fimplicit-none -Werror=implicit-interface  build\gfortran_2654F75F5833692A\feq-parse\test_test.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_abs_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_acos_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_asin_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_atan_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_cos_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_division_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_gaussian3d_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_linear_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_linear_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_linear_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_linear_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_linear_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_linear_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_linear_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_linear_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log10_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_log_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_monadic_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_print_tokens.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_random_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sech_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sin_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_sqrt_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tanh_sfp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_r1fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_r1fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_r2fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_r2fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_r3fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_r3fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_r4fp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_r4fp64.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_sfp32.f90.o build\gfortran_2654F75F5833692A\feq-parse\test_tan_sfp64.f90.o build\gfortran_63E63B2712D76620\feq-parse\libfeq-parse.a -o build\gfortran_688A5DB7BAD2F9DA\test\test.exe
 + gfortran    -O3 -funroll-loops -Wimplicit-interface -fPIC -fmax-errors=1 -fcoarray=single -fimplicit-none -Werror=implicit-interface  build\gfortran_2654F75F5833692A\feq-parse\example_scalar_with_scalar_eval.f90.o build\gfortran_63E63B2712D76620\feq-parse\libfeq-parse.a -o build\gfortran_688A5DB7BAD2F9DA\example\scalar_with_scalar_eval.exe
The command line is too long.
<ERROR> Unable to find build log " test.exe.log "
<ERROR> Compilation failed for object " test.exe "
@davidpfister davidpfister added the bug Something isn't working label Jan 26, 2024
@davidpfister davidpfister changed the title fpm fails at build projects with too many files fpm fails at building projects with too many files Jan 26, 2024
@perazz
Copy link
Contributor

perazz commented Jan 27, 2024

Windows has a hard limit of 32767 characters per command line that cannot be avoided.
I believe fpm cannot use something like rsp files, because the gfortran toolchains do not support them.

Instead, I think it would be viable to change the linking procedure according to the GCC guideline:

  • add all objects to a static library, one by one
  • link the static library so the linking command will always be short

This would be suitable for all compilers and platforms.

@davidpfister
Copy link
Contributor Author

That looks like a good and quite simple idea to implement

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

No branches or pull requests

2 participants