help-octave
[Top][All Lists]
Advanced

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

Re: LIBLINEAR octave make file


From: Chieh-Yen
Subject: Re: LIBLINEAR octave make file
Date: Tue, 20 May 2014 23:16:18 +0800

Dear Kai,

Thanks for your solution.
It is a possible alternative while I want to figure out 
the reason why I can use regular _expression_ like "../blas/*.c"
to separated compiling step and linking step(3.8.1):

mex -c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c
mex train.c

but fail to original method(3.8.1):

mex train.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c

If the regular _expression_ fails, the compiling step 
"mex -c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c"
should fails instead of successfully being compiled.

The version 3.2 works fine and I don't find enough information to conclude the reason.
Is there any comment?
Thanks a lot!

Chieh-Yen


On Tue, May 20, 2014 at 2:14 AM, Kai Torben Ohlhus <address@hidden> wrote:
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]