dfm / python-fsps

Python bindings to Charlie Conroy's Flexible Stellar Population Synthesis (FSPS) Fortran code
https://python-fsps.readthedocs.io
MIT License
66 stars 38 forks source link

Build doesn't work on Windows #267

Closed yashlapasia closed 1 month ago

yashlapasia commented 5 months ago

Hi all, I have been trying to install fsps on windows 11 for the past couple of days but I'm constantly running into this error

pip install -U fsps
Collecting fsps
  Using cached fsps-0.4.6.tar.gz (120 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in c:\users\yash lapasia\anaconda3\lib\site-packages (from fsps) (1.24.3)
Building wheels for collected packages: fsps
  Building wheel for fsps (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for fsps (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      WARNING: Use cmake.version instead of cmake.minimum-version with scikit-build-core >= 0.8
      WARNING: Use ninja.version instead of ninja.minimum-version with scikit-build-core >= 0.8
      *** scikit-build-core 0.8.1 using CMake 3.28.3 (wheel)
      *** Configuring CMake...
      2024-02-19 16:19:19,735 - scikit_build_core - WARNING - Can't find a Python library, got libdir=None, ldlibrary=None, multiarch=None, masd=None
      loading initial cache file C:\Users\YASHLA~1\AppData\Local\Temp\tmppcg8uyqz\build\CMakeInit.txt
      -- Building for: NMake Makefiles
      CMake Error at CMakeLists.txt:2 (project):
        Running

         'nmake' '-?'

        failed with:

         The system cannot find the file specified

      CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
      CMake Error: CMAKE_Fortran_COMPILER not set, after EnableLanguage
      -- Configuring incomplete, errors occurred!

      *** CMake configuration failed
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for fsps
Failed to build fsps
ERROR: Could not build wheels for fsps, which is required to install pyproject.toml-based projects

I was able to install this on the Ubuntu VM but constantly running into this issue here.

dfm commented 5 months ago

Unfortunately I haven't had much luck debugging compile issues on Windows. We used to build binary wheels for Windows, but those stopped working a while ago, and I don't have a Windows machine or the relevant expertise to get that to work.

I don't expect this is really a Python-FSPS specific problem, rather a bigger question of setting up a development environment that has the appropriate compilers (incl Fortran), but if anyone comes across this and has a set of steps to recommend, we'd love to hear them!

In the meantime, I'd recommend using a VM or Windows Subsystem for Linux.