diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sci-libs/libsvm/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-libs/libsvm/files')
-rw-r--r-- | sci-libs/libsvm/files/3.11-openmp.patch | 34 | ||||
-rw-r--r-- | sci-libs/libsvm/files/3.14-makefile.patch | 51 |
2 files changed, 85 insertions, 0 deletions
diff --git a/sci-libs/libsvm/files/3.11-openmp.patch b/sci-libs/libsvm/files/3.11-openmp.patch new file mode 100644 index 000000000000..e07b03e57380 --- /dev/null +++ b/sci-libs/libsvm/files/3.11-openmp.patch @@ -0,0 +1,34 @@ +--- a/svm.cpp.orig 2011-05-27 04:32:19.000000000 +0100 ++++ b/svm.cpp 2011-12-29 19:17:07.000000000 +0000 +@@ -1281,6 +1281,9 @@ + int start, j; + if((start = cache->get_data(i,&data,len)) < len) + { ++#ifdef OPENMP ++#pragma omp parallel for private(j) ++#endif + for(j=start;j<len;j++) + data[j] = (Qfloat)(y[i]*y[j]*(this->*kernel_function)(i,j)); + } +@@ -2463,7 +2466,10 @@ + model->param.svm_type == NU_SVR) + { + double *sv_coef = model->sv_coef[0]; +- double sum = 0; ++ double sum = 0; int i; ++#ifdef OPENMP ++#pragma omp parallel for private(i) reduction(+:sum) ++#endif + for(i=0;i<model->l;i++) + sum += sv_coef[i] * Kernel::k_function(x,model->SV[i],model->param); + sum -= model->rho[0]; +@@ -2480,6 +2486,9 @@ + int l = model->l; + + double *kvalue = Malloc(double,l); ++#ifdef OPENMP ++#pragma omp parallel for private(i) ++#endif + for(i=0;i<l;i++) + kvalue[i] = Kernel::k_function(x,model->SV[i],model->param); + diff --git a/sci-libs/libsvm/files/3.14-makefile.patch b/sci-libs/libsvm/files/3.14-makefile.patch new file mode 100644 index 000000000000..e38dafc10b20 --- /dev/null +++ b/sci-libs/libsvm/files/3.14-makefile.patch @@ -0,0 +1,51 @@ +* respect CFLAGS and CXXFLAGS from user +* compile with CC for C and CXX for C++ files +* propagate and respect user's LDFLAGS +* PIC only used for the library +* link the shared version library +nov 2012 - bicatali@gentoo.org + +--- a/Makefile.orig 2012-11-29 10:39:07.149421728 -0800 ++++ b/Makefile 2012-11-29 10:57:19.727766521 -0800 +@@ -1,9 +1,12 @@ + CXX ?= g++ +-CFLAGS = -Wall -Wconversion -O3 -fPIC ++CC ?= gcc ++CFLAGS ?= -Wall -Wconversion -O3 ++CXXFLAGS ?= $(CFLAGS) + SHVER = 2 + OS = $(shell uname) ++PICFLAGS ?= -fPIC + +-all: svm-train svm-predict svm-scale ++all: svm-train svm-predict svm-scale lib + + lib: svm.o + if [ "$(OS)" = "Darwin" ]; then \ +@@ -11,15 +14,20 @@ + else \ + SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.$(SHVER)"; \ + fi; \ +- $(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) ++ $(CXX) $(LDFLAGS) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) ; \ ++ ln -s libsvm.so.$(SHVER) libsvm.so + + svm-predict: svm-predict.c svm.o +- $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm ++ $(CC) $(CFLAGS) -c $@.c -o $@.o ++ $(CXX) $(LDFLAGS) $@.o svm.o -lm -o $@ + svm-train: svm-train.c svm.o +- $(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm ++ $(CC) $(CFLAGS) -c $@.c -o $@.o ++ $(CXX) $(LDFLAGS) $@.o svm.o -lm -o $@ + svm-scale: svm-scale.c +- $(CXX) $(CFLAGS) svm-scale.c -o svm-scale ++ $(CC) $(CFLAGS) -c $@.c -o $@.o ++ $(CXX) $(LDFLAGS) $@.o -o $@ ++ + svm.o: svm.cpp svm.h +- $(CXX) $(CFLAGS) -c svm.cpp ++ $(CXX) $(CXXFLAGS) $(PICFLAGS) -c svm.cpp -o $@ + clean: +- rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) ++ rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) libsvm.so |