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

BLD: numpy compile with mingw32 on windows using official python3.6 binary #8690

Closed
wants to merge 4 commits into from

Conversation

PierreSchnizer
Copy link

Changes I found necessary to compile numpy and to configure numpy and pygsl on windows.

I overloaded _fix_lib_args: This requires to call the parent class as the
temporary build directory is used by numpy for some static libraries
(e.g. npymath) to build numpy. This path is added to the link pathes by
one of the parent classes.

The comparison of the linked and run msvc / vcruntime library check was
not traced down. The compiled numpy was tested on windows and worked to a
large extend. The test results will be reported separately.

Pygsl uses the preprossesor to check some definitions in GSL header.
This worked for me after defining the preprocessor.

pygsl on windows.

I overloaded _fix_lib_args: This requires to call the parent class as the
temporary build directory is used by numpy for some static libraries
(e.g. npymath) to build numpy. This path is added to the link pathes by
one of the parent classes.

The comparison of the linked and run msvc / vcruntime library check was
not traced down. The compiled numpy was tested on windows and worked to a
large extend. The test results will be reported separately.

Pygsl uses the preprossesor to check some definitions in GSL header.
This worked for me after defining the preprocessor.
@@ -53,7 +53,9 @@ def get_msvcr_replacement():
_TABLE = re.compile(r'^\s+\[([\s*[0-9]*)\] ([a-zA-Z0-9_]*)')

# the same as cygwin plus some additional parameters
class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler):
_parent = distutils.cygwinccompiler.CygwinCCompiler # super() useable for all
# python versions?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super(Mingw32Compiler, self) works on all python versions we care about, so better to do it that way

@@ -608,6 +638,10 @@ def check_embedded_msvcr_match_linked(msver):
# embedding
maj = msvc_runtime_major()
if maj:
if type(msver) == type(1.0) and msver == 14.0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isinstance(msver, float) would be better here

# that did not fix this issue.
# I needed this change to have the config tests run. This links to the
# vcruntime in the python directory.
# Can this be fixed by an appropriate environment variable?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these comments feel like they belong in the PR, not the code (perhaps due to being first person)

@eric-wieser eric-wieser changed the title numpy compile with minge32 on windows using official python3.6 binary numpy compile with mingw32 on windows using official python3.6 binary Feb 25, 2017
@charris charris changed the title numpy compile with mingw32 on windows using official python3.6 binary BLD: numpy compile with mingw32 on windows using official python3.6 binary Feb 25, 2017
Schnizer added 3 commits February 26, 2017 20:05
-- python was compiled using ms c
-- extension is compiled with mingw
-- and the extension tries to makes ome file operations

I disabled fromfile function and tofile method of multiarray using the
preprocessor variable NPY_PYTHON_COMPILER_DIFFER.

Then I could run the tests using run_tests.py without any crashes. This
submission is to document the obtained results.

Test output added as file
PS: I am using numpy as distributed from numpy project for production use.
    I only compiled and tested it to find if my modifications to mingw32ccompiler.py
    introduced any further regressions
@charris
Copy link
Member

charris commented Mar 4, 2017

Have you tried with current master? There have been a lot of changes related to windows builds.

@charris
Copy link
Member

charris commented Mar 4, 2017

Commits should also be squashed.

Base automatically changed from master to main March 4, 2021 02:03
@github-actions github-actions bot added the 36 - Build Build related PR label Mar 4, 2021
@InessaPawson InessaPawson added 52 - Inactive Pending author response triage review Issue/PR to be discussed at the next triage meeting labels Jun 8, 2022
@seberg
Copy link
Member

seberg commented Nov 21, 2022

Maybe a good start at the time. 5 years on, we have cygwin tests and mingw is running mostly I think. I don't think there is anything here of interest anymore. Closing, thanks for the PR!
(I am not immediately sure how well the tooling works, feel free to open an issue if there is still a tooling problem related to this.)

@seberg seberg closed this Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 - Enhancement 36 - Build Build related PR 52 - Inactive Pending author response component: build triage review Issue/PR to be discussed at the next triage meeting
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants