liblinear icon indicating copy to clipboard operation
liblinear copied to clipboard

How to get 64bit dll for python in windows by Makefile.win

Open CharlesMei opened this issue 10 years ago • 7 comments

I want to use python interface for 64bit python in windows, but the liblinear.dll in the /windows directory seems to be 32bit one. And i can not generate 64bit dll by "nmake -f Makefile.win clean all" , this just generate exe file in /windows directory. So how can i do that?

CharlesMei avatar Jul 25 '15 19:07 CharlesMei

You should try "nmake -f Makefile.win lib" to generate .dll file.

infwinston avatar Jul 26 '15 05:07 infwinston

@infwinston Thank you! It works! But when i use "from liblinearutil import *", it throws "AttributeError: function 'find_parameter_C' not found".When i comment "fillprototype(liblinear.find_parameter_C, None, [POINTER(problem), POINTER(parameter), c_int, c_double, c_double, POINTER(c_double), POINTER(c_double)])" in the liblinear.py, it throws no errors. But what should i do if i want to use find_parameter_C

CharlesMei avatar Jul 26 '15 08:07 CharlesMei

Hi, @CharlesMei I find the problem is the authors forget to add somethings in linear.def, Here is one of the solutions for now, in linear.def, add a line of code: "find_parameter_C @20" then re-compile the dll file, you may use the function successfully. Hope this helps.

infwinston avatar Jul 26 '15 18:07 infwinston

BTW, I think the dll file in liblinear-2.01 is already 64-bit version, why do you need to re-generate the dll?

infwinston avatar Jul 27 '15 05:07 infwinston

Hi, @infwinston Thank you! It works well! You're right, it's already 64-bit version. When i use the original dll in liblinear-2.01, it throws errors when i use "from liblinearutil import *", and it is because of the find_parameter_C problem. When i use libsvm-3.20, it needs to re-generate the dll for 64bit to solve the import error, so i thought it may need to do the same in liblinear-2.01. I'm sorry for that.

CharlesMei avatar Jul 27 '15 13:07 CharlesMei

This issue was moved to angleto/liblinear#19

simsong avatar Jan 22 '18 23:01 simsong

In case it helps anybody, I was able to compile a 64-bit version DLL for an older release of liblinear which has 32-bit executable included.

First, activate the Visual C++ toolset in 64-bit mode from by running vcvarsall amd64 then run nmake -f Makefile.win lib as stated above.

se210 avatar Feb 28 '18 21:02 se210