爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 10614|回复: 16

wavewatch3模型在ubuntu18.04上安装提示无法找到‘prnc.o’文件的问题?

[复制链接]
回帖奖励 5 金钱 回复本帖可获得 1 金钱奖励! 每人限 1 次

新浪微博达人勋

发表于 2018-9-26 21:12:25 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x

最近在ubuntu18.04上安装海浪模拟模型wavewatch3 5.16,但是遇到诸多问题,目前的问题是在w3_make之后,**提示prnc.o文件无法找到**,如下:

  • * * * * * Processing ww3_prnc
  • * * * * * ---------------------
  • * * * * * ad3 : processing ww3_prnc
  • * * * * * mv: 无法获取'ww3_prnc.o' 的文件状态(stat): 没有那个文件或目录
  • * * * * * Linking ww3_prnc
  • * * * * * *** file ww3_prnc.o not found ***
  • * * * * * *** Missing object files ***
  • * * * * * makefile:87: recipe for target '/home/zhaojiaqing/exe/ww3_prnc' failed
  • * * * make: *** [/home/zhaojiaqing/exe/ww3_prnc] Error 3

    • watchwatch3模型在安装时指定的编译器是ifort和icc,目前怀疑是netcdf安装出现问题,但是不知道具体问题何在?网上查找他人的安装过程,在安装netcdf时,安装的是libnetcdf6或者libnetcdf7,但是我在sudo apt-get install libnetcdf6或者7时,提示无法找到安装包,只有libnetcdf13,不知道是源的原因还是libnetcdf6或7被下架了?

      另外,netcdf的环境变量配置如下:不知道是否有错



    • * * * * * export WWATCH3_NETCDF=NC
    • * * * * export NETCDF_CONFIG=/usr/bin/nc-config

    • 据说安装netcdf时使用的编译器要和安装模型时的一致,不知道该怎样将netcdf编译器指定为ifort和icc?
      小白提问,还请大佬们多多指教,超级感谢!




密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-9-27 09:20:05 | 显示全部楼层

回帖奖励 +1 金钱

建议手动安装
安装netcdf-4.1.3
./configure --prefix=/app/netcdf CC=gcc CXX=g++ FC=gfortran F77=gfortran
make
make install
设置环境变量
export PATH=/app/netcdf/bin:$PATH
export LD_LIBRARY_PATH=/app/netcdf/lib:$LD_LIBRARY_PATH
检查
ncdump (出现使用提示即可)
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-30 08:13:17 | 显示全部楼层
islandowner 发表于 2018-9-27 09:20
建议手动安装
安装netcdf-4.1.3
./configure --prefix=/app/netcdf CC=gcc CXX=g++ FC=gfortran F77=gfor ...

你好,我按照csdn一位博主的方法,手动安装了netcef,版本为4.3.2,配置了相关环境变量,运行ncdump后有显示结果,但是在运行w3_make时仍然提示“无法获取'ww3_prnc.o' 的文件状态(stat)”,我的系统是ubuntu18.04,gcc和gfortran已经经过降级,版本号为4.8.5,安装ww3 5.16模型时选择的编译器为gcc和gfortran,相关文件信息如下,求指导:
  1. zhaojiaqing@jiaqing:/$ ncdump
  2. ncdump [-c|-h] [-v ...] [[-b|-f] [c|f]] [-l len] [-n name] [-p n[,n]] [-k] [-x] [-s] [-t|-i] [-g ...] [-w] file
  3.   [-c]             Coordinate variable data and header information
  4.   [-h]             Header information only, no data
  5.   [-v var1[,...]]  Data for variable(s) <var1>,... only
  6.   [-b [c|f]]       Brief annotations for C or Fortran indices in data
  7.   [-f [c|f]]       Full annotations for C or Fortran indices in data
  8.   [-l len]         Line length maximum in data section (default 80)
  9.   [-n name]        Name for netCDF (default derived from file name)
  10.   [-p n[,n]]       Display floating-point values with less precision
  11.   [-k]             Output kind of netCDF file
  12.   [-s]             Output special (virtual) attributes
  13.   [-t]             Output time data as date-time strings
  14.   [-i]             Output time data as date-time strings with ISO-8601 'T' separator
  15.   [-g grp1[,...]]  Data and metadata for group(s) <grp1>,... only
  16.   [-w]             With client-side caching of variables for DAP URLs
  17.   [-x]             Output XML (NcML) instead of CDL
  18.   file             Name of netCDF file (or URL if DAP access enabled)
  19. netcdf library version 4.3.2 of Sep 28 2018 21:45:52 $
