-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix Demo modules #7247
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
base: master
Are you sure you want to change the base?
Fix Demo modules #7247
Conversation
subfolder callback, module cheese
Fix __declspec(dllexport) function decorator for the functionn find_cheeses
Modified cheesefinder.h and cheesefinder.c
subfolder libraries, module call_mymath
Fix
1 same function decorator
Modifled mymath.h and mymath.c
2 file name in the #include directive
file mymath.c
3 mofify file Setup.py
add check not sys.platform.startswith("win") prior call to gcc compiler
make call to cythonize conditional upon check for library file presence
add second variant of cythonize for windows without libraries and
library_dirs parameters
Modify Setup.py under Demos subfolder
1 add to the list of exclusions callback and libraries
2 organize custom extensions into array
3 ensure include_dirs for the extensions point to correct folders
4 ensure sources are correctly provided
subfolder callback, module cheese
Fix __declspec(dllexport) function decorator for the functionn find_cheeses
Modified cheesefinder.h and cheesefinder.c
subfolder libraries, module call_mymath
Fix
1 same function decorator
Modifled mymath.h and mymath.c
2 add #include directive for the file "mymath.c"
change #include directove for the file "math.h" to angle brackets
to ensure proper C standard file included
3 mofify file Setup.py
add check not sys.platform.startswith("win") prior call to gcc compiler
make call to cythonize conditional upon check for library file presence
add second variant of cythonize for windows without libraries and
library_dirs parameters
Modify Setup.py under Demos subfolder
1 add to the list of exclusions callback and libraries
2 organize custom extensions into array
3 ensure include_dirs for the extensions point to correct folders
4 ensure sources are correctly provided
subfolder callback, module cheese
Fix __declspec(dllexport) function decorator for the functionn
find_cheeses
Modified cheesefinder.h and cheesefinder.c
subfolder libraries, module call_mymath
Fix
1 same function decorator
Modifled mymath.h and mymath.c
2 add #include directive for the file "mymath.c"
change #include directove for the file "math.h" to angle brackets
to ensure proper C standard file included
3 mofify file Setup.py
add check not sys.platform.startswith("win") prior call to gcc compiler
make call to cythonize conditional upon check for library file
presence
add second variant of cythonize for windows without libraries and
library_dirs parameters
Modify Setup.py under Demos subfolder
1 add to the list of exclusions callback and libraries
2 organize custom extensions into array
3 ensure include_dirs for the extensions
4 ensure sources are correctly provided
- reduce the number of parameters in setup.py to just necessary - remove superfluous call to get_include() - remove specific directory to search for include files - replace explicit module name(s) with *, as those match .pyx file name - remove DLL_EXPORT directive from custom .c files in cheese and my_mathcall modules
|
Please review changes, as per above. |
It's very difficult to use anything except MSVC on Windows. The most promising open-source option is clang-cl. This would probably work perfectly except that setuptools doesn't recognise it. I really would not try to support or document mingw or cygwin. |
for callback and libraries .h file replace custom define with Python standard exports.h define Py_EXPORTED_SYMBOL for setup.py script under libraries module improve building library using distutil compile, create_static_lib ccompiler class methods for Microsoft Windows platform
Add python's include directory on command line to ensure correct build
Modify local setup.py under ./Demos/libraries to pick up its name from PYX file Modify common setup.py under ./Demos so that no dependency on numpy to build callback Retain common setup.py stopping on error immediatelly
…me/cython into miron/fix-demo-modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's really worth showing two ways to build the libraries. If setuptools can do it, that's probably enough. The intention here is not to show how to build an external library because users who want to integrate with an external library probably have it available or at least know how to build it.
modifying #include directive from <exports.h> to <Python.h> to deduce chance of name collision
Use variable for library name Ensure plaform specific handling of include directories Fix header line of setup.py under ./libraries Apply python formatter to align code
Changes:
subfolder callback, module cheese
Fix __declspec(dllexport) function decorator for the function find_cheeses
Modified cheesefinder.h and cheesefinder.c
subfolder libraries, module call_mymath
Fixes
1 same function decorator
Modified mymath.h and mymath.c
2 add #include directive for the file "mymath.c"
change #include directive for the file "math.h" to angle brackets to ensure proper C standard file included
3 modify file Setup.py
add check not sys.platform.startswith("win") prior call to gcc compiler
make call to cythonize conditional upon check for library file presence
add second variant of cythonize for windows without libraries and library_dirs parameters
Modify Setup.py under Demos subfolder
1 add to the list of exclusions callback and libraries subfolders and their respective modules
2 organize subset of custom extensions into array
3 ensure include_dirs for the extensions point to correct folders
4 ensure sources are correctly provided
Link issue #7233