msvc\mpir_config.py script errors

29 views
Skip to first unread message

dr vengy

unread,
Jan 8, 2019, 11:53:06 AM1/8/19
to mpir-devel
Hi,

Two questions:


Question #1:
------------
Trying to build the latest mpir version from here:

https://github.com/BrianGladman/mpir

I'd like to add assembler optimised versions using the mpir_config.py script
running python 3.7.2, however I get these errors:


C:\Work\mpir-master\msvc>mpir_config.py
Traceback (most recent call last):
File "C:\Work\mpir-master\msvc\mpir_config.py", line 21, in <module>
from _msvc_project import Project_Type, gen_vcxproj
File "C:\Work\mpir-master\msvc\_msvc_project.py", line 5, in <module>
from enum import IntEnum
ImportError: No module named enum


Question #2:
------------
I've built the generic C dll_mpir_gc versions mpir.lib (import library) and mpir.dll (external DLL). Does adding the import library mpir.lib cause issues with LGPL? I could use LoadLibrary()/GetProcAddress() instead of mpir.lib but that seems silly.


Any ideas?

Thanks.

dr vengy

unread,
Jan 8, 2019, 12:12:37 PM1/8/19
to mpir-devel
fyi

Fixed #1, uninstalled all python versions and reinstalled the latest.

However, am still curious about LGPL when using an import library mpir.lib with mpir.dll.

Thanks!

Brian Gladman

unread,
Jan 8, 2019, 12:57:01 PM1/8/19
to mpir-...@googlegroups.com
On 08/01/2019 15:15, dr vengy wrote:
> Hi,
>
> Two questions:
>
> Question #1:
> ------------
> Trying to build the latest mpir version from here:
>
> https://github.com/BrianGladman/mpir
>
> I'd like to add assembler optimised versions using the mpir_config.py script
> running python 3.7.2, however I get these errors:
>
>
> C:\Work\mpir-master\msvc>mpir_config.py
> Traceback (most recent call last):
> File "C:\Work\mpir-master\msvc\mpir_config.py", line 21, in <module>
> from _msvc_project import Project_Type, gen_vcxproj
> File "C:\Work\mpir-master\msvc\_msvc_project.py", line 5, in <module>
> from enum import IntEnum
> ImportError: No module named enum

Hi,

This is odd since the standard Python 3.7.2 distribution has the 'enum'
module, see here:

https://docs.python.org/3/library/enum.html#module-enum

On my system the file that provides this module is at:

C:\Program Files\Python37\Lib\enum.py

This suggests that there is an issue of some kind with your Python
installation.

Is it possible that there is an earlier version of Python that is also
instaled on your machine? If so, it may be that your machine is set up
to use this version of Python even though you have Python 3.7.2
installed. If this is what is happening, this article gives details of
how to solve this.

https://stackoverflow.com/questions/5087831/how-should-i-set-the-default-python-version-in-windows

But it may be easier to remove all versions of Python and reinstall only
Python 3.7.2.

Please let me know if I can help further with this.

> Question #2:
> ------------
> I've built the generic C dll_mpir_gc versions mpir.lib (import library) and mpir.dll (external DLL). Does adding the import library mpir.lib cause issues with LGPL? I could use LoadLibrary()/GetProcAddress() instead of mpir.lib but that seems silly.

When you run an MPIR DLL using its stub library (mpir.lib), this creates
a link to the MSVC runtime libraries on the target machine. Provided
that these libraries are not distributed as a part of any MPIR
distribution (which they are not), I believe that this is consistent
with the system library exception within the LGPL. I don't hence
_personally_ consider it necessary to avoid the use of the mpir.lib stub
library.

However, this is a purely personal opinion, not a legal one, since I am
not an expert on the legal niceties of the LGPL in relation to use of
Open Source software used on machines running Windows.

with my regards,

Brian Gladman



dr vengy

unread,
Jan 9, 2019, 9:06:30 AM1/9/19
to mpir-devel
Thanks Brian...

Great tool btw...we use it for the Chinese remainder algorithm and Montgomery Exponentiation.
Reply all
Reply to author
Forward
0 new messages