复制代码
[/code]

环境变量配置如下:
  1. export PATH=$PATH:/home/zhaojiaqing/wwatch3.v5.16/bin
  2. export PATH=$PATH:/home/zhaojiaqing/wwatch3.v5.16/exe

  3. export WWATCH3_NETCDF=NC4
  4. export NETCDF_CONFIG=/usr/local/netcdf4-needed/bin/nc-config
  5. # export NETCDF_CONFIG=/usr/bin/nc-config/path

  6. #安装了icc和ifort,但是目前并未使,目前是使用gcc和gfortran
  7. alias ifort='/opt/intel/compilers_and_libraries/linux/bin/intel64/ifort'
  8. alias icc='/opt/intel/compilers_and_libraries/linux/bin/intel64/icc'
  9. source /opt/intel/bin/ifortvars.sh intel64
  10. source /opt/intel/bin/iccvars.sh intel64

  11. #netcdf4.4
  12. export NETCDF=/usr/local/netcdf4-needed
  13. export PATH=$NETCDF/bin:$PATH
  14. export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH
  15. export CPPFLAGS='-I/usr/local/netcdf4-needed/include'
  16. export LDFLAGS='-L/usr/local/netcdf4-needed/lib'
复制代码
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-9-30 09:01:52 | 显示全部楼层
没装过这个,不过你需要提供更多的具体信息
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-9-30 09:02:26 | 显示全部楼层
把错误的log文件,关键部分贴出来
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-30 11:18:57 | 显示全部楼层
islandowner 发表于 2018-9-30 09:01
没装过这个,不过你需要提供更多的具体信息

好的,以下是安装过程中报错信息及其他文件信息:
1、进行w3_make时提示的错误信息
  1. Processing ww3_prnc
  2. ---------------------
  3. ad3 : processing ww3_prnc
  4. mv: 无法获取'ww3_prnc.o' 的文件状态(stat): 没有那个文件或目录
  5.       Linking ww3_prnc
  6.       *** file ww3_prnc.o not found ***
  7. *** Missing object files ***
  8. makefile:77: recipe for target '/home/zhaojiaqing/wwatch3.v5.16/exe/ww3_prnc' failed
  9. make: *** [/home/zhaojiaqing/wwatch3.v5.16/exe/ww3_prnc] Error 3
复制代码


2、gcc版本信息
  1. root@jiaqing:/# gcc -v

  2.         Using built-in specs.
  3.         COLLECT_GCC=gcc
  4.         COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
  5.         Target: x86_64-linux-gnu
  6.         Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.5-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
  7.         Thread model: posix
  8.         gcc version 4.8.5 (Ubuntu 4.8.5-4ubuntu8)
复制代码


3、gfortran版本信息
  1. root@jiaqing:/# gfortran -v

  2.     Using built-in specs.
  3.     COLLECT_GCC=gfortran
  4.     COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
  5.     Target: x86_64-linux-gnu
  6.     Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.5-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
  7.     Thread model: posix
  8.     gcc version 4.8.5 (Ubuntu 4.8.5-4ubuntu8)
复制代码


