AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-1005682

LvnTrvr's questions

Martin Hope
LvnTrvr
Asked: 2020-04-08 15:00:48 +0800 CST

Grib2 和 Netcdf 出错

  • 0

我正在尝试安装一个专为天气建模而设计的软件包。这可以在这里找到https://github.com/usgs/volcano-ash3d-metreader。当我尝试执行“全部制作”命令时,问题就出现了。运行时,我得到以下输出:

    /usr/bin/gfortran -O0 -g3 -Wall -fbounds-check -pedantic -fimplicit-none -Wunderflow -Wuninitialized -ffpe-trap=invalid,zero,overflow -fdefault-real-8   -L./ -lMetReader -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu -L/opt/USGS/lib -I/usr/lib -I/usr/local/include -I/usr/include -I/usr/lib/x86_64-linux-gnu -I/opt/USGS/include -I/usr/local/lib   -lnetcdff -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -lnetcdf -lnetcdf -leccodes -leccodes_f90 -c tools/MetSonde.f90
    /usr/bin/gfortran -O0 -g3 -Wall -fbounds-check -pedantic -fimplicit-none -Wunderflow -Wuninitialized -ffpe-trap=invalid,zero,overflow -fdefault-real-8   MetSonde.o  -L./ -lMetReader -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu -L/opt/USGS/lib -I/usr/lib -I/usr/local/include -I/usr/include -I/usr/lib/x86_64-linux-gnu -I/opt/USGS/include -I/usr/local/lib   -lnetcdff -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -lnetcdf -lnetcdf -leccodes -leccodes_f90 -L/opt/USGS/lib -I/opt/USGS/include -lhourssince -lprojection -o tools/MetSonde
    /usr/bin/gfortran -x f95-cpp-input -DFORWARD  -O0 -g3 -Wall -fbounds-check -pedantic -fimplicit-none -Wunderflow -Wuninitialized -ffpe-trap=invalid,zero,overflow -fdefault-real-8   tools/MetTraj.F90 -o tools/MetTraj_F -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu -L/opt/USGS/lib -I/usr/lib -I/usr/local/include -I/usr/include -I/usr/lib/x86_64-linux-gnu -I/opt/USGS/include -I/usr/local/lib   -lnetcdff -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -lnetcdf -lnetcdf -leccodes -leccodes_f90 -L./ -lMetReader -L/opt/USGS/lib -I/opt/USGS/include -lhourssince -lprojection
    .//libMetReader.a(MetReader_NetCDF.o): In function `mr_set_met_dims_template_netcdf_':
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2249: undefined reference to `__netcdf_MOD_nf90_open'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2251: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2279: undefined reference to `__netcdf_MOD_nf90_inq_dimid'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2281: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2282: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2285: undefined reference to `__netcdf_MOD_nf90_inquire_dimension'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2287: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2288: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2298: undefined reference to `__netcdf_MOD_nf90_inq_varid'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2300: undefined 
.
.
.
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2871: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2872: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2885: undefined reference to `__netcdf_MOD_nf90_get_var_4d_fourbytereal'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2887: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2888: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2902: undefined reference to `__netcdf_MOD_nf90_get_var_3d_fourbytereal'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2904: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:2905: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:3061: undefined reference to `__netcdf_MOD_nf90_close'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:3063: undefined reference to `__netcdf_MOD_nf90_strerror'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_NetCDF.f90:3064: undefined reference to `__netcdf_MOD_nf90_strerror'
    .//libMetReader.a(MetReader_GRIB.o): In function `mr_read_met_dimvars_grib_':
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:104: undefined reference to `__grib_api_MOD_grib_open_file'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:105: undefined reference to `__grib_api_MOD_grib_new_from_file'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:107: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:108: undefined reference to `__grib_api_MOD_grib_release'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:109: undefined reference to `__grib_api_MOD_grib_close_file'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:123: undefined reference to `__grib_api_MOD_grib_open_file'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:125: undefined reference to `__grib_api_MOD_grib_new_from_file'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:134: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:135: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:141: undefined reference to `__grib_api_MOD_grib_get_string'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:142: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:144: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:149: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:186: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:190: undefined reference to `__grib_api_MOD_grib_get_data_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:202: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:208: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:214: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:216: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:225: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:229: undefined reference to `__grib_api_MOD_grib_get_data_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:241: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:247: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:259: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:279: undefined reference to `__grib_api_MOD_grib_get_real8'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:281: undefined reference to `__grib_api_MOD_grib_get_real8'
    .//libMetReader.a(MetReader_GRIB.o):/home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:283: more undefined references to `__grib_api_MOD_grib_get_real8' follow
    .//libMetReader.a(MetReader_GRIB.o): In function `mr_read_met_dimvars_grib_':
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:306: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:308: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:311: undefined reference to `__grib_api_MOD_grib_get_int' 

.
.
.
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1378: undefined reference to `__grib_api_MOD_grib_index_release'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1385: undefined reference to `__grib_api_MOD_grib_open_file'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1388: undefined reference to `__grib_api_MOD_grib_multi_support_on'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1391: undefined reference to `__grib_api_MOD_grib_new_from_file'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1395: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1396: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1397: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1398: undefined reference to `__grib_api_MOD_grib_get_int'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1399: undefined reference to `__grib_api_MOD_grib_get_int'
    .//libMetReader.a(MetReader_GRIB.o):/home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1400: more undefined references to `__grib_api_MOD_grib_get_int' follow
    .//libMetReader.a(MetReader_GRIB.o): In function `mr_read_metp_variable_grib_':
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1423: undefined reference to `__grib_api_MOD_grib_get_real8_array'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1443: undefined reference to `__grib_api_MOD_grib_release'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1444: undefined reference to `__grib_api_MOD_grib_new_from_file'
    /home/trevor/Downloads/volcano-ash3d-metreader-master/MetReader_GRIB.f90:1446: undefined reference to `__grib_api_MOD_grib_close_file'
    collect2: error: ld returned 1 exit status
    makefile:174: recipe for target 'MetTraj_F' failed
    make: *** [MetTraj_F] Error 1

我相信我的 makefile 根本没有引用 grib_api_mod 和 NetCDF_Mod 的正确位置,但我似乎无法找到纠正此问题的最佳方法。在这里,我还附上了我正在执行的 make 文件。

##############################################################################
#  Makefile for libmetreader.a
#
#    User-specified flags are in this top block
#
###############################################################################

#      This file is a component of the volcanic ash transport and dispersion model Ash3d,
#      written at the U.S. Geological Survey by Hans F. Schwaiger (hschwaiger@usgs.gov),
#      Larry G. Mastin (lgmastin@usgs.gov), and Roger P. Denlinger (roger@usgs.gov).

#      The model and its source code are products of the U.S. Federal Government and therefore
#      bear no copyright.  They may be copied, redistributed and freely incorporated 
#      into derivative products.  However as a matter of scientific courtesy we ask that
#      you credit the authors and cite published documentation of this model (below) when
#      publishing or distributing derivative products.

#      Schwaiger, H.F., Denlinger, R.P., and Mastin, L.G., 2012, Ash3d, a finite-
#         volume, conservative numerical model for ash transport and tephra deposition,
#         Journal of Geophysical Research, 117, B04204, doi:10.1029/2011JB008968. 

#      We make no guarantees, expressed or implied, as to the usefulness of the software
#      and its documentation for any purpose.  We assume no responsibility to provide
#      technical support to users of this software.

#  SYSTEM specifies which compiler to use
#    Current available options are:
#      gfortran , ifort
#    This variable cannot be left blank
#      
SYSTEM = gfortran
#
#  RUN specifies which collection of compilation flags that should be run
#    Current available options are:
#      DEBUG : includes debugging info and issues warnings
#      PROF  : includes profiling flags with some optimization
#      OPT   : includes optimizations flags for fastest runtime
#    This variable cannot be left blank
RUN =DEBUG
#
INSTALLDIR=/opt/USGS
#INSTALLDIR=~/gcc
#
# DATA FORMATS
#  For each data format you want to include in the library, set the corresponding
#  variable below to 'T'.  Set to 'F' any you do not want compiled or any unavailable
USENETCDF = T
USEGRIB = T

# MEMORY
# If you need pointer arrays instead of allocatable arrays, set this to 'T'
USEPOINTERS = F

###############################################################################
#####  END OF USER SPECIFIED FLAGS  ###########################################
###############################################################################

FPPFLAGS = 
ifeq ($(USENETCDF), T)
 ncFPPFLAG = -DUSENETCDF
 ncOBJS = MetReader_NetCDF.o
 nclib = -lnetcdff -lnetcdf
else
 ncFPPFLAG =
 ncOBJS =
 nclib =
endif
ifeq ($(USEGRIB), T)
 grbFPPFLAG = -DUSEGRIB
 grbOBJS = MetReader_GRIB.o MetReader_GRIB_index.o
 # These are the libraries for grib_api
 #grblib = -lgrib_api_f90 -lgrib_api
 # These are the libraries for ecCodes
 grblib = -leccodes -leccodes_f90
else
 grb2FPPFLAG =
 grb2OBJS =
 grblib =
endif

ifeq ($(USEPOINTERS), T)
 memFPPFLAG = -DUSEPOINTERS
else
 memFPPFLAG =
endif

FPPFLAGS = -x f95-cpp-input $(ncFPPFLAG) $(grbFPPFLAG) $(grbFPPFLAG) $(memFPPFLAG)

# location of HoursSince and projection
USGSLIBDIR = -L$(INSTALLDIR)/lib
USGSINC = -I$(INSTALLDIR)/include
USGSLIB = $(USGSLIBDIR) $(USGSINC) -lhourssince -lprojection

EXEC = \
 gen_GRIB_index   \
 tools/MetSonde  \
 tools/MetTraj_F \
 tools/MetTraj_B \
 tools/MetCheck  \
 tools/makegfsncml

###############################################################################
###############################################################################

###############################################################################
##########  GNU Fortran Compiler  #############################################
ifeq ($(SYSTEM), gfortran)
    FCHOME=/usr
    FC = /usr/bin/gfortran

    COMPINC = -I$(FCHOME)/local/include -I$(FCHOME)/include -I$(FCHOME)/lib/x86_64-linux-gnu -I$(INSTALLDIR)/include -I$(FCHOME)/local/lib 
    COMPLIBS = -L$(FCHOME)/local/lib -L$(FCHOME)/lib/x86_64-linux-gnu -L${INSTALLDIR}/lib -I$(FCHOME)/lib

    #COMPINC = -I$(FCHOME)/include  -I$(INSTALLDIR)/include
    #COMPLIBS = -L$(FCHOME)/lib64 -L${INSTALLDIR}/lib

    LIBS = $(COMPLIBS) $(COMPINC) #-lefence
    # -lefence 
# Debugging flags
ifeq ($(RUN), DEBUG)
    FFLAGS =  -O0 -g3 -Wall -fbounds-check -pedantic -fimplicit-none -Wunderflow -Wuninitialized -ffpe-trap=invalid,zero,overflow -fdefault-real-8 
endif
# Profiling flags
ifeq ($(RUN), PROF)
    FFLAGS = -g -pg -w -fno-math-errno -funsafe-math-optimizations -fno-trapping-math -fno-signaling-nans -fcx-limited-range -fno-rounding-math -fdefault-real-8
endif
# Production run flags
ifeq ($(RUN), OPT)
    FFLAGS = -O3 -w -fno-math-errno -funsafe-math-optimizations -fno-trapping-math -fno-signaling-nans -fcx-limited-range -fno-rounding-math -fdefault-real-8
endif
    EXFLAGS =
endif
###############################################################################

all: libMetReader.a tools

libMetReader.a: MetReader.F90 MetReader.o $(ncOBJS) $(grbOBJS) MetReader_Grids.o MetReader_ASCII.o makefile
    ar rcs libMetReader.a MetReader.o $(ncOBJS) $(grbOBJS) MetReader_Grids.o MetReader_ASCII.o

MetReader.o: MetReader.F90 makefile
    $(FC) $(FPPFLAGS) $(EXFLAGS) -c MetReader.F90
MetReader_Grids.o: MetReader_Grids.f90 MetReader.o makefile
    $(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) -c MetReader_Grids.f90
MetReader_ASCII.o: MetReader_ASCII.f90 MetReader.o makefile
    $(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) -c MetReader_ASCII.f90

ifeq ($(USENETCDF), T)
MetReader_NetCDF.o: MetReader_NetCDF.f90 MetReader.o makefile
    $(FC) $(FPPFLAGS) $(FFLAGS) $(EXFLAGS) $(LIBS) $(nclib) $(USGSLIB) -c MetReader_NetCDF.f90
endif
ifeq ($(USEGRIB), T)
MetReader_GRIB_index.o: MetReader_GRIB_index.f90 makefile
    $(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) $(grblib) $(USGSLIB) -c MetReader_GRIB_index.f90
MetReader_GRIB.o: MetReader_GRIB.f90 MetReader_GRIB_index.o MetReader.o makefile
    $(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) $(grblib) -c MetReader_GRIB.f90
gen_GRIB_index: gen_GRIB_index.f90 MetReader_GRIB_index.o makefile libMetReader.a
    $(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) $(grblib) -c gen_GRIB_index.f90
    $(FC) $(FFLAGS) $(EXFLAGS) MetReader_GRIB_index.o gen_GRIB_index.o $(LIBS) $(grblib) -o gen_GRIB_index
endif


ifeq ($(USEGRIB), T)
  GRIBTOOL = gen_GRIB_index
else
  GRIBTOOL =
endif

tools: MetSonde MetTraj_F MetTraj_B MetCheck makegfsncml $(GRIBTOOL)

MetSonde: tools/MetSonde.f90 makefile libMetReader.a
    $(FC) $(FFLAGS) $(EXFLAGS) -L./ -lMetReader $(LIBS) $(nclib) $(grblib) -c tools/MetSonde.f90
    $(FC) $(FFLAGS) $(EXFLAGS) MetSonde.o  -L./ -lMetReader $(LIBS) $(nclib) $(grblib) $(USGSLIB) -o tools/MetSonde
MetTraj_F: tools/MetTraj.F90 makefile libMetReader.a
    $(FC) -x f95-cpp-input -DFORWARD  $(FFLAGS) $(EXFLAGS) tools/MetTraj.F90 -o tools/MetTraj_F $(LIBS) $(nclib) $(grblib) -L./ -lMetReader $(USGSLIB)
MetTraj_B: tools/MetTraj.F90 makefile libMetReader.a
    $(FC) -x f95-cpp-input -DBACKWARD $(FFLAGS) $(EXFLAGS) tools/MetTraj.F90 -o tools/MetTraj_B $(LIBS) $(nclib) $(grblib) -L./ -lMetReader $(USGSLIB)
MetCheck: tools/MetCheck.f90 makefile libMetReader.a
    $(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) $(nclib) $(grblib) -c tools/MetCheck.f90
    $(FC) $(FFLAGS) $(EXFLAGS) MetCheck.o $(LIBS) $(nclib) $(grblib) -L./ -lMetReader $(USGSLIB) -o tools/MetCheck
makegfsncml: tools/makegfsncml.f90 makefile
    $(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) $(nclib) -c tools/makegfsncml.f90
    $(FC) $(FFLAGS) $(EXFLAGS) makegfsncml.o  $(LIBS) $(nclib) -o tools/makegfsncml

clean:
    rm -f *.o
    rm -f *.mod
    rm -f lib*.a
    rm -f $(EXEC)

install:
    install -d $(INSTALLDIR)/lib/
    install -d $(INSTALLDIR)/include/
    install -d $(INSTALLDIR)/bin/
    install -d $(INSTALLDIR)/bin/autorun_scripts
    install -m 644 libMetReader.a $(INSTALLDIR)/lib/
    install -m 644 *.mod $(INSTALLDIR)/include/
    install -m 755 $(EXEC) $(INSTALLDIR)/bin/
    install -m 755 autorun_scripts/*.sh $(INSTALLDIR)/bin/autorun_scripts/

对此的任何帮助或建议将不胜感激。谢谢!

makefile
  • 1 个回答
  • 161 Views
Martin Hope
LvnTrvr
Asked: 2019-10-16 01:46:57 +0800 CST

配置错误“无法确定g++版本”

  • 2

我对使用 Ubuntu(18.04 版)比较陌生,并且正在尝试安装一个软件包以进行研究工作。该包可以从https://github.com/chetzer-ncpa/ncpaprop获得当我尝试运行 ./configure 时,我得到这个作为响应:

checking for bash... /bin/bash
checking for perl... /usr/bin/perl
checking for ranlib... ranlib
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for apt-get... apt-get
configure: enable-auto-dependencies =
configure: enable-library-guess =
checking for g++-4... no
checking for g++... g++
checking for gfortran... gfortran
checking for g++-4... no
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gcc-4... no
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking how to run the C preprocessor... gcc -E
configure: error: in `/home/trevor/Desktop/plz':
configure: error: g++ version cannot be determined
See `config.log' for more details

config.log 文件是:

    This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by NCPA Propagation Modeling Suite configure 1.3.20, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = trevor-VirtualBox
uname -m = x86_64
uname -r = 5.0.0-31-generic
uname -s = Linux
uname -v = #33~18.04.1-Ubuntu SMP Tue Oct 1 10:20:39 UTC 2019

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2288: checking for bash
configure:2306: found /bin/bash
configure:2318: result: /bin/bash
configure:2336: checking for perl
configure:2354: found /usr/bin/perl
configure:2366: result: /usr/bin/perl
configure:2438: checking for ranlib
configure:2454: found /usr/bin/ranlib
configure:2465: result: ranlib
configure:2521: checking build system type
configure:2535: result: x86_64-unknown-linux-gnu
configure:2555: checking host system type
configure:2568: result: x86_64-unknown-linux-gnu
configure:2650: checking for apt-get
configure:2666: found /usr/bin/apt-get
configure:2677: result: apt-get
configure:2698: enable-auto-dependencies = 
configure:2700: enable-library-guess = 
configure:2732: checking for g++-4
configure:2762: result: no
configure:2732: checking for g++
configure:2748: found /usr/bin/g++
configure:2759: result: g++
configure:2885: checking for gfortran
configure:2901: found /usr/bin/gfortran
configure:2912: result: gfortran
configure:3098: checking for g++-4
configure:3128: result: no
configure:3098: checking for g++
configure:3114: found /usr/bin/g++
configure:3125: result: g++
configure:3152: checking for C++ compiler version
configure:3161: g++ --version >&5
g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3172: $? = 0
configure:3161: g++ -v >&5
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) 
configure:3172: $? = 0
configure:3161: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3172: $? = 1
configure:3161: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
configure:3172: $? = 1
configure:3192: checking whether the C++ compiler works
configure:3214: g++    conftest.cpp  >&5
configure:3218: $? = 0
configure:3266: result: yes
configure:3269: checking for C++ compiler default output file name
configure:3271: result: a.out
configure:3277: checking for suffix of executables
configure:3284: g++ -o conftest    conftest.cpp  >&5
configure:3288: $? = 0
configure:3310: result: 
configure:3332: checking whether we are cross compiling
configure:3340: g++ -o conftest    conftest.cpp  >&5
configure:3344: $? = 0
configure:3351: ./conftest
configure:3355: $? = 0
configure:3370: result: no
configure:3375: checking for suffix of object files
configure:3397: g++ -c   conftest.cpp >&5
configure:3401: $? = 0
configure:3422: result: o
configure:3426: checking whether we are using the GNU C++ compiler
configure:3445: g++ -c   conftest.cpp >&5
configure:3445: $? = 0
configure:3454: result: yes
configure:3463: checking whether g++ accepts -g
configure:3483: g++ -c -g  conftest.cpp >&5
configure:3483: $? = 0
configure:3524: result: yes
configure:3601: checking for gcc-4
configure:3631: result: no
configure:3601: checking for gcc
configure:3617: found /usr/bin/gcc
configure:3628: result: gcc
configure:3659: checking for C compiler version
configure:3668: gcc --version >&5
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3679: $? = 0
configure:3668: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) 
configure:3679: $? = 0
configure:3668: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3679: $? = 1
configure:3668: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3679: $? = 1
configure:3683: checking whether we are using the GNU C compiler
configure:3702: gcc -c   conftest.c >&5
configure:3702: $? = 0
configure:3711: result: yes
configure:3720: checking whether gcc accepts -g
configure:3740: gcc -c -g  conftest.c >&5
configure:3740: $? = 0
configure:3781: result: yes
configure:3798: checking for gcc option to accept ISO C89
configure:3861: gcc  -c -g -O2  conftest.c >&5
configure:3861: $? = 0
configure:3874: result: none needed
configure:3947: checking for gfortran
configure:3963: found /usr/bin/gfortran
configure:3974: result: gfortran
configure:4000: checking for Fortran compiler version
configure:4009: gfortran --version >&5
GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4020: $? = 0
configure:4009: gfortran -v >&5
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) 
configure:4020: $? = 0
configure:4009: gfortran -V >&5
gfortran: error: unrecognized command line option '-V'
gfortran: fatal error: no input files
compilation terminated.
configure:4020: $? = 1
configure:4009: gfortran -qversion >&5
gfortran: error: unrecognized command line option '-qversion'; did you mean '--version'?
gfortran: fatal error: no input files
compilation terminated.
configure:4020: $? = 1
configure:4029: checking whether we are using the GNU Fortran compiler
configure:4042: gfortran -c   conftest.F >&5
configure:4042: $? = 0
configure:4051: result: yes
configure:4057: checking whether gfortran accepts -g
configure:4068: gfortran -c -g  conftest.f >&5
configure:4068: $? = 0
configure:4076: result: yes
configure:4110: checking how to run the C preprocessor
configure:4141: gcc -E  conftest.c
configure:4141: $? = 0
configure:4155: gcc -E  conftest.c
conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:4155: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "NCPA Propagation Modeling Suite"
| #define PACKAGE_TARNAME "ncpaprop"
| #define PACKAGE_VERSION "1.3.20"
| #define PACKAGE_STRING "NCPA Propagation Modeling Suite 1.3.20"
| #define PACKAGE_BUGREPORT "claus@olemiss.edu"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4180: result: gcc -E
configure:4200: gcc -E  conftest.c
configure:4200: $? = 0
configure:4214: gcc -E  conftest.c
conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:4214: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "NCPA Propagation Modeling Suite"
| #define PACKAGE_TARNAME "ncpaprop"
| #define PACKAGE_VERSION "1.3.20"
| #define PACKAGE_STRING "NCPA Propagation Modeling Suite 1.3.20"
| #define PACKAGE_BUGREPORT "claus@olemiss.edu"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4248: error: in `/home/trevor/Downloads/ncpaprop-master':
configure:4250: error: g++ version cannot be determined
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_FCFLAGS_set=
ac_cv_env_FCFLAGS_value=
ac_cv_env_FC_set=
ac_cv_env_FC_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_fc_compiler_gnu=yes
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_objext=o
ac_cv_path_BASHPATH=/bin/bash
ac_cv_path_PERLPATH=/usr/bin/perl
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_CXX_TEST=g++
ac_cv_prog_FC_TEST=gfortran
ac_cv_prog_PACKMAN=apt-get
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_ac_ct_FC=gfortran
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
ac_cv_prog_fc_g=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

