Skip to content
Snippets Groups Projects
Commit a7081c0c authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

implemented FS #65 as UGGrid maintainer seem not able to do this.

It's my pleasure....


[[Imported from SVN: r4804]]
parent 1f239490
No related branches found
No related tags found
No related merge requests found
......@@ -48,11 +48,12 @@ AC_DEFUN([DUNE_PATH_UG],[
# check for central header
AC_CHECK_HEADER([$UG_INCLUDE_PATH/gm.h],
[UG_CPPFLAGS="-I$UG_INCLUDE_PATH"
HAVE_UG="1"],
[HAVE_UG="0"
AC_MSG_WARN([gm.h not found in $UG_INCLUDE_PATH])]
[UG_CPPFLAGS="-I$UG_INCLUDE_PATH"
HAVE_UG="1"],
[HAVE_UG="0"
AC_MSG_WARN([gm.h not found in $UG_INCLUDE_PATH])]
)
FOUND_UG_HEADER=$HAVE_UG
# pre-set variable for summary
with_ug="no"
......@@ -65,63 +66,63 @@ AC_DEFUN([DUNE_PATH_UG],[
AC_LANG_PUSH([C++])
if test x$HAVE_UG = x1 ; then
CPPFLAGS="$UG_CPPFLAGS"
UG_LIBS="-lug2 -ldomS2 -lgg2 -lug3 -ldomS3 -lgg3 -ldevS"
AC_MSG_CHECKING([UG libraries (without MPI)])
LIBS="$UG_LIBS"
AC_TRY_LINK(
[#include "initug.h"],
[int i = UG::D2::InitUg(0,0)],
[UG_LDFLAGS="$LDFLAGS"
HAVE_UG="1"
with_ug="yes (sequential)"
AC_MSG_RESULT(yes)
],
[AC_MSG_RESULT(no)
HAVE_UG="0"]
)
# sequential lib not found/does not work?
if test x$HAVE_UG != x1 && test x"$MPI_LDFLAGS" != x"" ; then
# try again with added MPI-libs
UG_LIBS="$UG_LIBS $MPI_LDFLAGS"
AC_MSG_CHECKING([UG libraries (with MPI)])
LIBS="$UG_LIBS"
AC_TRY_LINK(
[#include "initug.h"],
[int i = UG::D2::InitUg(0,0)],
[UG_LDFLAGS="$LDFLAGS"
UG_CPPFLAGS="$UG_CPPFLAGS -DModelP"
HAVE_UG="1"
with_ug="yes (parallel)"
AC_MSG_RESULT(yes)
],
[AC_MSG_RESULT(no)
HAVE_UG="0"]
)
fi
CPPFLAGS="$UG_CPPFLAGS"
UG_LIBS="-lug2 -ldomS2 -lgg2 -lug3 -ldomS3 -lgg3 -ldevS"
AC_MSG_CHECKING([UG libraries (without MPI)])
LIBS="$UG_LIBS"
AC_TRY_LINK(
[#include "initug.h"],
[int i = UG::D2::InitUg(0,0)],
[UG_LDFLAGS="$LDFLAGS"
HAVE_UG="1"
with_ug="yes (sequential)"
AC_MSG_RESULT(yes)
],
[AC_MSG_RESULT(no)
HAVE_UG="0"]
)
# Okay. We have found a UG installation. But has it been built with --enable-dune?
# We check this by trying to link to the field int UG::duneMarker, which is there
# do indicate just this.
if test x$HAVE_UG = x1 ; then
AC_MSG_CHECKING([whether UG has been built with --enable-dune])
AC_TRY_LINK(
[#define FOR_DUNE
#include "dunemarker.h"],
[int i = UG::duneMarker],
[#UG_LDFLAGS="$LDFLAGS"
AC_MSG_RESULT(yes)
],
[AC_MSG_RESULT(no)
AC_MSG_WARN([UG has not been built with --enable-dune!])
HAVE_UG="0"
with_ug="no"
]
)
fi
# sequential lib not found/does not work?
if test x$HAVE_UG != x1 && test x"$MPI_LDFLAGS" != x"" ; then
# try again with added MPI-libs
UG_LIBS="$UG_LIBS $MPI_LDFLAGS"
AC_MSG_CHECKING([UG libraries (with MPI)])
LIBS="$UG_LIBS"
AC_TRY_LINK(
[#include "initug.h"],
[int i = UG::D2::InitUg(0,0)],
[UG_LDFLAGS="$LDFLAGS"
UG_CPPFLAGS="$UG_CPPFLAGS -DModelP"
HAVE_UG="1"
with_ug="yes (parallel)"
AC_MSG_RESULT(yes)
],
[AC_MSG_RESULT(no)
HAVE_UG="0"]
)
fi
# Okay. If UG header were found, then check whether
# UG installation has been built with --enable-dune?
# We check this by trying to link to the field int UG::duneMarker, which is there
# do indicate just this.
if test x$FOUND_UG_HEADER != x0 ; then
AC_MSG_CHECKING([whether UG has been built with --enable-dune])
AC_TRY_LINK(
[#define FOR_DUNE
#include "dunemarker.h"],
[int i = UG::duneMarker],
[#UG_LDFLAGS="$LDFLAGS"
AC_MSG_RESULT(yes)
],
[AC_MSG_RESULT(no)
AC_MSG_WARN([UG has not been built with --enable-dune! Rebuild UG using configure flags 'CC=$CXX' and '--enable-dune'!])
HAVE_UG="0"
with_ug="no (rebuild UG using configure flags 'CC=$CXX' and '--enable-dune')"
]
)
fi
fi
AC_LANG_POP([C++])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment