【问题标题】:Referenced at (1) not found in module in macbook monterey引用于 (1) not found in module in macbook monterey
【发布时间】:2021-12-22 13:49:51
【问题描述】:

我尝试在我的 macbook 上使用 gfortran 编译代码 https://github.com/msg-byu/enumlib。但是,它显示了以下错误。

 use io_utils, only: co_ca
                   1
Error: Symbol ‘co_ca’ referenced at (1) not found in module ‘io_utils’
make: *** [makeStr.o] Error 1

我尝试添加 -cpp 标志,但没有成功。你能帮帮我吗? 这是 Makefile。

当我添加co_ca 以在public 中定义时,它起作用了,但显示了一些警告,如下所示:

gfortran -fPIC -g -fbounds-check -Wall -ffree-line-length-none -fno-underscoring -I../symlib/src -c io_utils.f90
io_utils.f90:52:98:

   52 |   subroutine read_struct_enum_out(title,LatDim,pLV,nD,d,k,eq,Nmin,Nmax,eps,full,label,digit,cRange,fname)
      |                                                                                                  1
Warning: Unused dummy argument ‘crange’ at (1) [-Wunused-dummy-argument]
gfortran -fPIC -g -fbounds-check -Wall -ffree-line-length-none -fno-underscoring -I../symlib/src -c arrow_related.f90
gfortran -fPIC -g -fbounds-check -Wall -ffree-line-length-none -fno-underscoring -I../symlib/src -c tree_class.f90
tree_class.f90:483:18:

  483 |           index = index + binomial(nLeft-site_i, count(new_labeling(site_i:)==1)-1)
      |                  1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
tree_class.f90:224:14:

  224 |           I = I - nchoosek(ell-1,t-1)
      |              1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
tree_class.f90:110:37:

  110 |           self%branches(species_i) = nchoosek(sum(self%colors(species_i:)),self%colors(species_i))
      |                                     1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
gfortran -fPIC -g -fbounds-check -Wall -ffree-line-length-none -fno-underscoring -I../symlib/src -c labeling_related.f90
labeling_related.f90:1624:9:

 1624 |     nl = multinomial(iConc)
      |         1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
labeling_related.f90:1550:18:

 1550 |           count = count + (-1)**p*nchoosek(m,p)*tc
      |                  1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
labeling_related.f90:942:8:

  942 |     x = idx
      |        1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
labeling_related.f90:946:14:

  946 |        bnml = binomial(i-1,t-1)
      |              1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
labeling_related.f90:918:21:

  918 |              xTemp = xTemp + binomial(nLeft - iM, count(mask(iM:)==1)-1)
      |                     1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
labeling_related.f90:888:15:

  888 |        C(iK) = binomial(nLeft,conc(iK))
      |               1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
labeling_related.f90:727:20:

  727 |              quot = labIndx/multiplier(ilab) ! How many times does k(i) divide the number
      |                    1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
labeling_related.f90:310:83:

  310 |   SUBROUTINE generate_permutation_labelings(k,n,nD,perm,lab,iConc,parLabel,parDigit,degeneracy_list,fixed_cells)
      |                                                                                   1
Warning: Unused dummy argument ‘pardigit’ at (1) [-Wunused-dummy-argument]
labeling_related.f90:58:64:

   58 |   SUBROUTINE recursively_stabilized_enum(perm,conc,symsize,knary,SNF,LT,HNF,HNFcnt,hnf_degen,nfound,scount,fixOp,iBlock,equivalencies,inactives,permIndx,allowed,fixedcell,aperms)
      |                                                                1
Warning: Unused dummy argument ‘knary’ at (1) [-Wunused-dummy-argument]
labeling_related.f90:1487:35:

 1487 |   SUBROUTINE make_translation_group(d,trans)
      |                                   ^
Warning: ‘make_translation_group’ defined but not used [-Wunused-function]
labeling_related.f90:1583:52:

 1583 |   SUBROUTINE generate_disjoint_permutation_labelings(k,n,nD,perm,lab,iConc,parLabel,parDigit)
      |                                                    ^