4、NETCDF信息,netcdf-c,netcdf-fortran

  1.     root@jiaqing:/# nc-config --all


  2.     This netCDF 4.3.2 has been built with the following features:

  3.       --cc        ->   -I/usr/local/netcdf4-needed/include -I/usr/local/netcdf4-needed/include
  4.       --libs      -> -L/usr/local/netcdf4-needed/lib -lnetcdf

  5.     gcc
  6.       --cflags    ->  --has-c++   -> no
  7.       --cxx       ->
  8.       --has-c++4  -> no
  9.       --cxx4      ->

  10.       --fc        ->
  11.       --fflags    ->
  12.       --flibs     ->
  13.       --has-f90   -> no

  14.       --has-dap   -> no
  15.       --has-nc2   -> yes
  16.       --has-nc4   -> yes
  17.       --has-hdf5  -> yes
  18.       --has-hdf4  -> no
  19.       --has-pnetcdf-> no

  20.       --prefix    -> /usr/local/netcdf4-needed
  21.       --includedir-> /usr/local/netcdf4-needed/include
  22.       --version   -> netCDF 4.3.2
复制代码


  1.     root@jiaqing:/# nf-config --all


  2.     This netCDF-Fortran 4.4.1 has been built with the following features:

  3.       --cc        -> gcc
  4.       --cflags    ->  -I/usr/local/netcdf4-needed/include -I/usr/local/netcdf4-needed/include

  5.       --fc        -> gfortran
  6.       --fflags    -> -I/usr/local/netcdf4-needed/include
  7.       --flibs     -> -L/usr/local/netcdf4-needed/lib -lnetcdff -L/usr/local/netcdf4-needed/lib -lnetcdf -lnetcdf
  8.       --has-f90   -> no
  9.       --has-f03   -> yes

  10.       --has-nc2   -> yes
  11.       --has-nc4   -> yes

  12.       --prefix    -> /usr/local/netcdf4-needed
  13.       --includedir-> /usr/local/netcdf4-needed/include
  14.       --version   -> netCDF-Fortran 4.4.1
复制代码


5、ww3安装时设置的环境变量文件(选择的L)
  1. #
  2. # Environment variables for wavewatch III
  3. # ---------------------------------------
  4. #

  5. WWATCH3_LPR      printer
  6. WWATCH3_F77      gfortran
  7. WWATCH3_CC       gcc
  8. WWATCH3_DIR      /home/zhaojiaqing/wwatch3.v5.16
  9. WWATCH3_TMP      /home/zhaojiaqing/wwatch3.v5.16/tmp
  10. WWATCH3_SOURCE   yes
  11. WWATCH3_LIST     yes
复制代码


密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-30 11:19:02 | 显示全部楼层
islandowner 发表于 2018-9-30 09:01
没装过这个,不过你需要提供更多的具体信息

好的,以下是安装过程中报错信息及其他文件信息:
1、进行w3_make时提示的错误信息
  1. Processing ww3_prnc
  2. ---------------------
  3. ad3 : processing ww3_prnc
  4. mv: 无法获取'ww3_prnc.o' 的文件状态(stat): 没有那个文件或目录
  5.       Linking ww3_prnc
  6.       *** file ww3_prnc.o not found ***
  7. *** Missing object files ***
  8. makefile:77: recipe for target '/home/zhaojiaqing/wwatch3.v5.16/exe/ww3_prnc' failed
  9. make: *** [/home/zhaojiaqing/wwatch3.v5.16/exe/ww3_prnc] Error 3
复制代码


2、gcc版本信息
  1. root@jiaqing:/# gcc -v

  2.         Using built-in specs.
  3.         COLLECT_GCC=gcc
  4.         COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
  5.         Target: x86_64-linux-gnu
  6.         Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.5-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
  7.         Thread model: posix
  8.         gcc version 4.8.5 (Ubuntu 4.8.5-4ubuntu8)
复制代码


3、gfortran版本信息
  1. root@jiaqing:/# gfortran -v

  2.     Using built-in specs.
  3.     COLLECT_GCC=gfortran
  4.     COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
  5.     Target: x86_64-linux-gnu
  6.     Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.5-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
  7.     Thread model: posix
  8.     gcc version 4.8.5 (Ubuntu 4.8.5-4ubuntu8)
复制代码


