Sun T2000(Solaris 10)上安装MB-System的历程

一、install_makefiles中参数设置

#--------------------------------------------------------------------

# EDIT THE PARAMETERS HERE IF NO APPROPRIATE PRESET CONFIGURATION IS DEFINED
# Set the configuration parameters manually:
#--------------------------------------------------------------------
#
# Required parameters:
$MBSYSTEM_HOME = "/xiaok/mbsystem-5.3.2017";
$OS = "SOLARIS";
$CFLAGS = "-g -w";
$LFLAGS = "-L$NETCDFLIBDIR -o -lm -lnetcdf -lgen -lnsl";
$NETCDFLIBDIR = "/usr/local/lib";
$NETCDFINCDIR = "/usr/local/include";
$GMTLIBDIR = "/xiaok/GMT4.5.0/lib";
$GMTINCDIR = "/xiaok/GMT4.5.0/include";
$LEVITUS = "$MBSYSTEM_HOME/share/ANNUAL";
$PROJECTIONS = "$MBSYSTEM_HOME/share/Projections.dat";
#
# Required parameters for spectrogram program mbsegypsd
#   - mbsegypsd will not be built if these are commented out
$FFTWLIBDIR = "/usr/local/lib";
$FFTWINCDIR = "/usr/local/include";
#
# Required parameters for graphical tools
#   - graphical tools will not be built if these
#     are commented out
$MOTIFINCDIR = "/usr/dt/include";
$MOTIFLIBS = "-L/usr/dt/lib -L/usr/X11R6/lib -lXm -lXt -lX11";
#
# Required parameter for visualization tools
#   - visualization tools will not be built if this
#     is commented out
$OPENGLLIBS = "-lGLU -lGL";
#
# Required parameter for mblevitus program
$LEVITUS = "$MBSYSTEM_HOME/share/ANNUAL";
#
# Required parameter for mbotps program
$OTPSDIR = "/xiaok/OTPSnc";
#
# Optional parameter for use of non-default C compiler
$CC = "gcc";
#
# Optional parameters for use of independent GSF library installation
#   - GSF library included with MB-System will be used 
#     if these are commented out
#$GSFLIB = "/usr/sfw/lib/libgsf-1.so";
#$GSFINCDIR = "/usr/sfw/include/libgsf-1/gsf";
#
# Optional parameters for use of independent PROJ4 library installation
#   - PROJ4 library included with MB-System will be used 
#     if these are commented out
#$PROJLIB = "/usr/local/lib/libproj.a";
#$PROJINCDIR = "/usr/local/include/";
#
#--------------------------------------------------------------------
# END OF PARAMETER EDITING SECTION

#--------------------------------------------------------------------

注意:最好使用默认的PROJ和libGSF,否则会出现下面的错误:

有关PROJ的错误

gcc -c -g -w -I/usr/sfw/include/glib-1.2 -I/usr/sfw/lib/glib/include -DSOLARIS -I/usr/sfw/include/libgsf-1/gsf -I/usr/local/include mb_read_init.c
In file included from mb_read_init.c:248:
/usr/sfw/include/libgsf-1/gsf/gsf.h:29: error: syntax error before "typedef"
In file included from /usr/local/include/netcdf.h:38,
                 from mb_read_init.c:249:
/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/stddef.h:57: error: syntax error before "typedef"
mb_read_init.c: In function `mb_read_init':
mb_read_init.c:686: error: `GSF_READONLY' undeclared (first use in this function)
mb_read_init.c:686: error: (Each undeclared identifier is reported only once
mb_read_init.c:686: error: for each function it appears in.)
make[2]: *** [mb_read_init.o] Error 1
make[2]: Leaving directory `/xiaok/mbsystem-5.3.2017/src/mbio'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/xiaok/mbsystem-5.3.2017/src'
make: *** [all] Error 2
used gsf of mbsystem 
make[2]: Entering directory `/xiaok/mbsystem-5.3.2017/src/gsf'
gcc -c -Wall -g -I/usr/X11R6/include -DSOLARIS gsf.c
In file included from gsf.c:149:
gsf.h:404: error: redefinition of `struct timespec'
make[2]: *** [gsf.o] Error 1
make[2]: Leaving directory `/xiaok/mbsystem-5.3.2017/src/gsf'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/xiaok/mbsystem-5.3.2017/src'

