Skip to content

Commit

Permalink
- Force -fpmath=sse on Linux platforms, as otherwise simulations spin…
Browse files Browse the repository at this point in the history
… forever (32-bit)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5827 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jul 8, 2010
1 parent d8d92ad commit bb08ee6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 22 deletions.
47 changes: 31 additions & 16 deletions configure
Expand Up @@ -2191,6 +2191,37 @@ CFLAGS="-O3 -march=native"
fi
fi

if test "Darwin" != `uname`; then

if test "`uname -m`" = "x86_64"; then

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking x86_64 CFLAGS" >&5
$as_echo_n "checking x86_64 CFLAGS... " >&6; }

if echo $CFLAGS | grep -q -- -fPIC; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: already got -fPIC" >&5
$as_echo "already got -fPIC" >&6; }
else
CFLAGS+=" -fPIC"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: adding -fPIC" >&5
$as_echo "adding -fPIC" >&6; }
fi

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpmath" >&5
$as_echo_n "checking for fpmath... " >&6; }
if echo $CFLAGS | grep -q -- -fpmath=; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
CFLAGS+=" -fpmath=sse"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: adding -fpmath=sse" >&5
$as_echo "adding -fpmath=sse" >&6; }
fi

fi # End x86-specific CFLAGS

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Expand Down Expand Up @@ -3309,22 +3340,6 @@ rm -f conftest.l $LEX_OUTPUT_ROOT.c

fi

if test "`uname -m`" = "x86_64" && "Darwin" != `uname`; then

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking x86_64 CFLAGS" >&5
$as_echo_n "checking x86_64 CFLAGS... " >&6; }

if echo $CFLAGS | grep -q -- -fPIC; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: already got -fPIC" >&5
$as_echo "already got -fPIC" >&6; }
else
CFLAGS+=" -fPIC"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: adding -fPIC" >&5
$as_echo "adding -fPIC" >&6; }
fi

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for \$RMLHOME" >&5
$as_echo_n "checking for \$RMLHOME... " >&6; }
Expand Down
25 changes: 19 additions & 6 deletions configure.in
Expand Up @@ -40,13 +40,9 @@ CFLAGS="-O3 -march=native"
fi
fi

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_LEX
if test "Darwin" != `uname`; then

if test "`uname -m`" = "x86_64" && "Darwin" != `uname`; then
if test "`uname -m`" = "x86_64"; then

AC_MSG_CHECKING([x86_64 CFLAGS])

Expand All @@ -59,6 +55,23 @@ fi

fi

dnl Simulations spin forever unless -fpmath=sse is set
AC_MSG_CHECKING([for fpmath])
if echo $CFLAGS | grep -q -- -fpmath=; then
AC_MSG_RESULT([yes])
else
CFLAGS+=" -fpmath=sse"
AC_MSG_RESULT([adding -fpmath=sse])
fi

fi # End x86-specific CFLAGS

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_LEX

dnl check for environment variables

AC_MSG_CHECKING([for \$RMLHOME])
Expand Down

0 comments on commit bb08ee6

Please sign in to comment.