ubuntu edgy下安装SME 3.2.73

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 @@
#endif

static 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了。


已发布

分类

来自

标签:

评论

《 “ubuntu edgy下安装SME 3.2.73” 》 有 14 条评论

  1. tmac 的头像
    tmac

    请问阁下是不是浙大gis实验室毕业的阿,
    看到你用landuse了阿 呵呵

  2. wlx 的头像
    wlx

    不是的,呵呵

  3. BL 的头像
    BL

    你好,我想请教一下安装SME的问题,”make install”后,显示以下错误

    cd ./CGP/src; make install
    make[1]: Entering directory `/Applications/SME1/sme-3.2.74/CGP/src’
    g++ -o CGP Main.o Model.o Module.o Variable.o
    -L/Applications/SME1/sme-3.2.74/MML/src -lMMLmp
    -L/Applications/SME1/sme-3.2.74/Base/src -lBasemp -L/usr/local/lib
    -lmpich -L/usr/local/lib -ltcl -L/usr/lib -R/usr/lib -lxml2 -lz
    -lpthread -lm -lsocket -lnsl
    Undefined first referenced
    symbol in file
    sched_yield /usr/local/lib/libmpich.a(p4_tsr.o)
    ld: fatal: Symbol referencing errors. No output written to CGP
    collect2: ld returned 1 exit status
    make[1]: *** [CGP] Error 1
    make[1]: Leaving directory `/Applications/SME1/sme-3.2.74/CGP/src’
    make: *** [cinstall] Error 2

    可不可以帮我看一下,实在搞不清怎么回事,谢谢!

  4. wlx 的头像
    wlx

    你没有在.configure里指定各个连接库的具体位置,默认的设置是不适用的。

  5. wlx 的头像
    wlx

    官方最新仍然是3.2.73阿,你这怎么有3.2.74了?

  6. BL 的头像
    BL

    现在最新的是3.2.74,不过不在以前的官方网站上,在sourceforge site上。
    我要将SME安装在Solaris 10下,configure没有问题,上面的出错信息,好像是需要librt库,因为sched_yield在这个库里,但我在SUN的网站上下不了相关补丁,想问一下,你有没有呢?just in case.谢谢!

  7. BL 的头像
    BL

    能不能把你修改过的configure文件给我看一下,再谢!

  8. wlx 的头像
    wlx

    configure文件我并没有修改,只是在参数里指定了不同的参数,参考我上面的配置。
    BTW:谢谢告知SME在SF的存活!(我前面已经以为这个项目已经DEAD了)

  9. wlx 的头像
    wlx

    我下载了3.2.74-rc2试验了一下,仍然有一些错误,不过,都是限定符错误,很好修改。
    在ubuntu feisty下可以方便的修改、编译。
    在Solaris 10下,没用过这个系统,搞不清楚。

  10. wlx 的头像
    wlx

    在SF上提交了BUG,希望他们能尽早更改。
    http://sourceforge.net/tracker/?atid=625174&group_id=99732&func=browse

  11. […] 若不是BL在这里提问,还不知道呢。 新版本中已经解决了原来的大部分BUG,但还有一类错误没解决: error: extra qualification 解决这个BUG后,编译起来比原来要顺利得多。 在ubuntu feisty下,安装必须的开发包,然后编译: ./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 […]

  12. BL 的头像
    BL

    你好!

    我现在想把SME3。2。74安装在X86-64的机器上,编译通过了,但是make install时,出现了一长串的定义冲突,如
    CString.h:395: error: previous declaration of ‘TStrRep _nilTStrRep’ with ‘C++’ linkage
    CString.cc:36: error: conflicts with new declaration with ‘C’ linkage

    我对C++不太熟悉,所以想请教一下这个该怎么解决呢?

    Thanks a lot!

  13. wlx 的头像
    wlx

    应用了我的patch了么?
    看提示,应该是重复定义了

  14. lxl 的头像
    lxl

    你好,我想问一下,SME有没有windows版本,我把SME3.2.74装在windows上用不了,打开之后只是一个编译程序的黑色图框

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注