GalacticDynamics-Oxford / Agama

Action-based galaxy modeling framework
Other
74 stars 37 forks source link

Installing Agama Windows 10 / Python 3.9.0 #6

Closed ucapffm closed 4 years ago

ucapffm commented 4 years ago

Hello there, I'm trying to install Agama on my Windows 10 as follows:

python setup.py install --user

The following error occurs:

...
copying .\Doxyfile -> build\lib.win-amd64-3.9\agama
copying .\INSTALL -> build\lib.win-amd64-3.9\agama
copying .\LICENSE -> build\lib.win-amd64-3.9\agama
copying .\README -> build\lib.win-amd64-3.9\agama
running build_ext

    ==== Checking supported compiler options and available libraries ====

g++ -Wall test.cpp -o /dev/null
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot open output file /dev/null.exe: No such file or directory
collect2.exe: error: ld returned 1 exit status
error: Could not locate a compiler (set CXX=... environment variable to override)

It seems this error is general for windows 10 devices, as I also tried in my colleague's laptop and the same issue occurs.

Could someone please assist? Thank you!

eugvas commented 4 years ago

well, Windows platform is not "officially supported" - meaning that I haven't got a chance to test it (and the current installation script indeed fails, as you pointed out). There is no fundamental reason why the library shouldn't work on Windows (and I know at least one person who successfully compiled it), but at the moment I am unable to provide any working recipe, since I don't have a windows machine at hand. Sorry! You may give it a try with manually editing the Makefile (though it might not be an easy task).

ucapffm commented 4 years ago

Thank you very much for the prompt response. I might try that. If not successful I'll go Linux.

eugvas commented 3 years ago

Compilation on Windows with MSVC is now supported - the setup.py script should be able to do this, provided that it is run from a command-line environment with Visual Studio environment variables set by vcvars64.bat or something similar, and that Python can be accessed from this command line. Run python setup.py install --user as usual. I have not tried compilation with gcc / MinGW, and suspect that things might not work there. But if one wants to use a Python extension module, it has to be compiled with the same compiler as the Python itself, and this likely means MSVC.