/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk

« back to all changes in this revision

Viewing changes to cuda/nvopts.sh

  • Committer: Suren A. Chilingaryan
  • Date: 2009-01-15 13:50:29 UTC
  • Revision ID: csa@dside.dyndns.org-20090115135029-wleapicg9a4593tp
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# gccopts.sh    Shell script for configuring MEX-file creation script,
 
3
#               mex.  These options were tested with gcc 3.2.3.
 
4
#
 
5
# usage:        Do not call this file directly; it is sourced by the
 
6
#               mex shell script.  Modify only if you don't like the
 
7
#               defaults after running mex.  No spaces are allowed
 
8
#               around the '=' in the variable assignment.
 
9
#
 
10
#               Note: only the gcc side of this script was tested.
 
11
#               The FORTRAN variables are lifted directly from
 
12
#               mexopts.sh; use that file for compiling FORTRAN
 
13
#               MEX-files.
 
14
#
 
15
# Note: For the version of system compiler supported with this release,
 
16
#       refer to Technical Note 1601 at:
 
17
#       http://www.mathworks.com/support/tech-notes/1600/1601.html
 
18
#
 
19
#
 
20
# SELECTION_TAGs occur in template option files and are used by MATLAB
 
21
# tools, such as mex and mbuild, to determine the purpose of the contents
 
22
# of an option file. These tags are only interpreted when preceded by '#'
 
23
# and followed by ':'.
 
24
#
 
25
#SELECTION_TAG_MEX_OPT: Template Options file for building gcc MEX-files
 
26
#
 
27
# Copyright 1984-2004 The MathWorks, Inc.
 
28
# $Revision: 1.43.4.7 $  $Date: 2006/03/10 00:42:26 $
 
29
#----------------------------------------------------------------------------
 
30
#
 
31
    TMW_ROOT="$MATLAB"
 
32
    MFLAGS=''
 
33
    if [ "$ENTRYPOINT" = "mexLibrary" ]; then
 
34
        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut -lm"
 
35
    else  
 
36
        MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lm"
 
37
    fi
 
38
    case "$Arch" in
 
39
        Undetermined)
 
40
#----------------------------------------------------------------------------
 
41
# Change this line if you need to specify the location of the MATLAB
 
42
# root directory.  The script needs to know where to find utility
 
43
# routines so that it can determine the architecture; therefore, this
 
44
# assignment needs to be done while the architecture is still
 
45
# undetermined.
 
46
#----------------------------------------------------------------------------
 
47
            MATLAB="$MATLAB"
 
48
#
 
49
# Determine the location of the GCC libraries
 
50
#
 
51
            GCC_LIBDIR=`gcc -v 2>&1 | awk '/.*Reading specs.*/ {print substr($4,0,length($4)-6)}'`
 
52
            ;;
 
53
        glnx86)
 
54
#----------------------------------------------------------------------------
 
55
            RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
 
56
            CC='nvcc'
 
57
            CFLAGS='-O3 -Xcompiler "-fPIC -D_GNU_SOURCE -pthread -fexceptions -m32"'
 
58
            CLIBS="$RPATH $MLIBS -lm -lstdc++"
 
59
            COPTIMFLAGS='-Xcompiler "-O3 -funroll-loops -msse2 -DNDEBUG"'
 
60
            CDEBUGFLAGS='-g'
 
61
#           
 
62
            CXX='g++'
 
63
            CXXFLAGS='-fPIC -D_GNU_SOURCE -pthread '
 
64
            CXXLIBS="$RPATH $MLIBS -lm"
 
65
            CXXOPTIMFLAGS='-O -DNDEBUG'
 
66
            CXXDEBUGFLAGS='-g'
 
67
#
 
68
#           NOTE: g77 is not thread safe
 
69
            FC='g77'
 
70
            FFLAGS='-fPIC -fexceptions'
 
71
            FLIBS="$RPATH $MLIBS -lm -lstdc++"
 
72
            FOPTIMFLAGS='-O'
 
73
            FDEBUGFLAGS='-g'
 
74
#
 
75
            LD="gcc"
 
76
            LDEXTENSION='.mexglx'
 
77
            LDFLAGS='-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE'
 
78
            LDOPTIMFLAGS='-O'
 
79
            LDDEBUGFLAGS='-g'
 
80
#
 
81
            POSTLINK_CMDS=':'
 
82
#----------------------------------------------------------------------------
 
83
            ;;
 
84
        glnxa64)
 
85
#----------------------------------------------------------------------------
 
86
            RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
 
87
            CC='nvcc'
 
88
            CFLAGS='-O3 -Xcompiler "-fPIC -D_GNU_SOURCE -pthread -fexceptions -m64"'
 
89
            CLIBS="$RPATH $MLIBS -lm -lstdc++"
 
90
            COPTIMFLAGS='-Xcompiler "-O3 -funroll-loops -msse2 -DNDEBUG"'
 
91
            CDEBUGFLAGS='-g'
 
92
#           
 
93
            CXX='g++'
 
94
            CXXFLAGS='-fPIC -fno-omit-frame-pointer -ansi -D_GNU_SOURCE -pthread '
 
95
            CXXLIBS="$RPATH $MLIBS -lm"
 
96
            CXXOPTIMFLAGS='-O -DNDEBUG'
 
97
            CXXDEBUGFLAGS='-g'
 
98
#
 
99
#           NOTE: g77 is not thread safe
 
100
            FC='g77'
 
