cjlin1 / libsvm

LIBSVM -- A Library for Support Vector Machines
https://www.csie.ntu.edu.tw/~cjlin/libsvm/
BSD 3-Clause "New" or "Revised" License
4.55k stars 1.64k forks source link

Using LIBSVM with OpenMP under Octave #27

Closed kvantas closed 9 years ago

kvantas commented 9 years ago

Hello, I don't have enough development experience on Linux, forgive me if I ask something obvious.

  1. I added the -fopenmp to CFLAGS and -lgomp to MEX_OPTION at /matlab/Makefile
  2. I added to /Makefile -fopenmp to CFLAGS
  3. In svm.cpp I added: 3.1 "#pragma omp parallel for private(j)" above the line "for(j=start;j<len;j++)" (1285 line) 3.2 "#pragma omp parallel for private(i) reduction(+:sum)" above the line "for(i=0;il;i++)" (2511 line) 3.3 #pragma omp parallel for private(i)" above the line "for(i=0;i<l;i++)" (2528 line)
  4. I run under octave the make command

Then when I am using the svmtrain under Octave I get the error: /home/Octave/libsvm_mp/matlab/svmtrain.mex: failed to load: /home/Octave/libsvm_mp/matlab/svmtrain.mex: undefined symbol: omp_get_thread_num

What am I doing wrong here?

(Ubuntu 14.04, Octace 3.8.1, gcc 4.9, libsvm 3.20 )

cjlin1 commented 9 years ago

We have improved the description in libsvm faq. Please check

Thanks, Chih-Jen

Konstantinos Vantas writes:

Hello, I don't have enough development experience on Linux, forgive me if I ask something obvious.

  1. I added the -fopenmp to CFLAGS and -lgomp to MEX_OPTION at /matlab/Makefile
  2. I added to /Makefile -fopenmp to CFLAGS
  3. In svm.cpp I added: 3.1 "#pragma omp parallel for private(j)" above the line "for(j=start;jl;i++)" (2511 line) 3.3 #pragma omp parallel for private(i)" above the line "for(i=0;i<l;i++)" (2528 line)
  4. I run under octave the make command

Then when I am using the svmtrain under Octave I get the error: /home/Octave/ libsvm_mp/matlab/svmtrain.mex: failed to load: /home/Octave/libsvm_mp/matlab/ svmtrain.mex: undefined symbol: omp_get_thread_num

What am I doing wrong here?

(Ubuntu 14.04, Octace 3.8.1, gcc 4.9, libsvm 3.20 )

— Reply to this email directly or view it on GitHub.*

mricherzhagen commented 9 years ago

Kind of offtopic, but since you mention the FAQ:

Not Found

The requested URL /~cjlin/libsvm was not found on this server.

~~When trying to access http://www.csie.ntu.edu.tw/~cjlin/libsvm/ Did the FAQ and webpage move?~~

EDIT: its back online

kvantas commented 9 years ago

Thanks! Konstantinos

cjlin1 commented 9 years ago

I can access it.. Don't know what happened to you?

Matthias Richerzhagen writes:

Kind of offtopic, but since you mention the FAQ:

Not Found

The requested URL /~cjlin/libsvm was not found on this server.

When trying to access http://www.csie.ntu.edu.tw/~cjlin/libsvm/ Did the FAQ and webpage move?

— Reply to this email directly or view it on GitHub.*