question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] setuptools 62.1.0 breaks project that requires fortran sources (Nonexistent include directory)

See original GitHub issue

setuptools version

62.1.0

Python version

3.10

OS

Linux, macOS

Additional environment information

I am using the version supplied by conda-forge

Description

We have a project that requires compiling fortran source files, and everything has worked fine with setuptools until version 62.1.0 (62.0.0, and all other lower versions, work!). The problem exists using macos and linux with github actions, as well as on my own macos machine. I re-emphasize, that this is a problem ONLY with 62.1.0.

I will admit that I have no idea how to debug this problem: in the build process, all of the source and module files compile, but at the very end when we try to compile the python wrapper, it complains about a non-existent include directory, which prevents the source file from finding a pre-compiled module.

INFO: gfortran:f90: src/PythonWrapper.f95
      f951: Warning: Nonexistent include directory ‘build/temp.linux-x86_64-3.8’ [-Wmissing-include-dirs]
      src/PythonWrapper.f95:2:12:
      
          2 |         use shtools, only: PlmBar
            |            1
      Fatal Error: Cannot open module file ‘shtools.mod’ for reading at (1): No such file or directory
      compilation terminated.

Expected behavior

compile with no errors, as it has been doing for the past several years…

How to Reproduce

Try to install the pyshtools project: https://github.com/SHTOOLS/SHTOOLS using pip install -v -e .

Output

Please see the github actions output for this run:

https://github.com/SHTOOLS/SHTOOLS/runs/5987783398?check_suite_focus=true

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:24 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
henryiiicommented, Apr 21, 2022

This probably comes from this StackOverflow question:

https://stackoverflow.com/questions/14320220/testing-python-c-libraries-get-build-path

There’s a big warning there “This is an internal detail of setuptools (based on the bundled version of distutils), and so is not guaranteed to be stable.” even before I edited it to include the current Setuptools. The internal build directory is a private detail and building the name yourself is going to be prone to breakage.

Look at the edited response to see how you can build this (and there’s also an answer that avoids that using build_lib from build, if that’s accessible).

1reaction
henryiiicommented, Apr 12, 2022

This hardcoded assumption about the build directory is now wrong:

https://github.com/SHTOOLS/SHTOOLS/blob/8d83c42d1313d5624c4db8c2e57300c5d819834e/setup.py#L177

Read more comments on GitHub >

github_iconTop Results From Across the Web

55534 – -Wno-missing-include-dirs does not work with gfortran
Hi, a non-existent include directory generates a warning. Unfortunate it cannot be suppressed by -Wno-missing-include-dirs: % gfc-trunk ...
Read more >
Nonexistent include directory "/opt/local/include" fftw
I have built and installed fftw as is described in the tutorial and configured my compiler to gfortran using ./configure g77=gfortran. I am...
Read more >
Bug List - FreeBSD Bugzilla
This list is too long for Bugzilla's little mind; the Next/Prev/First/Last buttons won't appear on individual bugs. Hide Search Description.
Read more >
Broken cmake build when building in parallel - Fortran ...
I'm developing a small Fortran project, and using cmake to generate a Makefile on Linux. I'm using cmake version 3.9.0-rc5.
Read more >
Issue when building cases for CESM2 | DiscussCESM Forums
I am getting an error while building a test case using CESM2, the error is down below. f951: Warning: Nonexistent include directory...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found