Commit 29ef17cd authored by vijaysm's avatar vijaysm
Browse files

Merged in vijaysm/cgm-dev-integration (pull request #263)

Build with CGM directly
parents d41c8ec4 ac6a8848
......@@ -745,6 +745,7 @@ EXPORT_LDFLAGS="$ZOLTAN_LIB_FLAGS $EXPORT_LDFLAGS"
################################################################################
# CGM
################################################################################
USING_DEV_CGM=no
AC_ARG_WITH(cgm,
[AS_HELP_STRING([--with-cgm=DIR],[Specify directory containing CGM])],
[CGM_DIR=$withval
......@@ -767,7 +768,7 @@ case "x$CGM_DIR" in
AC_CHECK_FILE([${CGM_DIR}/lib/cgm.make],
[CGM_MAKE="${CGM_DIR}/lib/cgm.make"],
[AC_CHECK_FILE([${CGM_DIR}/cgm.make],
[CGM_MAKE="${CGM_DIR}/cgm.make"],
[CGM_MAKE="${CGM_DIR}/cgm.make"; USING_DEV_CGM=yes],
[AC_MSG_ERROR([$CGM_DIR : not a configured CGM]);
CGM_MISSING=yes])
])
......@@ -777,7 +778,6 @@ esac
if test "x$CGM_MISSING" = "xno"; then
CGM_CONFIG_OPTIONS="include $CGM_MAKE"
AC_MSG_CHECKING([Checking for GeometryQueryTool::ray_fire(RefFace*,...)])
FATHOM_MAKE_INC_VAR([$CGM_MAKE],[CGM_DEFINES], [CGM_CPPFLAGS="$make_val"])
FATHOM_MAKE_INC_VAR([$CGM_MAKE],[CGM_INCLUDES],[CGM_CPPFLAGS="$CGM_CPPFLAGS $make_val"])
FATHOM_MAKE_INC_VAR([$CGM_MAKE],[CGM_LTFLAGS], [CGM_LTFLAGS="$make_val"])
......@@ -789,40 +789,49 @@ if test "x$CGM_MISSING" = "xno"; then
CPPFLAGS="$CGM_CPPFLAGS $CPPFLAGS"
HAVE_OCC=no
HAVE_FACET=no
AC_CHECK_HEADER([OCCPoint.hpp],
[HAVE_OCC=yes; AC_DEFINE(HAVE_CGM_OCC, [1], [MOAB uses CGM configured with OpenCascade]) ],
[HAVE_FACET=yes; AC_DEFINE(HAVE_CGM_FACET, [1], [MOAB uses CGM configured with Facet Engine only]) ]
)
AC_MSG_CHECKING([for underlying geometry engine in CGM])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([@%:@include <CGMConfig.h>],
[ #ifndef CGM_HAVE_FACET_ENGINE_ONLY
// Perfect!
#else
# error Only Facet engine available
#endif
])
],
[HAVE_OCC=yes
AC_DEFINE(HAVE_CGM_OCC, [1], [MOAB uses CGM configured with OpenCascade])
AC_MSG_RESULT(OCC)],
[HAVE_FACET=yes
AC_DEFINE(HAVE_CGM_FACET, [1], [MOAB uses CGM configured with Facet Engine only])
AC_MSG_RESULT(Facets)] )
CPPFLAGS="$old_CPPFLAGS"
AC_LANG_POP([C++])
if (test "x$HAVE_CUBIT" != "xno"); then
AC_LANG_PUSH([C++])
old_CPPFLAGS="$CPPFLAGS"
old_LDFLAGS="$LDFLAGS"
old_LIBS="$LIBS"
CPPFLAGS="$CGM_CPPFLAGS $CPPFLAGS"
LDFLAGS="$CGM_LDFLAGS $CPPFLAGS"
LIBS="$CGM_LIBS $LIBS"
HAVE_CGM_FIRE_RAY=no
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include "GeometryQueryTool.hpp"
#include "CubitVector.hpp"],
[CubitVector a,b;
DLIList<double> c;
GeometryQueryTool::instance()->fire_ray((RefFace*)0, a, b, c );
])],
[HAVE_CGM_FIRE_RAY=yes;
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
CPPFLAGS="$old_CPPFLAGS"
LDFLAGS="$old_LDFLAGS"
LIBS="$old_LIBS"
# LDFLAGS="$old_LDFLAGS"
# LIBS="$old_LIBS"
AC_LANG_POP([C++])
fi
AC_MSG_CHECKING([for GeometryQueryTool::ray_fire(RefFace*,...)])
AC_LANG_PUSH([C++])
old_CPPFLAGS="$CPPFLAGS"
old_LDFLAGS="$LDFLAGS"
old_LIBS="$LIBS"
CPPFLAGS="$CGM_CPPFLAGS $CPPFLAGS"
LDFLAGS="$CGM_LDFLAGS $CPPFLAGS"
LIBS="$CGM_LIBS $LIBS"
HAVE_CGM_FIRE_RAY=no
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include "GeometryQueryTool.hpp"
#include "CubitVector.hpp"],
[CubitVector a,b;
DLIList<double> c;
GeometryQueryTool::instance()->fire_ray((RefFace*)0, a, b, c );
])],
[HAVE_CGM_FIRE_RAY=yes;
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
CPPFLAGS="$old_CPPFLAGS"
LDFLAGS="$old_LDFLAGS"
LIBS="$old_LIBS"
AC_LANG_POP([C++])
EXPORT_LDFLAGS="$EXPORT_LDFLAGS $CGM_LDFLAGS"
EXPORT_LTFLAGS="$EXPORT_LTFLAGS $CGM_LTFLAGS"
fi
......@@ -851,6 +860,7 @@ fi
AC_MSG_CHECKING([if iRel support is to be built])
AC_MSG_RESULT([$ENABLE_irel])
AM_CONDITIONAL([ENABLE_irel],[test "xyes" = "x$ENABLE_irel"])
if test "x$ENABLE_irel" = "xyes"; then
if (test "x$ENABLE_imesh" != "xyes" || test "x$CGM_MISSING" != "xno"); then
AC_MSG_ERROR([Cannot build iRel API. Enable both iGeom (CGM) and iMesh implementations.])
......@@ -861,9 +871,9 @@ if test "x$ENABLE_irel" = "xyes"; then
[IGEOM_CONFIG_OPTIONS="include ${CGM_DIR}/lib/iGeom-Defs.inc";
FATHOM_MAKE_INC_VAR([${CGM_DIR}/lib/iGeom-Defs.inc],[IGEOM_DEFINES], [IGEOM_DEFINES="$make_val"],
[IGEOM_DEFINES=]) ],
[AC_CHECK_FILE([${CGM_DIR}/iGeom-Defs.inc],
[IGEOM_CONFIG_OPTIONS="include ${CGM_DIR}/iGeom-Defs.inc"],
[AC_MSG_WARN([$CGM_DIR : not a configured iGeom])]
[AC_CHECK_FILE([${CGM_DIR}/itaps/iGeom-Defs.inc],
[IGEOM_CONFIG_OPTIONS="include ${CGM_DIR}/itaps/iGeom-Defs.inc"],
[AC_MSG_WARN([$CGM_DIR : iGeom is not configured correctly])]
)
])
AC_SUBST(IGEOM_DEFINES)
......@@ -879,6 +889,7 @@ test "x$ENABLE_irel" != "xyes" || HAVE_IREL="yes"
AC_SUBST(HAVE_IGEOM)
AC_SUBST(HAVE_IMESH)
AC_SUBST(HAVE_IREL)
AM_CONDITIONAL([USING_DEV_CGM],[test "xyes" = "x$USING_DEV_CGM"])
###############################################################################
# Optional Tools
......
......@@ -18,6 +18,6 @@ IMESH_LIBS = $(IMESH_LDFLAGS) -L$(MOAB_LIBDIR) \
@FCLIBS@ @LIBS@
IMESH_INCLUDEDIR = @abs_srcdir@
IMESH_INCLUDEDIR2 = -I@abs_builddir@ -I@abs_srcdir@/.. -I@abs_builddir@/.. -I@abs_top_builddir@/src
IMESH_INCLUDEDIR2 = -I@abs_builddir@ -I@abs_srcdir@/.. -I@abs_builddir@/.. -I@abs_top_builddir@/src -I@abs_srcdir@/../../src
IMESH_LIBDIR = @abs_builddir@/.libs
MOAB_LIBDIR = @abs_top_builddir@/src/.libs
......@@ -65,10 +65,16 @@ if HAVE_CGM
libiRel_la_SOURCES += \
GeomAssocPairSide.cpp \
GeomAssocPairSide.hpp
if USING_DEV_CGM
libiRel_la_LIBADD += \
${IGEOM_LTFLAGS} ${IGEOM_LDFLAGS} ${CGM_DIR}/itaps/libiGeom.la
TEST_DEPS += ${CGM_DIR}/itaps/libiGeom.la
else
libiRel_la_LIBADD += \
${IGEOM_LTFLAGS} ${IGEOM_LDFLAGS} ${CGM_DIR}/lib/libiGeom.la
LIBS += ${CGM_LIBS}
TEST_DEPS += ${CGM_DIR}/lib/libiGeom.la
endif
LIBS += ${CGM_LIBS}
endif
TEST_DEPS += ${MOAB_CXX_LINKFLAGS} ${MOAB_CXX_LIBS}
......
......@@ -5,6 +5,7 @@ MOAB_LIBDIR = @abs_builddir@/src/.libs
MOAB_INCLUDES = -I@abs_srcdir@/src \
-I@abs_builddir@/src \
-I@abs_srcdir@/src/oldinc \
-I@abs_srcdir@/src/verdict \
-I@abs_srcdir@/src/parallel \
-I@abs_builddir@/src/parallel \
-I@abs_srcdir@/src/LocalDiscretization \
......
......@@ -97,7 +97,10 @@ else
endif
if HAVE_CGM
AM_CPPFLAGS += @CGM_CPPFLAGS@
AM_CPPFLAGS += @CGM_CPPFLAGS@
if USING_DEV_CGM
AM_CPPFLAGS += -I$(CGM_DIR)/src
endif
MOAB_CGM_SRCS = ReadCGM.cpp ReadCGM.hpp
libmoabio_la_LIBADD += @CGM_LIBS@
else
......
......@@ -12,8 +12,12 @@ endif
if HAVE_CGM
AM_CPPFLAGS += $(CGM_CPPFLAGS)
if USING_DEV_CGM
LDADD+= ${CGM_DIR}/src/libcgm.la
else
LDADD+= ${CGM_DIR}/lib/libcgm.la
endif
endif
endif
# For old (pre 1.10.x) versions of Automake
docdir = @docdir@
......
......@@ -34,7 +34,11 @@ CGM_LIBS = @CGM_LIBS@
LDADD = libdagmc.la $(top_builddir)/src/libMOAB.la
if HAVE_CGM
LDADD += $(CGM_DIR)/lib/libcgm.la
if USING_DEV_CGM
LDADD += $(CGM_DIR)/src/libcgm.la
else
LDADD += $(CGM_DIR)/lib/libcgm.la
endif
endif
TESTS =
......
......@@ -45,10 +45,7 @@ endif
noinst_PROGRAMS = proj1 create_dp
if PARALLEL
noinst_PROGRAMS += cslam_par_test intx_imesh linear_advection
if ENABLE_FORTRAN
noinst_PROGRAMS += advection
endif
noinst_PROGRAMS += linear_advection
endif
check_PROGRAMS = $(TESTS)
......@@ -76,9 +73,11 @@ if HAVE_HDF5
intx_imesh_LDADD = libmbcslam.la $(top_builddir)/itaps/imesh/libiMesh.la $(top_builddir)/src/libMOAB.la
cslam_par_test_SOURCES = cslam_par_test.cpp
intx_mpas_SOURCES = intx_mpas.cpp
noinst_PROGRAMS += cslam_par_test intx_imesh
if ENABLE_FORTRAN
advection_SOURCES = advection.F90
advection_LDADD = libmbcslam.la $(top_builddir)/itaps/imesh/libiMesh.la $(top_builddir)/src/libMOAB.la $(FCLIBS)
noinst_PROGRAMS += advection
endif
endif
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment