Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
------------------------------
patched by: \
Felix Schaller \
(c) 2023 felixschaller.com \

######################################################################### \

WARNING: this patch solves the "fix Python CFFI error LNK2001: unresolved external symbol PyInit__…" compile problem. But it yet requires an interface fpr python. For more Info see the Documention here: https://docs.python.org/3/extending/building.html and here: https://www.codeproject.com/articles/820116/embedding-python-program-in-a-c-cplusplus-code

######################################################################### \

# pyrtools: tools for multi-scale image processing

[![PyPI Version](https://img.shields.io/pypi/v/pyrtools.svg)](https://pypi.org/project/pyrtools/)
Expand Down
5 changes: 5 additions & 0 deletions pyrtools/Windows.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* This contains hacks to get the installation on Windows working.
* This fixes error LNK2001: unresolved external symbol PyInit__cv_algorithms
*/
void PyInit_wrapConv(void) { }
2 changes: 1 addition & 1 deletion pyrtools/pyramids/c/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# the wrapConv.so file can have some system information after it from the compiler, so we just find
# whatever it is called
libpath = glob.glob(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'wrapConv*.so'))
libpath = glob.glob(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'wrapConv*.*'))
# print(libpath)

# load the c library
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
pyrtools_version_spec.loader.exec_module(pyrtools_version_module)
VERSION = pyrtools_version_module.version

platform_src = ["pyrtools/windows.c"] if os.name == 'nt' else []

setup(
name='pyrtools',
Expand All @@ -35,7 +36,7 @@
sources=['pyrtools/pyramids/c/convolve.c',
'pyrtools/pyramids/c/edges.c',
'pyrtools/pyramids/c/wrap.c',
'pyrtools/pyramids/c/internal_pointOp.c'],
'pyrtools/pyramids/c/internal_pointOp.c'] + platform_src,
depends=['pyrtools/pyramids/c/convolve.h',
'pyrtools/pyramids/c/internal_pointOp.h'],
extra_compile_args=['-fPIC', '-shared'])],
Expand Down