Commit 5fea31a5 authored by Rajeev Jain's avatar Rajeev Jain

o Resolve merge conflicts

Merge branch 'iulian07/clang_osx_warnings' of https://bitbucket.org/fathomteam/moab into iulian07/clang_osx_warnings
parents ff472619 18862019
......@@ -122,15 +122,13 @@ if test "xno" != "x$enablempi"; then
F77_LIST="mpixlf77 mpif77"
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-mpi=\"${WITH_MPI}\""
else
CC_LIST="$CC gcc icc clang"
CXX_LIST="$CXX g++ icpc clang++"
FC_LIST="$FC gfortran ifort g77 f77 nag xlf"
F77_LIST="$F77 $FC_LIST"
fi
CC_LIST="$CC $CC_LIST gcc icc clang"
CXX_LIST="$CXX $CXX_LIST g++ icpc clang++"
FC_LIST="$FC $FC_LIST gfortran ifort pgf90 nag xlf"
F77_LIST="$F77 $F77_LIST $FC gfortran ifort pgf77 nag xlf g77 f77"
COMPILERPATHS=""
if test "xno" != "x$enablempi"; then
COMPILERPATHS="${WITH_MPI}/bin"
......@@ -152,10 +150,10 @@ AC_PROG_CXXCPP
# Fortran support
if (test "x$CHECK_FC" != "xno"); then
FATHOM_SET_MPI_COMPILER([FC], [$FC_LIST],[$COMPILERPATHS])
FATHOM_SET_MPI_COMPILER([F77],[$F77_LIST],[$COMPILERPATHS])
AC_PROG_FC
AC_PROG_F77
FATHOM_SET_MPI_COMPILER([FC], [$FC_LIST],[$COMPILERPATHS])
AC_PROG_FC
fi
]) # FATHOM_CHECK_COMPILERS
......@@ -189,16 +187,20 @@ AC_ARG_ENABLE( optimize, AS_HELP_STRING([--enable-optimize],[Compile optimized (
[enable_optimize=""; enable_cxx_optimize="no"; enable_cc_optimize="no"; enable_fc_optimize="no"; ]
)
EXTRA_PGI_ONLY_FCFLAGS="-Mfree"
if (test "x$enable_debug" != "xno"); then # debug flags
# GNU
EXTRA_GNU_CXXFLAGS="-Wall -Wno-long-long -pipe -pedantic -Wshadow -Wunused-parameter -Wpointer-arith -Wformat -Wformat-security -Wextra -Wno-variadic-macros -Wno-unknown-pragmas"
EXTRA_GNU_FCFLAGS="-pipe -pedantic -ffree-line-length-0"
# CLANG
EXTRA_CLANG_CXXFLAGS="$EXTRA_GNU_CXXFLAGS"
EXTRA_CLANG_FCFLAGS="$EXTRA_GNU_FCFLAGS"
# Intel
EXTRA_INTEL_CXXFLAGS="-pipe -C"
EXTRA_INTEL_FCFLAGS="-C"
# PGI
EXTRA_PGI_CXXFLAGS="-traceback -Mfree -C"
EXTRA_PGI_FCFLAGS="-traceback -Mfree -C -freeform -extend-source"
EXTRA_PGI_CXXFLAGS="-traceback --diag_suppress 236 --diag_suppress=unrecognized_gcc_pragma -C"
EXTRA_PGI_FCFLAGS="-traceback -Mbounds -Ktrap=inv,divz,ovf"
# XLC
EXTRA_BG_CXXFLAGS="-qarch=qp -qpic=large -qdebug=except"
EXTRA_BG_FCFLAGS="-qarch=qp -qpic=large -qdebug=except"
......@@ -206,14 +208,17 @@ fi
if (test "x$enable_cxx_optimize" != "xno"); then # optimization flags
#GNU
EXTRA_GNU_CXXFLAGS="$EXTRA_GNU_CXXFLAGS -fprefetch-loop-arrays -finline-functions"
EXTRA_GNU_CXXFLAGS="$EXTRA_GNU_CXXFLAGS -fprefetch-loop-arrays -finline-functions -march=native"
EXTRA_GNU_FCFLAGS="$EXTRA_GNU_FCFLAGS -ffree-line-length-0 -finline-functions"
#CLANG
EXTRA_CLANG_CXXFLAGS="$EXTRA_CLANG_CXXFLAGS -march=native"
EXTRA_CLANG_FCFLAGS="$EXTRA_CLANG_FCFLAGS -ffree-line-length-0 -finline-functions"
# Intel
EXTRA_INTEL_CXXFLAGS="$EXTRA_INTEL_CXXFLAGS -xHost -ip -no-prec-div" # -fast
EXTRA_INTEL_FCFLAGS="$EXTRA_INTEL_FCFLAGS -xHost -ip -no-prec-div" # -fast
# PGI
EXTRA_PGI_CXXFLAGS="$EXTRA_PGI_CXXFLAGS -Munroll=5 -Mnoframe"
EXTRA_PGI_FCFLAGS="$EXTRA_PGI_FCFLAGS -Munroll=5 -Mnoframe -freeform -extend-source"
EXTRA_PGI_CXXFLAGS="$EXTRA_PGI_CXXFLAGS -fast"
EXTRA_PGI_FCFLAGS="$EXTRA_PGI_FCFLAGS -fast"
# XLC
EXTRA_BG_CXXFLAGS="$EXTRA_BG_CXXFLAGS -qarch=qp -qtune=auto -qpic=large -qenablevmx"
EXTRA_BG_FCFLAGS="$EXTRA_BG_FCFLAGS -qarch=qp -qtune=auto -qpic=large -qenablevmx"
......@@ -268,7 +273,7 @@ if test "xyes" = "x$enable_debug"; then
FFLAGS="$FFLAGS -g"
fi
# Add -fstack-protector-all option for g++ in debug mode
if (test "x$GXX" = "xyes"); then
if (test "x$cxx_compiler" = "xGNU"); then
CXXFLAGS="$CXXFLAGS -fstack-protector-all"
CFLAGS="$CFLAGS -fstack-protector-all"
LDFLAGS="$LDFLAGS -fstack-protector-all"
......@@ -298,13 +303,10 @@ if (test "x$ENABLE_FORTRAN" != "xno"); then
FFLAGS="$FFLAGS -O2"
fi
AC_FC_PP_DEFINE
AC_FC_PP_SRCEXT
# AC_F77_LIBRARY_LDFLAGS
# AC_FC_LIBRARY_LDFLAGS
fi
# Check for 32/64 bit.
# This requires FATHOM_CXX_FLAGS and FATHOM_CC_FLAGS to have been called first
# Check for 32/64 bit.
# This requires FATHOM_CXX_FLAGS and FATHOM_CC_FLAGS to have been called first
AC_ARG_ENABLE(32bit, AS_HELP_STRING([--enable-32bit],[Force 32-bit objects]),
[
if (test "xyes" != "x$enableval" && test "xno" != "x$enableval"); then
......@@ -381,7 +383,7 @@ if (test "x$ENABLE_FORTRAN" != "xno" && test "x$CHECK_FC" != "xno"); then
*mira*) LIBS="$LIBS /soft/compilers/ibmcmp-feb2015/vacpp/bg/12.1/bglib64/libibmc++.a"; fcxxlinkage=yes ;;
esac
if (test "$cc_compiler" == "Intel"); then
if (test "$cxx_compiler" == "Intel"); then
my_save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS -cxxlib"
AC_MSG_CHECKING([whether $FC supports -cxxlib])
......@@ -391,6 +393,26 @@ if (test "x$ENABLE_FORTRAN" != "xno" && test "x$CHECK_FC" != "xno"); then
[AC_MSG_RESULT([no])]
)
LDFLAGS="$my_save_ldflags"
elif (test "$cxx_compiler" == "PortlandGroup"); then
my_save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS -pgc++libs"
AC_MSG_CHECKING([whether $FC supports -pgc++libs])
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[fcxxlinkage=yes; FLIBS="$FLIBS -pgc++libs"; FCLIBS="$FCLIBS -pgc++libs"],
[AC_MSG_RESULT([no])]
)
LDFLAGS="$my_save_ldflags"
if (test "$fcxxlinkage" != "yes"); then
LDFLAGS="$LDFLAGS -pgcpplibs -lstd -lC"
AC_MSG_CHECKING([whether $FC supports -pgcpplibs -lstd -lC])
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[fcxxlinkage=yes; FLIBS="$FLIBS -pgcpplibs -lstd -lC"; FCLIBS="$FCLIBS -pgcpplibs -lstd -lC"],
[AC_MSG_RESULT([no])]
)
LDFLAGS="$my_save_ldflags"
fi
else
if (test "$fcxxlinkage" != "yes"); then
......@@ -411,7 +433,7 @@ if (test "x$ENABLE_FORTRAN" != "xno" && test "x$CHECK_FC" != "xno"); then
# GNU and other non-intel compilers will use the standard -lstdc++ linkage
# This case also includes the Ubuntu+Clang combination as mentioned before
if (test "$cc_compiler" != "Clang" || test "$fcxxlinkage" != "yes"); then
if (test "$cxx_compiler" != "Clang" || test "$fcxxlinkage" != "yes"); then
my_save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS -lstdc++"
AC_MSG_CHECKING([whether $FC supports -stdlib=libstdc++])
......@@ -426,6 +448,10 @@ if (test "x$ENABLE_FORTRAN" != "xno" && test "x$CHECK_FC" != "xno"); then
fi
if (test "$fcxxlinkage" != "yes"); then
AC_MSG_WARN([Unrecognized C++ linkage for C/Fortran programs])
fi
fi
AC_SUBST(FLIBS)
......@@ -625,6 +651,7 @@ if test x$GXX = xyes; then
# Intel and Clang claims to be GCC, check for it here
FATHOM_TRY_COMPILER_DEFINE([__INTEL_COMPILER],[cxx_compiler=Intel])
FATHOM_TRY_COMPILER_DEFINE([__clang__],[cxx_compiler=Clang])
FATHOM_TRY_COMPILER_DEFINE([__PGI],[cxx_compiler=PortlandGroup])
# Search for other compiler types
# For efficiency, limit checks to relevant OSs
else
......@@ -730,8 +757,11 @@ case "$cxx_compiler:$host_cpu" in
FATHOM_CXX_32BIT=-xarch=generic
FATHOM_CXX_64BIT=-xarch=generic64
;;
PortlandGroup:*)
FATHOM_CXX_SPECIAL="$EXTRA_PGI_CXXFLAGS"
;;
Clang:*)
FATHOM_CXX_SPECIAL="$EXTRA_GNU_CXXFLAGS"
FATHOM_CXX_SPECIAL="$EXTRA_CLANG_CXXFLAGS"
FATHOM_CXX_32BIT=-m32
FATHOM_CXX_64BIT=-m64
;;
......@@ -773,6 +803,7 @@ if test x$GCC = xyes; then
# Intel claims to be GCC, check for it here
FATHOM_TRY_COMPILER_DEFINE([__INTEL_COMPILER],[cc_compiler=Intel])
FATHOM_TRY_COMPILER_DEFINE([__clang__],[cc_compiler=Clang])
FATHOM_TRY_COMPILER_DEFINE([__PGI],[cc_compiler=PortlandGroup])
# Search for other compiler types
# For efficiency, limit checks to relevant OSs
else
......@@ -828,34 +859,40 @@ case "$cc_compiler:$host_cpu" in
FATHOM_CC_64BIT=-m64
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
GNU:powerpc*)
FATHOM_CC_32BIT=-m32
FATHOM_CC_64BIT=-m64
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
GNU:i?86|GNU:x86_64)
FATHOM_CC_32BIT=-m32
FATHOM_CC_64BIT=-m64
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
GNU:mips*)
FATHOM_CC_32BIT="-mips32 -mabi=32"
FATHOM_CC_64BIT="-mips64 -mabi=64"
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
GNU:*)
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
Intel:*)
FATHOM_CC_32BIT=-m32
FATHOM_CC_64BIT=-m64
FATHOM_CC_SPECIAL="$EXTRA_INTEL_CXXFLAGS -wd981 -wd279 -wd1418 -wd383 -wd1572"
FATHOM_FC_SPECIAL="$EXTRA_INTEL_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
VisualAge:*)
case "$target_vendor" in
......@@ -870,6 +907,7 @@ case "$cc_compiler:$host_cpu" in
FATHOM_CC_64BIT=-q64
FATHOM_CC_SPECIAL="$EXTRA_BG_CXXFLAGS -qmaxmem=-1 -qminimaltoc"
FATHOM_FC_SPECIAL="$EXTRA_BG_FCFLAGS -qnoescape -WF,-C! -qddim -qalias=intptr"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
AR="ar"
NM="nm -B"
;;
......@@ -878,6 +916,7 @@ case "$cc_compiler:$host_cpu" in
FATHOM_CC_64BIT=-q64
FATHOM_CC_SPECIAL="$EXTRA_BG_CXXFLAGS -qmaxmem=-1 -qminimaltoc"
FATHOM_FC_SPECIAL="$EXTRA_BG_FCFLAGS -qnoescape -WF,-C! -qddim -qalias=intptr"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
AR="ar"
NM="nm -B -X 32_64"
;;
......@@ -888,14 +927,22 @@ case "$cc_compiler:$host_cpu" in
FATHOM_CC_64BIT=-64
FATHOM_CC_SPECIAL=-LANG:std
FATHOM_FC_SPECIAL=-LANG:std
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
MIPSpro:*)
FATHOM_CC_SPECIAL=-LANG:std
FATHOM_FC_SPECIAL=-LANG:std
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
PortlandGroup:*)
FATHOM_CC_SPECIAL="-traceback -C"
FATHOM_FC_SPECIAL="$EXTRA_PGI_FCFLAGS $EXTRA_PGI_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$EXTRA_PGI_FCFLAGS"
;;
Clang:*)
FATHOM_CC_SPECIAL="$EXTRA_GNU_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_FCFLAGS"
FATHOM_CC_SPECIAL="$EXTRA_CLANG_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_CLANG_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
FATHOM_CC_32BIT=-m32
FATHOM_CC_64BIT=-m64
;;
......@@ -912,7 +959,6 @@ case "$cc_compiler:$host_cpu" in
esac
AC_MSG_RESULT([$cc_compiler:$host_cpu])
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
]) # end FATHOM_CC_FLAGS
......
......@@ -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
......
......@@ -64,7 +64,7 @@ program DirectAccessNoHolesF90
character*120 opt
! initialize interface and get root set
call iMesh_newMesh("", %REF(imesh), ierr)
call iMesh_newMesh("", imesh, ierr)
CHECK(ierr)
call iMesh_getRootSet(%val(imesh), root_set, ierr)
CHECK(ierr)
......
......@@ -15,7 +15,7 @@
! NOTE: not integer*4 (see meaning of _LP64 in GNU docs)
# define IBASE_HANDLE_T integer
# endif
#elif defined(__INTEL_COMPILER)
#elif defined(__INTEL_COMPILER) || defined(__PGI)
# ifdef __x86_64
# define IBASE_HANDLE_T integer*8
# else
......
......@@ -2354,7 +2354,7 @@ int test_entity_copies( iMesh_Instance imesh, iMeshP_PartitionHandle prtn, const
// add all vertices to local_data
for (size_t j = 0; j < verts.size(); ++j) {
int tag;
int tag=0;
ierr = vertex_tag( imesh, verts[j], tag );
if (ierr)
break;
......
......@@ -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
......@@ -2406,7 +2406,7 @@ extern "C" {
EntityHandle set1 = ENTITY_HANDLE(entity_set_1),
set2 = ENTITY_HANDLE(entity_set_2);
int isList1, isList2;
int isList1=0, isList2=0;
iMesh_isList(instance, entity_set_1, &isList1, err);
if (*err != iBase_SUCCESS) return;
iMesh_isList(instance, entity_set_2, &isList2, err);
......@@ -2455,7 +2455,7 @@ extern "C" {
EntityHandle set1 = ENTITY_HANDLE(entity_set_1),
set2 = ENTITY_HANDLE(entity_set_2);
int isList1, isList2;
int isList1=0, isList2=0;
iMesh_isList(instance, entity_set_1, &isList1, err);
if (*err != iBase_SUCCESS) return;
iMesh_isList(instance, entity_set_2, &isList2, err);
......@@ -2561,7 +2561,7 @@ extern "C" {
EntityHandle set1 = ENTITY_HANDLE(entity_set_1),
set2 = ENTITY_HANDLE(entity_set_2);
int isList1, isList2;
int isList1=0, isList2=0;
iMesh_isList(instance, entity_set_1, &isList1, err);
if (*err != iBase_SUCCESS) return;
iMesh_isList(instance, entity_set_2, &isList2, err);
......
......@@ -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}
......
......@@ -34,7 +34,7 @@ typedef void* iRel_EntityHandle;
*/
void handle_error_code(const int result,
int *number_failed,
int *number_not_implemented,
int * /*number_not_implemented*/,
int *number_successful)
{
if (result) {
......
......@@ -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 \
......
......@@ -815,6 +815,7 @@ bool BSPTreePoly::is_point_contained( const CartVect& point ) const
if (!faceList) // empty (zero-dimension) polyhedron
return false;
const double EPSILON = 1e-6;
// Test that point is below the plane of each face
// NOTE: This will NOT work for polyhedra w/ concavities
for (Face* face = faceList; face; face = face->nextPtr) {
......@@ -828,7 +829,7 @@ bool BSPTreePoly::is_point_contained( const CartVect& point ) const
CartVect norm = (*pt3 - *pt2) * (*pt1 - *pt2);
double coeff = -(norm % *pt2);
if (norm % point > -coeff) // if above plane
if ( (norm % point + coeff) > EPSILON) // if above plane, with some -epsilon
return false;
}
......
......@@ -36,13 +36,14 @@ using namespace moab;
const bool debug = false;
MetisPartitioner::MetisPartitioner( Interface *impl,
MetisPartitioner::MetisPartitioner( Interface *impl,
const bool use_coords)
: PartitionerBase(impl,use_coords)
: PartitionerBase<idx_t>(impl,use_coords)
{
}
MetisPartitioner::~MetisPartitioner()
MetisPartitioner::~MetisPartitioner()
{
}
......@@ -59,7 +60,7 @@ ErrorCode MetisPartitioner::partition_mesh(const idx_t nparts,
#ifdef MOAB_HAVE_MPI
// should only be called in serial
if (mbpc->proc_config().proc_size() != 1) {
std::cout << "MetisPartitioner::partition_mesh_and_geometry must be called in serial."
std::cout << "MetisPartitioner::partition_mesh_and_geometry must be called in serial."
<< std::endl;
return MB_FAILURE;
}
......@@ -72,7 +73,7 @@ ErrorCode MetisPartitioner::partition_mesh(const idx_t nparts,
<< std::endl;
return MB_FAILURE;
}
std::vector<double> pts; // x[0], y[0], z[0], ... from MOAB
std::vector<idx_t> ids; // poidx_t ids from MOAB
std::vector<idx_t> adjs, parts;
......@@ -81,17 +82,17 @@ ErrorCode MetisPartitioner::partition_mesh(const idx_t nparts,
// Get a mesh from MOAB and diide it across processors.
clock_t t = clock();
ErrorCode result;
if (!partition_tagged_sets && !partition_tagged_ents)
{
result = assemble_graph(part_dim, pts, ids, adjs, length, elems);MB_CHK_ERR(result);
}
else if (partition_tagged_sets)
else if (partition_tagged_sets)
{
result = assemble_taggedsets_graph(part_dim, pts, ids, adjs, length, elems, &(*aggregating_tag));MB_CHK_ERR(result);
}
else if (partition_tagged_ents)
else if (partition_tagged_ents)
{
result = assemble_taggedents_graph(part_dim, pts, ids, adjs, length, elems, &(*aggregating_tag));MB_CHK_ERR(result);
}
......@@ -105,7 +106,7 @@ ErrorCode MetisPartitioner::partition_mesh(const idx_t nparts,
t = clock();
}
std::cout << "Computing partition using " << method
std::cout << "Computing partition using " << method
<<" method for " << nparts << " processors..." << std::endl;
idx_t nelems = length.size()-1;
......@@ -120,14 +121,14 @@ ErrorCode MetisPartitioner::partition_mesh(const idx_t nparts,
{
idx_t options[METIS_NOPTIONS];
METIS_SetDefaultOptions(options);
options[METIS_OPTION_CONTIG] = 1;
options[METIS_OPTION_CONTIG] = 1;
metis_RESULT = METIS_PartGraphKway(&nelems, &nconstraidx_ts, &length[0], &adjs[0], NULL, NULL, NULL, &nOfPartitions, NULL, NULL, options, &edgeCut, assign_parts);
}
else if (strcmp(method, "ML_RB") == 0)
{
idx_t options[METIS_NOPTIONS];
METIS_SetDefaultOptions(options);
options[METIS_OPTION_OBJTYPE] = METIS_OBJTYPE_CUT; // CUT
options[METIS_OPTION_OBJTYPE] = METIS_OBJTYPE_CUT; // CUT
options[METIS_OPTION_IPTYPE] = METIS_IPTYPE_GROW; // GROW or RANDOM
options[METIS_OPTION_CTYPE] = METIS_CTYPE_RM; // RM or SHEM
options[METIS_OPTION_RTYPE] = METIS_RTYPE_FM; // FM
......@@ -153,7 +154,7 @@ ErrorCode MetisPartitioner::partition_mesh(const idx_t nparts,
if (metis_RESULT != METIS_OK)
return MB_FAILURE;
// take results & write onto MOAB partition sets
std::cout << "Saving partition information to MOAB..." << std::endl;
{
......@@ -180,21 +181,21 @@ ErrorCode MetisPartitioner::partition_mesh(const idx_t nparts,
ErrorCode MetisPartitioner::assemble_taggedents_graph(const int dimension,
std::vector<double> &coords,
std::vector<idx_t> &moab_ids,
std::vector<idx_t> &adjacencies,
std::vector<idx_t> &adjacencies,
std::vector<idx_t> &length,
Range &elems,
const char *aggregating_tag)
const char *aggregating_tag)
{
Tag partSetTag;
ErrorCode result = mbImpl->tag_get_handle(aggregating_tag, 1, MB_TYPE_INTEGER, partSetTag);
if (MB_SUCCESS != result) return result;
Range allSubElems;
result = mbImpl->get_entities_by_dimension(0, dimension, allSubElems);
if (MB_SUCCESS != result || allSubElems.empty()) return result;
idx_t partSet;
std::map<idx_t, Range> aggloElems;
for (Range::iterator rit = allSubElems.begin(); rit != allSubElems.end(); rit++)
for (Range::iterator rit = allSubElems.begin(); rit != allSubElems.end(); rit++)
{
EntityHandle entity = *rit;
result = mbImpl->tag_get_data(partSetTag,&entity,1,&partSet);
......@@ -208,26 +209,26 @@ ErrorCode MetisPartitioner::assemble_taggedents_graph(const int dimension,
if (type == MB_TAG_DENSE)
{
// clear tag on ents and sets
result = mbImpl->tag_delete(partSetTag);
result = mbImpl->tag_delete(partSetTag);
if (MB_SUCCESS != result) return result;
}