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

Doesn't install on Windows #41

Closed
manassharma07 opened this issue Sep 11, 2020 · 4 comments
Closed

Doesn't install on Windows #41

manassharma07 opened this issue Sep 11, 2020 · 4 comments

Comments

@manassharma07
Copy link

This may or may not be irrelevant since you are rewriting the library and API.

But I thought, I should bring this to your attention.

The library wont install on Windows machines natively because on Windows the C compiler that MS supplies doesn't support M_PI definition.

https://stackoverflow.com/questions/26065359/m-pi-flagged-as-undeclared-identifier

I get the following errors:

 -- Build files have been written to: C:/Users/cms/AppData/Local/Temp/pip-install-9bhhelkz/numgrid/build_setup_py
    C:\Users\cms\AppData\Local\Programs\Python\Python38-32\Scripts\cmake.exe --build C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py --target install
    Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(499,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\ZERO_CHECK.vcxproj]
      Checking Build System
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(499,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\version.vcxproj]
      Building Custom Rule C:/Users/cms/AppData/Local/Temp/pip-install-9bhhelkz/numgrid/CMakeLists.txt
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(499,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
      Building Custom Rule C:/Users/cms/AppData/Local/Temp/pip-install-9bhhelkz/numgrid/numgrid/CMakeLists.txt
    cl : command line warning D9002: ignoring unknown option '-fPIC' [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
      AtomGrid.cpp
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(59,1): warning C4273: 'numgrid_new_atom_grid': inconsistent dll linkage [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\numgrid.h(24,16): message : see previous definition of 'numgrid_new_atom_grid' [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(158,42): error C2065: 'M_PI': undeclared identifier [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(172,1): warning C4273: 'numgrid_free_atom_grid': inconsistent dll linkage [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\numgrid.h(70,10): message : see previous definition of 'numgrid_free_atom_grid' [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(180,1): warning C4273: 'numgrid_get_num_grid_points': inconsistent dll linkage [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\numgrid.h(34,9): message : see previous definition of 'numgrid_get_num_grid_points' [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(183,68): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(186,1): warning C4273: 'numgrid_get_num_radial_grid_points': inconsistent dll linkage [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\numgrid.h(38,9): message : see previous definition of 'numgrid_get_num_radial_grid_points' [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(191,35): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(205,1): warning C4273: 'numgrid_get_grid': inconsistent dll linkage [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\numgrid.h(42,10): message : see previous definition of 'numgrid_get_grid' [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(267,1): warning C4273: 'numgrid_get_radial_grid': inconsistent dll linkage [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\numgrid.h(56,10): message : see previous definition of 'numgrid_get_radial_grid' [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\AtomGrid.cpp(285,1): warning C4273: 'numgrid_get_angular_grid': inconsistent dll linkage [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\numgrid.h(62,10): message : see previous definition of 'numgrid_get_angular_grid' [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
      becke_partitioning.cpp
      grid_radial.cpp
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\grid_radial.cpp(77,37): error C2065: 'M_PI': undeclared identifier [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\grid_radial.cpp(80,24): error C2065: 'M_PI': undeclared identifier [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\grid_radial.cpp(80,31): error C2065: 'M_PI': undeclared identifier [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\grid_radial.cpp(81,23): error C2065: 'M_PI': undeclared identifier [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
      version.cpp
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\version.cpp(8,29): warning C4273: 'numgrid_get_version': inconsistent dll linkage [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\numgrid.h(20,11): message : see previous definition of 'numgrid_get_version' [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
      bragg.cpp
      sphere_lebedev_rule.cpp
    C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\numgrid\lebedev\sphere_lebedev_rule.cpp(6487,8): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\Users\cms\AppData\Local\Temp\pip-install-9bhhelkz\numgrid\build_setup_py\numgrid\numgrid-objects.vcxproj]
      Generating Code...
    Error while building with CMake
    ----------------------------------------
ERROR: Command errored out with exit status 4294967295: 'c:\users\cms\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\cms\\AppData\\Local\\Temp\\pip-install-9bhhelkz\\numgrid\\setup.py'"'"'; __file__='"'"'C:\\Users\\cms\\AppData\\Local\\Temp\\pip-install-9bhhelkz\\numgrid\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\cms\AppData\Local\Temp\pip-record-61jurh9m\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\cms\appdata\local\programs\python\python38-32\Include\numgrid' Check the logs for full command output.

Also, I guess the -fPIC argument should only be used with the compilers that support it MSVC doesn't seem to support it.

In case this is irrelevant for the Rust rewrite of the code then ignore it.
Although, it would be much appreciated if the new version would be Windows compatible.

@manassharma07 manassharma07 changed the title Doesn't work on Windows Doesn't install on Windows Sep 11, 2020
@bast
Copy link
Member

bast commented Sep 11, 2020

I can imagine that this fails. Thanks for reporting. In the upcoming version this problem will hopefully go away by itself. I will soon wrap up #40.

@bast
Copy link
Member

bast commented Jan 3, 2021

Now that v2.0.0 is out, I believe installation on Windows should work.

@bast bast closed this as completed Jan 3, 2021
@manassharma07
Copy link
Author

Although, I haven't tested the working on Windows yet, it does seem to install perfectly. A big thank you!

@bast
Copy link
Member

bast commented Jan 17, 2021

That is great to hear - thanks for feedback! More work upcoming soon.

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

2 participants