电脑音乐应用和Haskell安装Euterpea

问题描述 投票:4回答:1

我跟着指示这里http://www.euterpea.com安装Euterpea(领域特定语言嵌入在Haskell电脑音乐应用程序),我收到一条消息,某些包和东西安装失败(请参见下面的代码)。我怎样才能安装剩余的包?

Mo-MacBook-Pro:~ Mo$ cabal update
Downloading the latest package list from hackage.haskell.org
cabal install Euterpea
To revert to previous state run:
cabal update --index-state='2018-06-25T08:34:14Z'
Mo-MacBook-Pro:~ Mo$ cabal install Euterpea
clang: warning: argument unused during compilation: '-nopie' [-Wunused-         
command-line-argument]
Resolving dependencies...
Downloading heap-1.0.4...
Downloading PortMidi-0.1.6.1...
Configuring PortMidi-0.1.6.1...
Downloading lazysmallcheck-0.6...
Configuring heap-1.0.4...
Downloading semigroups-0.18.5...
Configuring lazysmallcheck-0.6...
Configuring semigroups-0.18.5...
Building heap-1.0.4...
Building PortMidi-0.1.6.1...
Building lazysmallcheck-0.6...
Building semigroups-0.18.5...
Installed semigroups-0.18.5
Downloading stm-2.5.0.0...
Configuring stm-2.5.0.0...
Installed lazysmallcheck-0.6
Downloading HCodecs-0.5.1...
Installed heap-1.0.4
Downloading Stream-0.4.7.2...
Configuring HCodecs-0.5.1...
Configuring Stream-0.4.7.2...
Building stm-2.5.0.0...
Building HCodecs-0.5.1...
Building Stream-0.4.7.2...
Failed to install HCodecs-0.5.1
Build log ( /Users/Mo/.cabal/logs/ghc-8.4.3/HCodecs-0.5.1-    
BtnY8oBJJ5FGnsoQaqbvOm.log ):
cabal: Entering directory      
'/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-   
5294/HCodecs-0.5.1'
Configuring HCodecs-0.5.1...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-     
command-line-argument]
Preprocessing library for HCodecs-0.5.1..
Building library for HCodecs-0.5.1..
<command line>: cannot satisfy -package-id random-1.1-    
7T1TXpwb46H1j0av1OnVaD
(use -v for more information)
cabal: Leaving directory    
'/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-  
5294/HCodecs-0.5.1'
Failed to install Stream-0.4.7.2
Build log ( /Users/Mo/.cabal/logs/ghc-8.4.3/Stream-0.4.7.2-    
ES6rey5IgWg9tsXDghlP7Y.log ):
cabal: Entering directory     
'/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-    
5295/Stream-0.4.7.2'
Warning: Stream.cabal:6:4: Tabs used as indentation at 6:4, 12:4, 13:4,    
14:4,
15:4, 16:4, 17:4
Configuring Stream-0.4.7.2...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-   
command-line-argument]
Preprocessing library for Stream-0.4.7.2..
Building library for Stream-0.4.7.2..
<command line>: cannot satisfy -package-id QuickCheck-2.11.3-    
4Q6LQ7mN6Tj8otrLuHN0se
(use -v for more information)
cabal: Leaving directory    
'/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-    
5295/Stream-0.4.7.2'
Installed PortMidi-0.1.6.1
Installed stm-2.5.0.0
cabal: Error: some packages failed to install:
Euterpea-2.0.6-LLo28S848YneLemh6QUkK depends on Euterpea-2.0.6 which     
failed to
install.
HCodecs-0.5.1-BtnY8oBJJ5FGnsoQaqbvOm failed during the building phase.          
The
exception was:
ExitFailure 1
Stream-0.4.7.2-ES6rey5IgWg9tsXDghlP7Y failed during the building phase.     
The
exception was:
ExitFailure 1
arrows-0.4.4.2-GLke2GgDEro6Tzj3MGmTOB depends on arrows-0.4.4.2 which     
failed
to install.

这将是巨大的,如果有人可以帮助。谢谢。

我已经包括了所有的代码,以免被省略了某些特定的相关细节。


编辑

我也试图通过堆叠安装Euterpea。我得到这个消息:

