Hello, I believe you need to change the link command so that it is linking libnetcdf and then libnetcdff. You might also try updating to the most recent versions of netCDF-C (4.6.3 at this moment, 4.7.0 later today) and netCDF-Fortran (4.4.5). I hope this helps, -Ward > Hi, > > I tried using linuxbrew on a linux server to build netcdf fortran and c > libraries. > netcdf-c-4.6.2-rc2 > > ./nc-config --all > > This netCDF 4.6.2-rc2 has been built with the following features: > > --cc -> gcc > --cflags -> > -I/proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/include > --libs -> > -L/proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/lib > -lnetcdf > > --has-c++ -> no > --cxx -> > > --has-c++4 -> no > --cxx4 -> > > --has-fortran -> yes > --fc -> nf-config not yet implemented for cmake builds > --fflags -> nf-config not yet implemented for cmake builds > --flibs -> nf-config not yet implemented for cmake builds > --has-f90 -> nf-config not yet implemented for cmake builds > --has-f03 -> nf-config not yet implemented for cmake builds > > --has-dap -> no > --has-dap2 -> no > --has-dap4 -> no > --has-nc2 -> yes > --has-nc4 -> no > --has-hdf5 -> no > --has-hdf4 -> no > --has-logging -> no > --has-pnetcdf -> no > --has-szlib -> > --has-cdf5 -> yes > --has-parallel4 -> no > --has-parallel -> no > > --prefix -> > /proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0 > --includedir -> > /proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/include > --libdir -> > /proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/lib > --version -> netCDF 4.6.2-rc2 > > ./nf-config --all > > This netCDF-Fortran 4.4.4 has been built with the following features: > > --cc -> gcc > --cflags -> > -I/proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/include > > --fc -> gfortran > --fflags -> > -I/proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/include > --flibs -> > -L/proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/lib > -lnetcdff -lnetcdf -lnetcdf > --has-f90 -> no > --has-f03 -> yes > > --has-nc2 -> yes > --has-nc4 -> yes > > --prefix -> > /proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0 > --includedir-> > /proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/include > --version -> netCDF-Fortran 4.4.4 > > > I am getting the following undefined references at link time for a program > called mcip, and can't figure out why. > gfortran -o mcip.exe > -I/proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/include > > -I/proj/ie/proj/CMAS/CMAQ/CMAQv5.3_branch_UNC3/openmpi_3.0.0_gcc_6.3.0/lib/x86_64/gcc/ioapi/modules > mcip.o alloc_ctm.o alloc_met.o alloc_x.o bcldprc_ak.o blddesc.o chkwpshdr.o > chkwrfhdr.o close_files.o collapx.o comheader.o comheader_lufrac.o > comheader_mos.o comheader_soi.o cori.o dealloc_ctm.o dealloc_met.o > dealloc_x.o detangle_soil_px.o e_aerk.o dynflds.o getgist.o getluse.o > getmet.o getpblht.o getpsih.o getsdt.o getversion.o graceful_stop.o gridout.o > init_io.o init_met.o init_x.o julian.o layht.o ll2xy_lam.o ll2xy_lam_sec.o > ll2xy_lam_tan.o ll2xy_merc.o ll2xy_ps.o locate.o lucro.o mapfac_lam.o > mapfac_merc.o mapfac_ps.o metcro.o metdot.o metgrid2ctm.o metvars2ctm.o > mm5v3opts.o moscro.o pblsup.o ptemp.o pvs.o qsat.o rdmm5v3.o rdwrfem.o > readnml.o readter.o refstate.o resistcalc.o setgriddefs.o setup.o > setup_mm5v3.o setup_wrfem.o sfclayer.o soilcro.o statflds.o vertarys.o ve rtnhy.o vertnhy_wrf.o vstamp.o vtemp.o wind.o wrfemopts.o wrgdesc.o xy2ll_lam.o xy2ll_merc.o const_mod.o const_pbl_mod.o coord_mod.o date_time_mod.o date_pack_mod.o files_mod.o groutcom_mod.o luoutcom_mod.o luvars_mod.o mcipparm_mod.o mcoutcom_mod.o mdoutcom_mod.o metinfo_mod.o metvars_mod.o mosoutcom_mod.o soioutcom_mod.o vgrd_mod.o wrf_netcdf_mod.o xvars_mod.o sat2mcip_mod.o -L/proj/ie/proj/CMAS/CMAQ/CMAQv5.3_branch_UNC3/openmpi_3.0.0_gcc_6.3.0/lib/x86_64/gcc/ioapi/lib -lioapi -L/proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/openmpi_3.0.0_gcc_6.3.0/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz > /nas/longleaf/home/lizadams/.linuxbrew/Homebrew/bin/ld: > /proj/ie/proj/CMAS/CMAQ/CMAQv5.3_branch_UNC3/openmpi_3.0.0_gcc_6.3.0/lib/x86_64/gcc/ioapi/lib/libnetcdff.a(nf_nc4.o): > in function `nf_inq_ncid_': > /proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/netcdf-fortran/fortran/nf_nc4.f90:150: > undefined reference to `nc_inq_ncid' > /nas/longleaf/home/lizadams/.linuxbrew/Homebrew/bin/ld: > /proj/ie/proj/CMAS/CMAQ/CMAQv5.3_branch_UNC3/openmpi_3.0.0_gcc_6.3.0/lib/x86_64/gcc/ioapi/lib/libnetcdff.a(nf_nc4.o): > in function `nf_inq_grps_': > /proj/ie/proj/staff/lizadams/netcdf-c-4.6.2-rc2/netcdf-fortran/fortran/nf_nc4.f90:195: > undefined reference to `nc_inq_grps' > > Thank you for any assistance. > > Liz > > Ticket Details =================== Ticket ID: OAL-569939 Department: Support netCDF Priority: Normal Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.