4、NETCDF信息,netcdf-c,netcdf-fortran

  1.     root@jiaqing:/# nc-config --all


  2.     This netCDF 4.3.2 has been built with the following features:

  3.       --cc        ->   -I/usr/local/netcdf4-needed/include -I/usr/local/netcdf4-needed/include
  4.       --libs      -> -L/usr/local/netcdf4-needed/lib -lnetcdf

  5.     gcc
  6.       --cflags    ->  --has-c++   -> no
  7.       --cxx       ->
  8.       --has-c++4  -> no
  9.       --cxx4      ->

  10.       --fc        ->
  11.       --fflags    ->
  12.       --flibs     ->
  13.       --has-f90   -> no

  14.       --has-dap   -> no
  15.       --has-nc2   -> yes
  16.       --has-nc4   -> yes
  17.       --has-hdf5  -> yes
  18.       --has-hdf4  -> no
  19.       --has-pnetcdf-> no

  20.       --prefix    -> /usr/local/netcdf4-needed
  21.       --includedir-> /usr/local/netcdf4-needed/include
  22.       --version   -> netCDF 4.3.2
复制代码


  1.     root@jiaqing:/# nf-config --all


  2.     This netCDF-Fortran 4.4.1 has been built with the following features:

  3.       --cc        -> gcc
  4.       --cflags    ->  -I/usr/local/netcdf4-needed/include -I/usr/local/netcdf4-needed/include

  5.       --fc        -> gfortran
  6.       --fflags    -> -I/usr/local/netcdf4-needed/include
  7.       --flibs     -> -L/usr/local/netcdf4-needed/lib -lnetcdff -L/usr/local/netcdf4-needed/lib -lnetcdf -lnetcdf
  8.       --has-f90   -> no
  9.       --has-f03   -> yes

  10.       --has-nc2   -> yes
  11.       --has-nc4   -> yes

  12.       --prefix    -> /usr/local/netcdf4-needed
  13.       --includedir-> /usr/local/netcdf4-needed/include
  14.       --version   -> netCDF-Fortran 4.4.1
复制代码


5、ww3安装时设置的环境变量文件(选择的L)
  1. #
  2. # Environment variables for wavewatch III
  3. # ---------------------------------------
  4. #

  5. WWATCH3_LPR      printer
  6. WWATCH3_F77      gfortran
  7. WWATCH3_CC       gcc
  8. WWATCH3_DIR      /home/zhaojiaqing/wwatch3.v5.16
  9. WWATCH3_TMP      /home/zhaojiaqing/wwatch3.v5.16/tmp
  10. WWATCH3_SOURCE   yes
  11. WWATCH3_LIST     yes
复制代码


密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-30 11:40:29 | 显示全部楼层
islandowner 发表于 2018-9-30 09:02
把错误的log文件,关键部分贴出来

内容有点多,但十分渴望能给些许建议,泪奔了,超级感谢!
在运行w3_make报错“无法获取'ww3_prnc.o' 的文件状态(stat)”之后,在tep临时文件夹中有‘prnc.F90’和‘prnc.l’文件,同时在‘prnc.l’文件的最后几行,标有这样的信息:
  1. ------------
  2. -c -g -O3 -static -fconvert=big-endian -J/home/zhaojiaqing/wwatch3.v5.16/mod -I/usr/local/netcdf4-needed/include -I/home/zhaojiaqing/wwatch3.v5.16/ftn
  3. ------------
  4. ------------
  5. /home/zhaojiaqing/wwatch3.v5.16/bin/comp: 120: /home/zhaojiaqing/wwatch3.v5.16/bin/comp: -c: not found
复制代码


按照错误的提示,可能是在/bin/comp文件的 120行左右出现了错误,下面是comp文件第120行附近的代码:
  1. 118  # 2.b.2 Compile
  2. 119
  3. 120   $comp $opt                             $name.$fext > $name.out 2> $name.err
  4. 121  OK="$?"
复制代码


