60 |
|
<flags SHAREDSUFFIX="@OS_SHAREDSUFFIX@"/> |
61 |
|
<flags LD_UNIT="@OS_LD_UNIT@ @ARCH_LD_UNIT@"/> |
62 |
|
<flags SCRAM_LANGUAGE_TYPE="C++"/> |
63 |
< |
<runtime name="@OS_RUNTIME_LDPATH_NAME@" value="$CXXCOMPILER_BASE/@OS_LIB64DIR@" type="path"/> |
63 |
> |
<runtime name="@OS_RUNTIME_LDPATH_NAME@" value="$CXXCOMPILER_BASE/@ARCH_LIB64DIR@" type="path"/> |
64 |
|
<runtime name="@OS_RUNTIME_LDPATH_NAME@" value="$CXXCOMPILER_BASE/lib" type="path"/> |
65 |
|
<runtime name="PATH" value="$CXXCOMPILER_BASE/bin" type="path"/> |
66 |
|
</tool> |
84 |
|
</tool> |
85 |
|
EOF_TOOLFILE |
86 |
|
|
87 |
+ |
# Notice that on OSX we have a LIBDIR defined for f77compiler because gcc C++ |
88 |
+ |
# compiler (which comes from the system) does not know about where to find |
89 |
+ |
# libgfortran. |
90 |
|
cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler.xml |
91 |
|
<tool name="f77compiler" version="@GCC_VERSION@" type="compiler"> |
92 |
|
<lib name="gfortran"/> |
94 |
|
<client> |
95 |
|
<environment name="F77COMPILER_BASE" default="@G77_ROOT@"/> |
96 |
|
<environment name="FC" default="$F77COMPILER_BASE/bin/gfortran"/> |
97 |
+ |
@ARCH_FORTRAN_LIBDIR@ |
98 |
|
</client> |
99 |
|
<flags SCRAM_COMPILER_NAME="gcc@COMPILER_VERSION@"/> |
100 |
|
<flags FFLAGS="-fno-second-underscore -Wunused -Wuninitialized -O2"/> |
114 |
|
slc* ) |
115 |
|
export OS_SHAREDFLAGS="-shared -Wl,-E" |
116 |
|
export OS_SHAREDSUFFIX="so" |
113 |
– |
export OS_LIB64DIR="lib64" |
117 |
|
export OS_LDFLAGS="-Wl,-E -Wl,--hash-style=gnu" |
118 |
|
export OS_RUNTIME_LDPATH_NAME="LD_LIBRARY_PATH" |
119 |
|
;; |
120 |
|
osx* ) |
121 |
|
export OS_SHAREDFLAGS="-shared -dynamic -single_module" |
122 |
|
export OS_SHAREDSUFFIX="dylib" |
123 |
< |
export OS_LIB64DIR="lib" |
123 |
> |
export OS_LDFLAGS="-Wl,-commons -Wl,use_dylibs" |
124 |
|
export OS_RUNTIME_LDPATH_NAME="DYLD_LIBRARY_PATH" |
125 |
|
;; |
126 |
|
esac |
131 |
|
osx*_ia32_* ) |
132 |
|
export ARCH_CXXFLAGS="-arch i386" |
133 |
|
export ARCH_SHAREDFLAGS="-arch i386" |
134 |
+ |
export ARCH_LIB64DIR="lib" |
135 |
+ |
export ARCH_FORTRAN_LIBDIR='<environment name="LIBDIR" default="$F77COMPILER_BASE/lib/gcc/i686-apple-darwin10/4.2.1"/>' |
136 |
|
;; |
137 |
|
osx*_amd64_* ) |
138 |
|
export ARCH_CXXFLAGS="-arch x86_64" |
139 |
|
export ARCH_SHAREDFLAGS="-arch x86_64" |
140 |
+ |
export ARCH_LIB64DIR="lib" |
141 |
+ |
export ARCH_FORTRAN_LIBDIR='<environment name="LIBDIR" default="$F77COMPILER_BASE/lib/gcc/i686-apple-darwin10/4.2.1/x86_64"/>' |
142 |
|
;; |
143 |
|
osx*_ppc32_* ) |
144 |
|
export ARCH_CXXFLAGS="-arch ppc" |
145 |
|
export ARCH_SHAREDFLAGS="-arch ppc" |
146 |
+ |
export ARCH_LIB64DIR="lib" |
147 |
|
;; |
148 |
< |
slc*_ia32_* ) |
148 |
> |
slc*_amd64_* ) |
149 |
|
# For some reason on mac, some of the header do not compile if this is |
150 |
|
# defined. Ignore for now. |
151 |
|
export ARCH_CXXFLAGS="-Werror=overflow" |
152 |
< |
export ARCH_LD_UNIT="-r -m elf_i386" |
152 |
> |
export ARCH_LIB64DIR="lib64" |
153 |
> |
export ARCH_LD_UNIT="-r -m elf_x86_64" |
154 |
|
;; |
155 |
< |
slc*_amd64_* ) |
155 |
> |
slc*_ia32_* ) |
156 |
|
# For some reason on mac, some of the header do not compile if this is |
157 |
|
# defined. Ignore for now. |
158 |
|
export ARCH_CXXFLAGS="-Werror=overflow" |
159 |
< |
export ARCH_LD_UNIT="-r -m elf_x86_64" |
159 |
> |
export ARCH_LIB64DIR="lib" |
160 |
> |
export ARCH_LD_UNIT="-r -m elf_i386" |
161 |
> |
;; |
162 |
> |
*) |
163 |
> |
echo "Unsupported." |
164 |
> |
exit 1 |
165 |
|
;; |
166 |
|
esac |
167 |
|
|
168 |
|
# Then handle compiler specific options. E.g. enable |
169 |
|
# optimizations as they become available in gcc. |
170 |
+ |
COMPILER_CXXFLAGS= |
171 |
|
case %cmsplatf in |
172 |
|
*_gcc4[56789]* ) |
173 |
< |
export COMPILER_CXXFLAGS="-ftree-vectorize" |
173 |
> |
COMPILER_CXXFLAGS="$COMPILER_CXXFLAGS -std=c++0x -ftree-vectorize" |
174 |
|
;; |
175 |
|
esac |
176 |
|
|
177 |
|
case %cmsplatf in |
178 |
|
*_gcc4[3456789]* ) |
179 |
< |
export COMPILER_CXXFLAGS="-Werror=array-bounds -Werror=format-contains-nul" |
179 |
> |
COMPILER_CXXFLAGS="$COMPILER_CXXFLAGS -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits" |
180 |
|
;; |
181 |
|
esac |
182 |
|
|
183 |
+ |
# Enable visibility inlines hidden. Should drastically remove |
184 |
+ |
# the amount of symbols due to templates. |
185 |
+ |
# FIXME: not enabled on linux, yet, change the case statement |
186 |
+ |
# to *_gcc4[23456789]* when stable. |
187 |
+ |
case %cmsplatf in |
188 |
+ |
osx* ) |
189 |
+ |
COMPILER_CXXFLAGS="$COMPILER_CXXFLAGS -fvisibility-inlines-hidden" |
190 |
+ |
;; |
191 |
+ |
esac |
192 |
+ |
|
193 |
+ |
export COMPILER_CXXFLAGS |
194 |
+ |
|
195 |
|
# Handle here platform specific overrides. In case we |
196 |
|
# want to tune something for a specific architecture. |
197 |
|
case %cmsplatf in |