小编Chr*_*ite的帖子

如何在cabal-dev安装中启用分析?

我正试图描述一个程序的数字,它有一些依赖性.Per Aleksander Dmitrov在Profile Haskell中的答案没有为所有依赖项安装分析库,我使用cabal-dev来(尝试)构建所有依赖项并启用分析.我试过了

  • cabal-dev install --config=./cabal-dev.config,其中cabal-dev.config是

    library-profiling: True
    executable-profiling: True
    package-db: /home/christopher/school/senior/senior_thesis/windingnumber_integration/cabal-dev/packages-7.6.1.conf
    local-repo: /home/christopher/school/senior/senior_thesis/windingnumber_integration/cabal-dev/packages
    user-install: False
    remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
    remote-repo-cache: /home/christopher/.cabal/packages
    optimization: True
    build-summary: /home/christopher/school/senior/senior_thesis/windingnumber_integration/cabal-dev/logs/build.log
    remote-build-reporting: anonymous
    optimization: True
    
    install-dirs user
      prefix: /home/christopher/school/senior/senior_thesis/windingnumber_integration/cabal-dev/
    install-dirs global
    
    Run Code Online (Sandbox Code Playgroud)
  • cabal-dev install --cabal-install-arg='--enable-library-profiling' --cabal-install-arg='--enable-executable-profiling'

(rm -rf cabal-dev当然,介于两者之间,从原始环境开始.)在每种情况下,我得到:

arch% cabal-dev/bin/windingnumber +RTS -p
cabal-dev/bin/windingnumber +RTS -p
windingnumber: the flag -p requires the program to be built with -prof
windingnumber: 
windingnumber: Usage: <prog> <args> [+RTS <rtsopts> | -RTS <args>] ... --RTS …
Run Code Online (Sandbox Code Playgroud)

profiling haskell cabal

9
推荐指数
1
解决办法
2138
查看次数

链接fortran模块:“未定义的引用”

我试图在模块中编写一些函数/子例程,以在同一模块中调用另一个函数并遇到链接器错误。一个显示相同行为的玩具示例:

!in test.f

module m1
  implicit none
contains
  real function mult(a, b)
    real :: a
    real :: b
    mult = a * b
    return
  end function mult

  real function sq(a)
    real :: a, mult
    sq = mult(a, a)
    return
  end function sq

end module m1

program main
use m1
write(*,*) sq(2.0)
end program
Run Code Online (Sandbox Code Playgroud)

当我尝试对此进行编译时,我遇到了麻烦:

[christopher@archlinux metropolis]$ gfortran -ffree-form test.f
/tmp/ccpzdTLE.o: In function `__m1_MOD_sq':
test.f:(.text+0x20): undefined reference to `mult_'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

另一方面,仅编译(gfortran -c -ffree-form test.f …

linker fortran module gfortran

5
推荐指数
1
解决办法
8984
查看次数

标签 统计

cabal ×1

fortran ×1

gfortran ×1

haskell ×1

linker ×1

module ×1

profiling ×1