同时将完整的comp文件附上:
  1. #!/bin/sh
  2. # --------------------------------------------------------------------------- #
  3. # comp  : Compiler script for use in ad3 (customized for hardware and         #
  4. #         optimization). Note that this script will not be replaced if part   #
  5. #         of WAVEWATCH III is re-installed. Used by ad3.                      #
  6. #                                                                             #
  7. # use   : comp name                                                           #
  8. #           name: name of source code file without the extension.             #
  9. #                                                                             #
  10. # error codes :  1 : input error                                              #
  11. #                2 : no environment file $ww3_env found.                      #
  12. #                3 : error in creating scratch directory.                     #
  13. #                4 : w3adc error.                                             #
  14. #                5 : compiler error.                                          #
  15. #                                                                             #
  16. # remarks :                                                                   #
  17. #                                                                             #
  18. #  - This script runs from the scratch directory, where it should remain.     #
  19. #                                                                             #
  20. #  - For this script to interact with ad3, it needs to generate / leave       #
  21. #    following files :                                                        #
  22. #       $name.f90   : Source code (generated by ad3).                         #
  23. #       $name.o     : Object module.                                          #
  24. #       $name.l     : Listing file.                                           #
  25. #       comp.stat   : status file of compiler, containing number of errors    #
  26. #                     and number of warnings (generated by comp).             #
  27. #                                                                             #
  28. #  - Upon (first) installation of WAVEWATCH III the user needs to check the   #
  29. #    following parts of this script :                                         #
  30. #      sec. 2.b : Provide correct compiler/options.                           #
  31. #      sec. 3.a : Provide correct error capturing.                            #
  32. #      sec. 3.d : Remove unnecessary files.                                   #
  33. #                                                                             #
  34. #  - This version is made for the Intel ifort version 8.1 on a Pentium 4      #
  35. #    processor.                                                               #
  36. #                                                                             #
  37. #                                                      Hendrik L. Tolman      #
  38. #                                                      April    2015          #
  39. # --------------------------------------------------------------------------- #
  40. # 1. Preparations                                                             #
  41. # --------------------------------------------------------------------------- #
  42. # 1.a Check and process input

  43.   if [ "$#" != '1' ]
  44.   then
  45.     echo "usage: comp name" ; exit 1
  46.   fi
  47.   name="$1"

  48. # 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  49.   rm -f $name.l
  50.   rm -f $name.o
  51.   rm -f comp.stat

  52. # --------------------------------------------------------------------------- #
  53. # 2. Compile                                                                  #
  54. # --------------------------------------------------------------------------- #
  55. # Add here the correct compiler call including command line options
  56. # Note: - do not invoke a link step
  57. #       - if possible, generate a listing $name.l
  58. #       - make sure the compiler point to the proper directory where the
  59. #         modules are stored ($m_path), see examples below.

  60. # 2.a Determine file extension - - - - - - - - - - - - - - - - - - - - - - - -
  61. #     .f90 assumes free format, .f assumes fixed format, change if necessary
  62. # *** file extension (fext) is set and exported by calling program (ad3) ***

  63. # 2.b Perform compilation  - - - - - - - - - - - - - - - - - - - - - - - - - -
  64. #     Save compiler exit code in $OK
  65. #
  66. # Intel compiler on Linux ----------------------------------------------------
  67. # 2.b.1 Build options and determine compiler name

  68.   # compilation options
  69.   opt="-c -g -O3 -static -fconvert=big-endian -J$path_m"
  70. # opt="-c -g -O0 -fbacktrace -fconvert=big-endian -J$path_m"

  71.   # mpi implementation
  72.   if [ "$mpi_mod" = 'yes' ]
  73.   then
  74.     comp=gfortran
  75.   else
  76.     comp=gfortran
  77.   fi

  78.   # open mpi implementation
  79.   if [ "$omp_mod" = 'yes' ]
  80.   then
  81.     opt="$opt -fopenmp"
  82.   fi

  83.   # oasis coupler include dir
  84.   if [ "$oasis_mod" = 'yes' ]
  85.   then
  86.     opt="$opt -I$OASISDIR/build/lib/psmile.MPI1"
  87.   fi

  88.   # palm coupler include dir
  89.   if [ "$palm_mod" = 'yes' ]
  90.   then
  91.     opt="$opt -I$PALM_LIBDIR -I$PALM_DIR"
  92.   fi

  93.   # netcdf include dir
  94.   if [ "$netcdf_compile" = 'yes' ]
  95.   then
  96.     case $WWATCH3_NETCDF in
  97.       NC3) opt="$opt -I$NETCDF_INCDIR" ;;
  98.       NC4) if [ "$mpi_mod" = 'no' ]; then comp="`$NETCDF_CONFIG --fc`"; fi
  99.            opt="$opt -I`$NETCDF_CONFIG --includedir`" ;;
  100.     esac
  101.   fi

  102.   # ftn include dir
  103.   opt="$opt -I$path_i"

  104. # 2.b.2 Compile

  105.   $comp $opt                             $name.$fext > $name.out 2> $name.err
  106.   OK="$?"

  107. # 2.b.2 Process listing

  108.   if [ -s $name.lst ]
  109.   then
  110.      mv $name.lst $name.l
  111.   fi

  112. # 2.b.3 Add test output to listing for later viewing

  113.   if [ -s $name.l ]
  114.   then
  115.     echo '------------' >> $name.l
  116.     echo "$comp $opt"   >> $name.l
  117.     echo '------------' >> $name.l
  118.     cat $name.out       >> $name.l 2> /dev/null
  119.     echo '------------' >> $name.l
  120.     cat $name.err       >> $name.l 2> /dev/null
  121.     echo '------------' >> $name.l
  122.   fi

  123. # --------------------------------------------------------------------------- #
  124. # 3. Postprocessing                                                           #
  125. # --------------------------------------------------------------------------- #
  126. # 3.a Capture errors
  127. #     nr_err : number of errors.
  128. #     nr_war : number of errors.

  129.   nr_err='0'
  130.   nr_war='0'

  131.   if [ -s $name.err ]
  132.   then
  133.     nr_err=`grep 'error' $name.err | wc -l | awk '{ print $1 }'`
  134.     nr_war=`grep 'warning' $name.err | wc -l | awk '{ print $1 }'`
  135.   else
  136.     if [ "$OK" != '0' ]
  137.     then
  138.       nr_err='1'
  139.     fi
  140.   fi

  141. # 3.b Make file comp.stat  - - - - - - - - - - - - - - - - - - - - - - - - - -

  142.   echo "ERROR    $nr_err"   > comp.stat
  143.   echo "WARNING  $nr_war"  >> comp.stat

  144. # 3.c Prepare listing  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  145. #     if compiler does not provide listing, make listing from source code
  146. #     and compiler messages. Second input line for w3list identifies if
  147. #     comment lines are to be numbered.

  148.   if [ ! -f $name.l ]
  149.   then
  150.     echo "$name.$fext" > w3list.inp
  151.     echo "T"          >> w3list.inp
  152.     w3list < w3list.inp 2> /dev/null
  153.     rm -f w3list.inp
  154.     mv w3list.out $name.l
  155.     echo '------------' >> $name.l
  156.     echo "$comp $opt"   >> $name.l
  157.     echo '------------' >> $name.l
  158.     cat $name.out >> $name.l #2> /dev/null
  159.     echo '------------' >> $name.l
  160.     cat $name.err >> $name.l #2> /dev/null
  161.     echo '------------' >> $name.l
  162.   fi

  163. # 3.d Remove unwanted files  - - - - - - - - - - - - - - - - - - - - - - - - -
  164. #     include here unwanted files generated by the compiler

  165.   rm -f $name.out
  166.   rm -f $name.err

  167. # end of comp --------------------------------------------------------------- #