Warning: ‘generate_disjoint_permutation_labelings’ defined but not used [-Wunused-function]
gfortran -fPIC -g -fbounds-check -Wall -ffree-line-length-none -fno-underscoring -I../symlib/src -c enumeration_routines.f90
gfortran -fPIC -g -fbounds-check -Wall -ffree-line-length-none -fno-underscoring -I../symlib/src -c derivative_structure_generator.f90
derivative_structure_generator.f90:1600:17:

 1600 |     size_count = size_count + this_count*nHNF
      |                 1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
derivative_structure_generator.f90:1601:18:

 1601 |     total_count = total_count + this_count*nHNF
      |                  1
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4) at (1) [-Wconversion]
gfortran -fPIC -g -fbounds-check -Wall -ffree-line-length-none -fno-underscoring -I../symlib/src -c enumeration_utilities.f90
enumeration_utilities.f90:86:57:

   86 |     if (minkowskiReduce) call minkowski_reduce_basis(sLV,sLV,eps)
      |                                                         1
Warning: Same actual argument associated with INTENT(OUT) argument ‘out’ and INTENT(IN) argument ‘in’ at (1)
ar ru libenum.a sorting.o enumeration_types.o io_utils.o arrow_related.o tree_class.o labeling_related.o enumeration_routines.o derivative_structure_generator.o enumeration_utilities.o
ar: creating archive libenum.a
ranlib  libenum.a
gfortran -fPIC -g -fbounds-check -Wall -ffree-line-length-none -fno-underscoring -I../symlib/src -c ../aux_src/makeStr.f90
../aux_src/makeStr.f90:13:67:

   13 | integer ioerr, iline, ic, i, ilab, pgOps, nD, hnfN, iAt, jAt, iSpec, nSpec, idx, foutput_unit
      |                                                                   1
Warning: Unused variable ‘ispec’ declared at (1) [-Wunused-variable]
gfortran  -o makestr.x makeStr.o libenum.a ../symlib/src/libcomparestructs.a ../symlib/src/libutils.a ../symlib/src/libsym.a ../symlib/src/librational.a ../symlib/src/libcombinatorics.a

【问题讨论】:

  • 您是否正在使用上述库编译自写部分,因为看起来引用的 co_ca 是库中的 private 成员
  • co_ca 写在模块 io_utils "call co_ca(10,err)" 中。我在图书馆里没看到。
  • 私有函数可以在它定义的模块中使用,但很可能不会被导出也不会写入.mod文件
  • 我不确定我应该做什么。我已经向编码员报告了,但直到现在没有任何回应。
  • 从院长和教学回来,我太忙了,无法跟上我所有的 github 存储库。我希望在 4 月底开始解决所有未解决的问题和 PRs

标签: gfortran


【解决方案1】:

好吧,只要存储库中的人没有做出反应,此时对您来说最好的解决方案可能就是调整您的本地代码。

在文件 src/io_utils.f90 中,您可以更改行(当前在主 11 和 12 中):

public read_input, write_lattice_symmetry_ops, write_rotperms_list, read_in_cells_from_file, &
       read_struct_enum_out, read_arrows, check_for_fixed_cells

public read_input, write_lattice_symmetry_ops, write_rotperms_list, read_in_cells_from_file, &
       read_struct_enum_out, read_arrows, check_for_fixed_cells, co_ca

所以只需将 co_ca 添加到当前主线 12。

免责声明:我没有编译该项目。

【讨论】:

  • 谢谢。它适用于一些变暖“警告:在 (1) [-Wconversion] 处从 INTEGER(8) 到 INTEGER(4) 的转换中值可能发生变化”。
  • 你在哪里看到这些警告,请完整参考。
  • 我在这里发布警告link
  • 将其添加到您的问题中,即您找到的消息的全文(或至少是开头),大多数人不想在外部链接中看到它(风险),他们可能不会坚持不懈。
  • @BinhThien 如果您不想开始大规模修复代码,您对这些警告无能为力。它们与您的原始错误无关。要么忽略它们,要么使它们保持沉默,或者您已经开始详细调查并开始推理这些值的所有可能大小。或者您可以使用一些提升选项将所有整数移动到 8 个字节,但这是有风险的,并且可能会导致其自身的一系列问题。我的建议是忽略。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-06
  • 1970-01-01
  • 2020-02-18
相关资源
最近更新 更多