Mo-MacBook-Pro:~ Mo$ stack install Euterpea

Error: While constructing the build plan, the following exceptions were     
encountered:


In the dependencies for Euterpea-2.0.6:
PortMidi must match ==0.1.6.1, but the stack configuration has no   specified version  (latest matching version is 0.1.6.1)
arrows must match >=0.4 && <0.5, but the stack configuration has no specified version  (latest matching version is 0.4.4.2)
needed since Euterpea is a build target.

Some different approaches to resolving this:

  * Consider trying 'stack solver', which uses the cabal-install solver     to attempt to find some working build configuration. This can be convenient     when dealing with many complicated constraint
    errors, but results may be unpredictable.

  * Recommended action: try adding the following to your extra-deps in     /Users/Mo/.stack/global-project/stack.yaml:

- PortMidi-0.1.6.1
- arrows-0.4.4.2

Plan construction failed.

- 编辑2。

如下面所建议的,我试图cabal install random-1.1 --force-reinstalls其产生:

 clang: warning: argument unused during compilation: '-nopie' [-    Wunused-command-line-argument]
 Resolving dependencies...
 Warning: The following packages are likely to be broken by the      reinstalls:
 tf-random-0.5
 QuickCheck-2.11.3
 Continuing even though the plan contains dangerous reinstalls.
 Configuring random-1.1...
 Building random-1.1...
 Installed random-1.1

然后

 Mo-MacBook-Pro:~ Mo$ cabal install Euterpea
 clang: warning: argument unused during compilation: '-nopie' [-   Wunused-command-line-argument]
 Resolving dependencies...
 Configuring Stream-0.4.7.2...
 Configuring HCodecs-0.5.1...
 Building HCodecs-0.5.1...
 Building Stream-0.4.7.2...
 Failed to install HCodecs-0.5.1
 Build log ( /Users/lukeburke/.cabal/logs/ghc-8.4.3/HCodecs-0.5.1-    BtnY8oBJJ5FGnsoQaqbvOm.log ):
 cabal: Entering directory      '/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-20742/HCodecs-     0.5.1'
 Configuring HCodecs-0.5.1...
 clang: warning: argument unused during compilation: '-nopie' [-    Wunused-command-line-argument]
 Preprocessing library for HCodecs-0.5.1..
 Building library for HCodecs-0.5.1..
 <command line>: cannot satisfy -package-id random-1.1-   7T1TXpwb46H1j0av1OnVaD
     (use -v for more information)
 cabal: Leaving directory '/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-20742/HCodecs-  0.5.1'
 Failed to install Stream-0.4.7.2
 Build log ( /Users/Mo/.cabal/logs/ghc-8.4.3/Stream-0.4.7.2-     ES6rey5IgWg9tsXDghlP7Y.log ):
 cabal: Entering directory '/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-20743/Stream-  0.4.7.2'
 Warning: Stream.cabal:6:4: Tabs used as indentation at 6:4, 12:4,    13:4, 14:4,
 15:4, 16:4, 17:4
 Configuring Stream-0.4.7.2...
 clang: warning: argument unused during compilation: '-nopie' [-  Wunused-command-line-argument]
 Preprocessing library for Stream-0.4.7.2..
 Building library for Stream-0.4.7.2..
 <command line>: cannot satisfy -package-id QuickCheck-2.11.3-    4Q6LQ7mN6Tj8otrLuHN0se
(use -v for more information)
 cabal: Leaving directory   '/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-20743/Stream-    0.4.7.2'
 cabal: Error: some packages failed to install:
 Euterpea-2.0.6-LLo28S848YneLemh6QUkK depends on Euterpea-2.0.6 which   failed to
 install.
 HCodecs-0.5.1-BtnY8oBJJ5FGnsoQaqbvOm failed during the building phase.     The
 exception was:
 ExitFailure 1
 Stream-0.4.7.2-ES6rey5IgWg9tsXDghlP7Y failed during the building   phase. The
 exception was:
 ExitFailure 1
 arrows-0.4.4.2-GLke2GgDEro6Tzj3MGmTOB depends on arrows-0.4.4.2 which   failed
 to install.

编辑3