有关libgsf的错误

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DORBIT2=1 -mt -I/usr/include/libbonobo-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -g -O2 -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -DG_DISABLE_DEPRECATED -Wno-system-headers -W -Wfloat-equal -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wnested-externs -Winline -c gsf-input-gnomevfs.c  -fPIC -DPIC -o .libs/gsf-input-gnomevfs.lo
cc1: error: invalid option `t'
make[2]: *** [gsf-input-gnomevfs.lo] Error 1
make[2]: Leaving directory `/xiaok/libgsf-1.7.2/gsf-gnome'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/xiaok/libgsf-1.7.2'
make: *** [all-recursive-am] Error 2
mt  means multihtread earse it

二 、安装netcdf3.5.1

bash configure success
make install
出现问题:
Returning to directory /xiaok/netcdf-3.5.1/src
make[1]: Leaving directory `/xiaok/netcdf-3.5.1/src'
make[1]: Entering directory `/xiaok/netcdf-3.5.1/src'
Making `install' in directory /xiaok/netcdf-3.5.1/src/f90
make[2]: Entering directory `/xiaok/netcdf-3.5.1/src/f90'
netCDF header-module not found
make[2]: *** [installed_netcdf_module] Error 1
make[2]: Leaving directory `/xiaok/netcdf-3.5.1/src/f90'
make[1]: *** [subdir_target] Error 1
make[1]: Leaving directory `/xiaok/netcdf-3.5.1/src'
make: *** [f90/install] Error 2
笔者不知道怎么解决,下载了3.6.1安装
 bash configure --prefix=/usr/local  
 make check 
 make install 

运行成功!

三、安装GMT4.5.0

四、安装Perl5.8.9

五、安装Gv3.6.4

bash configure
checking for XawInitializeWidgetSet in -lXaw3d... no
configure: error: Unable to find a valid Xaw3d library. Please install it and re
run configure.

安装Xaw3d-1.5E
   Building Xaw3d without an X11 source tree:
   ------------------------------------------
   Near the top of this distribution's Imakefile are the lines:

       XCOMM When building outside an X11 source tree:
       XCOMM EXTRA_INCLUDES = -I.

   Uncomment the second line by deleting the "XCOMM ". Then, while still
   in /xc/lib/Xaw3d, issue these commands:

       # mkdir X11; cd X11; ln -fs .. Xaw3d; cd ..
       # xmkmf; make depend; make; make install

   If this works for you, great.
   modify dir usr/openwin/include/X11/X11  to usr/openwin/include/X11/Xaw3d

make 
make check
make install

运行成功

六、安装OTPsnc

edit makefile
 NCLIB = /usr/local/lib
 NCINCLUDE = /usr/local/include
 NCLIBS= -lnetcdf
 
make extract_HC
make predict_tide

七、安装MB-System

bash /mbsystem-5.3.2017/install_makefiles
make all

1、出现错误1:

cp proj_api.h ../../include/proj_api.h
chmod 664 ../../include/proj_api.h
gcc -c -g -w -I/usr/sfw/include/glib-1.2 -I/usr/sfw/lib/glib/include -DSOLARIS -I. proj.c
gcc -g -w -I/usr/sfw/include/glib-1.2 -I/usr/sfw/lib/glib/include -DSOLARIS proj.o \
                ../../lib/libmbproj.a \
                -L -lm -lnetcdf -L/usr/local/lib -lnetcdf -o ../../bin/proj
Undefined                       first referenced
 symbol                             in file
