Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LibSVM #358

Merged
merged 6 commits into from
Apr 14, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions recipes/libsvm/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nmake /f Makefile.win all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you have removed the clean command, could you please remove the files in the windows folder before building?

if errorlevel 1 exit 1

REM Install step
copy windows\libsvm.dll %LIBRARY_LIB%\libsvm.dll
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add if errorlevel 1 exit 1 here too?

xcopy windows\*.exe %LIBRARY_BIN%\
if errorlevel 1 exit 1
copy svm.h %LIBRARY_INC%\svm.h
if errorlevel 1 exit 1
14 changes: 14 additions & 0 deletions recipes/libsvm/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

make all
make lib
# there is no make check or something similar and no make install

mkdir -p $PREFIX/share/licenses/libsvm $PREFIX/lib $PREFIX/include $PREFIX/bin
install -m644 libsvm.so.* $PREFIX/lib/
install -m644 svm.h $PREFIX/include/svm.h
install -m644 COPYRIGHT $PREFIX/share/licenses/libsvm/LICENSE
install -m755 svm-train $PREFIX/bin/
install -m755 svm-scale $PREFIX/bin/
install -m755 svm-predict $PREFIX/bin/
ln -s libsvm.so.* $PREFIX/lib/libsvm.so
48 changes: 48 additions & 0 deletions recipes/libsvm/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% set version = "3.21" %}
{% set flatversion = version.replace(".", "") %}

package:
name: libsvm
version: {{ version }}

source:
fn: libsvm-{{ flatversion }}.tar.gz
url: https://github.com/cjlin1/libsvm/archive/v{{ flatversion }}.tar.gz
md5: acff2c058b7cb38a135fa5d0b4f39e43

patches:
- win32.patch # [win32]

build:
number: 0
features:
- vc9 # [win and py27]
- vc10 # [win and py34]
- vc14 # [win and py35]

test:
requires:
- python {{ environ['PY_VER'] + '*' }} # [win]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msarahan this became a bit confusing but this is now the libsvm PR. I point you again to this, which was required to get builds to work and appears to be the source of the woes on the jpeg PR.


test:
commands:
- test -e $PREFIX/include/svm.h # [unix]
- test -e $PREFIX/lib/libsvm.so # [unix]
- test -e $PREFIX/lib/libsvm.so.2 # [unix]
- svm-train | grep 'Usage' # [unix]
- svm-scale | grep 'Usage' # [unix]
- svm-predict | grep 'Usage' # [unix]
- svm-train | find "Usage" # [win]
- svm-scale | find "Usage" # [win]
- svm-predict | find "Usage" # [win]
- if not exist %PREFIX%\\Library\\lib\\libsvm.dll exit 1 # [win]

about:
home: https://github.com/cjlin1/libsvm
license: Modified BSD License (3-clause)
summary: A simple, easy-to-use, and efficient software for SVM classification and regression.

extra:
recipe-maintainers:
- 183amir
- patricksnape
7 changes: 7 additions & 0 deletions recipes/libsvm/win32.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--- Makefile.win
+++ Makefile.win
@@ -7,3 +7,3 @@
CXX = cl.exe
-CFLAGS = /nologo /O2 /EHsc /I. /D _WIN64 /D _CRT_SECURE_NO_DEPRECATE
+CFLAGS = /nologo /O2 /EHsc /I. /D _WIN32 /D _CRT_SECURE_NO_DEPRECATE
TARGET = windows