有人提出以下多个包拙劣,我应该尝试重新安装所有的人(在一个单一的命令,即cabal install random tf-random QuickCheck Euterpea --force-reinstalls

不过,如果我写cabal install random tf-random QuickCheck Euterpea --force-reinstalls我收到下面的代码:

 clang: warning: argument unused during compilation: '-nopie' [-   Wunused-command-line-argument]
 Resolving dependencies...
 Warning: The following packages are likely to be broken by the   reinstalls:
 QuickCheck-2.11.3
 Continuing even though the plan contains dangerous reinstalls.
 Downloading erf-2.0.0.0...
 Configuring random-1.1...
 Configuring erf-2.0.0.0...
 Building random-1.1...
 Building erf-2.0.0.0...
 Installed erf-2.0.0.0
 Installed random-1.1
 Downloading tf-random-0.5...
 Configuring tf-random-0.5...
 Building tf-random-0.5...
 Failed to install tf-random-0.5
Build log ( /Users/Mo/.cabal/logs/ghc-8.4.3/tf-random-0.5-  ADZoyzEXgHe6hyR0Bycce0.log ):
 cabal: Entering directory      '/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-21584/tf-   random-0.5'
 Configuring tf-random-0.5...
 clang: warning: argument unused during compilation: '-nopie' [-   Wunused-command-line-argument]
 Preprocessing library for tf-random-0.5..
Building library for tf-random-0.5..
 <command line>: cannot satisfy -package-id primitive-0.6.4.0-  9k41Y6ToOAE8KXK6VMGV2O
     (use -v for more information)
 cabal: Leaving directory   '/var/folders/dy/q51p3v595kbd8_wclmt80v700000gn/T/cabal-tmp-21584/tf-   random-0.5'
 cabal: Error: some packages failed to install:
 Euterpea-2.0.6-87WYqltNL8w8teqXOsc4TL depends on Euterpea-2.0.6 which    failed
 to install.
 HCodecs-0.5.1-DrGKEnNk6EBHti2goL6KP5 depends on HCodecs-0.5.1 which.  failed to
 install.
 QuickCheck-2.12.6.1-KuXpgimNOXzF2SmGPEs5LR depends on QuickCheck-  2.12.6.1
 which failed to install.
 Stream-0.4.7.2-FedzVSwUnWMDxlzmPNWt7x depends on Stream-0.4.7.2 which   failed
 to install.
 arrows-0.4.4.2-EGvZPpby4BcD99TcXDoCg4 depends on arrows-0.4.4.2 which.  failed
 to install.
 tf-random-0.5-ADZoyzEXgHe6hyR0Bycce0 failed during the building phase.   The
 exception was:
 ExitFailure 1

我能做些什么来安装Euterpea?

haskell dsl euterpea
1个回答
4
投票

安装Euterpea包

这个答案使用12.26 LTS,因为我已经验证了它的工作原理,但是这应该对大多数LTS发行版上工作(见步骤2细节的底部)。

  1. 创建一个新的Stack项目: stack new euter-test cd euter-test
  2. 编辑stack.yaml并设置LTS至12.26和extra-deps指定是不存在的,但LTS上存在Hackage包的版本: resolver: lts-12.26 ... extra-deps: - Euterpea-2.0.6 - PortMidi-0.1.6.1 - arrows-0.4.4.2 - Stream-0.4.7.2 - lazysmallcheck-0.6 你得到的堆栈中的错误安装(“PortMidi必须== 0.1.6.1匹配,但堆栈配置没有指定版本”)表明您使用的是包需要一个库的特定版本,但包库(LTS快照)不包含该库,所以你需要明确指定它。堆栈话库和版本缺少它打印,所以你可以不断尝试stack build和库添加到构建成功。 我们用LTS 12.26这里,但通过添加上述的extra-deps包,你应该能够得到它的工作在任何LTS。
  3. 编辑package.yaml并添加Euterpea到依赖性列表: dependencies: ... - Euterpea
  4. 一个简单的测试中app/Main.hsmodule Main where import Euterpea main :: IO () main = play $ c 4 qn
  5. 运行stack buildlazysmallcheck-0.6: download heap-1.0.4: download heap-1.0.4: configure HCodecs-0.5.1: download PortMidi-0.1.6.1: download heap-1.0.4: build lazysmallcheck-0.6: configure lazysmallcheck-0.6: build HCodecs-0.5.1: configure HCodecs-0.5.1: build PortMidi-0.1.6.1: configure heap-1.0.4: copy/register lazysmallcheck-0.6: copy/register PortMidi-0.1.6.1: build Stream-0.4.7.2: download Stream-0.4.7.2: configure Stream-0.4.7.2: build Stream-0.4.7.2: copy/register PortMidi-0.1.6.1: copy/register arrows-0.4.4.2: download arrows-0.4.4.2: configure arrows-0.4.4.2: build arrows-0.4.4.2: copy/register HCodecs-0.5.1: copy/register Euterpea-2.0.6: download Euterpea-2.0.6: configure Euterpea-2.0.6: build Euterpea-2.0.6: copy/register Building all executables for `euter' once. After a successful build of all of them, only specified executables will be rebuilt. euter-0.1.0.0: configure (lib + exe) Configuring euter-0.1.0.0... euter-0.1.0.0: build (lib + exe) Preprocessing library for euter-0.1.0.0.. Building library for euter-0.1.0.0.. [1 of 2] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/Lib.o ) [2 of 2] Compiling Paths_euter ( .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/autogen/Paths_euter.hs, .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/Paths_euter.o ) Preprocessing executable 'euter-exe' for euter-0.1.0.0.. Building executable 'euter-exe' for euter-0.1.0.0.. [1 of 2] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/euter-exe/euter-exe-tmp/Main.o ) [2 of 2] Compiling Paths_euter ( .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/euter-exe/autogen/Paths_euter.hs, .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/euter-exe/euter-exe-tmp/Paths_euter.o ) Linking .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/euter-exe/euter-exe ... euter-0.1.0.0: copy/register Installing library in <...> Installing executable euter-exe in <...> Registering library for euter-0.1.0.0..
  6. 如果你正在运行一个MIDI合成器运行由项目生成的可执行应该发出声音: stack exec euter-test-exe

故障排除

  • 如果你得到像*** Exception: No MIDI outputs!一个错误,那么你就没有运行MIDI合成(见下文)。确保你在后台运行(例如,在另一端)。
  • 如果你没有得到一个错误,但没有音频输出,尝试在GHCI运行devices,看看有什么输出可用,然后用它代替playDev x,其中play是合成器输入端口的OutputDeviceID x。例如: > devices Input devices: InputDeviceID 1 Midi Through Port-0 Output devices: OutputDeviceID 0 Midi Through Port-0 OutputDeviceID 2 Synth input port (25952:0) > playDev 2 $ c 4 qn
  • 如果您运行devices并没有看到任何合成器输入端口,但你必须在后台运行fluidsynth,那么你可能需要重新启动ghci,然后再试一次。

运行MIDI合成器

这里有一个快速一步一步得到Fluidsynth在Debian运行(与猜测,在前进的道路上设置Mac)。

  1. 安装fluidsynth:在Debian这是sudo apt install fluidsynth,在Mac上它可能是brew install fluidsynth - 有关于如何做到这一点有好几篇文章,如有疑问它只是谷歌。
  2. 运行fluidsynth:在Debian使用ALSA这是 fluidsynth -s -a alsa -m alsa_seq /usr/share/sounds/sf2/FluidR3_GM.sf2 指示fluidsynth在服务器模式下运行,使用alsa作为音频驱动程序和alsa_seq作为MIDI驱动程序,并使用SoundFont音色FluidR3_GM.sf2(应安装的fluidsynth安装的一部分)。 在Mac上,这似乎是正确的命令行是: fluidsynth -s -a coreaudio -m coremidi /usr/share/sounds/sf2/FluidR3_GM.sf2 如果你不能找到FluidR3_GM.sf2文件,那么它很可能它被安装在不同的位置。作为最后的手段,你可以下载一个音色库文件和使用,而不是由FluidSynth提供的一个。 运行之后,你应该给一个提示,也许一些警告,并fluidsynth将运行。请确保它的使用Euterpea之前运行,并保持它在使用Euterpea运行。
© www.soinside.com 2019 - 2024. All rights reserved.