Commit 24470abd authored by Dave DeMarle's avatar Dave DeMarle
Browse files

Restructure to function as a module in VTK6.

In this change I:
  Replace the build system for the library with a simplified version that
can be called from modular vtk's build system. For the most part this means
gutting the parts related to wrapping and packaging as vtk's cmake macros
do that.
  Made it so that the vtk directory and libsrc directory are separable so that
once promoted to VTK they can be placed in separate directories.
  Update the style to be more consistent with modern vtk.
  Removed the Ice subdirectory as it appears unused.
parent 2bbc674a
......@@ -23,7 +23,7 @@ MACRO(CHECK_FOR_64BIT_STREAMS VARIABLE)
MESSAGE(STATUS "Check if system supports 64 bit streams")
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${Xdmf_SOURCE_DIR}/CMake/CheckFor64BitStreams.cxx
${xdmf2_SOURCE_DIR}/CMake/CheckFor64BitStreams.cxx
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FOR_64BIT_STREAMS_FLAGS}
OUTPUT_VARIABLE OUTPUT)
......
PROJECT(Xdmf)
cmake_minimum_required(VERSION 2.8)
SET(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
project(xdmf2)
# Send VTK executables to the ParaView LIBRARY directory (not a mistake).
# Send VTK include files to the ParaView include directory
# Send VTK libraries to the ParaView library directory.
SET(VTK_INSTALL_PACKAGE_DIR_CM24 ${PV_INSTALL_LIB_DIR})
#options
set(XDMF_USE_ANSI_STDLIB 1)
set(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
IF (PARAVIEW_USE_MPI)
SET(XDMF_BUILD_MPI 1)
INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
IF (MPI_LIBRARY)
SET(XDMF2_MPI_LIBRARIES ${MPI_LIBRARY})
ENDIF (MPI_LIBRARY)
IF (MPI_EXTRA_LIBRARY)
SET(XDMF2_MPI_LIBRARIES ${XDMF2_MPI_LIBRARIES} "${MPI_EXTRA_LIBRARY}")
ENDIF (MPI_EXTRA_LIBRARY)
ELSE (PARAVIEW_USE_MPI)
SET(XDMF_BUILD_MPI 0)
ENDIF (PARAVIEW_USE_MPI)
#hard dependencies
#XML
if (XDMF_BUILT_INVTK)
set(XDMF_LIBXML2_LIBRARIES ${vtklibxml2_LIBRARIES})
set(XDMF_LIBXML2_INCLUDE_DIRS ${vtklibxml2_INCLUDE_DIRS})
else()
find_package(LibXml2 REQUIRED)
set(XDMF_LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES})
set(XDMF_LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
endif()
#?
if(NOT BUILD_SHARED_LIBS)
add_definitions(-DLIBXML_STATIC)
endif()
IF(NOT BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DLIBXML_STATIC)
ENDIF(NOT BUILD_SHARED_LIBS)
#HDF5
if (XDMF_BUILT_INVTK)
set(XDMF_HDF5_LIBRARIES ${vtkhdf5_LIBRARIES})
set(XDMF_HDF5_INCLUDE_DIRS ${vtkhdf5_INCLUDE_DIRS})
else()
find_package(HDF5 REQUIRED)
set(XDMF_HDF5_LIBRARIES ${HDF5_LIBRARIES})
set(XDMF_HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS})
endif()
if(EXISTS "${HDF5_CONFIG}")
include("${HDF5_CONFIG}")
add_definitions(${HDF5_EXTRA_FLAGS})
endif()
SET(XDMF_BUILD_VTK 1)
#optional dependencies
#MPI
option(XDMF_BUILD_MPI "XDMF should use MPI" OFF)
mark_as_advanced(XDMF_BUILD_MPI)
if (XDMF_BUILD_MPI)
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
set(XDMF_MPI_LIBRARIES ${MPI_LIBRARIES})
add_definitions(-DMPICH_IGNORE_CXX_SEEK)
else()
add_definitions(-DUSE_SERIAL_XMDF)
endif()
set(LIBXML2_LIBRARY ${vtklibxml2_LIBRARIES})
set(VTKLIBXML2_INCLUDE_DIRS ${vtklibxml2_INCLUDE_DIRS})
#NDGM
option(XDMF_HAS_NDGM "XDMF has Network Distributed Global Memory (NDGM)" OFF)
mark_as_advanced(XDMF_HAS_NDGM)
if(XDMF_HAS_NDGM)
option(XDMF_HAS_NDGM_SOURCE "XDMF has Network Distributed Global Memory (NDGM) Source" OFF)
if(XDMF_HAS_NDGM_SOURCE)
find_path(NDGM_DIR BuildNDGM.cmake ${xdmf2_SOURCE_DIR}/../Ndgm "Root of Source for NDGM")
if(NDGM_DIR)
message(STATUS "......Process NDGM Source")
include(${NDGM_DIR}/BuildNDGM.cmake)
#subdirs(NDGM)
include_directories(${NDGM_DIR}/libsrc)
set(NDGM_LIBRARY ndgm)
endif()
else()
message(STATUS "......Looking for NDGM_INCLUDE_DIR")
find_path(NDGM_INCLUDE_DIR Ndgm ${xdmf2_SOURCE_DIR}/../Ndgm/libsrc "Include Directory for NDGM; Resolves #include <Ndgm/ndgm.h>")
message(STATUS "......Looking for NDGM_LIBRARY")
find_library(NDGM_LIBRARY ndgm ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
include_directories(${NDGM_INCLUDE_DIR})
set(NDGM_LIBRARY ${NDGM_LIBRARY})
endif()
set(HAVE_NDGM 1)
endif()
SET(HDF5_LIBRARY ${PARAVIEW_HDF5_LIBRARIES})
IF(VTK_USE_SYSTEM_EXPAT)
SET(XDMF_EXPAT_LIBRARIES ${EXPAT_LIBRARY})
ELSE(VTK_USE_SYSTEM_EXPAT)
SET(XDMF_EXPAT_LIBRARIES vtkexpat)
ENDIF(VTK_USE_SYSTEM_EXPAT)
SET(XDMF_USE_ANSI_STDLIB ${PARAVIEW_USE_ANSI_STDLIB})
##########################
#packaging
if(NOT XDMF_INSTALL_LIB_DIR)
set(XDMF_INSTALL_LIB_DIR /lib)
endif()
if(NOT XDMF_INSTALL_INCLUDE_DIR)
set(XDMF_INSTALL_INCLUDE_DIR /include/Xdmf)
endif()
IF(NOT XDMF_INSTALL_LIB_DIR)
SET(XDMF_INSTALL_LIB_DIR /lib)
ENDIF(NOT XDMF_INSTALL_LIB_DIR)
IF(NOT XDMF_INSTALL_INCLUDE_DIR)
SET(XDMF_INSTALL_INCLUDE_DIR /include/Xdmf)
ENDIF(NOT XDMF_INSTALL_INCLUDE_DIR)
IF(NOT XDMF_INSTALL_INCLUDE_VTK_DIR)
SET(XDMF_INSTALL_INCLUDE_VTK_DIR /include/XdmfVtk)
ENDIF(NOT XDMF_INSTALL_INCLUDE_VTK_DIR)
set(XDMF2_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR})
configure_file(${xdmf2_SOURCE_DIR}/XDMFConfig.cmake.in
${xdmf2_BINARY_DIR}/XDMFConfig.cmake @ONLY IMMEDIATE)
# Let parent project set XDMF_INSTALL_NO_DEVELOPMENT or
# XDMF_INSTALL_NO_RUNTIME to remove components from the installation.
SET(XDMF_INSTALL_NO_LIBRARIES)
IF(BUILD_SHARED_LIBS)
IF(XDMF_INSTALL_NO_RUNTIME AND XDMF_INSTALL_NO_DEVELOPMENT)
SET(XDMF_INSTALL_NO_LIBRARIES 1)
ENDIF(XDMF_INSTALL_NO_RUNTIME AND XDMF_INSTALL_NO_DEVELOPMENT)
ELSE(BUILD_SHARED_LIBS)
IF(XDMF_INSTALL_NO_DEVELOPMENT)
SET(XDMF_INSTALL_NO_LIBRARIES 1)
ENDIF(XDMF_INSTALL_NO_DEVELOPMENT)
ENDIF(BUILD_SHARED_LIBS)
include_directories(vtkhdf5_INCLUDE_DIRS)
IF(EXISTS "${HDF5_CONFIG}")
INCLUDE("${HDF5_CONFIG}")
ADD_DEFINITIONS(${HDF5_EXTRA_FLAGS})
ENDIF(EXISTS "${HDF5_CONFIG}")
OPTION(XDMF_HAS_NDGM "XDMF has Network Distributed Global Memory (NDGM)" OFF)
MARK_AS_ADVANCED(XDMF_HAS_NDGM)
IF(XDMF_HAS_NDGM)
OPTION(XDMF_HAS_NDGM_SOURCE "XDMF has Network Distributed Global Memory (NDGM) Source" OFF)
IF(XDMF_HAS_NDGM_SOURCE)
FIND_PATH(NDGM_DIR BuildNDGM.cmake ${Xdmf_SOURCE_DIR}/../Ndgm "Root of Source for NDGM")
IF(NDGM_DIR)
MESSAGE(STATUS "......Process NDGM Source")
INCLUDE(${NDGM_DIR}/BuildNDGM.cmake)
#SUBDIRS(NDGM)
INCLUDE_DIRECTORIES(${NDGM_DIR}/libsrc)
SET(NDGM_LIBRARY ndgm)
ENDIF(NDGM_DIR)
ELSE(XDMF_HAS_NDGM_SOURCE)
MESSAGE(STATUS "......Looking for NDGM_INCLUDE_DIR")
FIND_PATH(NDGM_INCLUDE_DIR Ndgm ${Xdmf_SOURCE_DIR}/../Ndgm/libsrc "Include Directory for NDGM; Resolves #include <Ndgm/ndgm.h>")
MESSAGE(STATUS "......Looking for NDGM_LIBRARY")
FIND_LIBRARY(NDGM_LIBRARY ndgm ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
INCLUDE_DIRECTORIES(${NDGM_INCLUDE_DIR})
SET(NDGM_LIBRARY ${NDGM_LIBRARY})
ENDIF(XDMF_HAS_NDGM_SOURCE)
SET(HAVE_NDGM 1)
ENDIF(XDMF_HAS_NDGM)
SET(XDMF2_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR})
SET(XDMF2_VTK_DIR ${ParaView_BINARY_DIR}/VTK)
CONFIGURE_FILE(${Xdmf_SOURCE_DIR}/XDMFConfig.cmake.in
${Xdmf_BINARY_DIR}/XDMFConfig.cmake @ONLY IMMEDIATE)
#setup build
include_directories(
${xdmf2_SOURCE_DIR}/libsrc
${xdmf2_BINARY_DIR}/libsrc
${xdmf2_SOURCE_DIR}/libsrc/utils
${XDMF_EXPAT_INCLUDE_DIRS}
${XDMF_LIBXML2_INCLUDE_DIRS}
${XDMF_HDF5_INCLUDE_DIRS}
)
MAKE_DIRECTORY(${Xdmf_BINARY_DIR}/Ice)
include(TestBigEndian)
test_big_endian(CMAKE_WORDS_BIGENDIAN)
INCLUDE_DIRECTORIES(
${Xdmf_SOURCE_DIR}/Ice
${Xdmf_BINARY_DIR}/Ice
${Xdmf_SOURCE_DIR}/libsrc
${Xdmf_BINARY_DIR}/libsrc
${Xdmf_SOURCE_DIR}/libsrc/utils
${Xdmf_SOURCE_DIR}/vtk
${Xdmf_BINARY_DIR}/vtk
${VTK_INCLUDE_DIR}
${VTKEXPAT_INCLUDE_DIR}
${ParaView_SOURCE_DIR}/VTK/Utilities
${ParaView_BINARY_DIR}/VTK/Utilities
${VTKLIBXML2_INCLUDE_DIR}
${HDF5_INCLUDE_DIR}
)
SUBDIRS(Ice)
SUBDIRS(libsrc)
SUBDIRS(vtk)
add_subdirectory(libsrc)
vtk_target(xdmf2 NO_INSTALL) #?? hdf5 does it, should we?
PROJECT(ICE)
# Version
SET(ICE_YEAR 03)
SET(ICE_MONTH 08)
SET(ICE_VERSION
"${ICE_YEAR}.${ICE_MONTH}")
# System to Build
STRING(REGEX REPLACE "-" "_" ICE_SYSTEM ${CMAKE_SYSTEM_NAME})
SET(ARCH_TO_BUILD ${ICE_SYSTEM} CACHE INTERNAL "Host Arcitecture : Linux IRIXN32 IRIX64 AIX CYGWIN")
# Allow the user to customize their build with some local options
#
ADD_DEFINITIONS(-D${ARCH_TO_BUILD})
SET(ICE_SIZEOF_CHAR ${VTK_SIZEOF_CHAR})
SET(ICE_SIZEOF_DOUBLE ${VTK_SIZEOF_DOUBLE})
SET(ICE_SIZEOF_FLOAT ${VTK_SIZEOF_FLOAT})
SET(ICE_SIZEOF_INT ${VTK_SIZEOF_INT})
SET(ICE_SIZEOF_LONG ${VTK_SIZEOF_LONG})
SET(ICE_SIZEOF_SHORT ${VTK_SIZEOF_SHORT})
INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
IF(WIN32)
CHECK_TYPE_SIZE(__int64 SIZEOF___INT64)
ENDIF(WIN32)
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL)
# Don't Really Need to check these ...
SET(ICE_VOID_VALID 1)
SET(ICE_VOID "void")
SET(ICE_PTR_VALID 1)
SET(ICE_PTR "void *")
SET(ICE_CHAR_VALID 1)
SET(ICE_CHAR "char")
SET(ICE_8_INT_VALID 1)
SET(ICE_8_INT "char")
SET(ICE_8_U_INT "unsigned char")
SET(ICE_16_INT_VALID 1)
SET(ICE_16_INT "short")
SET(ICE_16_U_INT "unsigned short")
# These should be Valid
IF(${ICE_SIZEOF_FLOAT} MATCHES 4)
SET(ICE_32_FLOAT_VALID 1)
SET(ICE_FLOAT "float")
SET(ICE_32_FLOAT "float")
ELSE (${ICE_SIZEOF_FLOAT} MATCHES 4)
MESSAGE(SEND_ERROR "Can't Find a 32 Bit Float")
ENDIF (${ICE_SIZEOF_FLOAT} MATCHES 4)
IF(${ICE_SIZEOF_DOUBLE} MATCHES 8)
SET(ICE_64_FLOAT_VALID 1)
SET(ICE_DOUBLE "double")
SET(ICE_64_FLOAT "double")
ELSE (${ICE_SIZEOF_DOUBLE} MATCHES 8)
MESSAGE(SEND_ERROR "Can't Find a 64 Bit Float")
ENDIF (${ICE_SIZEOF_DOUBLE} MATCHES 8)
# These are sometimes different
IF(${ICE_SIZEOF_INT} MATCHES 4)
SET(ICE_32_INT_VALID 1)
SET(ICE_32_INT "int")
SET(ICE_32_U_INT "unsigned int")
SET(ICE_32_S_INT "int")
ELSE (${ICE_SIZEOF_INT} MATCHES 4)
IF(${ICE_SIZEOF_LONG} MATCHES 4)
SET(ICE_32_INT_VALID 1)
SET(ICE_32_INT "long")
SET(ICE_32_U_INT "unsigned long")
SET(ICE_32_S_INT "long")
ELSE(${ICE_SIZEOF_LONG} MATCHES 4)
MESSAGE(SEND_ERROR "Can't Find a 32 Bit Integer")
ENDIF(${ICE_SIZEOF_LONG} MATCHES 4)
ENDIF(${ICE_SIZEOF_INT} MATCHES 4)
INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cmake)
INCLUDE(${Xdmf_SOURCE_DIR}/CMake/CheckFor64BitStreams.cmake)
CHECK_FOR_64BIT_STREAMS(ICE_HAVE_64BIT_STREAMS)
# Find include files
FIND_PATH(ICE_HAVE_FCNTL fcntl.h /usr/include /usr/include/sys)
FIND_PATH(ICE_HAVE_NETINET in.h /usr/include/netinet /usr/include /usr/include/sys)
FIND_PATH(ICE_HAVE_MMAN mman.h /usr/include/sys /usr/include)
MARK_AS_ADVANCED(ICE_HAVE_FCNTL ICE_HAVE_NETINET ICE_HAVE_MMAN)
#Create IceConfig.h
CONFIGURE_FILE(
${ICE_SOURCE_DIR}/IceConfig.h.in
${ICE_BINARY_DIR}/IceConfig.h
)
IF(NOT XDMF_INSTALL_NO_DEVELOPMENT)
FILE(GLOB devFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
INSTALL(
FILES ${devFiles}
DESTINATION ${XDMF_INSTALL_INCLUDE_DIR}
COMPONENT Development)
# INSTALL_FILES(${XDMF_INSTALL_INCLUDE_DIR} .h IceConfig ice)
ENDIF(NOT XDMF_INSTALL_NO_DEVELOPMENT)
/********************************************************/
/* */
/* ICE Host Dependent Configuration File */
/* Automatically Generated by CMake */
/* */
/********************************************************/
#ifndef __ICE_CONFIG
#define __ICE_CONFIG
/* what byte order */
#cmakedefine CMAKE_WORDS_BIGENDIAN
#ifdef CMAKE_WORDS_BIGENDIAN
#define ICE_WORDS_BIGENDIAN
#define ICE_BYTE_ORDER_BIG
#else
#define ICE_WORDS_LITTLEENDIAN
#define ICE_BYTE_ORDER_LITTLE
#endif
#define ICE_SYSTEM "@ICE_SYSTEM@"
#define ICE_HOST @ICE_SYSTEM@
#ifndef @ICE_SYSTEM@
#define @ICE_SYSTEM@
#endif
#cmakedefine ICE_VOID_VALID
#ifndef ICE_VOID_VALID
/* Force an Error */
#error ICE_VOID not defined
#endif
#define ICE_VOID @ICE_VOID@
#cmakedefine ICE_PTR_VALID
#ifndef ICE_PTR_VALID
/* Force an Error */
#error ICE_PTR not defined
#endif
#define ICE_PTR @ICE_PTR@
#cmakedefine ICE_CHAR_VALID
#ifndef ICE_CHAR_VALID
/* Force an Error */
#error ICE_CHAR not defined
#endif
#define ICE_CHAR @ICE_CHAR@
#cmakedefine ICE_8_INT_VALID
#ifndef ICE_8_INT_VALID
/* Force an Error */
#error ICE_8_INT not defined
#endif
#define ICE_8_INT @ICE_8_INT@
#define ICE_8_U_INT @ICE_8_U_INT@
#cmakedefine ICE_16_INT_VALID
#ifndef ICE_16_INT_VALID
/* Force an Error */
#error ICE_16_INT not defined
#endif
#define ICE_16_INT @ICE_16_INT@
#define ICE_16_U_INT @ICE_16_U_INT@
#cmakedefine ICE_32_INT_VALID
#ifndef ICE_32_INT_VALID
/* Force an Error */
#error ICE_32_INT not defined
#endif
#define ICE_32_INT @ICE_32_INT@
#define ICE_32_U_INT @ICE_32_U_INT@
#define ICE_32_S_INT @ICE_32_S_INT@
#cmakedefine ICE_32_FLOAT_VALID
#ifndef ICE_32_FLOAT_VALID
/* Force an Error */
#error ICE_32_FLOAT not defined
#endif
#define ICE_32_FLOAT @ICE_32_FLOAT@
#define ICE_FLOAT @ICE_32_FLOAT@
#cmakedefine ICE_64_FLOAT_VALID
#ifndef ICE_64_FLOAT_VALID
/* Force an Error */
#error ICE_64_FLOAT not defined
#endif
#define ICE_64_FLOAT @ICE_64_FLOAT@
#define ICE_DOUBLE @ICE_64_FLOAT@
#ifndef SIZEOF___INT64
#cmakedefine SIZEOF___INT64
#endif
#cmakedefine HAVE_STRTOLL
#ifndef SIZEOF_LONG_LONG
#cmakedefine SIZEOF_LONG_LONG
#endif
#if defined( SIZEOF___INT64 )
# define ICE_64_INT __int64
# define HAVE_64_INT
#elif defined( SIZEOF_LONG_LONG )
# define ICE_64_INT long long
# define HAVE_64_INT
# define ICE_have_64_bit_int
#else
# error "64 bit long not defined"
#endif
#cmakedefine ICE_HAVE_64BIT_STREAMS
#ifdef ICE_HAVE_64BIT_STREAMS
#define ICE_64BIT_CAST
#else
#define ICE_64BIT_CAST (long)
#endif
#cmakedefine ICE_HAVE_FCNTL
#cmakedefine ICE_HAVE_NETINET
#cmakedefine ICE_HAVE_MMAN
#endif /* __ICE_CONFIG */
/*******************************************************************/
/* XDMF */
/* eXtensible Data Model and Format */
/* */
/* Id : Id */
/* Date : $Date$ */
/* Version : $Revision$ */
/* */
/* Author: */
/* Jerry A. Clarke */
/* clarke@arl.army.mil */
/* US Army Research Laboratory */
/* Aberdeen Proving Ground, MD */
/* */
/* Copyright @ 2002 US Army Research Laboratory */
/* All Rights Reserved */
/* See Copyright.txt or http://www.arl.hpc.mil/ice for details */
/* */
/* This software is distributed WITHOUT ANY WARRANTY; without */
/* even the implied warranty of MERCHANTABILITY or FITNESS */
/* FOR A PARTICULAR PURPOSE. See the above copyright notice */
/* for more information. */
/* */
/*******************************************************************/
#ifndef ice_included
#define ice_included
#if !defined( WIN32 ) || defined(__CYGWIN__)
#define UNIX
#endif /* WIN32 */
#ifndef SWIG
/* System Includes */
# include "stdio.h"
# include "stdlib.h"
# include "sys/types.h"
# include "time.h"
# include "string.h"
# ifdef __hpux
# include <sys/param.h>
# endif
# ifdef UNIX
# include "sys/file.h"
# include "strings.h"
# define STRCASECMP strcasecmp
# define STRNCASECMP strncasecmp
# define STRCMP strcmp
# define STRNCMP strncmp
# endif
# if defined(WIN32) && !defined(__CYGWIN__)
# include "winsock.h"
/* String comparison routine. */
# define STRCASECMP _stricmp
# define STRNCASECMP _strnicmp
# define STRCMP strcmp
# define STRNCMP strncmp
# endif
#endif
/* System Dependent Defines */
#include "IceConfig.h"
#ifndef ICE_SYSTEM
/* Force An Error */
ATTENTION ERROR_IN_ICE Probably a Bad/Missing IceConfig.h
#endif
#define ICE_MACHINE_TYPE ICE_SYSTEM
#ifndef SWIG
# ifdef ICE_HAVE_FCNTL
# include "fcntl.h"
# endif
# ifdef ICE_HAVE_MMAN
# include "sys/mman.h"
# else
# define ICE_HAS_NO_MMAP 1
# endif
# ifdef ICE_HAVE_NETINET
# include "netinet/in.h"
# endif
#endif
/* Defines */
#define ICE_INT ICE_32_INT
#define ICE_TRUE 1
#define ICE_FALSE 0
#define ICE_SUCCESS 1
#define ICE_FAIL -1
#define ICE_CHAR_TYPE 1
#define ICE_8_INT_TYPE 2
#define ICE_32_INT_TYPE 3
#define ICE_64_INT_TYPE 4
#define ICE_FLOAT_TYPE 5
#define ICE_DOUBLE_TYPE 6
/* Macros */
#define WORD2FLOAT( a ) ((a) == NULL ? ICE_FAIL : atof((a)))
#define WORD2INT( a ) ((a) == NULL ? ICE_FAIL : strtol( (a) , ( char **)NULL, 0))
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
#ifndef abs
#define ABS(a) ((a) >= 0 ? (a) : -(a))
#endif
#define ICE_ERROR fprintf(stderr, "Error on line #%d in file %s\n", __LINE__, __FILE__);
#define ICE_PERROR fprintf(stderr, "Error on line #%d in file %s\n", __LINE__, __FILE__);
#define ICE_PORT(a) (((a) * 5) + 7788 + 1)
#ifdef ICE_BYTE_ORDER_LITTLE
#define ICE_BYTE_ORDER_LITTLE
#endif
#ifdef ICE_BYTE_ORDER_LITTLE
#define ICE_x86_BYTEORDER
#else
#define ICE_XDR_BYTEORDER
#endif
/************************************************/
/************************************************/
/* Byte Order Macros */
/************************************************/
/************************************************/
#ifdef ICE_have_64_bit_int
typedef ICE_64_INT ICE_BIG_INT; /* Biggest Int */
#define ICE_x86_SHIFT64(a) \
( ICE_64_INT )( (( ( ICE_64_INT )(a) & 0xFFU ) << 56 ) | \
(( ( ICE_64_INT )(a) & 0xFF00U ) << 40 ) | \
(( ( ICE_64_INT )(a) & 0xFF0000U ) << 24 ) | \
(( ( ICE_64_INT )(a) & 0xFF000000U ) << 8 ) | \
(( ( ICE_64_INT )(a) >> 8 ) & 0xFF000000U ) | \
(( ( ICE_64_INT )(a) >> 24 ) & 0xFF0000U ) | \
(( ( ICE_64_INT )(a) >> 40 ) & 0xFF00U ) | \
(( ( ICE_64_INT )(a) >> 56 ) & 0xFFU ) )
#define ICE_XDR_SHIFT64(a) (a) /* Already in Correct Order */
#else /* have_64_bit_int */
#define ICE_x86_SHIFT64(a) (a)
#define ICE_XDR_SHIFT64(a) (a)
typedef ICE_32_INT ICE_BIG_INT;
#endif /* have_64_bit_int */
#define ICE_x86_SHIFT32(a) htonl((a))
#define ICE_XDR_SHIFT32(a) (a)
#ifdef ICE_x86_BYTEORDER
#define ICE_SHIFT64(a) ICE_x86_SHIFT64((a))
#define ICE_SHIFT32(a) ICE_x86_SHIFT32((a))
#endif
#ifdef ICE_XDR_BYTEORDER
#define ICE_SHIFT32(a) (a)
#define ICE_SHIFT64(a) (a)
#endif
#define ICE_SHIFT(a) (sizeof((a)) == 8 ? ICE_SHIFT64(a) : ICE_SHIFT32(a))
#define ICE_SHIFT_FROM32(a) ICE_SHIFT(a)
#define ICE_SHIFT_TO_XDR32(a) ICE_SHIFT(a)
#define ICE_SHIFT_FROM_XDR64(a) ICE_SHIFT(a)
#define ICE_SHIFT_TO_XDR64(a) ICE_SHIFT(a)
#define ICE_SHIFT_FROM_XDR(a) ICE_SHIFT(a)
#define ICE_SHIFT_TO_XDR(a) ICE_SHIFT(a)
#endif /* ice_included */
......@@ -5,49 +5,33 @@
# This file is configured by XDMF and used by the UseXDMF.cmake module