In a ghci
session (doing this way for autodidactical reasons):
:module +System.Process
createProcess (proc "mingw32-make.exe" ["dll"]) { env = Just ( ("PATH", "C:/PROGRA~2/HASKEL~1/201220~1.0/mingw/bin;h:/mingw/bin"):[] ) }
Will build the libsvm.dll
file for runtime use in ghci
.
For the .a
file I did (PATH setting this order to first find the g++ tools coming with Haskell Platform itself, then the remaining mingw+msys-bundled mingw32-make):
:module +System.Process
createProcess (proc "mingw32-make.exe" []){ env = Just ( ("PATH", "C:/PROGRA~2/HASKEL~1/201220~1.0/mingw/bin;h:/mingw/bin;"):[] ) }
createProcess (proc "ar.exe" ["rc", "libsvm.a", "svm.o"]){ env = Just ( ("PATH", "C:/PROGRA~2/HASKEL~1/201220~1.0/mingw/bin;h:/mingw/bin"):[] ) }
createProcess (proc "ranlib.exe" ["libsvm.a"]){ env = Just ( ("PATH", "C:/PROGRA~2/HASKEL~1/201220~1.0/mingw/bin;h:/mingw/bin"):[] ) }
You'll need the libsvm sources.
And you'll have to edit their Makefile
, adding:
svm.dll: svm.cpp svm.h
$(CXX) $(CFLAGS) -c svm.cpp
dll: svm.dll
$(CXX) -shared svm.o -o libsvm.dll