source: orange/source/orange/Makefile @ 8981:db95844528c6

Revision 8981:db95844528c6, 2.5 KB checked in by ales_erjavec <ales.erjavec@…>, 3 years ago (diff)

Refactored the code for LibSVM and LIBLINEAR. The sources are unmodified in liblinear and libsvm directories. Can be excluded from the build and instead linked to a system libraries instead.
The most significant change is in the way custom kernels are handled for SVMLearner - it now uses 'PRECOMPUTED' kernel functionality from LibSVM (as a bonus the results seem to be better then before (was there a bug in the previous code?), also faster)

Line 
1all:    objdir $(OLD)/orange.so
2
3MODULENAME=ORANGE
4include ../makefile.defs
5-include makefile.deps
6
7
8#########################################################################
9# If BLAS_LIB is not defiend then include a minimal subset of blas into
10# orange library. If BLAS_LIB is defined it must be the name of the blas
11# library to link with (e.g. blas). The libraries must be on the
12# search path.
13#########################################################################
14
15ifndef BLAS_LIB
16BLAS_OBJECTS = obj/daxpy.o obj/ddot.o obj/dnrm2.o obj/dscal.o obj/dcopy.o
17else
18BLAS_OBJECTS =
19LINKOPTIONS += -l$(BLAS_LIB)
20endif
21
22obj/%.o : blas/%.c blas/blas.h blas/blasp.h
23    $(CCOMPILER) $(COMPILEOPTIONS) -c $< -o $@
24
25
26#########################################################################
27# If LIBLINEAR_LIB is not defiend then include a minimal subset of LIBLINEAR
28# into orange library. If LIBLINEAR_LIB is defined it must be the name of the
29# liblinear library to link with (e.g. linear). The library must be on the
30# search path.
31#########################################################################
32
33ifndef LIBLINEAR_LIB
34LIBLINEAR_OBJECTS = obj/linear.o obj/tron.o
35COMPILEOPTIONS += -Iliblinear # Add liblinear inclue dir to compile options
36else
37LIBLINEAR_OBJECTS =
38LINKOPTIONS += -l$(LIBLINEAR_LIB)
39endif
40
41obj/%.o : liblinear/%.cpp liblinear/%.h
42    $(COMPILER) $(COMPILEOPTIONS) -c $< -o $@
43
44
45#########################################################################
46# If LIBSVM_LIB is not defiend then include a minimal subset of LIBSVM
47# into orange library. If LIBSVM_LIB is defined it must be the name of the
48# libsvm library to link with (e.g. svm). The library must be on the
49# search path.
50#########################################################################
51
52ifndef LIBSVM_LIB
53LIBSVM_OBJECTS = obj/svm.o
54else
55LIBSVM_OBJECTS =
56LINKOPTIONS += -l$(LIBSVM_LIB)
57endif
58
59obj/%.o : libsvm/%.cpp libsvm/%.h
60    $(COMPILER) $(COMPILEOPTIONS) -c $< -o $@
61   
62
63LINPACK_OBJECTS = obj/dqrsl.o obj/dqrdc2.o obj/dtrsl.o obj/linpack.o
64
65obj/%.o : linpack/%.c linpack/linpack.h
66    $(CCOMPILER) $(COMPILEOPTIONS) -c $< -o $@
67
68ALL_OBJECTS = $(ORANGE_OBJECTS) $(BLAS_OBJECTS) $(LINPACK_OBJECTS) $(LIBLINEAR_OBJECTS) $(LIBSVM_OBJECTS)
69
70$(OLD)/orange.so:   ppp/stamp px/stamp $(ALL_OBJECTS)
71    $(LINKER) $(ALL_OBJECTS) $(LINKOPTIONS) -o $(OLD)/orange.so
72ifeq ($(OS), Darwin)
73    install_name_tool -id $(DESTDIR)/orange.so $(OLD)/orange.so
74endif
75    cd $(OLD); ln -sf orange.so $(LIBRARY_FILE)
76
77clean: cleantemp
78#   rm -f r_imports.ipp r_imports.jpp
79    rm -f $(OLD)/orange.so $(OLD)/liborange.so
Note: See TracBrowser for help on using the repository browser.