help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LIBLINEAR octave make file


From: Kai Torben Ohlhus
Subject: Re: LIBLINEAR octave make file
Date: Mon, 19 May 2014 20:14:15 +0200

On Mon, May 19, 2014 at 5:39 PM, Chieh-Yen <address@hidden> wrote:
Dear all,

I am one of the maintainers of LIBLINEAR.
I tried to make the octave binary of LIBLINEAR-1.94.
In octave 3.2.4, the original make file works fine 
but fails when using octave 3.8.1.

The original make file is :
==
mex train.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c
==
But the compiler shows error message:

"gcc: fatal error: cannot specify -o with -c, -S or -E with multiple files"

I think mex parse the command
mex train.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c
to another command containing target file name, object file names, 
-c and -o together.
It is obvious that the command is ambiguous.
The problem could be solved by separating the compiling and linking steps as
==
mex -c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c
mex train.c
==
However, it's strange why it worked before but not right now.
Can anyone explain it or offer any comment?
Thanks a lot.

Best regards,
Chieh-Yen

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave


Hello Chieh-Yen,

I tried to compile your library and the problem lies in the wildcard command "../blas/*.c". mkoctfile and mex make individual calls for compilation and stores the .o files in the calling directory. Even with GCC it is not possible to run a statement like this. Maybe you try the compiler flag "-v" to see the difference from Octave 3.2 to 3.8, I don't have 3.2 installed.

mex -v train.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/daxpy.c  ../blas/ddot.c   ../blas/dnrm2.c  ../blas/dscal.c %MODIFIED!!
clang -c  [snip]  train.c -o train.o
clang -c  [snip]  linear_model_matlab.c -o linear_model_matlab.o
clang -c  [snip] ../blas/daxpy.c -o daxpy.o
[snip]
clang++ -c  [snip]  ../linear.cpp -o linear.o
[snip]
clang++ -shared -Wl,-Bsymbolic  -o train.mex  train.o linear_model_matlab.o daxpy.o ddot.o dnrm2.o dscal.o linear.o tron.o   -L/usr/local/lib/octave/4.1.0+ -L/usr/local/lib -loctinterp -loctave

HTH,
Kai

reply via email to

[Prev in Thread] Current Thread [Next in Thread]