AWK=''
BASHPATH='/bin/bash'
CC='gcc'
CFLAGS='-g -O2'
CPP='gcc -E'
CPPFLAGS=''
CXX='g++'
CXXFLAGS='-g -O2'
CXX_TEST='g++'
DEFS=''
DORUFLAGS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FC='gfortran'
FCFLAGS='-g -O2'
FC_TEST='gfortran'
GREP=''
INCLUDEFLAGS=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MPICXX=''
OBJEXT='o'
PACKAGE_BUGREPORT='claus@olemiss.edu'
PACKAGE_NAME='NCPA Propagation Modeling Suite'
PACKAGE_STRING='NCPA Propagation Modeling Suite 1.3.20'
PACKAGE_TARNAME='ncpaprop'
PACKAGE_URL=''
PACKAGE_VERSION='1.3.20'
PACKMAN='apt-get'
PATH_SEPARATOR=':'
PERLPATH='/usr/bin/perl'
PETSC_ARCH_COMPLEX=''
PETSC_ARCH_REAL=''
PETSC_DIR=''
PETSC_OS=''
PETSC_USE_MPI=''
PETSC_USE_SHARED_LIBRARIES='--with-shared-libraries'
PETSC_VERSION=''
POW_LIB=''
RANLIB='ranlib'
SHELL='/bin/bash'
SLEPC_DIR=''
SLEPC_USE_MPI=''
SLEPC_VERSION=''
STATICLIBS=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
ac_ct_FC='gfortran'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "NCPA Propagation Modeling Suite"
#define PACKAGE_TARNAME "ncpaprop"
#define PACKAGE_VERSION "1.3.20"
#define PACKAGE_STRING "NCPA Propagation Modeling Suite 1.3.20"
#define PACKAGE_BUGREPORT "claus@olemiss.edu"
#define PACKAGE_URL ""

configure: exit 1

对此的任何见解都将非常有帮助。

gcc configure g++
  • 1 个回答
  • 2294 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve