Skip to content

Build failure with submodules #434

@sgeard

Description

@sgeard

The attached code fails to build:

  simon@localhost autodiff (master)]$ fpm build
   + mkdir -p build/dependencies
   + mkdir -p build/gfortran_2A42023B310FA28D/autodiff
   + gfortran -c ././src/avd.f90 -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fcheck=bounds -fcheck=array-temps -fbacktrace -fcoarray=single -J build/gfortran_2A42023B310FA28D/autodiff -I build/gfortran_2A42023B310FA28D/autodiff -o build/gfortran_2A42023B310FA28D/autodiff/src_avd.f90.o
   + gfortran -c app/av_utest.f90 -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fcheck=bounds -fcheck=array-temps -fbacktrace -fcoarray=single -J build/gfortran_2A42023B310FA28D/autodiff -I build/gfortran_2A42023B310FA28D/autodiff -o build/gfortran_2A42023B310FA28D/autodiff/app_av_utest.f90.o
  app/av_utest.f90:19:12:
  
     19 |         u = 0.5*sin(2*a)
        |            1
  Error: Unexpected derived-type entities in binary intrinsic numeric operator ‘*’ at (1)
  compilation terminated due to -fmax-errors=1.
   Command failed
  ERROR STOP 
  
  Error termination. Backtrace:
  #0  0x4118f9 in __fpm_environment_MOD_run
          at ././src/fpm_environment.f90:144
  #1  0x476d4a in build_target
          at ././src/fpm_backend.f90:247
  #2  0x476d4a in __fpm_backend_MOD_build_package
          at ././src/fpm_backend.f90:76
  #3  0x41966b in __fpm_MOD_cmd_build
          at ./src/fpm.f90:270
  #4  0x402422 in MAIN__
          at app/main.f90:26
  #5  0x402422 in main
          at app/main.f90:9

This is a working project which builds and runs fine with makefiles. It looks as if the problem could be due to the fact that the submodule needs to be compiled after the module. As an aside I don't think fpm itself should be reporting its own call stack in the final release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    packagingRelated to porting or packaging a project to fpm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions