Commit 0d8e1e2a authored by miller86's avatar miller86

switching from bzip2 to zlib

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@4989 18c085ea-50e0-402c-830e-de6fd14e8384
parent 085bbfd3
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# generated automatically by aclocal 1.10 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
# 2005, 2006 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......
......@@ -66,7 +66,7 @@ CPPFLAGS=-I../../include/visit @COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libavtddf
LIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(ZLIB_LIB) $(GLEW_LIBS)
SERLIBS=-ldbatts -lpipeline_ser -lavtmath_ser -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lmisc -lstate -lcomm -lexpr -lparser -lutility $(VTK_LIBS) $(LIBS_FOR_MACOSX_PREBINDING) $(X_LIBS)
PARLIBS=-ldbatts -lpipeline_par -lavtmath_par -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lmisc -lstate -lcomm -lexpr -lparser -lutility $(VTK_LIBS) $(LIBS_FOR_MACOSX_PREBINDING) $(X_LIBS)
......
......@@ -875,16 +875,24 @@ avtVariableCache::OneTimestep::~OneTimestep()
// Programmer: Mark C. Miller (refactored from orig. code by Hank Childs)
// Created: May 20, 2008
//
// Modifications:
//
// Mark C. Miller, Thu Aug 14 19:31:14 PDT 2008
// Moved test for negative domain to front to avoid unnecessary work.
//
// ****************************************************************************
void
avtVariableCache::OneTimestep::GetHashIndices(int domain, int *L0, int *L1, int *L2) const
{
if (domain < 0) // work around negative modulos.
{
*L0 = *L1 = *L2 = 0;
return;
}
*L0 = domain % HASH_SIZE;
*L1 = (domain / HASH_SIZE) % HASH_SIZE;
*L2 = (domain / (HASH_SIZE*HASH_SIZE)) % HASH_SIZE;
if (domain < 0) // work around negative modulos.
*L0 = *L1 = *L2 = 0;
}
// ****************************************************************************
......
......@@ -182,7 +182,7 @@ CPPFLAGS=-I../../include @COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libdatabase
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(ZLIB_LIB) $(GLEW_LIBS)
COMMONLIBS=-ldbatts -lavtexceptions -lstate -lcomm -lmisc -lplugin -lexpr -lparser -lutility -lvisit_vtk -llightweight_visit_vtk $(LIBS_FOR_MACOSX_PREBINDING)
SERLIBS=$(COMMONLIBS) -lmir_ser -lpipeline_ser -lavtmath_ser $(VTK_LIBS)
PARLIBS=$(COMMONLIBS) -lmir_par -lpipeline_par -lavtmath_par $(VTK_LIBS) @SHLIB_MPI_LIBS@
......
......@@ -433,8 +433,8 @@ CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libexpressions
SERLIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS) -lavtfilters_ser -lavtddf_ser
PARLIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS) -lavtfilters_par -lavtddf_par
SERLIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(ZLIB_LIB) $(GLEW_LIBS) -lavtfilters_ser -lavtddf_ser
PARLIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(ZLIB_LIB) $(GLEW_LIBS) -lavtfilters_par -lavtddf_par
COMMONLIBS=-ldbatts -lavtexceptions -lstate -lcomm -lmisc -lexpr -lparser -lutility -lplugin -lvisit_vtk -llightweight_visit_vtk -lavtview
SERLIBS=$(COMMONLIBS) -lpipeline_ser -lavtmath_ser -ldatabase_ser -lmir_ser $(VTK_LIBS) $(SERLIBS_FOR_MACOSX_PREBINDING) $(X_LIBS) @LIBS@
PARLIBS=$(COMMONLIBS) -lpipeline_par -lavtmath_par -ldatabase_par -lmir_par $(VTK_LIBS) $(PARLIBS_FOR_MACOSX_PREBINDING) $(X_LIBS) @LIBS@ @SHLIB_MPI_LIBS@
......
......@@ -77,7 +77,7 @@ CPPFLAGS=-I../../include/visit @COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libavtwriter
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(ZLIB_LIB) $(GLEW_LIBS)
SER_LIBS_FOR_MACOSX_PREBINDING=-lplotter_ser
PAR_LIBS_FOR_MACOSX_PREBINDING=-lplotter_par
SERLIBS=-ldbatts -lpipeline_ser -lavtmath_ser -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lmisc -lstate -lcomm -lexpr -lparser -lutility $(SER_LIBS_FOR_MACOSX_PREBINDING) $(LIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(X_LIBS)
......
......@@ -147,7 +147,7 @@ CPPFLAGS=-I../../include @COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libavtfilters
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(ZLIB_LIB) $(GLEW_LIBS)
COMMONLIBS=-ldbatts -lstate -lcomm -lmisc -lavtexceptions -lexpr -lparser -lutility -lavtview -lvisit_vtk -llightweight_visit_vtk $(LIBS_FOR_MACOSX_PREBINDING)
SERLIBS=$(COMMONLIBS) -lpipeline_ser -lavtmath_ser $(VTK_LIBS)
PARLIBS=$(COMMONLIBS) -lpipeline_par -lavtmath_par $(VTK_LIBS)
......
......@@ -97,7 +97,7 @@ CPPFLAGS=-I../../include @COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libmir
LIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(ZLIB_LIB) $(GLEW_LIBS)
SERLIBS=-ldbatts -lpipeline_ser -lavtmath_ser -lavtexceptions -lstate -lutility -lmisc -lcomm -lexpr -lparser -llightweight_visit_vtk $(VTK_LIBS) $(LIBS_FOR_MACOSX_PREBINDING)
PARLIBS=-ldbatts -lpipeline_par -lavtmath_par -lavtexceptions -lstate -lutility -lmisc -lcomm -lexpr -lparser -llightweight_visit_vtk $(VTK_LIBS) $(LIBS_FOR_MACOSX_PREBINDING)
......
......@@ -76,8 +76,8 @@
#include <NoInputException.h>
#include <DebugStream.h>
#ifdef HAVE_LIBBZ2
#include <bzlib.h>
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#include <TimingsManager.h>
#endif
......@@ -2701,17 +2701,21 @@ MajorEigenvalue(double *vals)
// Function: CMaybeCompressedDataString
//
// Purpose: Check a data string for leading characters indicating it *might*
// be a BZ2 compressed string.
// be a compressed string.
//
// Programmer: Mark C. Miller
// Creation: November 15, 2005
//
// Modifciations:
// Mark C. Miller, Sun Aug 17 00:38:37 PDT 2008
// Switched to use ZLIB
//
// ****************************************************************************
bool
CMaybeCompressedDataString(const unsigned char *dstr)
{
if (dstr[0] == 'B' && dstr[1] == 'Z' && dstr[2] == 'h')
if (dstr[0] == 'Z' && dstr[1] == 'L' && dstr[2] == 'I' && dstr[3] == 'B')
return true;
return false;
}
......@@ -2740,36 +2744,45 @@ CMaybeCompressedDataString(const unsigned char *dstr)
// Hank Childs, Fri Jun 9 13:21:29 PDT 2006
// Remove unused variable.
//
// Mark C. Miller, Sun Aug 17 00:38:37 PDT 2008
// Switched to use ZLIB
// ****************************************************************************
bool CCompressDataString(const unsigned char *dstr, int len,
unsigned char **newdstr, int *newlen,
float *timec, float *ratioc)
{
#ifdef HAVE_LIBBZ2
unsigned int lenBZ2 = *newlen == 0 ? len / 2 : *newlen;
unsigned char *dstrBZ2 = new unsigned char [lenBZ2+20];
#ifdef HAVE_ZLIB_H
unsigned int lenZIP = *newlen == 0 ? len / 2 : *newlen;
unsigned char *dstrZIP = new unsigned char [lenZIP+24];
int startCompress = visitTimer->StartTimer(true);
if (BZ2_bzBuffToBuffCompress((char*)dstrBZ2, &lenBZ2, (char*) dstr, len,
1, 0, 250) != BZ_OK)
uLongf lenZIPtmp = (uLongf) lenZIP;
dstrZIP[0] = 'Z';
dstrZIP[1] = 'L';
dstrZIP[2] = 'I';
dstrZIP[3] = 'B';
// use fastest mode of compression. Maybe we'll make a GUI knob for it?
if (compress2(&dstrZIP[4], &lenZIPtmp, dstr, (uLong) len, 1) != Z_OK)
{
visitTimer->StopTimer(startCompress,
"Failed attempt to compress data", true);
delete [] dstrBZ2;
debug5 << "Failed to compress data" << endl;
delete [] dstrZIP;
return false;
}
else
{
lenZIP = (unsigned int) lenZIPtmp+4;
double timeToCompress =
visitTimer->StopTimer(startCompress, "Compressing data", true);
debug5 << "Compressed data "
<< (float) len / (float) lenBZ2
<< (float) len / (float) lenZIP
<< ":1 in " << timeToCompress << " seconds" << endl;
sprintf((char*) &dstrBZ2[lenBZ2], "%10d", len);
sprintf((char*) &dstrBZ2[lenBZ2+10], "% 10.6f", timeToCompress);
*newdstr = dstrBZ2;
*newlen = lenBZ2+20;
sprintf((char*) &dstrZIP[lenZIP], "%10d", len);
sprintf((char*) &dstrZIP[lenZIP+10], "% 10.6f", timeToCompress);
*newdstr = dstrZIP;
*newlen = lenZIP+20;
if (timec) *timec = timeToCompress;
if (ratioc) *ratioc = (float) len / (float) lenBZ2;
if (ratioc) *ratioc = (float) len / (float) lenZIP;
return true;
}
#else
......@@ -2794,13 +2807,15 @@ bool CCompressDataString(const unsigned char *dstr, int len,
// Jeremy Meredith, Wed Aug 6 18:06:14 EDT 2008
// Fixed scanf for double, plus it doesn't understand many printf modifiers.
//
// Mark C. Miller, Sun Aug 17 00:38:37 PDT 2008
// Switched to use ZLIB
// ****************************************************************************
bool CDecompressDataString(const unsigned char *dstr, int len,
unsigned char **newdstr, int *newlen,
float *timec, float *timedc, float *ratioc)
{
#ifdef HAVE_LIBBZ2
#ifdef HAVE_ZLIB_H
if (CMaybeCompressedDataString(dstr))
{
unsigned int strLengthOrig;
......@@ -2809,18 +2824,19 @@ bool CDecompressDataString(const unsigned char *dstr, int len,
sscanf((char*) &dstr[len-10], "%lf", &timeToCompress);
unsigned char *strOrig = new unsigned char[strLengthOrig];
int startDecompress = visitTimer->StartTimer(true);
if (BZ2_bzBuffToBuffDecompress((char*) strOrig, &strLengthOrig,
(char*) dstr, len, 0, 0) != BZ_OK)
uLongf strLengthOrigTmp = (uLongf) strLengthOrig;
if (uncompress(strOrig, &strLengthOrigTmp, &dstr[4], len-4) != Z_OK)
{
visitTimer->StopTimer(startDecompress,
"Failed attempt to decompress data", true);
debug5 << "Found 3 character \"BZh\" header in data string "
debug5 << "Found 4 character \"ZLIB\" header in data string "
<< "but failed to decompress. Assuming coincidence." << endl;
delete [] strOrig;
return false;
}
else
{
strLengthOrig = (unsigned int) strLengthOrigTmp;
double timeToDecompress =
visitTimer->StopTimer(startDecompress, "Decompressing data", true);
debug5 << "Uncompressed data 1:"
......
......@@ -402,7 +402,7 @@ CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libpipeline
LIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(ZLIB_LIB) $(GLEW_LIBS)
SERLIBS=-ldbatts -lavtexceptions -lstate -lcomm -lmisc -lutility -lexpr -lparser -lavtmath_ser -llightweight_visit_vtk @VTK_LIBS@ $(LIBS_FOR_MACOSX_PREBINDING) $(X_LIBS) @LIBS@
PARLIBS=-ldbatts -lavtexceptions -lstate -lcomm -lmisc -lutility -lexpr -lparser -lavtmath_par -llightweight_visit_vtk @VTK_LIBS@ $(LIBS_FOR_MACOSX_PREBINDING) $(X_LIBS) @LIBS@ @SHLIB_MPI_LIBS@
......
......@@ -214,7 +214,7 @@ CPPFLAGS=-I../../include/visit @COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o) $(SEROPENGL_OBJ) $(SERMESA_OBJ)
PAROBJ=$(SRC:.C=_par.o) $(PAROPENGL_OBJ) $(PARMESA_OBJ)
LIB=libplotter
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(GL_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(GL_LIBS) $(ZLIB_LIB) $(GLEW_LIBS)
SERLIBS=-ldbatts -lmisc -lcomm -lstate -lexpr -lparser -lutility -lpipeline_ser -lavtview -lavtmath_ser -lavtfilters_ser -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lparallel_visit_vtk_ser $(LIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(X_LIBS)
PARLIBS=-ldbatts -lmisc -lcomm -lstate -lexpr -lparser -lutility -lpipeline_par -lavtview -lavtmath_par -lavtfilters_par -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lparallel_visit_vtk_par $(LIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(X_LIBS)
......
......@@ -76,7 +76,7 @@ CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@ @VTKQT_CPPFLAGS@
OBJ=$(SRC:.C=.o)
LIB=libqtviswindow
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(ZLIB_LIB) $(GLEW_LIBS)
LIBS=-ldbatts -lviswindow_ser -lpipeline_ser -lavtfilters_ser -lavtmath_ser -lavtview -lavtexceptions -lplotter_ser -lvisit_vtk -llightweight_visit_vtk -lparallel_visit_vtk_ser -lmisc -lstate -lcomm -lexpr -lparser -lutility $(LIBS_FOR_MACOSX_PREBINDING) @VTKQT_LIBS@ $(VTK_LIBS) $(X_LIBS)
##
......
......@@ -283,8 +283,8 @@ CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libquery
SERLIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS) -lavtddf_ser -lavtshapelets_ser
PARLIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS) -lavtddf_par -lavtshapelets_par
SERLIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(ZLIB_LIB) $(GLEW_LIBS) -lavtddf_ser -lavtshapelets_ser
PARLIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(ZLIB_LIB) $(GLEW_LIBS) -lavtddf_par -lavtshapelets_par
COMMONLIBS=-ldbatts -lavtexceptions -lstate -lcomm -lmisc -lexpr -lparser -lutility -lplugin -lavtview -lvisit_vtk -llightweight_visit_vtk
SERLIBS=$(COMMONLIBS) -lpipeline_ser -lavtmath_ser -lavtfilters_ser -lexpressions_ser -ldatabase_ser -lmir_ser $(SERLIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(X_LIBS) @LIBS@
PARLIBS=$(COMMONLIBS) -lpipeline_par -lavtmath_par -lavtfilters_par -lexpressions_par -ldatabase_par -lmir_par $(PARLIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(X_LIBS) @LIBS@ @SHLIB_MPI_LIBS@
......
......@@ -60,7 +60,7 @@ CPPFLAGS=-I../../include/visit @COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libavtshapelets
LIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(ZLIB_LIB) $(GLEW_LIBS)
SERLIBS=-ldbatts -lpipeline_ser -lavtmath_ser -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lmisc -lstate -lcomm -lexpr -lparser -lutility $(VTK_LIBS) $(LIBS_FOR_MACOSX_PREBINDING) $(X_LIBS)
PARLIBS=-ldbatts -lpipeline_par -lavtmath_par -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lmisc -lstate -lcomm -lexpr -lparser -lutility $(VTK_LIBS) $(LIBS_FOR_MACOSX_PREBINDING) $(X_LIBS)
......
......@@ -232,7 +232,7 @@ CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@ @ANNOTATION_FLAGS@ @VTK_INCLUDES@ $(MES
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libviswindow
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(GL_LIBS) $(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(MESA_LIBS) $(GL_LIBS) $(ZLIB_LIB) $(GLEW_LIBS)
SERLIBS=-ldbatts -lpipeline_ser -lavtfilters_ser -lavtmath_ser -lavtexceptions -lavtview -lmisc -lstate -lcomm -lexpr -lparser -lutility -lplotter_ser -lvisit_vtk -llightweight_visit_vtk -lparallel_visit_vtk_ser @VTKQT_LIBS@ $(LIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(X_LIBS)
PARLIBS=-ldbatts -lpipeline_par -lavtfilters_par -lavtmath_par -lavtexceptions -lavtview -lmisc -lstate -lcomm -lexpr -lparser -lutility -lplotter_par -lvisit_vtk -llightweight_visit_vtk -lparallel_visit_vtk_par @VTKQT_LIBS@ $(LIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(X_LIBS)
......
This diff is collapsed.
......@@ -1659,42 +1659,15 @@ case $withval in
esac
AC_SUBST(DB_BUILD_DIRS)
dnl
dnl bzip2 related stuff
dnl
AC_ARG_ENABLE(bzip2,
AS_HELP_STRING([--disable-bzip2], [do not build or use bzip2 library -- disables compression]),
Usebzip2="$enable_bzip2", Usebzip2=yes)
AC_ARG_WITH(bzip2,
AS_HELP_STRING([--with-bzip2], [build against external bzip2 in LIB-DIR (can be ommited if "-lbzip2" alone works)]),
[WithExternalBzip2=$withval],
[WithExternalBzip2="no"])
BUILD_BZIP2=""
BZIP2_LIBS=""
if test "$Usebzip2" = "yes"; then
if test $WithExternalBzip2 != "no"; then
if test $WithExternalBzip2 -nq "yes"; then
BZIP2_LIBS="-L${WithExternalBzip2}"
fi
else
BUILD_BZIP2="bzip2"
fi
AC_DEFINE(HAVE_LIBBZ2, [1], [Define if you have the bz2 library.])
BZIP2_LIBS="${BZIP2_LIBS} -lbz2"
fi
AC_SUBST(BUILD_BZIP2)
AC_SUBST(BZIP2_LIBS)
dnl
dnl glew related stuff
dnl
AC_ARG_ENABLE(glew,
AS_HELP_STRING([--disable-glew], [do not build or use glew library -- disables detection of OpenGL extensions]),
AC_HELP_STRING([--disable-glew], [do not build or use glew library -- disables detection of OpenGL extensions]),
Useglew="$enable_glew", Useglew=yes)
AC_ARG_WITH(glew,
AS_HELP_STRING([--with-glew], [build against external glew in INC-DIR,LIB-DIR (may be ommitted)]),
AC_HELP_STRING([--with-glew], [build against external glew in INC-DIR,LIB-DIR (may be ommitted)]),
[WithExternalGlew=$withval],
[WithExternalGlew="no"])
......@@ -1920,77 +1893,83 @@ AC_TRY_COMPILE([#include <sys/types.h>
# Check for non-graphics libraries in the reverse order that they
# are needed. The libraries are added to the beginning of `LIBS'.
#
AC_CHECK_LIB(m, main, LIBS="-lm $LIBS")
dnl Is zlib present?
dnl
dnl It's required if hdf5 was compiled with deflate support. Normally check
dnl for zlib.h and libz.a but skip the test if `--without-zlib' is specified.
dnl Alternate directories can be specified for the header and library by
dnl giving names like this `--with-zlib=INC,LIB' (if only the LIB directory
dnl is supplied then it must still be preceded by a comma).
dnl
AC_CHECK_LIB(m, main)
saved_CPPFLAGS="$CPPFLAGS"
saved_CFLAGS="$CFLAGS"
saved_LDFLAGS="$LDFLAGS"
saved_LIBS="$LIBS"
AC_ARG_WITH(zlib,[ --with-zlib=INC-DIR,LIB-DIR Use the GNU zlib compression],
,withval=yes)
#
# Handle zlib. By default, we try to find a zlib because VisIt can
# use compression when shipping data between engine and viewer.
# Since zlib may not be available everywhere, we also support it
# as a 3rd party builtin. So, the logic here handles several cases.
# If we can find it 'normally', we use that. If finding 'normally'
# fails, we use our 3rd party builtin. Alternatively, the user
# can explicitly specify to use our 3rd party builtin effectively
# disabling the step where we find it 'normally.' Likewise, the user
# can explicitly specify zlib inc/lib dirs s/he wants or disable zlib
# entirely though that also disables any compression in VisIt between
# engine and viewer.
#
BUILD_ZLIB=""
ZLIB_LIB="-lz"
AC_ARG_WITH(zlib,[ --with-zlib=INC-DIR,LIB-DIR Use the GNU zlib compression],,withval=yes)
case $withval in
yes)
#
# Header
#
AC_CHECK_HEADERS(zlib.h)
AC_CHECK_LIB(z, compress2,
ZLIB_LIB="-lz $ZLIB_LIB"
AC_DEFINE(HAVE_LIBZ, [1], [Define if you have the z library.]))
# This is the 'default' action when --with-zlib= is NOT
# given on the command line to configure. So, we look
# for zlib headers and lib 'normally'
AC_CHECK_HEADERS(zlib.h,have_zlib_h="yes")
if test -n "$have_zlib_h"; then
AC_CHECK_LIB(z, compress2)
if test -z "`echo $LIBS | tr ' ' '\n' | grep -x -e '-lz'`"; then
# If we get here, there was a problem with the 'normal'
# way of finding zlib. So, we'll fallback to our 3rd
# party builtin. Note that in this case, zlib.h will
# appear in VisIt's include dir. So, all we need to
# do is add '-lz' to LIBS variable.
BUILD_ZLIB=zlib
LIBS="-lz $LIBS"
AC_DEFINE(HAVE_ZLIB_H,1)
fi
fi
;;
builtin)
# This is the case where they user has specified --with-zlib=builtin
# to skip the attempt to look for zlib 'normally' and explicilty force
# the use of our 3rd party builtin. Note that in this case, zlib.h
# will appear in VisIt's include dir. So, all we need to do is
# add '-lz' to LIBS variable.
AC_MSG_CHECKING(for GNU zlib)
BUILD_ZLIB=zlib
LIBS="-lz $LIBS"
AC_DEFINE(HAVE_ZLIB_H,1)
AC_MSG_RESULT(builtin)
;;
no)
# Totally disable zlib
ZLIB_LIBS=""
AC_MSG_CHECKING(for GNU zlib)
AC_MSG_RESULT(suppressed)
;;
*)
#
# Header
#
# Use a zlib at the specified inc/lib dir pair
AC_MSG_CHECKING(for GNU zlib)
zlib_inc="`echo $withval |cut -f1 -d,`"
if test "X" != "$zlib_inc"; then
CPPFLAGS="$CPPFLAGS -I$zlib_inc"
AC_CHECK_HEADERS(zlib.h,ZLIB_INCLUDE="-I$zlib_inc $ZLIB_INCLUDE")
CPPFLAGS="$saved_CPPFLAGS"
else
AC_CHECK_HEADERS(zlib.h)
if test ! -f $zlib_inc/zlib.h; then
AC_MSG_ERROR(no zlib.h found in $zlib_inc)
fi
CPPFLAGS="$CPPFLAGS -I$zlib_inc"
zlib_lib="`echo $withval |cut -f2 -d, -s`"
if test "X" != "$zlib_lib"; then
CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE"
LDFLAGS="$LDFLAGS -L$zlib_lib"
AC_CHECK_LIB(z, compress2,
ZLIB_LIB="-L$zlib_lib -lz $ZLIB_LIB"
AC_DEFINE(HAVE_LIBZ, [1], [Define if you have the z library.])
)
LIBS="$saved_LIBS"
LDFLAGS="$saved_LDFLAGS"
CPPFLAGS="$saved_CPPFLAGS"
else
CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE"
AC_CHECK_LIB(z, compress2,
ZLIB_LIB="-lz $ZLIB_LIB"
AC_DEFINE(HAVE_LIBZ, [1], [Define if you have the z library.])
)
LIBS="$saved_LIBS"
CPPFLAGS="$saved_CPPFLAGS"
if test ! -f $zlib_lib/libz.a && test ! -f $zlib_lib/libz.so; then
AC_MSG_ERROR(no libz.a or libz.so found in $zlib_lib)
fi
LDFLAGS="$LDFLAGS -L$zlib_lib"
LIBS="-lz $LIBS"
AC_DEFINE(HAVE_ZLIB_H,1)
ZLIB_LIBS="-L$zlib_lib -lz"
AC_MSG_RESULT(-I$zlib_inc -L$zlib_lib -lz)
;;
esac
AC_SUBST(ZLIB_INCLUDE)
AC_SUBST(ZLIB_LIB)
AC_SUBST(BUILD_ZLIB)
AC_SUBST(ZLIB_LIB) # primarily for mac pre-binding
dnl Is szip present?
dnl
......@@ -2252,15 +2231,15 @@ if test -n "$HDF5_LIB"; then
AC_MSG_CHECKING(whether to use libsilo.a or libsiloh5.a)
if test "$SHORT_UNAME" = "darwin"; then
SILO_LIB="-L$SILO_LIBDIR -lsiloh5 $HDF5_LIB $ZLIB_LIB"
SILO_LIB="-L$SILO_LIBDIR -lsiloh5 $HDF5_LIB"
AC_MSG_RESULT(libsiloh5.dylib)
else
saved_CPPFLAGS="$CPPFLAGS"
saved_LIBS="$LIBS"
saved_SILO_LIB="$SILO_LIB"
SILO_LIB="-L$SILO_LIBDIR -lsiloh5 $HDF5_LIB $ZLIB_LIB"
CPPFLAGS="$CPPFLAGS $SILO_INCLUDE $HDF5_INCLUDE $ZLIB_INCLUDE"
SILO_LIB="-L$SILO_LIBDIR -lsiloh5 $HDF5_LIB"
CPPFLAGS="$CPPFLAGS $SILO_INCLUDE $HDF5_INCLUDE"
LIBS="$SILO_LIB $LIBS"
AC_TRY_RUN(
......@@ -2292,7 +2271,7 @@ if test -n "$HDF5_LIB"; then
AC_MSG_CHECKING(whether libsilo.a depends on hdf5)
if test "$SHORT_UNAME" = "darwin"; then
SILO_LIB="$SILO_LIB $HDF5_LIB $ZLIB_LIB"
SILO_LIB="$SILO_LIB $HDF5_LIB"
AC_MSG_RESULT(libsilo.dylib)
else
......@@ -2300,8 +2279,8 @@ if test -n "$HDF5_LIB"; then
saved_LIBS="$LIBS"
saved_SILO_LIB="$SILO_LIB"
SILO_LIB="$SILO_LIB $HDF5_LIB $ZLIB_LIB"
CPPFLAGS="$CPPFLAGS $SILO_INCLUDE $HDF5_INCLUDE $ZLIB_INCLUDE"
SILO_LIB="$SILO_LIB $HDF5_LIB"
CPPFLAGS="$CPPFLAGS $SILO_INCLUDE $HDF5_INCLUDE"
LIBS="$SILO_LIB $LIBS"
AC_TRY_RUN(
......@@ -4014,7 +3993,7 @@ SIMULATION_PROTOTYPE_FILES="sim/Makefile
sim/lib/Makefile"
CQSCORE_FILES="cqscore/Makefile"
THIRD_PARTY_BUILTIN_FILES="third_party_builtin/Makefile
third_party_builtin/bzip2/Makefile
third_party_builtin/zlib/Makefile
third_party_builtin/glew/Makefile
third_party_builtin/bilib/Makefile
third_party_builtin/mesa_stub/Makefile
......
......@@ -230,7 +230,7 @@
# Added PLATFORM_CPPFLAGS.
#
# Mark C. Miller, Mon Dec 12 20:53:03 PST 2005
# Added BZIP2_LIBS variable
# Added ZLIB_LIB variable
#
# Hank Childs, Mon Feb 6 14:16:15 PST 2006
# Remove one -lexpr, since it is listed twice in the link line.
......@@ -292,7 +292,7 @@ SERLIBS=$(COMMONLIBS) -lviswindow_ser -lplotter_ser -lmir_ser -lavtwriter_ser \
-lavtddf_ser -lavtivp_ser -lavtmath_ser -lavtshapelets_ser -ldatabase_ser -lquery_ser \
-lexpressions_ser -lavtfilters_ser -lpipeline_ser \
-lengineparstate_ser -lparallel_visit_vtk_ser \
$(GLEW_LIBS) @VTKQT_LIBS@ $(VTK_LIBS) $(MESA_LIBS) $(GL_LIBS) $(X_LIBS) $(BZIP2_LIBS) \
$(GLEW_LIBS) @VTKQT_LIBS@ $(VTK_LIBS) $(MESA_LIBS) $(GL_LIBS) $(X_LIBS) $(ZLIB_LIB) \
$(FILIB_LIBS) @LIBS@ @PTHREAD_LIB@ @TCMALLOC_LIB@
PARLIBS=$(COMMONLIBS) -lviswindow_par -lplotter_par -lmir_par -lavtwriter_par \
......@@ -300,7 +300,7 @@ PARLIBS=$(COMMONLIBS) -lviswindow_par -lplotter_par -lmir_par -lavtwriter_par \
-lexpressions_par -lavtfilters_par -lpipeline_par \
-lengineparstate_par -lparallel_visit_vtk_par \
$(GLEW_LIBS) @VTKQT_LIBS@ $(VTK_LIBS) $(MESA_LIBS) $(GL_LIBS) $(X_LIBS) \
$(BZIP2_LIBS) $(FILIB_LIBS) @LIBS@ @PTHREAD_LIB@ @TCMALLOC_LIB@
$(ZLIB_LIB) $(FILIB_LIBS) @LIBS@ @PTHREAD_LIB@ @TCMALLOC_LIB@
SERLIBDEP=../../lib/libplugin.@SHLIB_LIBEXT@ ../../lib/libplotter_ser.@SHLIB_LIBEXT@ \
../../lib/libdatabase_ser.@SHLIB_LIBEXT@ ../../lib/libpipeline_ser.@SHLIB_LIBEXT@ \
......
......@@ -63,13 +63,6 @@ void foogl(void)
GLfloat mad[] = {0.1, 0.5, 0.8, 1.0};
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mad);
}
#ifdef HAVE_LIBBZ2
#include <bzlib.h>
void foobz2(void)
{
BZ2_bzlibVersion();
}
#endif
#endif
//
// END HACK
......
......@@ -98,7 +98,7 @@ SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libengineparstate
LIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(ZLIB_LIB) $(GLEW_LIBS)
SERLIBS=-lstate -lcomm -lmisc -lutility -lpipeline_ser -ldbatts -lavtexceptions \
-lexpr -lparser -lavtmath_ser -llightweight_visit_vtk $(LIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS)
PARLIBS=-lstate -lcomm -lmisc -lutility -lpipeline_par -ldbatts -lavtexceptions \
......
......@@ -91,7 +91,7 @@ SRC=EngineProxy.C
HDR=EngineProxy.h
OBJ=$(SRC:.C=.o)
LIB=libengineproxy
LIBS_FOR_MACOSX_PREBINDING=-lexpr $(BZIP2_LIBS) $(GLEW_LIBS)
LIBS_FOR_MACOSX_PREBINDING=-lexpr $(ZLIB_LIB) $(GLEW_LIBS)
LIBS=-lenginerpc -ldbatts -lpipeline_ser -lavtmath_ser -lavtexceptions -lcomm -lmisc -lstate -lplugin -lparser -lutility -lproxybase -llightweight_visit_vtk $(LIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS)
......
......@@ -31,7 +31,6 @@ PY_LDFLAGS=@PY_LDFLAGS@
QT_LDFLAGS=@QT_LDFLAGS@
QT_LIBS=@QT_LIBS@
QUI_LIBS=@QUI_LIBS@
BZIP2_LIBS=@BZIP2_LIBS@
MESA_LIBS=@MESA_LIBS@
ICET_ENG_MAIN_OBJ=@ICET_ENG_MAIN_OBJ@
ICET_LIBS=@ICET_LIBS@
......@@ -61,6 +60,8 @@ INSTALL=@tmpbin@/install-sh -c -m 755
INSTALL_DATA=@tmpbin@/install-sh -c -m 644
RM=rm -f
ZLIB_LIB=@ZLIB_LIB@
PTHREAD_CXXFLAGS=@PTHREAD_CXXFLAGS@
PTHREAD_LIB=@PTHREAD_LIB@
......@@ -76,10 +77,8 @@ EXODUS_LIBS=@EXODUS_LIBS@
HDF4_FLAGS=@HDF4_FLAGS@
HDF4_LIBS=@HDF4_LIBS@
ZLIB_INCLUDE=@ZLIB_INCLUDE@
SZIP_INCLUDE=@SZIP_INCLUDE@
HDF5_INCLUDE=@HDF5_INCLUDE@
ZLIB_LIB=@ZLIB_LIB@
SZIP_LIB=@SZIP_LIB@
HDF5_LIB=@HDF5_LIB@
......
......@@ -33,9 +33,6 @@
/* Define if you have isfinite. */
#undef HAVE_ISFINITE
/* Define if you have the bz2 library. */
#undef HAVE_LIBBZ2
/* Define if you have the cgns library. */
#undef HAVE_LIBCGNS
......@@ -48,6 +45,9 @@
/* Define if you have the hdf5 library. */
#undef HAVE_LIBHDF5
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define if you have the netcdf library. */
#undef HAVE_LIBNETCDF
......@@ -57,7 +57,7 @@
/* Define if you have the sz library. */
#undef HAVE_LIBSZ
/* Define if you have the z library. */
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the <limits.h> header file. */
......
......@@ -161,7 +161,7 @@
# Eliminated refs to sl_io library. Added LibPipelineStubs.
#
# Mark C. Miller, Mon Dec 12 20:53:03 PST 2005
# Added BZIP2_LIBS variable
# Added ZLIB_LIB variable
#
# Thomas R. Treadway, Tue Feb 6 17:04:03 PST 2007
# Added $(GLEW_LIBS)
......@@ -208,7 +208,6 @@ LIBS= \
-llightweight_visit_vtk \
@VTK_LIGHTWEIGHT_LIBS@ \
@PREBIND_LIBS@ \
$(BZIP2_LIBS) \
@LIBS@ \
@PTHREAD_LIB@
LIBDEP=
......
......@@ -53,16 +53,6 @@
// Prototypes.
bool ProcessCommandLine(int argc, char *argv[]);
#ifdef AIX
#ifdef HAVE_LIBBZ2
#include <bzlib.h>
void foobz2(void)
{
BZ2_bzlibVersion();
}
#endif
#endif
// ****************************************************************************
// Function: main
//
......
......@@ -60,9 +60,9 @@
@VARIABLES@
@DIRTARGETS@
SUBDIRS=@BUILD_MESA_STUB@ @BUILD_BZIP2@ @BUILD_GLEW@ @BUILD_BILIB@ \
SUBDIRS=@BUILD_MESA_STUB@ @BUILD_ZLIB@ @BUILD_GLEW@ @BUILD_BILIB@ \
@BUILD_SLIVR@ @BUILD_COGNOMEN@ bow
ALLSUBDIRS=mesa_stub bzip2 glew bilib slivr bow cognomen
ALLSUBDIRS=mesa_stub zlib glew bilib slivr bow cognomen
message:
@echo
......
......@@ -49,36 +49,51 @@
@VARIABLES@
CPPFLAGS=-I. -I../../include @CPPFLAGS@
#CFLAGS=@CFLAGS@ -O3 -DZ_PREFIX
CFLAGS=@CFLAGS@ -O3
LIBS=
##
## Files...
##
SRC=blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c
HDR=bzlib.h bzlib_private.h
SRC=adler32.c compress.c crc32.c gzio.c uncompr.c deflate.c trees.c \
zutil.c inflate.c infback.c inftrees.c inffast.c
HDR=crc32.h deflate.h inffast.h inffixed.h inflate.h inftrees.h \
trees.h zconf.h zlib.h zutil.h
OBJ=$(SRC:.c=.o)
LIB=libbz2
LIB=libz
##
## Standard targets...
##
all: message $(LIBSHARED)
clean:
$(RM) $(OBJ) $(SRC) $(HDR) $(LIBSHARED) LICENSE words* ../../include/visit/bzlib.h
##
## Remove all the sources we untarred
##
clean_untarred_sources:
$(RM) $(SRC) $(HDR) ChangeLog ../../include/visit/zlib.h
clean: clean_untarred_sources
$(RM) $(OBJ) $(LIBSHARED)
LICENSE:
gunzip < bzip2-1.0.3.v.tar.gz | tar xvf -