复制代码
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-9-30 14:39:25 | 显示全部楼层
建议, 把comp文件第76行中 opt="-c -g -O3 -static -fconvert=big-endian -J$path_m"  ,把-c去掉,变成 opt=" -g -O3 -static -fconvert=big-endian -J$path_m" 试试
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-30 21:59:58 | 显示全部楼层
islandowner 发表于 2018-9-30 14:39
建议, 把comp文件第76行中 opt="-c -g -O3 -static -fconvert=big-endian -J$path_m"  ,把-c去掉,变成 o ...

我刚刚试了下,去掉‘-c’选项以后,仍会报错,而且从第一个编译的文件开始就报错,所以这个应该是不行,然后我查了下gfortran编译的选项,‘-c’选项的意思应该是:“编译和汇编,但是不链接”,如下

  1. zhaojiaqing@jiaqing:~$ gfortran --help
  2. Usage: gfortran [options] file...
  3. Options:
  4.   -pass-exit-codes         Exit with highest error code from a phase
  5.   --help                   Display this information
  6.   --target-help            Display target specific command line options
  7.   --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...]
  8.                            Display specific types of command line options
  9.   (Use '-v --help' to display command line options of sub-processes)
  10.   --version                Display compiler version information
  11.   -dumpspecs               Display all of the built in spec strings
  12.   -dumpversion             Display the version of the compiler
  13.   -dumpmachine             Display the compiler's target processor
  14.   -print-search-dirs       Display the directories in the compiler's search path
  15.   -print-libgcc-file-name  Display the name of the compiler's companion library
  16.   -print-file-name=<lib>   Display the full path to library <lib>
  17.   -print-prog-name=<prog>  Display the full path to compiler component <prog>
  18.   -print-multiarch         Display the target's normalized GNU triplet, used as
  19.                            a component in the library path
  20.   -print-multi-directory   Display the root directory for versions of libgcc
  21.   -print-multi-lib         Display the mapping between command line options and
  22.                            multiple library search directories
  23.   -print-multi-os-directory Display the relative path to OS libraries
  24.   -print-sysroot           Display the target libraries directory
  25.   -print-sysroot-headers-suffix Display the sysroot suffix used to find headers
  26.   -Wa,<options>            Pass comma-separated <options> on to the assembler
  27.   -Wp,<options>            Pass comma-separated <options> on to the preprocessor
  28.   -Wl,<options>            Pass comma-separated <options> on to the linker
  29.   -Xassembler <arg>        Pass <arg> on to the assembler
  30.   -Xpreprocessor <arg>     Pass <arg> on to the preprocessor
  31.   -Xlinker <arg>           Pass <arg> on to the linker
  32.   -save-temps              Do not delete intermediate files
  33.   -save-temps=<arg>        Do not delete intermediate files
  34.   -no-canonical-prefixes   Do not canonicalize paths when building relative
  35.                            prefixes to other gcc components
  36.   -pipe                    Use pipes rather than intermediate files
  37.   -time                    Time the execution of each subprocess
  38.   -specs=<file>            Override built-in specs with the contents of <file>
  39.   -std=<standard>          Assume that the input sources are for <standard>
  40.   --sysroot=<directory>    Use <directory> as the root directory for headers
  41.                            and libraries
  42.   -B <directory>           Add <directory> to the compiler's search paths
  43.   -v                       Display the programs invoked by the compiler
  44.   -###                     Like -v but options quoted and commands not executed
  45.   -E                       Preprocess only; do not compile, assemble or link
  46.   -S                       Compile only; do not assemble or link
  47.   -c                       Compile and assemble, but do not link
  48.   -o <file>                Place the output into <file>
  49.   -pie                     Create a position independent executable
  50.   -shared                  Create a shared library
  51.   -x <language>            Specify the language of the following input files
  52.                            Permissible languages include: c c++ assembler none
  53.                            'none' means revert to the default behavior of
  54.                            guessing the language based on the file's extension

  55. Options starting with -g, -f, -m, -O, -W, or --param are automatically
  56. passed on to the various sub-processes invoked by gfortran.  In order to pass
  57. other options on to these processes the -W<letter> options must be used.

  58. For bug reporting instructions, please see:
  59. <file:///usr/share/doc/gcc-4.8/README.Bugs>.
复制代码


求建议
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表