annotate extra/NaN/src/Makefile @ 12683:d36d7d7c4b68 octave-forge

honor compiler flags - do not force but only enable debian hardening - fixes build on debian/wheezy
author schloegl
date Sun, 30 Aug 2015 00:10:09 +0000
parents a74726ba86d1
children 29631e455f62
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7802
03cd0c75b7ac docu for ML72; highlight user-specific configuration in Makefile
schloegl
parents: 7376
diff changeset
1 ####################################################
12679
a74726ba86d1 [nan-tb] support hardening flags (currenlty only for Linux)
schloegl
parents: 12652
diff changeset
2 # Copyright 2010,2011,2012,2015 Alois Schloegl
7802
03cd0c75b7ac docu for ML72; highlight user-specific configuration in Makefile
schloegl
parents: 7376
diff changeset
3 # This is part of the NaN-toolbox - a statistics and machine learning toolbox for data with and without missing values.
03cd0c75b7ac docu for ML72; highlight user-specific configuration in Makefile
schloegl
parents: 7376
diff changeset
4 # http://pub.ist.ac.at/~schloegl/matlab/NaN/
03cd0c75b7ac docu for ML72; highlight user-specific configuration in Makefile
schloegl
parents: 7376
diff changeset
5 ####################################################
03cd0c75b7ac docu for ML72; highlight user-specific configuration in Makefile
schloegl
parents: 7376
diff changeset
6
03cd0c75b7ac docu for ML72; highlight user-specific configuration in Makefile
schloegl
parents: 7376
diff changeset
7 ### modify directories according to your needs
7993
b670af56dd9d octave version support included
schloegl
parents: 7992
diff changeset
8
11098
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
9 # Define non-default octave-version
7993
b670af56dd9d octave version support included
schloegl
parents: 7992
diff changeset
10 # Octave - global install (e.g. from debian package)
11098
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
11 # OCTAVE_VERSION=
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
12 # Better alternative: define an OCTAVE_VERSION bash variable (or in .bashrc or .profile)
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
13 # OCTAVE_VERSION=-3.6.3
7993
b670af56dd9d octave version support included
schloegl
parents: 7992
diff changeset
14
b670af56dd9d octave version support included
schloegl
parents: 7992
diff changeset
15 # Matlab configuration
11098
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
16 #MATLABDIR = /usr/local/MATLAB/R2010b
7802
03cd0c75b7ac docu for ML72; highlight user-specific configuration in Makefile
schloegl
parents: 7376
diff changeset
17 # comment the following line if you use MATLAB on 32-bit operating system
03cd0c75b7ac docu for ML72; highlight user-specific configuration in Makefile
schloegl
parents: 7376
diff changeset
18 MEX_OPTION += -largeArrayDims
7993
b670af56dd9d octave version support included
schloegl
parents: 7992
diff changeset
19
7912
14021a3f31a6 fix (cross-)compilation for MEXW32 target
schloegl
parents: 7899
diff changeset
20 # Mingw crosscompiler: available at http://www.nongnu.org/mingw-cross-env/
12554
5fbbb9986f8e omit -lgomp - its not necessary and causes problems n macosx
schloegl
parents: 12384
diff changeset
21 CROSS = $(HOME)/src/mxe/usr/bin/i686-w64-mingw32.static-
5fbbb9986f8e omit -lgomp - its not necessary and causes problems n macosx
schloegl
parents: 12384
diff changeset
22 CROSS64 = $(HOME)/src/mxe/usr/bin/x86_64-w64-mingw32.static-
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
23 # include directory for Win32-Matlab include
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
24 W32MAT_INC = $(HOME)/bin/win32/Matlab/R2010b/extern/include/
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
25 W64MAT_INC = $(HOME)/bin/win64/Matlab/R2010b/extern/include/
7912
14021a3f31a6 fix (cross-)compilation for MEXW32 target
schloegl
parents: 7899
diff changeset
26 # path to GNUMEX libraries, available from here http://sourceforge.net/projects/gnumex/
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
27 GNUMEX = $(HOME)/bin/win32/gnumex
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
28 GNUMEX64 = $(HOME)/bin/win64/gnumex
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
29 # building gnumex64 was difficult, these hints were quite useful:
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
30 # http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinZvxgC9ezp2P3UCX_a7TAUYuVsp2U40MQUV6qr%40mail.gmail.com&forum_name=gnumex-users
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
31 # Instead of building "mex shortpath.c" and "mex uigetpath.c", I used empty m-functions within argout=argin;
7802
03cd0c75b7ac docu for ML72; highlight user-specific configuration in Makefile
schloegl
parents: 7376
diff changeset
32 ####################################################
12652
1bd0f6f40c56 - fix Makefile for Octave4 on windows
schloegl
parents: 12594
diff changeset
33 MKOCTFILE ?= mkoctfile$(OCTAVE_VERSION)
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
34 CC = gcc
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
35 CXX = g++
12679
a74726ba86d1 [nan-tb] support hardening flags (currenlty only for Linux)
schloegl
parents: 12652
diff changeset
36 CFLAGS += -fopenmp -Wall -Wextra -Wconversion -O2
12652
1bd0f6f40c56 - fix Makefile for Octave4 on windows
schloegl
parents: 12594
diff changeset
37 OCTMEX = $(MKOCTFILE) --mex
7912
14021a3f31a6 fix (cross-)compilation for MEXW32 target
schloegl
parents: 7899
diff changeset
38 RM = rm
3901
0c83673d2cbe Fix broken Makefile
adb014
parents: 2968
diff changeset
39
12683
d36d7d7c4b68 honor compiler flags
schloegl
parents: 12679
diff changeset
40 # Support Debian Hardening flags
d36d7d7c4b68 honor compiler flags
schloegl
parents: 12679
diff changeset
41 # https://wiki.debian.org/HardeningWalkthrough#Handling_dpkg-buildflags_in_your_upstream_build_system
d36d7d7c4b68 honor compiler flags
schloegl
parents: 12679
diff changeset
42 CFLAGS += $(CPPFLAGS)
12679
a74726ba86d1 [nan-tb] support hardening flags (currenlty only for Linux)
schloegl
parents: 12652
diff changeset
43
12652
1bd0f6f40c56 - fix Makefile for Octave4 on windows
schloegl
parents: 12594
diff changeset
44 ifneq ($(OS),Windows_NT)
1bd0f6f40c56 - fix Makefile for Octave4 on windows
schloegl
parents: 12594
diff changeset
45 CFLAGS += -fPIC
1bd0f6f40c56 - fix Makefile for Octave4 on windows
schloegl
parents: 12594
diff changeset
46 endif
1bd0f6f40c56 - fix Makefile for Octave4 on windows
schloegl
parents: 12594
diff changeset
47
12557
b0e00812d4ee on MacOSX do not compile with OpenMP
schloegl
parents: 12554
diff changeset
48 ifneq (Darwin,$(shell uname))
b0e00812d4ee on MacOSX do not compile with OpenMP
schloegl
parents: 12554
diff changeset
49 CFLAGS += -fopenmp
b0e00812d4ee on MacOSX do not compile with OpenMP
schloegl
parents: 12554
diff changeset
50 MEX_OPTION += -lgomp
b0e00812d4ee on MacOSX do not compile with OpenMP
schloegl
parents: 12554
diff changeset
51 endif
b0e00812d4ee on MacOSX do not compile with OpenMP
schloegl
parents: 12554
diff changeset
52
12554
5fbbb9986f8e omit -lgomp - its not necessary and causes problems n macosx
schloegl
parents: 12384
diff changeset
53 MEX_OPTION += CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS) " CXXFLAGS\#"$(CFLAGS) "
7912
14021a3f31a6 fix (cross-)compilation for MEXW32 target
schloegl
parents: 7899
diff changeset
54 MATMEX = $(MATLABDIR)/bin/mex $(MEX_OPTION)
6560
1170c9d6d1c4 method LibLinear is included
schloegl
parents: 6556
diff changeset
55
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
56 PROGS = histo_mex.mex covm_mex.mex kth_element.mex sumskipnan_mex.mex str2array.mex train.mex svmtrain_mex.mex svmpredict_mex.mex xptopen.mex
6547
schloegl
parents: 5579
diff changeset
57
11098
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
58 ### per default only the mex-files for octave are built
8067
6c6cb24503b9 fix warnings when ML is not available
schloegl
parents: 8066
diff changeset
59 mex4o octave: $(PROGS)
8068
12bd31f8727c fix building mex4m
schloegl
parents: 8067
diff changeset
60
11098
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
61
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
62 ### Matlab configuration - search for a matlab directory if not defined above
12572
22658fcb51e9 [tsa][nan] fix handling of MATLABDIR variable in Makefile
schloegl
parents: 12557
diff changeset
63 ifeq (,$(MATLABDIR))
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
64 ifneq (,$(shell ls -1 /usr/local/ |grep MATLAB))
12572
22658fcb51e9 [tsa][nan] fix handling of MATLABDIR variable in Makefile
schloegl
parents: 12557
diff changeset
65 # use oldest, typically mex-files are compatible with newer Matlab versions
22658fcb51e9 [tsa][nan] fix handling of MATLABDIR variable in Makefile
schloegl
parents: 12557
diff changeset
66 MATLABDIR=/usr/local/MATLAB/$(shell ls -1rt /usr/local/MATLAB/ |grep "^R20*" |head -1)
11098
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
67 endif
8067
6c6cb24503b9 fix warnings when ML is not available
schloegl
parents: 8066
diff changeset
68 endif
11098
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
69
12572
22658fcb51e9 [tsa][nan] fix handling of MATLABDIR variable in Makefile
schloegl
parents: 12557
diff changeset
70
22658fcb51e9 [tsa][nan] fix handling of MATLABDIR variable in Makefile
schloegl
parents: 12557
diff changeset
71 ### if MATLABDIR has been found or defined
22658fcb51e9 [tsa][nan] fix handling of MATLABDIR variable in Makefile
schloegl
parents: 12557
diff changeset
72 ifneq (,$(MATLABDIR))
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
73 ifneq (,$(shell ls -1 $(MATLABDIR)/bin/mexext))
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
74 MEX_EXT=$(shell $(MATLABDIR)/bin/mexext)
11098
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
75 mex4m matlab: $(patsubst %.mex, %.$(MEX_EXT), $(PROGS))
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
76 endif
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
77 endif
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
78
4becffbdb0ea fix for (presumbably a newer version of ) gnu make; Matlab: search for default installation directory
schloegl
parents: 10621
diff changeset
79
7912
14021a3f31a6 fix (cross-)compilation for MEXW32 target
schloegl
parents: 7899
diff changeset
80 mexw32 win32: $(patsubst %.mex, %.mexw32, $(PROGS))
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
81 mexw64 win64: $(patsubst %.mex, %.mexw64, $(PROGS))
8068
12bd31f8727c fix building mex4m
schloegl
parents: 8067
diff changeset
82 all: octave win32 win64 mex4m
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
83
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
84 clean:
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
85 -$(RM) *.o *.obj *.o64 core octave-core *.oct *~ *.mex*
3901
0c83673d2cbe Fix broken Makefile
adb014
parents: 2968
diff changeset
86
10621
7740a34f1dac fix message on missing mexext
schloegl
parents: 9421
diff changeset
87 #$(PROGS): Makefile
8139
3fad4ff49e91 svmpredict_mex: remove command line output; some clean up
schloegl
parents: 8101
diff changeset
88
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
89 #########################################################
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
90 # Octave, MATLAB on Linux
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
91 #########################################################
12582
664b99514b4a [nan] fix Makefile - when running -j same target is compiled simultaneously causing errors
schloegl
parents: 12572
diff changeset
92 svm%_mex.mex: svm%_mex.cpp svm.o svm_model_octave.o
664b99514b4a [nan] fix Makefile - when running -j same target is compiled simultaneously causing errors
schloegl
parents: 12572
diff changeset
93 env CC=$(CXX) $(OCTMEX) "$<" svm.o svm_model_octave.o
664b99514b4a [nan] fix Makefile - when running -j same target is compiled simultaneously causing errors
schloegl
parents: 12572
diff changeset
94 svm%_mex.$(MEX_EXT): svm%_mex.cpp svm.o svm_model_matlab.o
664b99514b4a [nan] fix Makefile - when running -j same target is compiled simultaneously causing errors
schloegl
parents: 12572
diff changeset
95 $(MATMEX) "$<" svm.o svm_model_matlab.o
12594
faae8e81f0ff [nan] simplify Makefile - options of system libraries (libsvm liblinear) are not supported anymore
schloegl
parents: 12586
diff changeset
96 %.$(MEX_EXT): %.cpp
faae8e81f0ff [nan] simplify Makefile - options of system libraries (libsvm liblinear) are not supported anymore
schloegl
parents: 12586
diff changeset
97 $(MATMEX) "$<"
6549
41e9854fe26d use *.cpp instead of *.c
schloegl
parents: 6547
diff changeset
98
12582
664b99514b4a [nan] fix Makefile - when running -j same target is compiled simultaneously causing errors
schloegl
parents: 12572
diff changeset
99 svm_model_octave.o: svm_model_matlab.c
12652
1bd0f6f40c56 - fix Makefile for Octave4 on windows
schloegl
parents: 12594
diff changeset
100 env CC=$(CC) $(MKOCTFILE) -o "$@" -c "$<"
12582
664b99514b4a [nan] fix Makefile - when running -j same target is compiled simultaneously causing errors
schloegl
parents: 12572
diff changeset
101 svm_model_matlab.o: svm_model_matlab.c
12594
faae8e81f0ff [nan] simplify Makefile - options of system libraries (libsvm liblinear) are not supported anymore
schloegl
parents: 12586
diff changeset
102 $(CC) $(CFLAGS) -I $(MATLABDIR)/extern/include -o "$@" -c "$<"
12585
26be3bc7237c [nan] support multi-threaded make; use liblinear and libsvm provided by target system
schloegl
parents: 12582
diff changeset
103 svm.o: svm.cpp
26be3bc7237c [nan] support multi-threaded make; use liblinear and libsvm provided by target system
schloegl
parents: 12582
diff changeset
104 $(CC) $(CFLAGS) -c svm.cpp
6547
schloegl
parents: 5579
diff changeset
105
12585
26be3bc7237c [nan] support multi-threaded make; use liblinear and libsvm provided by target system
schloegl
parents: 12582
diff changeset
106 train.$(MEX_EXT) predict.$(MEX_EXT): train.c tron.o linear.o linear_model_matlab.c
6563
4b3ccb63b4cf fix for ML*
schloegl
parents: 6562
diff changeset
107 $(CC) $(CFLAGS) -I $(MATLABDIR)/extern/include -c linear_model_matlab.c
6588
98a8d8e4dd44 fix make liblinear svm
schloegl
parents: 6586
diff changeset
108 $(MATMEX) -lblas train.c tron.o linear.o linear_model_matlab.o
6563
4b3ccb63b4cf fix for ML*
schloegl
parents: 6562
diff changeset
109 #$(MATMEX) -lblas predict.c tron.o linear.o linear_model_matlab.o
12585
26be3bc7237c [nan] support multi-threaded make; use liblinear and libsvm provided by target system
schloegl
parents: 12582
diff changeset
110 train.mex predict.mex: train.c tron.o linear.o linear_model_matlab.c
8101
5dfc952387ba workaround to avoid need for path to mex.h (INCOCTAVE)
schloegl
parents: 8068
diff changeset
111 env CC=$(CXX) $(OCTMEX) -lblas train.c tron.o linear.o linear_model_matlab.c
12585
26be3bc7237c [nan] support multi-threaded make; use liblinear and libsvm provided by target system
schloegl
parents: 12582
diff changeset
112 linear.o: linear.cpp
6560
1170c9d6d1c4 method LibLinear is included
schloegl
parents: 6556
diff changeset
113 $(CXX) $(CFLAGS) -c linear.cpp
1170c9d6d1c4 method LibLinear is included
schloegl
parents: 6556
diff changeset
114 tron.o: tron.cpp tron.h
1170c9d6d1c4 method LibLinear is included
schloegl
parents: 6556
diff changeset
115 $(CXX) $(CFLAGS) -c tron.cpp
1170c9d6d1c4 method LibLinear is included
schloegl
parents: 6556
diff changeset
116
12586
43fdbcb25f46 [nan] test for libsvm-dev and liblinear-dev
schloegl
parents: 12585
diff changeset
117 %.oct: %.cc
43fdbcb25f46 [nan] test for libsvm-dev and liblinear-dev
schloegl
parents: 12585
diff changeset
118 mkoctfile$(OCTAVE_VERSION) "$<"
43fdbcb25f46 [nan] test for libsvm-dev and liblinear-dev
schloegl
parents: 12585
diff changeset
119
43fdbcb25f46 [nan] test for libsvm-dev and liblinear-dev
schloegl
parents: 12585
diff changeset
120 %.mex: %.cpp
43fdbcb25f46 [nan] test for libsvm-dev and liblinear-dev
schloegl
parents: 12585
diff changeset
121 $(OCTMEX) "$<"
6560
1170c9d6d1c4 method LibLinear is included
schloegl
parents: 6556
diff changeset
122
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
123 #########################################################
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
124 # MATLAB/WIN32
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
125 #########################################################
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
126 %.obj: %.cpp
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
127 $(CROSS)$(CXX) -fopenmp -c -DMATLAB_MEX_FILE -x c++ -o "$@" -I$(W32MAT_INC) -O2 -DMX_COMPAT_32 "$<"
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
128 %.obj: %.c
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
129 $(CROSS)$(CXX) -fopenmp -c -DMATLAB_MEX_FILE -x c++ -o "$@" -I$(W32MAT_INC) -O2 -DMX_COMPAT_32 "$<"
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
130
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
131 train.mexw32 predict.mexw32: train.obj linear.obj linear_model_matlab.obj tron.obj
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
132 $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" linear_model_matlab.obj linear.obj tron.obj -llibmx -llibmex -llibmat -lcholmod -lblas
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
133
7912
14021a3f31a6 fix (cross-)compilation for MEXW32 target
schloegl
parents: 7899
diff changeset
134 svmpredict_mex.mexw32 : svmpredict_mex.obj svm.obj svm_model_matlab.obj
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
135 $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" svm_model_matlab.obj svm.obj -llibmx -llibmex -llibmat -lcholmod
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
136 svmtrain_mex.mexw32 : svmtrain_mex.obj svm.obj svm_model_matlab.obj
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
137 $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" svm_model_matlab.obj svm.obj -llibmx -llibmex -llibmat -lcholmod
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
138
7912
14021a3f31a6 fix (cross-)compilation for MEXW32 target
schloegl
parents: 7899
diff changeset
139 %.mexw32: %.obj
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
140 $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" -llibmx -llibmex -llibmat -lcholmod -lgomp -lpthread
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
141
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
142
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
143
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
144 #########################################################
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
145 # MATLAB/WIN64
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
146 #########################################################
7899
07e96b66779f add support for WIN32 cross-compilation
schloegl
parents: 7802
diff changeset
147
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
148 ## ToDO: fix OpenMP support: currently -fopenmp causes Matlab to crash
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
149 %.o64: %.cpp
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
150 $(CROSS64)$(CXX) -c -DMATLAB_MEX_FILE -x c++ -o "$@" -I$(W64MAT_INC) -O2 "$<"
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
151 %.o64: %.c
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
152 $(CROSS64)$(CXX) -c -DMATLAB_MEX_FILE -x c++ -o "$@" -I$(W64MAT_INC) -O2 "$<"
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
153
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
154 train.mexw64 predict.mexw64: train.o64 linear.o64 linear_model_matlab.o64 tron.o64
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
155 $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" linear_model_matlab.o64 linear.o64 tron.o64 -llibmx -llibmex -llibmat -lcholmod -lblas
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
156
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
157 svmpredict_mex.mexw64 : svmpredict_mex.o64 svm.o64 svm_model_matlab.o64
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
158 $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" svm_model_matlab.o64 svm.o64 -llibmx -llibmex -llibmat -lcholmod
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
159 svmtrain_mex.mexw64 : svmtrain_mex.o64 svm.o64 svm_model_matlab.o64
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
160 $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" svm_model_matlab.o64 svm.o64 -llibmx -llibmex -llibmat -lcholmod
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
161
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
162 %.mexw64: %.o64
12383
a06636a6401d nan: avoid spurios error messages when no Matlab is installed
schloegl
parents: 11098
diff changeset
163 $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" -llibmx -llibmex -llibmat -lcholmod -lgomp -lpthread
8066
8d8da31799c0 add support for building mexw64
schloegl
parents: 8037
diff changeset
164