Skip to content

Commit

Permalink
- Force 64-bit double precision only for the files that require it
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8778 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed May 2, 2011
1 parent ba3c5de commit b23f614
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
6 changes: 6 additions & 0 deletions c_runtime/Makefile.common
Expand Up @@ -148,6 +148,12 @@ libf2c/libf2c.a :
meta_modelica_catch.o : meta_modelica_catch.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c -g $<

# Requires IEEE floating-point precision
simulation_input.o : simulation_input.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -mfpmath=sse -c -g $<
simulation_events.o : simulation_events.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -mfpmath=sse -c -g $<

install: libc_runtime.a libsim.a libsim_ompd.a $(LIBF2C) interactive/libinteractive.a $(LIBSENDDATA) omdevinstall ModelicaExternalC/libModelicaExternalC.a
cp $(HFILES) $(builddir_inc)/
cp fmu_model_interface.c $(builddir_inc)/
Expand Down
22 changes: 9 additions & 13 deletions configure
Expand Up @@ -2298,19 +2298,15 @@ fi

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floating point bugs" >&5
$as_echo_n "checking for floating point bugs... " >&6; }
if echo $CFLAGS | grep -q -- -ffloat-store; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: have -ffloat-store" >&5
$as_echo "have -ffloat-store" >&6; }
elif echo $CFLAGS | grep -q -- -msse2 && echo $CFLAGS | grep -q -- -mfpmath=sse; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: have SSE2" >&5
$as_echo "have SSE2" >&6; }
else
CFLAGS+=" -msse2 -mfpmath=sse"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: adding -msse2 -mfpmath=sse" >&5
$as_echo "adding -msse2 -mfpmath=sse" >&6; }
fi
#AC_MSG_CHECKING([for floating point bugs])
#if echo $CFLAGS | grep -q -- -ffloat-store; then
# AC_MSG_RESULT([have -ffloat-store])
#elif echo $CFLAGS | grep -q -- -msse2 && echo $CFLAGS | grep -q -- -mfpmath=sse; then
# AC_MSG_RESULT([have SSE2])
#else
# CFLAGS+=" -msse2 -mfpmath=sse"
# AC_MSG_RESULT([adding -msse2 -mfpmath=sse])
#fi

fi # End x86-specific CFLAGS

Expand Down
19 changes: 10 additions & 9 deletions configure.in
Expand Up @@ -75,15 +75,16 @@ fi

dnl Simulations spin forever unless -msse2 -mfpmath=sse is set
dnl Or if -ffloat-store is set
AC_MSG_CHECKING([for floating point bugs])
if echo $CFLAGS | grep -q -- -ffloat-store; then
AC_MSG_RESULT([have -ffloat-store])
elif echo $CFLAGS | grep -q -- -msse2 && echo $CFLAGS | grep -q -- -mfpmath=sse; then
AC_MSG_RESULT([have SSE2])
else
CFLAGS+=" -msse2 -mfpmath=sse"
AC_MSG_RESULT([adding -msse2 -mfpmath=sse])
fi
dnl With the new solver interface, this seems to work even with -mpfpath=387
#AC_MSG_CHECKING([for floating point bugs])
#if echo $CFLAGS | grep -q -- -ffloat-store; then
# AC_MSG_RESULT([have -ffloat-store])
#elif echo $CFLAGS | grep -q -- -msse2 && echo $CFLAGS | grep -q -- -mfpmath=sse; then
# AC_MSG_RESULT([have SSE2])
#else
# CFLAGS+=" -msse2 -mfpmath=sse"
# AC_MSG_RESULT([adding -msse2 -mfpmath=sse])
#fi

fi # End x86-specific CFLAGS

Expand Down

0 comments on commit b23f614

Please sign in to comment.