Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

LINK_WITH_PYTHON issue on windows #8778

Closed
1 of 3 tasks
jmarrec opened this issue May 20, 2021 · 1 comment · Fixed by #8832
Closed
1 of 3 tasks

LINK_WITH_PYTHON issue on windows #8778

jmarrec opened this issue May 20, 2021 · 1 comment · Fixed by #8832
Assignees
Labels
Defect Includes code to repair a defect in EnergyPlus

Comments

@jmarrec
Copy link
Contributor

jmarrec commented May 20, 2021

Issue overview

I have a build error on windows. I've tried with both python 3.8 and 3.9.

find_package(PythonLibs 3 REQUIRED) outputs this:

Found PythonLibs: optimized;C:/Python38/libs/python38.lib;debug;C:/Python38/libs/python38_d.lib (found suitable version "3.8.6", minimum required is "3")

As a result, PythonGetLibAndLinkUp is called with the

 RESOLVED_PYTHON_LIB=C:/Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/optimized;C:/Python38/libs/python38.lib;debug;C:/Python38/libs/python38_d.lib

so in PythonGetLibAndLinkUp it'll try to copy and install the non existing C:/Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/optimized. So the resulting package is broken since it's missing the Python DLL.

I would very much recommend we actually stop using the deprecated FindPythonInterp / FindPythonLibs (deprecated since cmake 3.12) and move to the more modern

Details

Some additional details for this issue (if relevant):

>cmake --version
cmake version 3.20.0

Tested with pythons:

Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
  • Version of EnergyPlus (if using an intermediate build, include SHA): develop, b9b6636

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Defect file added (list location of defect file here)
  • Ticket added to Pivotal for defect (development team task)
  • Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect)
@jmarrec
Copy link
Contributor Author

jmarrec commented May 20, 2021

I'm pretty sure that the reason I'm getting problem is because I explicitly installed the DEBUG libraries when I installed Python, so cmake finds both.

@jmarrec jmarrec self-assigned this May 20, 2021
@jmarrec jmarrec added the Defect Includes code to repair a defect in EnergyPlus label May 20, 2021
Myoldmopar added a commit that referenced this issue Jul 1, 2021
Fix #8778 - FindPython in modern cmake and handle issue when LINK_WITH_PYTHON on windows with both Release/debug libraries
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
1 participant