cos                                 ../../lib/libmbproj.a(pj_factors.o)
exp                                 ../../lib/libmbproj.a(proj_etmerc.o)
log                                 ../../lib/libmbproj.a(proj_etmerc.o)
pow                                 ../../lib/libmbproj.a(gen_cheb.o)
sin                                 ../../lib/libmbproj.a(pj_factors.o)
tan                                 ../../lib/libmbproj.a(pj_factors.o)
acos                                ../../lib/libmbproj.a(PJ_aeqd.o)
asin                                ../../lib/libmbproj.a(PJ_aea.o)
atan                                ../../lib/libmbproj.a(pj_factors.o)
cosh                                ../../lib/libmbproj.a(PJ_gstmerc.o)
fmod                                ../../lib/libmbproj.a(rtodms.o)
sinh                                ../../lib/libmbproj.a(PJ_gstmerc.o)
sqrt                                proj.o
atan2                               ../../lib/libmbproj.a(pj_factors.o)
floor                               ../../lib/libmbproj.a(rtodms.o)
hypot                               ../../lib/libmbproj.a(pj_factors.o)
ld: fatal: Symbol referencing errors. No output written to ../../bin/proj
collect2: ld returned 1 exit status
make[2]: *** [../../bin/proj] Error 1
make[2]: Leaving directory `/xiaok/mbsystem-5.3.2017/src/proj'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/xiaok/mbsystem-5.3.2017/src'

修改
$LFLAGS = "-L$NETCDFLIBDIR -lm -lnetcdf";

$LFLAGS = "-L$NETCDFLIBDIR -o -lm -lnetcdf";

2、出现错误2:
make[2]: Entering directory `/xiaok/mbsystem-5.3.2017/src/utilities'
gcc -g -w -DSOLARIS mbformat.o ../../lib/libmbio.a ../../lib/libmbproj.a ../../lib/libmbgsf.a ../../lib/libmr1pr.a ../../lib/libsapi.a ../../lib/libmbaux.a -L -o -lm -lnetcdf -L/usr/local/lib -lnetcdf \
                -o ../../bin/mbformat
Undefined                       first referenced
 symbol                             in file
xdr_double                          ../../lib/libmbio.a(mbr_mr1prhig.o)
xdr_opaque                          ../../lib/libmbio.a(mbr_hsds2raw.o)
xdr_u_long                          ../../lib/libsapi.a(xdr_surf.o)
xdr_bytes                           ../../lib/libmbio.a(mbr_mr1prhig.o)
xdr_float                           ../../lib/libmbio.a(mbr_mr1prhig.o)
xdr_short                           ../../lib/libsapi.a(xdr_surf.o)
xdr_u_int                           ../../lib/libmbio.a(mbr_hsds2raw.o)
xdr_u_short                         ../../lib/libmbio.a(mbr_hsds2raw.o)
xdr_char                            ../../lib/libmbio.a(mbr_hsmdaraw.o)
xdr_long                            ../../lib/libmbio.a(mbr_mr1prhig.o)
xdrstdio_create                     ../../lib/libsapi.a(xdr_surf.o)
xdr_int                             ../../lib/libmbio.a(mbr_mr1prhig.o)
ld: fatal: Symbol referencing errors. No output written to ../../bin/mbformat
collect2: ld returned 1 exit status
make[2]: *** [../../bin/mbformat] Error 1
make[2]: Leaving directory `/xiaok/mbsystem-5.3.2017/src/utilities'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/xiaok/mbsystem-5.3.2017/src'
gmake: *** [all] Error 2

修改
$LFLAGS = "-L$NETCDFLIBDIR -o -lm -lnetcdf";

$LFLAGS = "-L$NETCDFLIBDIR -o -lm -lnetcdf -lgen -lnsl";

3、出现错误3:
 -L -o -lm -lnetcdf -lgen -lnsl -L/usr/local/lib -lnetcdf -o ../../bin/mbsegygrid
gcc -c -g -w -DSOLARIS -I/xiaok/GMT4.5.0/include -I/usr/local/include -I/usr/local/include mbsegypsd.c
mbsegypsd.c:47:19: fftw3.h: No such file or directory
mbsegypsd.c: In function `main':
mbsegypsd.c:123: error: `fftw_plan' undeclared (first use in this function)
mbsegypsd.c:123: error: (Each undeclared identifier is reported only once
mbsegypsd.c:123: error: for each function it appears in.)
mbsegypsd.c:123: error: syntax error before "plan"
mbsegypsd.c:124: error: `fftw_complex' undeclared (first use in this function)
mbsegypsd.c:124: error: `fftw_in' undeclared (first use in this function)
mbsegypsd.c:125: error: `fftw_out' undeclared (first use in this function)
mbsegypsd.c:498: error: syntax error before ')' token
mbsegypsd.c:499: error: syntax error before ')' token
mbsegypsd.c:500: error: `plan' undeclared (first use in this function)
mbsegypsd.c:500: error: `FFTW_FORWARD' undeclared (first use in this function)
mbsegypsd.c:500: error: `FFTW_MEASURE' undeclared (first use in this function)
make[2]: *** [mbsegypsd.o] Error 1
make[2]: Leaving directory `/xiaok/mbsystem-5.3.2017/src/utilities'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/xiaok/mbsystem-5.3.2017/src'
make: *** [all] Error 2

