forked from ulfgri/gdsii-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makemex.m
105 lines (85 loc) · 3.1 KB
/
makemex.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
%
% script to make .mex files
%
% don't run on Linux or unix
if isunix && (exist('OCTAVE_VERSION')==5)
fprintf('\n>>>\n');
fprintf('>>> Use makemex-octave shell script to compile mex functions in Linux\n');
fprintf('>>>\n\n');
return;
end
% check if we are running on MATLAB
if ~(exist('OCTAVE_VERSION')==5)
% low level functions
fprintf('Compiling mex functions for low-level i/o on MATLAB ...\n');
cd Basic/gdsio
mex -O gds_open.c mexfuncs.c
mex -O gds_close.c mexfuncs.c
mex -O gds_ftell.c mexfuncs.c
mex -O gds_structdata.c gdsio.c mexfuncs.c
mex -O gds_libdata.c gdsio.c mexfuncs.c
mex -O gds_beginstruct.c gdsio.c mexfuncs.c
mex -O gds_endstruct.c gdsio.c mexfuncs.c
mex -O gds_beginlib.c gdsio.c mexfuncs.c
mex -O gds_endlib.c gdsio.c mexfuncs.c
mex -O gds_write_element.c gdsio.c mexfuncs.c
mex -O gds_read_element.c gdsio.c mexfuncs.c mxlist.c
mex -O gds_record_info.c gdsio.c mexfuncs.c
cd ../@gds_element/private
mex -O poly_iscwmex.c
mex -O poly_areamex.c
mex -O -I../../gdsio isref.c
mex -O -I../../gdsio get_etype.c
mex -O -I../../gdsio is_not_internal.c
mex -O -I../../gdsio new_internal.c
mex -O -I../../gdsio has_property.c
mex -O -I../../gdsio get_element_data.c ../../gdsio/mexfuncs.c
mex -O -I../../gdsio set_element_data.c ../../gdsio/mexfuncs.c
cd ../../../Structures/private
mex -O datamatrixmex.c
% Boolean functions
fprintf('Compiling Boolean set algebra functions (Clipper)...\n');
% for Clipper library
cd ../../Boolean
mex -O poly_boolmex.cpp clipper.cpp
% back up
cd ..
else % we are on Octave with gcc
% low level functions
fprintf('Compiling mex functions for low-level i/o on Octave/Windows ...\n');
setenv('CFLAGS', '-O3 -fomit-frame-pointer -march=native -mtune=native');
setenv('CXXFLAGS', '-O3 -fomit-frame-pointer -march=native -mtune=native');
cd Basic/gdsio
mex gds_open.c mexfuncs.c
mex gds_close.c mexfuncs.c
mex gds_ftell.c mexfuncs.c
mex gds_structdata.c gdsio.c mexfuncs.c
mex gds_libdata.c gdsio.c mexfuncs.c
mex gds_beginstruct.c gdsio.c mexfuncs.c
mex gds_endstruct.c gdsio.c mexfuncs.c
mex gds_beginlib.c gdsio.c mexfuncs.c
mex gds_endlib.c gdsio.c mexfuncs.c
mex gds_write_element.c gdsio.c mexfuncs.c
mex gds_read_element.c gdsio.c mexfuncs.c mxlist.c
mex gds_record_info.c gdsio.c mexfuncs.c
cd ../@gds_element/private
mex poly_iscwmex.c
mex poly_areamex.c
mex -I../../gdsio isref.c
mex -I../../gdsio get_etype.c
mex -I../../gdsio is_not_internal.c
mex -I../../gdsio new_internal.c
mex -I../../gdsio has_property.c
mex -I../../gdsio get_element_data.c ../../gdsio/mexfuncs.c
mex -I../../gdsio set_element_data.c ../../gdsio/mexfuncs.c
cd ../../../Structures/private
mex datamatrixmex.c
% Boolean functions
fprintf('Compiling Boolean set algebra functions (Clipper)...\n');
% for Clipper library
cd ../../Boolean
mex poly_boolmex.cpp clipper.cpp
% back up
cd ..
end
fprintf('Done.\n');