www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/01/30/22:54:42

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E92C83857810
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=trueroad.jp
Authentication-Results: sourceware.org;
spf=none smtp.mailfrom=trueroad AT trueroad DOT jp
Date: Sun, 31 Jan 2021 12:53:48 +0900 (JST)
Message-Id: <20210131.125348.529339282301413911.trueroad@trueroad.jp>
To: cygwin AT cygwin DOT com
Subject: Re: python-cython C++ support patch
From: Masamichi Hosoda <trueroad AT trueroad DOT jp>
In-Reply-To: <20210130.222850.1144915727792964409.trueroad@trueroad.jp>
References: <20210129 DOT 193143 DOT 371461372727925270 DOT trueroad AT trueroad DOT jp>
<7edac602-ab79-7421-f5f8-929c7fa68428 AT gmail DOT com>
<20210130 DOT 222850 DOT 1144915727792964409 DOT trueroad AT trueroad DOT jp>
X-Mailer: Mew version 6.8 on Emacs 27.1
Mime-Version: 1.0
X-VirusScan: Outbound; mvir-ac12; Sun, 31 Jan 2021 12:53:54 +0900
X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Cc: trueroad AT trueroad DOT jp
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

>> PyMODINIT_FUNC unfortunately dos not work and my changes try
>> to overcome it, see similar on
>> 
>> https://sourceware.org/pipermail/cygwin/2021-January/247211.html
>> 
>> but your portion is for additional C++ case
>> than I am adding in asimilar way
>> 
>> Regards
>> Marco
>
> a test package has been just uploaded.
> Try it and tell me if it solves your problem.
>
> Otherwise point me to your C++ code and I will look on it.
>
> Regards
> Marco

python38-cython-0.29.21-3 works fine with following test code.

```hello.pyx
print('Hello World!')
```

```setup.py
from distutils.core import setup
from Cython.Build import cythonize

setup(
    ext_modules=cythonize(
        "hello.pyx",
        language="c++",
    )
)
```

```test.py
import hello
```

Here's the result by python38-cython-0.29.21-2 (failed).

```
$ python setup.py build_ext --inplace
[...snip...]
$ python test.py
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import hello
ImportError: dynamic module does not define module export function (PyInit_hello)
```

Here's the result by python38-cython-0.29.21-3 (succeeded).

```
$ python setup.py build_ext --inplace
[...snip...]
$ python test.py
Hello World!
```

Thanks.
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019