需要fftw3

4、安装fftw

下载安装 fftw3.1.2
出现错误:
 gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I.. -I../simd -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mc
pu=ultrasparc -MT trig.lo -MD -MP -MF .deps/trig.Tpo -c trig.c -o trig.o
/var/tmp//ccFq8GEE.s: Assembler messages:
/var/tmp//ccFq8GEE.s:509: Error: Illegal operands: There are only 32 single precision f registers; [0-31]
make[2]: *** [trig.lo] Error 1
make[2]: Leaving directory `/xiaok/fftw-3.1.2/kernel'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/xiaok/fftw-3.1.2'
make: *** [all] Error 2
笔者不知道怎样解决

下载安装fftw3.2.2

出现错误:
root@em1002-248 # make
make  all-recursive
make[1]: Entering directory `/xiaok/fftw-3.2.2'
Making all in support
make[2]: Entering directory `/xiaok/fftw-3.2.2/support'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/xiaok/fftw-3.2.2/support'
Making all in kernel
make[2]: Entering directory `/xiaok/fftw-3.2.2/kernel'
/bin/sh ../libtool --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I../simd   -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mcpu=ultrasparc -MT align.lo -MD -MP -MF .deps/align.Tpo -c -o align.lo align.c
../libtool: syntax error at line 645: `func_arith_result=$' unexpected
make[2]: *** [align.lo] Error 2
make[2]: Leaving directory `/xiaok/fftw-3.2.2/kernel'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/xiaok/fftw-3.2.2'
make: *** [all] Error 2

修改
SHELL=/bin/sh 为
SHELL=/bin/bash
重新编译,出现和3.1.2一样的错误。
/bin/bash ../libtool --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I../simd   -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mcpu=ultrasparc -MT trig.lo -MD -MP -MF .deps/trig.Tpo -c -o trig.lo trig.c
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../simd -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mcpu=ultrasparc -MT trig.lo -MD -MP -MF .deps/trig.Tpo -c trig.c -o trig.o
/var/tmp//ccgHhj79.s: Assembler messages:
/var/tmp//ccgHhj79.s:508: Error: Illegal operands: There are only 32 single precision f registers; [0-31]
make[2]: *** [trig.lo] Error 1
make[2]: Leaving directory `/xiaok/fftw-3.2.2/kernel'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/xiaok/fftw-3.2.2'
make: *** [all] Error 2

下载安装 fftw3.3.3
出现错误:
gmake  all-recursive
gmake[1]: Entering directory `/xiaok/fftw-3.3.3'
Making all in support
gmake[2]: Entering directory `/xiaok/fftw-3.3.3/support'
gmake[2]: Nothing to be done for `all'.
gmake[2]: Leaving directory `/xiaok/fftw-3.3.3/support'
Making all in kernel
gmake[2]: Entering directory `/xiaok/fftw-3.3.3/kernel'
/bin/sh ../libtool --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I../simd   -O3 -fomit-frame-pointer -fstrict-aliasing -fno-schedule-insns -ffast-math -MT align.lo -MD -MP -MF .deps/align.Tpo -c -o align.lo align.c
../libtool: bad substitution
gmake[2]: *** [align.lo] Error 1
gmake[2]: Leaving directory `/xiaok/fftw-3.3.3/kernel'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/xiaok/fftw-3.3.3'
gmake: *** [all] Error 2

修改
SHELL=/bin/sh为

SHELL=/bin/bash

make all

make check

make install

安装成功!



你可能感兴趣的:(Solaris,sun,MB-System)