wo80/vs-suitesparse

complex klu

Closed this issue · 6 comments

Hi, I'm fairly new to using visual studio so this might be a simple problem to fix. I have a project that is using the following KLU methods:

    klu_zl_rgrowth
    klu_zl_condest
    klu_zl_factor
    klu_zl_solve
    klu_zl_free_numeric
    klu_zl_refactor
    klu_l_analyze
    klu_l_defaults
    klu_zl_rcond
    klu_zl_tsolve
    klu_zl_sort
    klu_l_free_symbolic

I figured these were not getting exported so I added these to the exports.def for libklu. However I then get errors like:

Build started...
1>------ Build started: Project: libklu, Configuration: Release x64 ------
1>exports.def : error LNK2001: unresolved external symbol klu_l_analyze
1>exports.def : error LNK2001: unresolved external symbol klu_l_defaults
1>exports.def : error LNK2001: unresolved external symbol klu_l_free_symbolic
1>exports.def : error LNK2001: unresolved external symbol klu_zl_condest
1>exports.def : error LNK2001: unresolved external symbol klu_zl_factor
1>exports.def : error LNK2001: unresolved external symbol klu_zl_free_numeric
1>exports.def : error LNK2001: unresolved external symbol klu_zl_rcond
1>exports.def : error LNK2001: unresolved external symbol klu_zl_refactor
1>exports.def : error LNK2001: unresolved external symbol klu_zl_rgrowth
1>exports.def : error LNK2001: unresolved external symbol klu_zl_solve
1>exports.def : error LNK2001: unresolved external symbol klu_zl_sort
1>exports.def : error LNK2001: unresolved external symbol klu_zl_tsolve
1>C:\Users\a1223695\git\vs-suitesparse\src\x64\Release\libklu.lib : fatal error LNK1120: 12 unresolved externals
1>Done building project "libklu.vcxproj" -- FAILED.

Is the current solution setup to not generate the complex versions of these functions somehow?

wo80 commented

Hi.
At the moment KLU only compiles as di, using double for matrix values and int (32bit) for indices. To get other versions like zl (complex, long), separate project configurations have to be added, like done with UMFPACK.
I'll add those now (not a big deal), but don't know when I get the time to publish the binaries.

I see, thanks for the quick response! When you push up the changes I can compile my own binaries and test it out.

wo80 commented

New version available in the vs-suitesparse/long branch. Will merge into master by time.

Have fun testing!

Thanks for the super quick fixes! I'll keep this issue open for now and run it through some tests.

On a separate note, your work here would be very useful to distribute through the Conda-Forge package manager for using Suitesparse with MSVC compiled Python libraries. Would you be ok if I made a package for it?

wo80 commented

Would you be ok if I made a package for it?

Sure, go ahead!
Let me know once you're ready. Then I'll add a note to the readme.

wo80 commented

With the latest upstream changes (adding a CMake build system), I guess this is no longer relevant. Feel free to re-open.