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

Can't install due to "ninja: build stopped: subcommand failed." #249

Closed
pavelkomarov opened this issue Apr 7, 2024 · 31 comments
Closed

Comments

@pavelkomarov
Copy link

pavelkomarov commented Apr 7, 2024

I've installed meson --version 1.4.0 and ninja --version 1.11.1.git.kitware.jobserver-1 (also ninja --version 1.10.1 on another machine with the same result), but now when I attempt python3 -m pip install clawpack, I get a massively long ninja error I've never seen before. It's like all the types are failing to be defined. Are all the source files getting properly routed to where they need to go in the pip install?

python3 -m pip install clawpack
Defaulting to user installation because normal site-packages is not writeable
Collecting clawpack
  Using cached clawpack-5.10.0.tar.gz (7.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [5261 lines of output]
      + meson setup /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/meson-python-native-file.ini
      The Meson build system
      Version: 1.4.0
      Source dir: /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b
      Build dir: /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w
      Build type: native build
      Program python3 found: YES (/usr/bin/python3)
      Project name: clawpack
      Project version: 5.10.0
      Fortran compiler for the host machine: gfortran (gcc 11.4.0 "GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
      Fortran linker for the host machine: gfortran ld.bfd 2.38
      C compiler for the host machine: cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
      C linker for the host machine: cc ld.bfd 2.38
      Host machine cpu family: x86_64
      Host machine cpu: x86_64
      Program python3 found: YES (/usr/bin/python3)
      Found pkg-config: YES (/usr/bin/pkg-config) 0.29.2
      Run-time dependency python found: YES 3.10
      Compiler for Fortran supports arguments -Wno-unused-dummy-argument: YES
      Compiler for Fortran supports arguments -Wno-unused-variable: YES
      Compiler for Fortran supports arguments -Wno-unused-label: YES
      Compiler for C supports arguments -Wno-unused-but-set-variable: YES
      Build targets in project: 115
      
      clawpack 5.10.0
      
        User defined options
          Native files: /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/meson-python-native-file.ini
          buildtype   : release
          b_ndebug    : if-release
          b_vscrt     : md
      
      Found ninja-1.11.1.git.kitware.jobserver-1 at /home/kutz/.local/bin/ninja
      + /home/kutz/.local/bin/ninja
      [1/480] Generating riemann/riemann/traffic_vc_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_traffic_vc.f90' (format:free)
      Post-processing...
          Block: traffic_vc_1D
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "traffic_vc_1D"...
                  Constructing wrapper function "rp1"...
                    wave,s,amdq,apdq = rp1(maxm,num_waves,num_ghost,num_cells,ql,qr,auxl,auxr,[num_eqn,num_aux])
          Wrote C/API module "traffic_vc_1D" to file "riemann/riemann/traffic_vc_1Dmodule.c"
      [2/480] Generating pyclaw/src/pyclaw/euler_tfluct1module.c with a custom command
      Reading fortran codes...
          Reading file '../pyclaw/src/pyclaw/sharpclaw/../../../examples/euler_1d/euler_tfluct.f90' (format:free)
      Post-processing...
          Block: euler_tfluct1
                          Block: tfluct1
      Post-processing (stage 2)...
      Building modules...
          Building module "euler_tfluct1"...
                  Constructing wrapper function "tfluct1"...
                    adq = tfluct1(maxnx,mwaves,mbc,mx,ql,qr,auxl,auxr,[meqn,maux])
                  Constructing COMMON block support for "cparam"...
                    gamma
          Wrote C/API module "euler_tfluct1" to file "pyclaw/src/pyclaw/euler_tfluct1module.c"
          Fortran 77 wrappers are saved to "pyclaw/src/pyclaw/euler_tfluct1-f2pywrappers.f"
      [3/480] Generating riemann/riemann/traffic_vc_fwave_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_traffic_vc_fwave.f90' (format:free)
      Post-processing...
          Block: traffic_vc_fwave_1D
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "traffic_vc_fwave_1D"...
                  Constructing wrapper function "rp1"...
                    fwave,s,amdq,apdq = rp1(maxm,num_waves,num_ghost,num_cells,ql,qr,auxl,auxr,[num_eqn,num_aux])
          Wrote C/API module "traffic_vc_fwave_1D" to file "riemann/riemann/traffic_vc_fwave_1Dmodule.c"
      [4/480] Generating riemann/riemann/euler_hlle_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_euler_hlle.f90' (format:free)
      Post-processing...
          Block: euler_hlle_1D
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "euler_hlle_1D"...
                  Constructing wrapper function "rp1"...
                    wave,s,amdq,apdq = rp1(maxmx,mwaves,mbc,mx,ql,qr,auxl,auxr,[meqn,maux])
                  Constructing COMMON block support for "cparam"...
                    gamma
          Wrote C/API module "euler_hlle_1D" to file "riemann/riemann/euler_hlle_1Dmodule.c"
          Fortran 77 wrappers are saved to "riemann/riemann/euler_hlle_1D-f2pywrappers.f"
      [5/480] Generating riemann/riemann/shallow_roe_with_efix_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_shallow_roe_with_efix.f90' (format:free)
      Post-processing...
          Block: shallow_roe_with_efix_1D
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "shallow_roe_with_efix_1D"...
                  Constructing wrapper function "rp1"...
                    wave,s,amdq,apdq = rp1(maxmx,num_waves,num_ghost,num_cells,ql,qr,auxl,auxr,[num_eqn,num_aux])
                  Constructing COMMON block support for "cparam"...
                    grav
          Wrote C/API module "shallow_roe_with_efix_1D" to file "riemann/riemann/shallow_roe_with_efix_1Dmodule.c"
          Fortran 77 wrappers are saved to "riemann/riemann/shallow_roe_with_efix_1D-f2pywrappers.f"
      [6/480] Generating riemann/riemann/traffic_vc_tracer_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_traffic_vc_tracer.f90' (format:free)
      Post-processing...
          Block: traffic_vc_tracer_1D
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "traffic_vc_tracer_1D"...
                  Constructing wrapper function "rp1"...
                    wave,s,amdq,apdq = rp1(maxm,num_waves,num_ghost,num_cells,ql,qr,auxl,auxr,[num_eqn,num_aux])
          Wrote C/API module "traffic_vc_tracer_1D" to file "riemann/riemann/traffic_vc_tracer_1Dmodule.c"
      [7/480] Generating riemann/riemann/advection_color_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_advection_color.f90' (format:free)
      Post-processing...
          Block: advection_color_1D
      {}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "maxmx".
      {}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "meqn".
      {}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "mwaves".
      {}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "maux".
      {}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "mbc".
      {}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "mx".
      {'attrspec': ['dimension(meqn,1-mbc:maxmx+mbc)']}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "ql".
      {'attrspec': ['dimension(meqn,1-mbc:maxmx+mbc)']}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "qr".
      {'attrspec': ['dimension(maux,1-mbc:maxmx+mbc)']}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "auxl".
      {'attrspec': ['dimension(maux,1-mbc:maxmx+mbc)']}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "auxr".
      {'attrspec': ['dimension(meqn, mwaves,1-mbc:maxmx+mbc)']}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "wave".
      {'attrspec': ['dimension(mwaves,1-mbc:maxmx+mbc)']}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "s".
      {'attrspec': ['dimension(meqn,1-mbc:maxmx+mbc)']}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "amdq".
      {'attrspec': ['dimension(meqn,1-mbc:maxmx+mbc)']}
      In: :advection_color_1D:../riemann/riemann/../src/rp1_advection_color.f90:rp1
      vars2fortran: No typespec for argument "apdq".
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "advection_color_1D"...
                  Constructing wrapper function "rp1"...
                    rp1(maxmx,mbc,mx,ql,qr,auxl,auxr,wave,s,amdq,apdq,[meqn,mwaves,maux])
                  Constructing COMMON block support for "comrp"...
                    u
          Wrote C/API module "advection_color_1D" to file "riemann/riemann/advection_color_1Dmodule.c"
          Fortran 77 wrappers are saved to "riemann/riemann/advection_color_1D-f2pywrappers.f"
      [8/480] Generating riemann/riemann/burgers_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_burgers.f90' (format:free)
      Post-processing...
          Block: burgers_1D
      {}
      In: :burgers_1D:../riemann/riemann/../src/rp1_burgers.f90:rp1
      vars2fortran: No typespec for argument "maux".
      {}
      In: :burgers_1D:../riemann/riemann/../src/rp1_burgers.f90:rp1
      vars2fortran: No typespec for argument "auxl".
      {}
      In: :burgers_1D:../riemann/riemann/../src/rp1_burgers.f90:rp1
      vars2fortran: No typespec for argument "auxr".
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "burgers_1D"...
                  Constructing wrapper function "rp1"...
                    rp1(maxmx,maux,mbc,mx,ql,qr,auxl,auxr,wave,s,amdq,apdq,[meqn,mwaves])
          Wrote C/API module "burgers_1D" to file "riemann/riemann/burgers_1Dmodule.c"
      [9/480] Generating riemann/riemann/reactive_euler_with_efix_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90' (format:free)
      Post-processing...
          Block: reactive_euler_with_efix_1D
      {}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "maxmx".
      {}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "meqn".
      {}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "mwaves".
      {}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "maux".
      {}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "mbc".
      {}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "mx".
      {'attrspec': ['dimension(meqn,1-mbc:maxmx+mbc)']}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "ql".
      {'attrspec': ['dimension(meqn,1-mbc:maxmx+mbc)']}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "qr".
      {}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "auxl".
      {}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "auxr".
      {'attrspec': ['dimension(meqn, mwaves,1-mbc:maxmx+mbc)']}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "wave".
      {'attrspec': ['dimension(mwaves,1-mbc:maxmx+mbc)']}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "s".
      {'attrspec': ['dimension(meqn,1-mbc:maxmx+mbc)']}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "amdq".
      {'attrspec': ['dimension(meqn,1-mbc:maxmx+mbc)']}
      In: :reactive_euler_with_efix_1D:../riemann/riemann/../src/rp1_reactive_euler_with_efix.f90:rp1
      vars2fortran: No typespec for argument "apdq".
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "reactive_euler_with_efix_1D"...
                  Constructing wrapper function "rp1"...
                    rp1(maxmx,maux,mbc,mx,ql,qr,auxl,auxr,wave,s,amdq,apdq,[meqn,mwaves])
                  Constructing COMMON block support for "cparam"...
                    gamma,qheat
          Wrote C/API module "reactive_euler_with_efix_1D" to file "riemann/riemann/reactive_euler_with_efix_1Dmodule.c"
          Fortran 77 wrappers are saved to "riemann/riemann/reactive_euler_with_efix_1D-f2pywrappers.f"
      [10/480] Generating riemann/riemann/psystem_fwave_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_psystem_fwave.f90' (format:free)
      Post-processing...
          Block: psystem_fwave_1D
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "psystem_fwave_1D"...
                  Constructing wrapper function "rp1"...
                    fwave,s,amdq,apdq = rp1(maxm,mwaves,mbc,mx,ql,qr,auxl,auxr,[meqn,maux])
                  Constructing COMMON block support for "cparam"...
                    pstar,vstar,gamma
          Wrote C/API module "psystem_fwave_1D" to file "riemann/riemann/psystem_fwave_1Dmodule.c"
          Fortran 77 wrappers are saved to "riemann/riemann/psystem_fwave_1D-f2pywrappers.f"
      [11/480] Generating riemann/riemann/advection_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_advection.f90' (format:free)
      Post-processing...
          Block: advection_1D
      {}
      In: :advection_1D:../riemann/riemann/../src/rp1_advection.f90:rp1
      vars2fortran: No typespec for argument "maxmx".
      {}
      In: :advection_1D:../riemann/riemann/../src/rp1_advection.f90:rp1
      vars2fortran: No typespec for argument "meqn".
      {}
      In: :advection_1D:../riemann/riemann/../src/rp1_advection.f90:rp1
      vars2fortran: No typespec for argument "mwaves".
      {}
      In: :advection_1D:../riemann/riemann/../src/rp1_advection.f90:rp1
      vars2fortran: No typespec for argument "maux".
      {}
      In: :advection_1D:../riemann/riemann/../src/rp1_advection.f90:rp1
      vars2fortran: No typespec for argument "mbc".
      {}
      In: :advection_1D:../riemann/riemann/../src/rp1_advection.f90:rp1
      vars2fortran: No typespec for argument "mx".
      {}
      In: :advection_1D:../riemann/riemann/../src/rp1_advection.f90:rp1
      vars2fortran: No typespec for argument "auxl".
      {}
      In: :advection_1D:../riemann/riemann/../src/rp1_advection.f90:rp1
      vars2fortran: No typespec for argument "auxr".
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "advection_1D"...
                  Constructing wrapper function "rp1"...
                    rp1(maxmx,maux,mbc,mx,ql,qr,auxl,auxr,wave,s,amdq,apdq,[meqn,mwaves])
                  Constructing COMMON block support for "cparam"...
                    u
          Wrote C/API module "advection_1D" to file "riemann/riemann/advection_1Dmodule.c"
          Fortran 77 wrappers are saved to "riemann/riemann/advection_1D-f2pywrappers.f"
      [12/480] Generating pyclaw/src/pyclaw/advection_2dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90' (format:free)
          Reading file '../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90' (format:free)
      Post-processing...
          Block: advection_2d
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "ixy".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "maxm".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "meqn".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "mwaves".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "maux".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "mbc".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "mx".
      {'attrspec': ['dimension(meqn, 1-mbc:maxm+mbc)']}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "ql".
      {'attrspec': ['dimension(meqn, 1-mbc:maxm+mbc)']}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "qr".
      {'attrspec': ['dimension(maux,1-mbc:maxm+mbc)']}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "auxl".
      {'attrspec': ['dimension(maux,1-mbc:maxm+mbc)']}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "auxr".
      {'attrspec': ['dimension(meqn, mwaves, 1-mbc:maxm+mbc)']}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "wave".
      {'attrspec': ['dimension(mwaves, 1-mbc:maxm+mbc)']}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "s".
      {'attrspec': ['dimension(meqn,1-mbc:maxm+mbc)']}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "amdq".
      {'attrspec': ['dimension(meqn,1-mbc:maxm+mbc)']}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpn2_vc_advection_vector.f90:rpn2
      vars2fortran: No typespec for argument "apdq".
                          Block: rpn2
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "ixy".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "imp".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "maxm".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "meqn".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "mwaves".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "maux".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "mbc".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "mx".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "ql".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "qr".
      {}
      In: :advection_2d:../pyclaw/src/pyclaw/../../examples/advection_reaction_2d/rpt2_dummy.f90:rpt2
      vars2fortran: No typespec for argument "aux1".
      ...

 ... It continues on for 354072 characters!

      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      append_needs: unknown need 'float'
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      append_needs: unknown need 'float'
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      getctype: "real(kind=dp)" is mapped to C "float" (to override define dict(real = dict(dp="<C typespec>")) in /tmp/pip-install-cez8i5kb/clawpack_c617b86a683945b38fa309bdf4d8c61b/.mesonpy-b4dipe1w/.f2py_f2cmap file).
      append_needs: unknown need 'float'
          getarrlen:variable "num_aux" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpn3
          getarrlen:variable "num_waves" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpn3
          getarrlen:variable "mwork" undefined
                                          Block: rpt3
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_aux" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_aux" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_aux" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_aux" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "num_waves" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rpt3
          getarrlen:variable "mwork" undefined
                                          Block: rptt3
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_eqn" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_aux" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_aux" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_aux" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_aux" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "num_waves" undefined
      In: :classic3:../pyclaw/src/pyclaw/classic/step3.f90:step3:unknown_interface:rptt3
          getarrlen:variable "mwork" undefined
      Post-processing (stage 2)...
      Building modules...
          Constructing call-back function "cb_rpn3_in_flux3__user__routines"
            def rpn3(ixyz,maxm,num_aux,num_ghost,mx,q1d,q1d1,e_aux2_1_1_num_ghost_2_errrr,e_aux2_1_1_num_ghost_2_errrrr,wave,s,amdq,apdq,[num_eqn,num_waves]): return
          Constructing call-back function "cb_rpt3_in_flux3__user__routines"
            def rpt3(ixyz,e_2_err,e_1_err,maxm,num_waves,num_ghost,mx,q1d,q1d1,aux1,aux2,aux3,amdq,bmamdq,bpamdq,[num_eqn,num_aux]): return
          Constructing call-back function "cb_rptt3_in_flux3__user__routines"
            def rptt3(ixyz,e_2_errrrrr,e_2_errrrrrr,e_2_errrrrrrr,maxm,num_waves,num_ghost,mx,q1d,q1d1,aux1,aux2,aux3,cpapdq2,bmcpapdq,bpcpapdq,[num_eqn,num_aux]): return
          Constructing call-back function "cb_rpn3_in_step3ds__user__routines"
            def rpn3(x): return x
          Constructing call-back function "cb_rpt3_in_step3ds__user__routines"
            def rpt3(x): return x
          Constructing call-back function "cb_rptt3_in_step3ds__user__routines"
            def rptt3(x): return x
          Constructing call-back function "cb_rpn3_in_step3__user__routines"
            def rpn3(x): return x
          Constructing call-back function "cb_rpt3_in_step3__user__routines"
            def rpt3(x): return x
          Constructing call-back function "cb_rptt3_in_step3__user__routines"
            def rptt3(x): return x
          Building module "classic3"...
                  Constructing wrapper function "limiter"...
                    limiter(maxm,num_ghost,mx,wave,s,mthlim,[num_eqn,num_waves])
                  Creating wrapper for Fortran function "philim"("philim")...
                  Constructing wrapper function "philim"...
                    philim = philim(a,b,meth)
                  Constructing wrapper function "flux3"...
                    flux3(ixyz,maxm,num_ghost,mx,q1d,dtdx1d,dtdy,dtdz,aux1,aux2,aux3,method,mthlim,qadd,fadd,gadd,hadd,cfl1d,wave,s,amdq,apdq,cqxx,bmamdq,bmapdq,bpamdq,bpapdq,cmamdq,cmapdq,cpamdq,cpapdq,cmamdq2,cmapdq2,cpamdq2,cpapdq2,bmcqxxp,bpcqxxp,bmcqxxm,bpcqxxm,cmcqxxp,cpcqxxp,cmcqxxm,cpcqxxm,bmcmamdq,bmcmapdq,bpcmamdq,bpcmapdq,bmcpamdq,bmcpapdq,bpcpamdq,bpcpapdq,use_fwave,rpn3,rpt3,rptt3,[num_eqn,num_waves,num_aux,rpn3_extra_args,rpt3_extra_args,rptt3_extra_args])
                  Constructing wrapper function "step3ds"...
                    qnew,cfl = step3ds(maxm,num_ghost,mx,my,mz,qold,qnew,aux,dx,dy,dz,dt,method,mthlim,aux1,aux2,aux3,work,idir,use_fwave,rpn3,rpt3,rptt3,[num_eqn,num_waves,qadd,fadd,gadd,hadd,q1d,dtdx1d,dtdy1d,dtdz1d,num_aux,mwork,rpn3_extra_args,rpt3_extra_args,rptt3_extra_args])
                  Constructing wrapper function "step3"...
                    qnew,cfl = step3(maxm,num_ghost,mx,my,mz,qold,qnew,aux,dx,dy,dz,dt,method,mthlim,aux1,aux2,aux3,work,use_fwave,rpn3,rpt3,rptt3,[num_eqn,num_waves,qadd,fadd,gadd,hadd,q1d,dtdx1d,dtdy1d,dtdz1d,num_aux,mwork,rpn3_extra_args,rpt3_extra_args,rptt3_extra_args])
                  Constructing COMMON block support for "comxyt"...
                    dtcom,dxcom,dycom,dzcom,tcom,icom,jcom,kcom
                  Constructing COMMON block support for "comxyzt"...
                    dtcom,dxcom,dycom,dzcom,tcom,icom,jcom,kcom
          Wrote C/API module "classic3" to file "pyclaw/src/pyclaw/classic3module.c"
          Fortran 77 wrappers are saved to "pyclaw/src/pyclaw/classic3-f2pywrappers.f"
      ninja: build stopped: subcommand failed.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
@pavelkomarov
Copy link
Author

pavelkomarov commented Apr 7, 2024

Buried in some of what I had to trim, there is

FileNotFoundError: [Errno 2] No such file or directory: 'riemann/riemann/traffic_vc_1D-f2pywrappers.f'
FileNotFoundError: [Errno 2] No such file or directory: 'riemann/riemann/traffic_vc_fwave_1D-f2pywrappers.f'
FileNotFoundError: [Errno 2] No such file or directory: 'riemann/riemann/burgers_1D-f2pywrappers.f'
FileNotFoundError: [Errno 2] No such file or directory: 'pyclaw/src/pyclaw/advection_2d-f2pywrappers.f'
FileNotFoundError: [Errno 2] No such file or directory: 'riemann/riemann/acoustics_variable_1D-f2pywrappers.f'
FileNotFoundError: [Errno 2] No such file or directory: 'pyclaw/src/pyclaw/sw_sphere_problem-f2pywrappers.f'
FileNotFoundError: [Errno 2] No such file or directory: 'riemann/riemann/traffic_vc_tracer_1D-f2pywrappers.f'
FileNotFoundError: [Errno 2] No such file or directory: 'riemann/riemann/cubic_1D-f2pywrappers.f'

which is what makes me ask whether something is missing. Or maybe I need to specifically install one of the sub packages first?

@mandli
Copy link
Member

mandli commented Apr 7, 2024

Those files are auto-generated wrappers for the Fortran code so something is going awry before that step. I recently installed clawpack on a clean computer and did not have any issues so I think we are back to something weird about your environment. Unfortunately the real error is probably buried in the output you truncated. Most of it is output from the overly verbose auto-generated code mentioned before and not relevant. I would start looking for the word "error" in the output and see if you find anything that would be helpful. Note that there is one:

  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

but we are going to need more info than that to figure out what is going wrong.

@pavelkomarov
Copy link
Author

pavelkomarov commented Apr 7, 2024

Hmm. "error" occurs 46 times in the output. You've accounted for 3. 8 more come from the FileNotFoundErrors. Each of those is preceded by a little section that reads like:

    FAILED: riemann/riemann/traffic_vc_tracer_1D.cpython-310-x86_64-linux-gnu.so.p/depscan.dd
      /home/kutz/.local/bin/meson --internal depscan riemann/riemann/traffic_vc_tracer_1D.cpython-310-x86_64-linux-
        gnu.so.p/traffic_vc_tracer_1D.cpython-310-x86_64-linux-gnu.dat riemann/riemann/traffic_vc_tracer_1D.cpython-
        310-x86_64-linux-gnu.so.p/depscan.dd /tmp/pip-install-exg17ioo/clawpack_12a3acc0e5444e3490add1c5c7c66aee/.mesonpy-
        fdvhj04x/riemann/riemann/traffic_vc_tracer_1D.cpython-310-x86_64-linux-gnu.so.p/traffic_vc_tracer_1D.cpython-
        310-x86_64-linux-gnu-deps.json
    Traceback (most recent call last):
        File "/home/kutz/.local/bin/meson", line 8, in <module>
          sys.exit(main())
        File "/tmp/pip-build-env-8xfsmaz9/overlay/local/lib/python3.10/dist-packages/mesonbuild/mesonmain.py", line 286, in main
          return run(sys.argv[1:], launcher)
        File "/tmp/pip-build-env-8xfsmaz9/overlay/local/lib/python3.10/dist-packages/mesonbuild/mesonmain.py", line 274, in run
          return run_script_command(args[1], args[2:])
        File "/tmp/pip-build-env-8xfsmaz9/overlay/local/lib/python3.10/dist-packages/mesonbuild/mesonmain.py", line 215, in run_script_command
          return module.run(script_args)
        File "/tmp/pip-build-env-8xfsmaz9/overlay/local/lib/python3.10/dist-packages/mesonbuild/scripts/depscan.py", line 198, in run
          return scanner.scan()
        File "/tmp/pip-build-env-8xfsmaz9/overlay/local/lib/python3.10/dist-packages/mesonbuild/scripts/depscan.py", line 148, in scan
          self.scan_file(s)
        File "/tmp/pip-build-env-8xfsmaz9/overlay/local/lib/python3.10/dist-packages/mesonbuild/scripts/depscan.py", line 48, in scan_file
          self.scan_fortran_file(fname)
        File "/tmp/pip-build-env-8xfsmaz9/overlay/local/lib/python3.10/dist-packages/mesonbuild/scripts/depscan.py", line 57, in scan_fortran_file
          for line in fpath.read_text(encoding='utf-8', errors='ignore').split('\n'):
        File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text
          with self.open(mode='r', encoding=encoding, errors=errors) as f:
        File "/usr/lib/python3.10/pathlib.py", line 1119, in open
          return self._accessor.open(self, mode, buffering, encoding, errors,
      FileNotFoundError: [Errno 2] No such file or directory: 'riemann/riemann/traffic_vc_tracer_1D-f2pywrappers.f'

which accounts for 4 more per each of those 8. We're at 43/46.

The last 3 come from:

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.

"fail" occurs 10 times, once for each of the 8 FileNotFoundErrors (as above), and 2 in the postamble:

      ninja: build stopped: subcommand failed.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

I'm not sure that's giving us any more info, but maybe you can make heads or tails of it.

What are some possible environment problems that might cause this not to play nice? I'm installing on two new Ubuntu machines. I went ahead and installed meson and ninja ahead of time, and they're both on the path. gfortran and gcc live on the system path too, of course.

@eli-schwartz
Copy link

eli-schwartz commented Apr 11, 2024

From the meson bug report (full build log was attached as LINK), I believe this is not a bug in meson.

https://github.com/clawpack/riemann/blob/7b4004c044d04900ca2de6bc6ae49fc23330c64f/riemann/meson.build

  f2py_srcs = custom_target(
    command: [f2py, ext_name],
    input: ext_srcs,
    output: [ext_name + 'module.c', ext_name + '-f2pywrappers.f'],
  )

Where ext_name is acoustics_variable_1D.

      [1/480] Generating riemann/riemann/acoustics_variable_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_acoustics_variable.f90' (format:free)
      Post-processing...
          Block: acoustics_variable_1D
      {}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "maxm".
      {}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "meqn".
      {}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "mwaves".
      {}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "maux".
      {}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "mbc".
      {}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "mx".
      {'attrspec': ['dimension(meqn, 1-mbc:maxm+mbc)']}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "ql".
      {'attrspec': ['dimension(meqn, 1-mbc:maxm+mbc)']}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "qr".
      {'attrspec': ['dimension(maux, 1-mbc:maxm+mbc)']}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "auxl".
      {'attrspec': ['dimension(maux, 1-mbc:maxm+mbc)']}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "auxr".
      {'attrspec': ['dimension(meqn, mwaves, 1-mbc:maxm+mbc)']}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "wave".
      {'attrspec': ['dimension(mwaves, 1-mbc:maxm+mbc)']}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "s".
      {'attrspec': ['dimension(meqn, 1-mbc:maxm+mbc)']}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "amdq".
      {'attrspec': ['dimension(meqn, 1-mbc:maxm+mbc)']}
      In: :acoustics_variable_1D:../riemann/riemann/../src/rp1_acoustics_variable.f90:rp1
      vars2fortran: No typespec for argument "apdq".
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "acoustics_variable_1D"...
                  Constructing wrapper function "rp1"...
                    rp1(maxm,mbc,mx,ql,qr,auxl,auxr,wave,s,amdq,apdq,[meqn,mwaves,maux])
          Wrote C/API module "acoustics_variable_1D" to file "riemann/riemann/acoustics_variable_1Dmodule.c"

Only seems to emit a C file. In comparison, build rule 2:

      [2/480] Generating riemann/riemann/euler_hlle_1Dmodule.c with a custom command
      Reading fortran codes...
          Reading file '../riemann/riemann/../src/rp1_euler_hlle.f90' (format:free)
      Post-processing...
          Block: euler_hlle_1D
                          Block: rp1
      Post-processing (stage 2)...
      Building modules...
          Building module "euler_hlle_1D"...
                  Constructing wrapper function "rp1"...
                    wave,s,amdq,apdq = rp1(maxmx,mwaves,mbc,mx,ql,qr,auxl,auxr,[meqn,maux])
                  Constructing COMMON block support for "cparam"...
                    gamma
          Wrote C/API module "euler_hlle_1D" to file "riemann/riemann/euler_hlle_1Dmodule.c"
          Fortran 77 wrappers are saved to "riemann/riemann/euler_hlle_1D-f2pywrappers.f"

This is a problem because waaaaaaaaaaaaaay later on, this build rule fails:

      [45/480] Module scanner.
      FAILED: riemann/riemann/acoustics_variable_1D.cpython-310-x86_64-linux-gnu.so.p/depscan.dd
      /home/kutz/.local/bin/meson --internal depscan riemann/riemann/acoustics_variable_1D.cpython-310-x86_64-linux-gnu.so.p/acoustics_variable_1D.cpython-310-x86_64-linux-gnu.dat riemann/riemann/acoustics_variable_1D.cpython-310-x86_64-linux-gnu.so.p/depscan.dd /tmp/pip-install-0gypk13m/clawpack_69bc5d3337da4625b12f1bccce6b64ee/.mesonpy-rhs1cize/riemann/riemann/acoustics_variable_1D.cpython-310-x86_64-linux-gnu.so.p/acoustics_variable_1D.cpython-310-x86_64-linux-gnu-deps.json
      Traceback (most recent call last):
        File "/home/kutz/.local/bin/meson", line 8, in <module>
          sys.exit(main())
        File "/tmp/pip-build-env-7x5j_qbw/overlay/local/lib/python3.10/dist-packages/mesonbuild/mesonmain.py", line 286, in main
          return run(sys.argv[1:], launcher)
        File "/tmp/pip-build-env-7x5j_qbw/overlay/local/lib/python3.10/dist-packages/mesonbuild/mesonmain.py", line 274, in run
          return run_script_command(args[1], args[2:])
        File "/tmp/pip-build-env-7x5j_qbw/overlay/local/lib/python3.10/dist-packages/mesonbuild/mesonmain.py", line 215, in run_script_command
          return module.run(script_args)
        File "/tmp/pip-build-env-7x5j_qbw/overlay/local/lib/python3.10/dist-packages/mesonbuild/scripts/depscan.py", line 198, in run
          return scanner.scan()
        File "/tmp/pip-build-env-7x5j_qbw/overlay/local/lib/python3.10/dist-packages/mesonbuild/scripts/depscan.py", line 148, in scan
          self.scan_file(s)
        File "/tmp/pip-build-env-7x5j_qbw/overlay/local/lib/python3.10/dist-packages/mesonbuild/scripts/depscan.py", line 48, in scan_file
          self.scan_fortran_file(fname)
        File "/tmp/pip-build-env-7x5j_qbw/overlay/local/lib/python3.10/dist-packages/mesonbuild/scripts/depscan.py", line 57, in scan_fortran_file
          for line in fpath.read_text(encoding='utf-8', errors='ignore').split('\n'):
        File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text
          with self.open(mode='r', encoding=encoding, errors=errors) as f:
        File "/usr/lib/python3.10/pathlib.py", line 1119, in open
          return self._accessor.open(self, mode, buffering, encoding, errors,
      FileNotFoundError: [Errno 2] No such file or directory: 'riemann/riemann/acoustics_variable_1D-f2pywrappers.f'

It assumes since the rule that is supposed to produce acoustics_variable_1Dmodule.c + acoustics_variable_1D-f2pywrappers.f has successfully run, that it can now run a module scanner on the fortran source file. But, it has not been emitted! Oops.

Unfortunately I believe f2py doesn't have an option to make it a fatal error if a wrapper is required but failed to be generated.

@pavelkomarov
Copy link
Author

Thanks for the analysis, Eli! @mandli, is my environment or version of f2py somehow to blame for this, or is this a build file issue? Would changing the version of meson or ninja I'm using help? I'm using the latest.

@mandli
Copy link
Member

mandli commented Apr 11, 2024

What version of gfortran do you have?

@pavelkomarov
Copy link
Author

kutz@kutz-Lambda-Vector:~$ gfortran --version
GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@mandli
Copy link
Member

mandli commented Apr 11, 2024

I have not actually seen the auto-generation fail before like this so I am a bit puzzled. As @eli-schwartz pointed I highly doubt that meson or ninja is to blame for this. Rather this sounds more likely to be a f2py/numpy problem. Couple things would be helpful:

  1. the version of NumPy are you using (I tried figuring it out from what you pasted but I did not see it my cursory glance),
  2. the full log from above as an attachment, and
  3. what things have you tried from the pip install instructions, in particular the troubleshooting steps.

Another thing to try as well is to just install the Fortran specific codes and test/troubleshoot those. That would ensure that there is not something wacky with your compiler, environment variables or basic python functionality.

@pavelkomarov
Copy link
Author

  1. numpy==1.21.5
  2. error.txt
  3. I've specifically called python3 -m pip install clawpack as the root user, which is equivalent to the --user based install given in the instructions (and worked for me a couple months ago on an OSX machine). I've also tried python3 -m pip install --no-build-isolation -e git+https://github.com/clawpack/clawpack.git@v5.10.0#egg=clawpack with the same result.

Fortran-specific:
From all the faffing around I've done so far, I have the clawpack git repo at ~/src/clawpack, so I cded in there and did the following:

git checkout v5.10.0
git submodule init
git submodule update
export CLAW=`pwd`

Then cding down to $CLAW/classic/tests and running nosetests3 -sv, I get

Failure: ModuleNotFoundError (No module named 'clawpack') ... ERROR
Failure: ModuleNotFoundError (No module named 'clawpack') ... ERROR
Failure: ModuleNotFoundError (No module named 'clawpack') ... ERROR

======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'clawpack')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.10/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.10/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/kutz/src/clawpack/classic/tests/acoustics_1d_heterogeneous/regression_tests.py", line 9, in <module>
    import clawpack.classic.test as test
ModuleNotFoundError: No module named 'clawpack'

======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'clawpack')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.10/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.10/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/kutz/src/clawpack/classic/tests/acoustics_3d_heterogeneous/regression_tests.py", line 9, in <module>
    import clawpack.classic.test as test
ModuleNotFoundError: No module named 'clawpack'

======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'clawpack')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.10/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.10/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/kutz/src/clawpack/classic/tests/advection_2d_annulus/regression_tests.py", line 9, in <module>
    import clawpack.classic.test as test
ModuleNotFoundError: No module named 'clawpack'

----------------------------------------------------------------------
Ran 3 tests in 0.001s

FAILED (errors=3)

@ketch
Copy link
Member

ketch commented Apr 12, 2024

I think that version of numpy had a bug that affected Clawpack installation. It's likely that if you update numpy, this issue will go away.

@pavelkomarov
Copy link
Author

pavelkomarov commented Apr 12, 2024

That is a really old version of numpy, actually. I upgraded to 1.26.4, though, and I get the same exact error.

@ketch
Copy link
Member

ketch commented Apr 13, 2024

Looking at the error log, it seems that f2py creates wrappers for all but 7 of the Riemann solvers. Then when it tries to install those 7 Riemann solvers, it fails because the wrapper file doesn't exist. I can't see what is different about those specific solvers. They are:

rp1_cubic
rp1_acoustics_variable
rpn2_advection
rp1_burgers
rp1_traffic_vc
rp1_traffic_vc_tracer
rp1_traffic_vc_fwave

@eli-schwartz
Copy link

Unfortunately I believe f2py doesn't have an option to make it a fatal error if a wrapper is required but failed to be generated.

@rgommers, I wonder if you know whether anything could be done about this?

@rgommers
Copy link
Contributor

"*-f2py-wrappers.f may or may not be generated" is an issue I had early on in SciPy as well. We fixed that in numpy 1.22.4, where empty wrapper files started to be written even if they were not needed. I haven't seen an issue with that since. The relevant options are --wrap-functions (default) and --skip-empty-wrappers (to restore the pre-1.22.4 behavior), documented at https://numpy.org/devdocs/f2py/usage.html.

From the comment above with the custom_target invocation and the f2py command at

clawpack/meson.build

Lines 30 to 36 in 4c5990f

f2py = [
py, '-m', 'numpy.f2py',
'--lower',
'--build-dir', '@OUTDIR@',
'@INPUT@',
'-m', # <extension-name>
]
, it looks like you are not using those options. Hence, if the wrappers indeed go missing with recent numpy versions, that is a bug in numpy.f2py.

I've specifically called python3 -m pip install clawpack as the root user, which is equivalent to the --user based install given in the instructions (and worked for me a couple months ago on an OSX machine). I've also tried python3 -m pip install --no-build-isolation -e git+https://github.com/clawpack/clawpack.git@v5.10.0#egg=clawpack with the same result.

Please make sure with a clean build that the numpy version is the one you think it is. pip install --user is obsolete, and used to have (maybe still has) unfortunate side effects of keeping old packages visible because $HOME/.local was added to every Python environment.

@pavelkomarov
Copy link
Author

pavelkomarov commented Apr 29, 2024

kutz@kutz-Lambda-Vector:~$ python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.26.4'

Then I run python3 -m pip install clawpack, which, unless there's a failure mode I'm unaware of, is using that numpy version.

@rgommers
Copy link
Contributor

Then I run python3 -m pip install clawpack, which, unless there's a failure mode I'm unaware of, is using that numpy version.

There is indeed such a failure mode: due to "build isolation", the versions of packages that are already installed is not relevant. That's what the Installing build dependencies ... done here is about:

python3 -m pip install clawpack
Defaulting to user installation because normal site-packages is not writeable
Collecting clawpack
  Using cached clawpack-5.10.0.tar.gz (7.5 MB)
  Installing build dependencies ... done

If you add -v (for verbose) to your install command, pip will tell you what version is used during the build.

@pavelkomarov
Copy link
Author

pavelkomarov commented May 13, 2024

with_verbose_flag.txt

I'm starting to lose hope, guys.

@rgommers
Copy link
Contributor

NumPy 1.26.4 is downloaded and there are indeed a number of missing files that cause your build to fail:

FileNotFoundError: [Errno 2] No such file or directory: 'pyclaw/src/pyclaw/sw_sphere_problem-f2pywrappers.f'

So there should be a bug somewhere - I am having a closer look. I cannot reproduce the problem, at least on macOS I can build wheels just fine, and the -f2pywrappers.f files exist. There are some issues in the meson.build files in this repo that could cause it, I'll have a go at cleaning those up to see if it helps (and make the logs readable).

@rgommers
Copy link
Contributor

The 7 f2pywrappers.f files mentioned in #249 (comment) that are missing are all empty when I build locally. All the other ones are non-empty. That's exactly the bug we fixed in f2py 1.22.4, so somehow the wrong numpy.f2py is still used I suspect. gh-253 could fix this hopefully (but can't be sure, since I can't reproduce the issue).

@pavelkomarov
Copy link
Author

Thanks for looking in to this more. When I run python3 -m pip -v install git+https://github.com/clawpack/clawpack so I get your changes, I get a similar but slightly different (I think?) very long printout.

errors_now.txt

@eli-schwartz
Copy link

  Program python found: YES (/usr/bin/python3)
  Found pkg-config: YES (/usr/bin/pkg-config) 1.8.0
  Run-time dependency python found: YES 3.10
  Message: f2py version: 1.21.5

Is it not using the isolated env's python3 command?

@pavelkomarov
Copy link
Author

I'm using the system's python3. All packages are installed as system packages. There is no other isolated python installed here, and I'm not putting things in a virtual environment.

@eli-schwartz
Copy link

There is no other isolated python installed here, and I'm not putting things in a virtual environment.

There is the temporary one that pip creates...

@pavelkomarov
Copy link
Author

pavelkomarov commented May 13, 2024

If it's using f2py 1.21.5, and a relevant bug was fixed in 1.22.4, then do we just need to mandate it use a newer numpy? But didn't I already try that? I don't know which versions of f2py are packaged with which versions of numpy.

I'm also slightly confused why no one can reproduce this bug. Has anyone tried it on Ubuntu?

@rgommers
Copy link
Contributor

The temporary build venv's packages are as expected:

  Successfully installed meson-1.4.0 meson-python-0.16.0 numpy-1.26.4 packaging-24.0 pyproject-metadata-0.8.0 tomli-2.0.1

This is the problem:

  Program python found: YES (/usr/bin/python3)

If I check another CI job (from SciPy) on Ubuntu 22.04 that manually creates a venv on top of the system python3, then the path looks like:

   Program python found: YES (/home/runner/work/scipy/venvs/scipy-venv/bin/python)

So somehow, for this version of Ubuntu and pip, the created venv does not get picked up correctly. Probably yet another way that Debian/Ubuntu's Python packaging is broken.

I'm also slightly confused why no one can reproduce this bug. Has anyone tried it on Ubuntu?

Yes, since Ubuntu 22.04 is the default CI image on GitHub Actions. You are doing something though that is very much not advised, which is mixing the system packages with user installs. This is broken in many ways, and this seems to be a new one. I don't think I have a CI job anywhere for this config.

then do we just need to mandate it use a newer numpy? But didn't I already try that? I don't know which versions of f2py are packaged with which versions of numpy.

numpy and f2py versions are always matching, so if f2py -v says 1.21.5 then it's numpy 1.21.5 as well.

In your setup, it wouldn't help to add numpy>=1.22.4 to pyproject.toml, since you're being bitten by some packaging bug. What would help is upgrading numpy with apt.

@eli-schwartz
Copy link

Yes, since Ubuntu 22.04 is the default CI image on GitHub Actions. You are doing something though that is very much not advised, which is mixing the system packages with user installs. This is broken in many ways, and this seems to be a new one. I don't think I have a CI job anywhere for this config.

That's not remotely a useful heuristic, since those are also using actions/setup-python rather than anything Debian/Ubuntu provides as packages. CI environments are unfortunately NOT an indicator of what works on an actual install.

@rgommers
Copy link
Contributor

rgommers commented May 14, 2024 via email

@pavelkomarov
Copy link
Author

pavelkomarov commented May 14, 2024

kutz@kutz-Lambda-Vector:~$ sudo apt-get install python3-numpy
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-numpy is already the newest version (1:1.21.5-1ubuntu22.04.1).

Ahha! 1.21.5!

@pavelkomarov
Copy link
Author

pavelkomarov commented May 14, 2024

If I sudo apt-get remove python3-numpy so that it can't take precedence over the version installed with pip, then python3 -m pip -v install clawpack, then:

Successfully built clawpack
Installing collected packages: clawpack
Successfully installed clawpack-5.10.0

🎉

@mandli
Copy link
Member

mandli commented May 14, 2024

Thanks for all the help on figuring this out!

@rgommers
Copy link
Contributor

Great, glad that you got it to work @pavelkomarov. It looks like that's a bug in Debian's pip packaging then, since isolated build venvs should be created with --no-site-packages but in this case the numpy 1.21 in your system site-packages leaked in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants