Commit 58621bb6 authored by bonnell's avatar bonnell

Fix windows compile errors

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@2236 18c085ea-50e0-402c-830e-de6fd14e8384
parent 519838eb
......@@ -619,7 +619,7 @@ configure as given. (2) Look at the Makefile and find the value of the
variable OPT. (3) Re-execute configure with OPT specified through the env
command, with the additional flags added to OPT. For example:
env OPT="-fPIC -O2" ./configure --prefix=$VISITDIR/python/$VISITARCH
env OPT="-fPIC -O2" ./configure --prefix=$VISITDIR/python/2.5/$VISITARCH
where the "-O2" was the value of OPT in the makefile. (4) Continue with
the commands below as given.
......@@ -628,20 +628,20 @@ On irix systems, if you want to build a 64 bit version will need to override
the default compiler and linker options. This is done in a similar fashion
as described above but -64 is added to OPT and LDFLAGS. For example:
env OPT="-64 -O2" LDFLAGS="-64" ./configure --prefix=$VISITDIR/python/$VISITARCH
env OPT="-64 -O2" LDFLAGS="-64" ./configure --prefix=$VISITDIR/python/2.5/$VISITARCH
When you need to specify a C compiler other than the default gcc compiler
that Python's configure process will detect, you should also specify a
compatible C++ compiler so you can build C++ Python extensions. You can
specify compilers using the following example command lines:
env CXX=CC ./configure --with-gcc=cc --with-cxx=CC --prefix=$VISITDIR/python/$VISITARCH # irix
env CXX=xlC ./configure --with-gcc=xlc --with-cxx=xlC --prefix=$VISITDIR/python/$VISITARCH # aix
env CXX=CC ./configure --with-gcc=cc --with-cxx=CC --prefix=$VISITDIR/python/2.5/$VISITARCH # irix
env CXX=xlC ./configure --with-gcc=xlc --with-cxx=xlC --prefix=$VISITDIR/python/2.5/$VISITARCH # aix
On AIX systems, you may want to build using the vendor xlc compiler in 64 bit mode.
Use the following command line to do so:
env CXX=xlC ./configure --with-gcc="xlc -q64 -O2" --with-cxx="xlC -q64 -O2" --disable-ipv6 AR="ar -X64" --prefix=$VISITDIR/python/$VISITARCH
env CXX=xlC ./configure --with-gcc="xlc -q64 -O2" --with-cxx="xlC -q64 -O2" --disable-ipv6 AR="ar -X64" --prefix=$VISITDIR/python/2.5/$VISITARCH
#
# Build and install it in the visit directory under the python directory.
......@@ -649,7 +649,7 @@ env CXX=xlC ./configure --with-gcc="xlc -q64 -O2" --with-cxx="xlC -q64 -O2" --di
gunzip Python-2.5.tgz
tar xf Python-2.5.tar
cd Python-2.5
./configure --prefix=$VISITDIR/python/$VISITARCH
./configure --prefix=$VISITDIR/python/2.5/$VISITARCH
make
make install
......@@ -672,7 +672,7 @@ g++ -Wl,-G -o ../libpython2.5.so *.o # solaris
g++ -Wl,-expect_unresolved -Wl,'*' -shared -o ../libpython2.5.so *.o # tru64
cd ..
rm -rf tmpdir
cp libpython2.5.so $VISITDIR/python/$VISITARCH/lib/python2.5/config/libpython2.5.so
cp libpython2.5.so $VISITDIR/python/2.5/$VISITARCH/lib/python2.5/config/libpython2.5.so
cd ..
......@@ -1278,9 +1278,9 @@ More information about building VisIt follows after that.
#
# Build and install it in the visit directory.
#
gunzip visit070702.tar.gz
tar xf visit070702.tar
cd visit070702/src/config-site
gunzip visit1.7.tar.gz
tar xf visit1.7.tar
cd visit1.7/src/config-site
echo VISITHOME=$VISITDIR > `hostname`.conf
sed "s/ARCH/$VISITARCH/" Template.conf >> `hostname`.conf
cd ..
......@@ -1298,15 +1298,15 @@ clearcase_bin/visit-bin-dist
# Use the appropriate install command based on the operating system on
# which you built VisIt.
#
clearcase_bin/visit-install 1.6.1 aix $VISITDIR
clearcase_bin/visit-install 1.6.1 aix64 $VISITDIR
clearcase_bin/visit-install 1.6.1 darwin $VISITDIR
clearcase_bin/visit-install 1.6.1 irix6 $VISITDIR
clearcase_bin/visit-install 1.6.1 linux $VISITDIR
clearcase_bin/visit-install 1.6.1 linux-ia64 $VISITDIR
clearcase_bin/visit-install 1.6.1 linux-x86_64 $VISITDIR
clearcase_bin/visit-install 1.6.1 osf1 $VISITDIR
clearcase_bin/visit-install 1.6.1 sunos5 $VISITDIR
clearcase_bin/visit-install 1.7 aix $VISITDIR
clearcase_bin/visit-install 1.7 aix64 $VISITDIR
clearcase_bin/visit-install 1.7 darwin $VISITDIR
clearcase_bin/visit-install 1.7 irix6 $VISITDIR
clearcase_bin/visit-install 1.7 linux $VISITDIR
clearcase_bin/visit-install 1.7 linux-ia64 $VISITDIR
clearcase_bin/visit-install 1.7 linux-x86_64 $VISITDIR
clearcase_bin/visit-install 1.7 osf1 $VISITDIR
clearcase_bin/visit-install 1.7 sunos5 $VISITDIR
When running the configure script you can enable or disable certain dependent
packages. All the configure options are listed at the beginning of the
......
......@@ -17,7 +17,7 @@ Unix and Mac OS X:
where
"version" will be 1.6.1 for the current distribution.
"version" will be 1.7 for the current distribution.
"platform" will be one of the following: aix, aix64-xlc, darwin,
irix6, linux-altix, linux-ia64, linux-x86_64, linux_chaos, linux_rhel3,
......@@ -29,17 +29,17 @@ Unix and Mac OS X:
For example
visit-install 1.6.1 irix6 /usr/local/visit
visit-install 1.7 irix6 /usr/local/visit
will install the irix6, 1.6.1 version of visit in the directory
will install the irix6, 1.7 version of visit in the directory
"/usr/local/visit". Note that you will need to have the file
"visit1_6_1.irix6.tar.gz" present in the current directory for this
"visit1_7.irix6.tar.gz" present in the current directory for this
to function properly. You can install multiple binaries into the
same directory. For example, you could then execute
visit-install 1.6.1 linux /usr/local/visit
visit-install 1.7 linux /usr/local/visit
to add a linux, 1.6.1 version of visit to the same directory.
to add a linux, 1.7 version of visit to the same directory.
2. Add the bin directory below the installation directory
(/usr/local/visit/bin in our example) to each user's search path.
......@@ -77,8 +77,8 @@ Unix and Mac OS X:
Windows:
1. Copy the file visit1.6.1.exe to your desktop.
1. Copy the file visit1.7.exe to your desktop.
2. Double click on the visit1.6.1.exe icon to run the installer.
2. Double click on the visit1.7.exe icon to run the installer.
3. Follow the directions provided by the installer.
......@@ -1488,7 +1488,7 @@ PluginManager::ReadPluginDir(vector< vector<pair<string,string> > > &files)
{
while(FindNextFile(dirHandle, &fd))
{
files.push_back(pair<string,string>(pluginDir,fd.cFileName));
files[i].push_back(pair<string,string>(pluginDir,fd.cFileName));
}
FindClose(dirHandle);
}
......
/*****************************************************************************
*
* Copyright (c) 2000 - 2007, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtDataRangeSelection.C //
// ************************************************************************* //
#include <limits.h>
#include <avtDataRangeSelection.h>
// ****************************************************************************
// Method: avtDataRangeSelection constructor
//
// Programmer: Kathleen Bonnell
// Creation: October 11, 2007
//
// ****************************************************************************
avtDataRangeSelection::avtDataRangeSelection()
{
var = "default";
min = -FLT_MAX;
max = +FLT_MAX;
}
// ****************************************************************************
// Method: avtDataRangeSelection constructor
//
// Programmer: Kathleen Bonnell
// Creation: October 11, 2007
//
// ****************************************************************************
avtDataRangeSelection::avtDataRangeSelection(const std::string _var,
const double _min, const double _max)
{
var = _var;
min = _min;
max = _max;
}
// ****************************************************************************
// Method: avtDataRangeSelection destructor
//
// Programmer: Kathleen Bonnell
// Creation: October 11, 2007
//
// ****************************************************************************
avtDataRangeSelection::~avtDataRangeSelection()
{
}
// ****************************************************************************
// Method: operator==
//
// Programmer: Kathleen Bonnell
// Creation: October 11, 2007
//
// ****************************************************************************
bool
avtDataRangeSelection::operator==(const avtDataRangeSelection &s) const
{
return ( (min == s.min) && (max == s.max) && (var == s.var) );
}
......@@ -66,13 +66,11 @@ class PIPELINE_API avtDataRangeSelection : public avtDataSelection
{
public:
avtDataRangeSelection()
{ var = "default";
min = -FLT_MAX;
max = +FLT_MAX; };
avtDataRangeSelection(const std::string _var, const double _min, const double _max)
{ var = _var; min = _min; max = _max; };
virtual ~avtDataRangeSelection() {} ;
avtDataRangeSelection();
avtDataRangeSelection(const std::string _var,
const double _min,
const double _max);
virtual ~avtDataRangeSelection();
virtual const char * GetType() const
{ return "Data Range Selection"; };
......@@ -91,8 +89,7 @@ class PIPELINE_API avtDataRangeSelection : public avtDataSelection
double GetMax() const
{ return max; };
bool operator==(const avtDataRangeSelection &s) const
{ return ( (min == s.min) && (max == s.max) && (var == s.var) ); };
bool operator==(const avtDataRangeSelection &s) const;
private:
......@@ -102,7 +99,7 @@ class PIPELINE_API avtDataRangeSelection : public avtDataSelection
};
typedef ref_ptr<avtDataRangeSelection> avtDataRangeSelectiont_p;
typedef ref_ptr<avtDataRangeSelection> avtDataRangeSelection_p;
#endif
......@@ -377,7 +377,7 @@ avtHexahedron20Extractor::StoreRay(int x, int y, int frontZ, int backZ,
const float (*samples)[AVT_VARIABLE_LIMIT])
{
// The temporary ray we will fill up with samples
float tmp[backZ-frontZ+1][AVT_VARIABLE_LIMIT];
float (*tmp)[AVT_VARIABLE_LIMIT] = new float [backZ-frontZ+1][AVT_VARIABLE_LIMIT];
float weight;
int index;
......@@ -421,6 +421,7 @@ avtHexahedron20Extractor::StoreRay(int x, int y, int frontZ, int backZ,
// Finally store the actual ray samples
avtExtractor::StoreRay(x,y,frontZ,backZ,tmp);
delete [] tmp;
}
......
......@@ -342,7 +342,7 @@ avtHexahedron27Extractor::StoreRay(int x, int y, int frontZ, int backZ,
const float (*samples)[AVT_VARIABLE_LIMIT])
{
// The temporary ray we will fill up with samples
float tmp[backZ-frontZ+1][AVT_VARIABLE_LIMIT];
float (*tmp)[AVT_VARIABLE_LIMIT] = new float[backZ-frontZ+1][AVT_VARIABLE_LIMIT];
float weight;
int index;
......@@ -385,6 +385,7 @@ avtHexahedron27Extractor::StoreRay(int x, int y, int frontZ, int backZ,
// Finally store the actual ray sampels
avtExtractor::StoreRay(x,y,frontZ,backZ,tmp);
delete [] tmp;
}
......
......@@ -33,8 +33,8 @@ fi
##
## Use VisIt's Python.
##
PYDIR=$VISITHOME/python/altix_gcc_3.3.3
PYVERSION=python2.1
PYDIR=$VISITHOME/python/2.5/altix_gcc_3.3.3
PYVERSION=python2.5
##
## Turn off warnings for deprecated features.
......
......@@ -146,6 +146,11 @@ GetFilenames(string scanfStr, string regexStr, string rootDir,
struct dirent *theDirEnt;
while ((theDirEnt = readdir(theDir)) != 0)
{
//
// Some compilers don't support NAME_MAX. Specifically gcc 3.2
// and xlC.
//
#ifdef NAME_MAX
// check we didn't exceed name length
if (strlen(theDirEnt->d_name) >= NAME_MAX)
{
......@@ -154,6 +159,7 @@ GetFilenames(string scanfStr, string regexStr, string rootDir,
"of dirent struct for entry...\n \"%s\"", theDirEnt->d_name);
EXCEPTION1(ImproperUseException, msg);
}
#endif
// use either scanf pattern or regex pattern to match the entry
if (scanfStr != "")
......
......@@ -9,7 +9,6 @@ void error_action(char *start, ...)
va_list ap;
enum ACTION action;
int line;
void **ptr;
char *string;
strncpy(message, start, 1024);
va_start(ap, start);
......
......@@ -14,6 +14,12 @@
#include <ctype.h>
#include "object.h"
#include "error.h"
#ifdef WIN32
#define strtok_r(s,sep,lasts) (*(lasts)=strtok((s),(sep)))
#define strcasecmp stricmp
#endif
static char *filenames[] = { "object.data", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
static int nfiles = 1;
static int nobject = 0, mobject = 0;
......@@ -68,11 +74,10 @@ int object_get(OBJECT*object, char *name, void *ptr, int type, int length, char
{
int l;
FIELD f;
char **sptr, *cptr;
f = object_parse(object, name, type, dvalue);
if (f.n == 0 || length <= 0) return 0;
l = MIN(f.n, length);
bcopy(f.v, ptr, l*f.element_size);
memmove(ptr, f.v, l*f.element_size);
return f.n;
}
......@@ -82,7 +87,7 @@ int object_getv(OBJECT*object, char *name, void **pptr, int type)
void *ptr;
f = object_parse(object, name, type, NULL);
ptr = malloc(f.size);
bcopy(f.v, ptr, f.size);
memmove(ptr, f.v, f.size);
*pptr = (void *)ptr;
return f.n;
}
......@@ -95,7 +100,7 @@ int object_getv1(OBJECT*object, char *name, void **pptr, int type)
if (f.n > 0)
{
ptr = malloc(f.size);
bcopy(f.v, ptr, f.size);
memmove(ptr, f.v, f.size);
*pptr = (void *)ptr;
}
else
......@@ -189,7 +194,7 @@ FILE *object_fileopen(char *filename)
FILE *file;
int first, last;
name = strdup(filename);
ptr = index(name, '@'); /* filename */
ptr = strchr(name, '@'); /* filename */
if (ptr != NULL)
{
*ptr = 0x0; /* add a string termination to filename */
......@@ -439,7 +444,7 @@ FIELD object_parse(OBJECT*object, char *name, int type, char *dvalue)
element_size = sizeof(char *);
break;
case FILETYPE:
ptr = index(vptr, '@'); /* filename */
ptr = strchr(vptr, '@'); /* filename */
if (ptr != NULL)
{
*ptr = 0x0; /* add a string termination to filename */
......@@ -455,7 +460,7 @@ FIELD object_parse(OBJECT*object, char *name, int type, char *dvalue)
v.file[nv] = file;
break;
case FILELIST:
ptr = index(vptr, '@'); /* filename */
ptr = strchr(vptr, '@'); /* filename */
if (ptr != NULL)
{
*ptr = 0x0; /* add a string termination to filename */
......@@ -495,7 +500,7 @@ void object_compileSectionedFile(char *filename, int section)
OBJECT obj, obj_delim;
char *line;
OBJECTFILE file;
int rc, i, l, id, sec;
int rc, i, l, sec;
obj.name = obj_delim.name = NULL;
file = object_fopen(filename, "r");
sec = -1;
......@@ -559,7 +564,7 @@ void object_compilefilesubset(char *filename, int first, int last)
OBJECT obj;
char *line;
OBJECTFILE file;
int rc, i, l, n,id;
int rc, i, l, n;
file = object_fopen(filename, "r");
n=0;
if (file.file != NULL)
......@@ -627,10 +632,10 @@ void object_compile()
void object_reset(OBJECT*target)
{
OBJECT obj, *objshort;
OBJECT obj;
char *line;
OBJECTFILE file;
int rc, i, l, k;
int rc, l, k;
if (target->name == NULL || target->_class == NULL) return;
*(target->value) = '\0';
for (k = 0; k < nfiles; k++)
......@@ -766,7 +771,7 @@ char *object_read(OBJECTFILE ofile)
FILE *file;
static char *line = NULL;
static int nline = 0;
int n, c, first, last, len, i, nitems, offset, l;
int n, c, first, last, len, nitems, offset;
file = ofile.file;
n = 0;
c = getc(file);
......@@ -902,7 +907,7 @@ int object_lineparse(char *line, OBJECT*object)
char *tok;
int rc, l;
trim(line);
tok = index(line,'{');
tok = strchr(line,'{');
*tok = '\0';
tok++;
l = strlen(tok);
......
......@@ -61,6 +61,7 @@
#include <HostProfileList.h>
#include <HostProfile.h>
#include <ViewerProxy.h>
#include <DBPluginInfoAttributes.h>
#include <visit-config.h>
......
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