SME: Spatial Modeling Environment,现在要将其安装到我的UBUNTU edgy上,中间遇到了系列问题,持续了2天才将起解决。
ubuntu edgy里软件的版本:g++ 4.1.2, jdk 1.5.0_08, tcl 8.4。
首先从官方下载最新的版本:
wget http://www.uvm.edu/giee/SME3/ftp/sme-3.2.73.zip
unzip sme-3.2.73.zip
cd sme-3.2.73
正常情况下,按照README所述,应该进行下述步骤就可以安装:
./configure --enable-mpi=no --with-tcl_inc_dir=/usr/include/tcl8.4/ \
--with-tcl_lib_dir=/usr/lib/tcl8.4/ --with-hdf_inc_dir=/usr/include/hdf/ \
--with-hdf_lib_dir=/usr/lib/ --enable-opt=yes --enable-java=yes \
--with-jdk_dir=$JAVA_HOME --prefix=/usr/share/sme
sudo make install
但是在make install这步时出现问题:
cd /home/wlx/Desktop/sme-3.2.73/java; jar cf lib/JST.jar
miiee/*/*.class spyconsole/*.class
miiee/*/*.class: No such file or directory
Error adding miiee/*/*.class to jar archive!
细看README,其中好像有说道这一点:
8) On some platforms Java does not get compiles as a result of the
installation process. In that case go to ./java and run
install.sh SME_DIR, where SME_DIR is the directory where SME is
to be installed.
根据其中的操作,可以解决这个问题,然后继续编译,又出现一系列的问题。
我把修改后的patch文件放出来:
diff -u -r sme-3.2.73/Base/src/CString.h sme-3.2.73-new/Base/src/CString.h
--- sme-3.2.73/Base/src/CString.h 2002-03-01 13:00:00.000000000 +0800
+++ sme-3.2.73-new/Base/src/CString.h 2006-10-18 12:00:05.000000000 +0800
@@ -61,13 +61,12 @@void assign(const TStrRep*, const char*, int = -1);
TSubString(TString& x, int p, int l);
- TSubString(const TSubString& x);public:
// Note there are no public constructors. TSubStrings are always
// created via TString operations
-
+ TSubString(const TSubString& x);
~TSubString();TSubString& operator = (const TString& y);
@@ -697,8 +696,8 @@// constructive concatenation
-#if defined(__GNUG__) && !defined(_G_NO_NRV)
-
+//#if defined(__GNUG__) && !defined(_G_NO_NRV)
+/*
inline TString operator + (const TString& x, const TString& y) return r;
{
cat(x, y, r);
@@ -768,8 +767,8 @@
{
r.rep = TStrRep::Scapitalize(x.rep, r.rep);
}
-
-#else /* NO_NRV */
+*/
+//#else /* NO_NRV */inline TString operator + (const TString& x, const TString& y)
{
@@ -841,7 +840,7 @@
TString r; r.rep = TStrRep::Scapitalize(x.rep, r.rep); return r;
}-#endif
+//#endif// prepend
diff -u -r sme-3.2.73/Base/src/datasocket.h sme-3.2.73-new/Base/src/datasocket.h
--- sme-3.2.73/Base/src/datasocket.h 2002-09-19 12:00:00.000000000 +0800
+++ sme-3.2.73-new/Base/src/datasocket.h 2006-10-18 12:07:16.000000000 +0800
@@ -65,14 +65,14 @@
void disconnect( );
int setupDataFormats();- inline void DataSocket::writeInts( const jint* ji, int ndata, int buffer ) {
+ inline void writeInts( const jint* ji, int ndata, int buffer ) {
if(buffer) {
load_buffer(ji,ndata*4);
} else {
write( _socket_desc, ji, ndata*4 );
}
}
- inline void DataSocket::writeShorts( const jshort* js, int ndata, int buffer ) {
+ inline void writeShorts( const jshort* js, int ndata, int buffer ) {
if(buffer) {
load_buffer(js,ndata*2);
} else {
@@ -80,7 +80,7 @@
}
}- inline void DataSocket::writeBytes( const jbyte* jb, int ndata, int buffer ) {
+ inline void writeBytes( const jbyte* jb, int ndata, int buffer ) {
if(buffer) {
load_buffer(jb,ndata);
} else {
@@ -88,7 +88,7 @@
}
}- inline void DataSocket::writeFloats( const jfloat* jf, int ndata, int buffer ) {
+ inline void writeFloats( const jfloat* jf, int ndata, int buffer ) {
if( _byteFormat == 2 ) {
if(buffer) {
load_buffer(jf,ndata*4);
@@ -110,12 +110,12 @@
}- inline void DataSocket::flush() {
+ inline void flush() {
write( _socket_desc, _buffer, _bufferPtr );
_bufferPtr = 0;
}- inline void DataSocket::readBytes( jbyte* jb, int ndata ) {
+ inline void readBytes( jbyte* jb, int ndata ) {
read( _socket_desc, jb, ndata );
}diff -u -r sme-3.2.73/Base/src/DLnkList.h sme-3.2.73-new/Base/src/DLnkList.h
--- sme-3.2.73/Base/src/DLnkList.h 2000-09-13 12:00:00.000000000 +0800
+++ sme-3.2.73-new/Base/src/DLnkList.h 2006-10-18 12:04:41.000000000 +0800
@@ -14,7 +14,7 @@
#endifstatic const byte DLListNodMask1 = ~(~0 << 1); - +class TOrderedObjectDLList; class TOrderedObjectDLListNode { friend const char* node_name(TOrderedObjectDLListNode*); friend class TOrderedObjectDLList; diff -u -r sme-3.2.73/PointGrid/src/Ghost.h sme-3.2.73-new/PointGrid/src/Ghost.h --- sme-3.2.73/PointGrid/src/Ghost.h 2002-09-19 12:00:00.000000000 +0800 +++ sme-3.2.73-new/PointGrid/src/Ghost.h 2006-10-18 13:16:32.000000000 +0800 @@ -29,7 +29,7 @@ Region2 operator()() const; - int GhostIterator::operator !() const; + int operator !() const; void operator ++(); operator void *(); }; @@ -63,7 +63,7 @@ ic = fCol[0]; } - inline int GhostCounter::Count( int& ir, int& ic ) { + inline int Count( int& ir, int& ic ) { switch(fLeg) { case 0: diff -u -r sme-3.2.73/PointGrid/src/MultiCoverage.h sme-3.2.73-new/PointGrid/src/MultiCoverage.h --- sme-3.2.73/PointGrid/src/MultiCoverage.h 2002-09-19 12:00:00.000000000 +0800 +++ sme-3.2.73-new/PointGrid/src/MultiCoverage.h 2006-10-18 13:17:13.000000000 +0800 @@ -212,7 +212,7 @@ int CopyToMap( TMap& map, Bool swap=FALSE, EScaleType st=kDefaultScaling, int layer_index=-1, int targetProc=0 ); inline void CopyData( const float* fdata , int fsize ) { memcpy( (void*) data(), (void*) fdata, fsize*sizeof(float) ); } - MultiCoverage& MultiCoverage::CopyFromMap( TMap& map, int layer_index=-1, int srcProc = -1, const char* name = NULL ); + MultiCoverage& CopyFromMap( TMap& map, int layer_index=-1, int srcProc = -1, const char* name = NULL ); inline Region2& Region(int iproc=gIProc, int layer_index=-1 ) const { TLayer* l = fMultiGrid->getCellLayer( layer_index );
diff -u -r sme-3.2.73/PointGrid/src/TMap.h sme-3.2.73-new/PointGrid/src/TMap.h
--- sme-3.2.73/PointGrid/src/TMap.h 2002-04-03 13:00:00.000000000 +0800
+++ sme-3.2.73-new/PointGrid/src/TMap.h 2006-10-18 13:13:50.000000000 +0800
@@ -65,7 +65,7 @@
void ReadTextData2( FILE* file, const char* name, int row_min, int row_max, int col_min, int col_max, int rows, int cols );
int WriteCmeMap( const char* name, int time_index, float time_value, Bool last_write = False );
int Read(const char* mapSrc, const char* fileName, int nbytes=0, LayerConfig* lc = NULL, const char* format = NULL );
- int TMap::Read( LayerConfig& lc, int nbytes );
+ int Read( LayerConfig& lc, int nbytes );
int ReadCategories( const char* mapSrc, const char* fileName );
int Write( int index = -1, Bool lastWrite = False );diff -u -r sme-3.2.73/SpaceSim/src/CVariable.h sme-3.2.73-new/SpaceSim/src/CVariable.h
--- sme-3.2.73/SpaceSim/src/CVariable.h 2002-03-28 13:00:00.000000000 +0800
+++ sme-3.2.73-new/SpaceSim/src/CVariable.h 2006-10-18 13:19:09.000000000 +0800
@@ -423,7 +423,7 @@
// }
}- void CVariable::Dump( char* msg, int pl0=0, int pl1=0, FILE* file=stdout, int s0 = 15, int s1 = 15 );
+ void Dump( char* msg, int pl0=0, int pl1=0, FILE* file=stdout, int s0 = 15, int s1 = 15 );inline virtual void Reset() {
TVariable::Reset();
diff -u -r sme-3.2.73/SpaceSim/src/SSTcl.cc sme-3.2.73-new/SpaceSim/src/SSTcl.cc
--- sme-3.2.73/SpaceSim/src/SSTcl.cc 2004-09-30 09:28:03.000000000 +0800
+++ sme-3.2.73-new/SpaceSim/src/SSTcl.cc 2006-10-18 15:13:16.000000000 +0800
@@ -20,6 +20,7 @@
#include "SSComm.h"
#include "Utility.h"+
static Tcl_Interp* _interp;
static Module* current_module;
static Variable* current_variable;
@@ -1239,7 +1240,7 @@
Tcl_CreateExitHandler( SMETcl_Exit, NULL );// create shortened version of major commands as well
- Tcl_CreateCommand(interp, "s", SMETcl_step, 0, NULL);
+ Tcl_CreateCommand(interp, "s", SMETcl_step, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
Tcl_CreateCommand(interp, "r", SMETcl_run, 0, NULL);
Tcl_CreateCommand(interp, "S", SMETcl_restart, 0, NULL);diff -u -r sme-3.2.73/SpaceSim/src/SSTcl.h sme-3.2.73-new/SpaceSim/src/SSTcl.h
--- sme-3.2.73/SpaceSim/src/SSTcl.h 2004-09-30 09:25:25.000000000 +0800
+++ sme-3.2.73-new/SpaceSim/src/SSTcl.h 2006-10-18 15:13:52.000000000 +0800
@@ -7,9 +7,10 @@
#ifdef USE_TCL
#ifndef _SSTCL_H
#define _SSTCL_H
-
+#define USE_NON_CONST
#include+
typedef struct {
char* command;
int (*func)(Tcl_Interp*, void*);
diff -u -r sme-3.2.73/SpaceSim/src/StellaLib.h sme-3.2.73-new/SpaceSim/src/StellaLib.h
--- sme-3.2.73/SpaceSim/src/StellaLib.h 2000-08-04 12:00:00.000000000 +0800
+++ sme-3.2.73-new/SpaceSim/src/StellaLib.h 2006-10-18 13:20:26.000000000 +0800
@@ -79,10 +79,10 @@
static float MinP(float x, float y, float xp, float yp );
static float MinP(float x, float y, float z, float xp, float yp, float zp);- static inline float SL::Min(float w, float x, float y, float z) { return SL::Min( SL::Min( w, x ), y, z ); }
- static inline float SL::Max(float w, float x, float y, float z) { return SL::Max( SL::Max( w, x ), y, z ); }
- static inline float SL::Min(float v, float w, float x, float y, float z) { return SL::Min( SL::Min( v, w, x ), y, z ); }
- static inline float SL::Max(float v, float w, float x, float y, float z) { return SL::Max( SL::Max( v, w, x ), y, z ); }
+ static inline float Min(float w, float x, float y, float z) { return SL::Min( SL::Min( w, x ), y, z ); }
+ static inline float Max(float w, float x, float y, float z) { return SL::Max( SL::Max( w, x ), y, z ); }
+ static inline float Min(float v, float w, float x, float y, float z) { return SL::Min( SL::Min( v, w, x ), y, z ); }
+ static inline float Max(float v, float w, float x, float y, float z) { return SL::Max( SL::Max( v, w, x ), y, z ); }};
diff -u -r sme-3.2.73/SpaceSim/src/TPipe.h sme-3.2.73-new/SpaceSim/src/TPipe.h
--- sme-3.2.73/SpaceSim/src/TPipe.h 2000-10-11 12:00:00.000000000 +0800
+++ sme-3.2.73-new/SpaceSim/src/TPipe.h 2006-10-18 13:19:35.000000000 +0800
@@ -157,8 +157,8 @@public:
- TPointPipe::TPointPipe( const char* name, EType type, CVariable* var, Point2& point ) : PointPipe(name,type,(Variable*)var,point) {;}
- TPointPipe::TPointPipe( const char* name, EType type, CVariable* var ) : PointPipe(name,type,(Variable*)var) {;}
+ TPointPipe( const char* name, EType type, CVariable* var, Point2& point ) : PointPipe(name,type,(Variable*)var,point) {;}
+ TPointPipe( const char* name, EType type, CVariable* var ) : PointPipe(name,type,(Variable*)var) {;}virtual int Initialize();
inline virtual void Reset() { PointPipe::Reset(); TPipe::Reset(); }
把这个patch应用后就应该可以install了。
发表回复