101
            FFLAGS='-fPIC -fno-omit-frame-pointer -fexceptions'
 
102
            FLIBS="$RPATH $MLIBS -lm -lstdc++"
 
103
            FOPTIMFLAGS='-O'
 
104
            FDEBUGFLAGS='-g'
 
105
#
 
106
            LD="gcc"
 
107
            LDEXTENSION='.mexa64'
 
108
            LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
 
109
            LDOPTIMFLAGS='-O'
 
110
            LDDEBUGFLAGS='-g'
 
111
#
 
112
            POSTLINK_CMDS=':'
 
113
#----------------------------------------------------------------------------
 
114
            ;;
 
115
        sol2)
 
116
#----------------------------------------------------------------------------
 
117
            CC='gcc'
 
118
            GCC_LIBDIR=`$CC -v 2>&1 | sed -n '1s/[^\/]*\(.*\/lib\).*/\1/p'`
 
119
            CFLAGS='-fPIC -fexceptions'
 
120
            CLIBS="$MLIBS -lm"
 
121
            COPTIMFLAGS='-O -DNDEBUG'
 
122
            CDEBUGFLAGS='-g'  
 
123
            CXXDEBUGFLAGS='-g'
 
124
#
 
125
            CXX='g++'
 
126
            CXXFLAGS='-fPIC'
 
127
            CXXLIBS="$MLIBS -lm"
 
128
            CXXOPTIMFLAGS='-O -DNDEBUG'
 
129
#
 
130
            LD="$COMPILER"
 
131
            LDEXTENSION='.mexsol'
 
132
            LDFLAGS="-shared -Wl,-M,$TMW_ROOT/extern/lib/$Arch/$MAPFILE,-R,$GCC_LIBDIR"
 
133
            LDOPTIMFLAGS='-O'
 
134
            LDDEBUGFLAGS='-g'  
 
135
#
 
136
            POSTLINK_CMDS=':'
 
137
#----------------------------------------------------------------------------
 
138
            ;;
 
139
        mac)
 
140
#----------------------------------------------------------------------------
 
141
            CC='gcc-3.3'
 
142
            CFLAGS='-fno-common -no-cpp-precomp -fexceptions'
 
143
            CLIBS="$MLIBS -lstdc++"
 
144
            COPTIMFLAGS='-O3 -DNDEBUG'
 
145
            CDEBUGFLAGS='-g'
 
146
#
 
147
            CXX=g++-3.3
 
148
            CXXFLAGS='-fno-common -no-cpp-precomp -fexceptions'
 
149
            CXXLIBS="$MLIBS -lstdc++"
 
150
            CXXOPTIMFLAGS='-O3 -DNDEBUG'
 
151
            CXXDEBUGFLAGS='-g'
 
152
#
 
153
            LD="$CC"
 
154
            LDEXTENSION='.mexmac'
 
155
            LDFLAGS="-bundle -Wl,-flat_namespace -undefined suppress -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
 
156
            LDOPTIMFLAGS='-O'
 
157
            LDDEBUGFLAGS='-g'
 
158
#
 
159
            POSTLINK_CMDS=':'
 
160
#----------------------------------------------------------------------------
 
161
            ;;
 
162
        maci)
 
163
#----------------------------------------------------------------------------
 
164
            CC='nvcc'
 
165
            CFLAGS='-O3 -Xcompiler "-fPIC -D_GNU_SOURCE -pthread -fno-common -no-cpp-precomp  -fexceptions -m32"'
 
166
            CLIBS="$MLIBS -lm -lstdc++"
 
167
            COPTIMFLAGS='-Xcompiler "-O3 -funroll-loops -msse2 -DNDEBUG"'
 
168
            CDEBUGFLAGS='-g'
 
169
 
 
170
#
 
171
            CXX=g++-3.3
 
172
            CXXFLAGS='-fno-common -no-cpp-precomp -fexceptions'
 
173
            CXXLIBS="$MLIBS -lstdc++"
 
174
            CXXOPTIMFLAGS='-O3 -DNDEBUG'
 
175
            CXXDEBUGFLAGS='-g'
 
176
#
 
177
            LD="gcc"
 
178
            LDEXTENSION='.mexmaci'
 
179
            LDFLAGS="-bundle -Wl,-flat_namespace -undefined suppress -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
 
180
            LDOPTIMFLAGS='-O'
 
181
            LDDEBUGFLAGS='-g'
 
182
#
 
183
            POSTLINK_CMDS=':'
 
184
#----------------------------------------------------------------------------
 
185
            ;;
 
186
 
 
187
    esac
 
188
#############################################################################
 
189
#
 
190
# Architecture independent lines:
 
191
#
 
192
#     Set and uncomment any lines which will apply to all architectures.
 
193
#
 
194
#----------------------------------------------------------------------------
 
195
#           CC="$CC"
 
196
#           CFLAGS="$CFLAGS"
 
197
#           COPTIMFLAGS="$COPTIMFLAGS"
 
198
#           CDEBUGFLAGS="$CDEBUGFLAGS"
 
199
#           CLIBS="$CLIBS"
 
200
#
 
201
#           LD="$LD"
 
202
#           LDFLAGS="$LDFLAGS"
 
203
#           LDOPTIMFLAGS="$LDOPTIMFLAGS"
 
204
#           LDDEBUGFLAGS="$LDDEBUGFLAGS"
 
205
#----------------------------------------------------------------------------
 
206
#############################################################################