在安裝mb-system 5.5.2252版時,遇到下面的問題:
configure: error: Did not find libgmt according to --with-gmt-lib - check the installation!
我的gmt5是裝在 /usr/local/gmt5 裏
#執行下述命令時就是會出問題
./configure --with-netcdf-include=/usr/local/netcdf/include --with-netcdf-lib=/usr/local/netcdf/lib --with-gmt-include=/usr/local/gmt5/include/gmt --with-gmt-lib=/usr/local/gmt5/lib64
#檢查config.log
#可以看到下列訊息
#configure:14103: checking for GMT_begin in -lgmt
#configure:14128: gcc -o conftest -g -O2 -L/usr/local/gmt5/lib64 conftest.c -lgmt -lm >&5
#/usr/bin/ld: warning: libpsl.so.5, needed by /usr/local/gmt5/lib64/libgmt.so, not found (try using -rpath or -rpath-link)
#查一下configure 14103行附近
vi configure
if test "$GOT_GMT" = "yes" ; then
$as_echo "GMT library location specified: $gmt_libdir - check if libgmt libpsl are there..."
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -L$gmt_libdir"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMT_begin in -lgmt" >&5 #<--這是14103行
$as_echo_n "checking for GMT_begin in -lgmt... " >&6; }
if ${ac_cv_lib_gmt_GMT_begin+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgmt $LIBS" # <-- 這一行有問題,現在的gmt需要加上 -lpsl
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
###
#所以把 change the LIBS line
LIBS="-lgmt $LIBS"
#改成 to
LIBS="-lgmt -lpsl $LIBS"
試用
TMPLIST=tmplist
DATALIST="datalist"
ls -1 | grep all$ > $TMPLIST
mbdatalist -F-1 -I $TMPLIST > $DATALIST # 產生datalist-1 檔
mbdatalist -F-1 -I $DATALIST -N # 每個原始檔會產生三個檔案,副檔名依次為 fbt fnv inv
mbm_plot -F-1 -I $DATALIST -G2 -N -C # -N:航跡。-G2 有打光的彩色地形。-C:等深線。
./datalist-1.cmd
沒有留言:
張貼留言