How to install for M1 Mac

I wrote an article about how to install Tidal Cycles on M1-Mac.
but this original article is japanese only. I use the google Translation.

If you have a problem of install, please read it.

Thank you.

barbe_gnerative_diary/Tidal Cycles How to install for M1 Mac

4 Likes

Looking around at Haskell issues on the M1, I also came across this:
GHC leaks LLVM's llc processes on a package with large number of modules on macOS (#20305) · Issues · Glasgow Haskell Compiler / GHC · GitLab
which might be making things more complicated. It looks like this has been fixed in GHC 9 but may still exist in GHC 8

1 Like

Hi bgold

That advice was so helpful- thank you!
I will try to use GHC9.

GHC 9.2.2 (latest) worked. And it don't need llvm.
I rewrote my article! Thank you.

1 Like

Hello,
I'm having a hard time with a new install on an M1 MBP with Monterey. I believe that I've installed all of the components by frankensteinging instructions from a few different threads and the ones linked above.

I'm getting the following errors from VSCODE:

Summary
GHCi, version 9.2.2: https://www.haskell.org/ghc/  :? for help
ghci> ghci> Warning: GHCi | 
Warning: GHCi | <no location info>: error:
Warning: GHCi |     Could not load module ‘Sound.OSC.FD’
Warning: GHCi |     It is a member of the hidden package ‘hosc-0.19.1’.
Warning: GHCi |     You can run ‘:set -package hosc’ to expose it.
Warning: GHCi |     (Note: this unloads all the modules in the current scope.)
[TidalCycles version 1.8.0]
Installed in /Users/lightning/.cabal/store/ghc-9.2.2/tdl-1.8.0-cadf1346/share
Listening for external controls on 127.0.0.1:6010
Connected to SuperWarning: GHCi | 
Dirt.
Warning: GHCi | <interactive>:37:17: error:
Warning: GHCi |     Not in scope: ‘O.time’
Warning: GHCi |     No module named ‘O’ is imported.
Warning: GHCi | 
Warning: GHCi | <interactive>:230:13: error:
Warning: GHCi |     • Variable not in scope: setcps :: t -> t1
Warning: GHCi |     • Perhaps you meant one of these:
Warning: GHCi |         ‘Tempo.setCps’ (imported from Sound.Tidal.Tempo),
Warning: GHCi |         ‘steps’ (imported from Sound.Tidal.Context)
Warning: GHCi | 
Warning: GHCi | <interactive>:231:13: error:
Warning: GHCi |     • Variable not in scope: setcps :: t -> t1
Warning: GHCi |     • Perhaps you meant one of these:
Warning: GHCi |         ‘Tempo.setCps’ (imported from Sound.Tidal.Tempo),
Warning: GHCi |         ‘steps’ (imported from Sound.Tidal.Context)
tidal> Warning: GHCi | 
Warning: GHCi | <interactive>:250:1: error:
Warning: GHCi |     • Variable not in scope: d1 :: ControlPattern -> b
Warning: GHCi |     • Perhaps you meant ‘dt’ (imported from Sound.Tidal.Context)
tidal> ```

It seems like I haven't been able to properly give GHC a path but my attempts to do that haven't worked.
Thanks for any suggestions!

EDIT: Any ideas @yaxu

It does seem the Tidal library is itself installed correctly (it's finding the modules), but it looks like your startup file is trying to load something from the "hosc" package, which has been installed as "hidden" (which is the default).

That's not normally part of the startup, so I don't know why it's doing that. So you could either figure out where something is trying to import Sound.OSC.FD and get rid of it, or you tell the system to "unhide" the hosc library by doing cabal install --lib hosc

1 Like

This worked. Thanks so much!!!
B

1 Like

Thanks for writing this article! Couldn't get tidalcycles to work on my M1 until I followed your steps.

1 Like

Thank you for sharing this, was lucky to find it soon enough :slight_smile:

1 Like

Hi barbe & all. longtime tidal user but setting it up fresh on a new M1 Mac and running into problems. Thanks barbe for the helpful guide. I've followed it carefully and it has got me the closest of any info I've found, but unfortunately still running into problems.

When I install tidal, I get the below log. If anyone could advise about what to try next, I'd be grateful. Thanks

Tom

Last login: Tue Sep 27 21:35:25 on ttys001
tom@Toms-MBP ~ % cabal update                                                                                               
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date at index-state 2022-09-27T20:19:21Z
tom@Toms-MBP ~ % cabal install tidal --lib                                                                                  
Resolving dependencies...
Build profile: -w ghc-9.2.2 -O1
In order, the following will be built (use -v for more details):
 - clock-0.8.3 (lib) (requires build)
 - hsc2hs-0.68.8 (exe:hsc2hs) (requires build)
 - primitive-0.7.4.0 (lib) (requires build)
 - splitmix-0.1.0.4 (lib) (requires build)
 - tidal-link-1.0.1 (lib) (requires build)
 - network-3.1.2.7 (lib:network) (requires build)
 - random-1.2.1.1 (lib) (requires build)
 - hosc-0.19.1 (lib) (requires build)
 - tidal-1.9.2 (lib) (requires build)
Starting     clock-0.8.3 (lib)
Starting     primitive-0.7.4.0 (lib)
Starting     hsc2hs-0.68.8 (exe:hsc2hs)
Starting     splitmix-0.1.0.4 (lib)
Starting     tidal-link-1.0.1 (lib)
Building     clock-0.8.3 (lib)
Building     splitmix-0.1.0.4 (lib)
Building     hsc2hs-0.68.8 (exe:hsc2hs)
Building     primitive-0.7.4.0 (lib)

Failed to build clock-0.8.3.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/clck-0.8.3-54c8492a.log ):
Configuring library for clock-0.8.3..
Preprocessing library for clock-0.8.3..
linking dist/build/System/Clock_hsc_make.o failed (exit code 1)
rsp file was: "dist/build/System/hsc2hscall4153-2.rsp"
command was: /usr/bin/gcc dist/build/System/Clock_hsc_make.o dist/build/System/Clock_hsc_utils.o -o dist/build/System/Clock_hsc_make --target=arm64-apple-darwin --target=arm64-apple-darwin -fuse-ld=lld -L/Users/tom/.ghcup/ghc/9.2.2/lib/ghc-9.2.2/lib/../lib/aarch64-osx-ghc-9.2.2/base-4.16.1.0 -liconv -L/Users/tom/.ghcup/ghc/9.2.2/lib/ghc-9.2.2/lib/../lib/aarch64-osx-ghc-9.2.2/ghc-bignum-1.2 -L/Users/tom/.ghcup/ghc/9.2.2/lib/ghc-9.2.2/lib/../lib/aarch64-osx-ghc-9.2.2/ghc-prim-0.8.0 -L/Users/tom/.ghcup/ghc/9.2.2/lib/ghc-9.2.2/lib/../lib/aarch64-osx-ghc-9.2.2/rts-1.0.2 -lm -ldl -lffi
error: clang: error: invalid linker name in argument '-fuse-ld=lld'


Failed to build exe:hsc2hs from hsc2hs-0.68.8.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/hsc2hs-0.68.8-39697ba7.log ):
Configuring executable 'hsc2hs' for hsc2hs-0.68.8..
Preprocessing executable 'hsc2hs' for hsc2hs-0.68.8..
Building executable 'hsc2hs' for hsc2hs-0.68.8..
[ 1 of 12] Compiling ATTParser        ( src/ATTParser.hs, dist/build/hsc2hs/hsc2hs-tmp/ATTParser.o )
[ 2 of 12] Compiling Compat.ResponseFile ( src/Compat/ResponseFile.hs, dist/build/hsc2hs/hsc2hs-tmp/Compat/ResponseFile.o )
[ 3 of 12] Compiling Compat.TempFile  ( src/Compat/TempFile.hs, dist/build/hsc2hs/hsc2hs-tmp/Compat/TempFile.o )
[ 4 of 12] Compiling Common           ( src/Common.hs, dist/build/hsc2hs/hsc2hs-tmp/Common.o )
[ 5 of 12] Compiling Flags            ( src/Flags.hs, dist/build/hsc2hs/hsc2hs-tmp/Flags.o )
[ 6 of 12] Compiling HSCParser        ( src/HSCParser.hs, dist/build/hsc2hs/hsc2hs-tmp/HSCParser.o )
[ 7 of 12] Compiling C                ( src/C.hs, dist/build/hsc2hs/hsc2hs-tmp/C.o )
[ 8 of 12] Compiling CrossCodegen     ( src/CrossCodegen.hs, dist/build/hsc2hs/hsc2hs-tmp/CrossCodegen.o )
[ 9 of 12] Compiling Paths_hsc2hs     ( dist/build/hsc2hs/autogen/Paths_hsc2hs.hs, dist/build/hsc2hs/hsc2hs-tmp/Paths_hsc2hs.o )
[10 of 12] Compiling UtilsCodegen     ( src/UtilsCodegen.hs, dist/build/hsc2hs/hsc2hs-tmp/UtilsCodegen.o )
[11 of 12] Compiling DirectCodegen    ( src/DirectCodegen.hs, dist/build/hsc2hs/hsc2hs-tmp/DirectCodegen.o )
[12 of 12] Compiling Main             ( src/Main.hs, dist/build/hsc2hs/hsc2hs-tmp/Main.o )
Linking dist/build/hsc2hs/hsc2hs ...
clang: error: invalid linker name in argument '-fuse-ld=lld'
`gcc' failed in phase `Linker'. (Exit code: 1)

Failed to build primitive-0.7.4.0.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/prmtv-0.7.4.0-4f8a5dbe.log ):
Configuring library for primitive-0.7.4.0..
Preprocessing library for primitive-0.7.4.0..
Building library for primitive-0.7.4.0..
[ 1 of 12] Compiling Control.Monad.Primitive ( Control/Monad/Primitive.hs, dist/build/Control/Monad/Primitive.o, dist/build/Control/Monad/Primitive.dyn_o )
[ 2 of 12] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, dist/build/Data/Primitive/Array.o, dist/build/Data/Primitive/Array.dyn_o )
[ 3 of 12] Compiling Data.Primitive.MVar ( Data/Primitive/MVar.hs, dist/build/Data/Primitive/MVar.o, dist/build/Data/Primitive/MVar.dyn_o )
[ 4 of 12] Compiling Data.Primitive.MachDeps ( Data/Primitive/MachDeps.hs, dist/build/Data/Primitive/MachDeps.o, dist/build/Data/Primitive/MachDeps.dyn_o )
[ 5 of 12] Compiling Data.Primitive.Internal.Operations ( Data/Primitive/Internal/Operations.hs, dist/build/Data/Primitive/Internal/Operations.o, dist/build/Data/Primitive/Internal/Operations.dyn_o )
ld.lld: builderMainLoop: posix_spawnp: illegal operation (Inappropriate ioctl for device)

Failed to build splitmix-0.1.0.4.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/spltmx-0.1.0.4-9ce2336d.log ):
Configuring library for splitmix-0.1.0.4..
Preprocessing library for splitmix-0.1.0.4..
Building library for splitmix-0.1.0.4..
[1 of 4] Compiling Data.Bits.Compat ( src-compat/Data/Bits/Compat.hs, dist/build/Data/Bits/Compat.o, dist/build/Data/Bits/Compat.dyn_o )
[2 of 4] Compiling System.Random.SplitMix.Init ( src/System/Random/SplitMix/Init.hs, dist/build/System/Random/SplitMix/Init.o, dist/build/System/Random/SplitMix/Init.dyn_o )
ld.lld: builderMainLoop: posix_spawnp: illegal operation (Inappropriate ioctl for device)

Failed to build tidal-link-1.0.1. The failure occurred during the configure
step.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/tdl-lnk-1.0.1-e1d0b6c4.log ):
Configuring library for tidal-link-1.0.1..
cabal-3.6.2.0: Missing dependency on a foreign library:
* Missing (or bad) C library: c++
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

cabal: Failed to build clock-0.8.3 (which is required by tidal-1.9.2). See the
build log above for details.
Failed to build exe:hsc2hs from hsc2hs-0.68.8 (which is required by
tidal-1.9.2). See the build log above for details.
Failed to build primitive-0.7.4.0 (which is required by tidal-1.9.2). See the
build log above for details.
Failed to build splitmix-0.1.0.4 (which is required by tidal-1.9.2). See the
build log above for details.
Failed to build tidal-link-1.0.1 (which is required by tidal-1.9.2). See the
build log above for details.

tom@Toms-MBP ~ % cabal update             
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date at index-state 2022-09-27T20:19:21Z
tom@Toms-MBP ~ % cabal install tidal --lib
Resolving dependencies...
Build profile: -w ghc-9.2.2 -O1
In order, the following will be built (use -v for more details):
 - clock-0.8.3 (lib) (requires build)
 - hsc2hs-0.68.8 (exe:hsc2hs) (requires build)
 - primitive-0.7.4.0 (lib) (requires build)
 - splitmix-0.1.0.4 (lib) (requires build)
 - tidal-link-1.0.1 (lib) (requires build)
 - network-3.1.2.7 (lib:network) (requires build)
 - random-1.2.1.1 (lib) (requires build)
 - hosc-0.19.1 (lib) (requires build)
 - tidal-1.9.2 (lib) (requires build)
Starting     clock-0.8.3 (lib)
Starting     primitive-0.7.4.0 (lib)
Starting     hsc2hs-0.68.8 (exe:hsc2hs)
Starting     splitmix-0.1.0.4 (lib)
Starting     tidal-link-1.0.1 (lib)
Building     clock-0.8.3 (lib)
Building     hsc2hs-0.68.8 (exe:hsc2hs)
Building     splitmix-0.1.0.4 (lib)
Building     primitive-0.7.4.0 (lib)

Failed to build clock-0.8.3.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/clck-0.8.3-54c8492a.log ):
Configuring library for clock-0.8.3..
Preprocessing library for clock-0.8.3..
linking dist/build/System/Clock_hsc_make.o failed (exit code 1)
rsp file was: "dist/build/System/hsc2hscall4848-2.rsp"
command was: /usr/bin/gcc dist/build/System/Clock_hsc_make.o dist/build/System/Clock_hsc_utils.o -o dist/build/System/Clock_hsc_make --target=arm64-apple-darwin --target=arm64-apple-darwin -fuse-ld=lld -L/Users/tom/.ghcup/ghc/9.2.2/lib/ghc-9.2.2/lib/../lib/aarch64-osx-ghc-9.2.2/base-4.16.1.0 -liconv -L/Users/tom/.ghcup/ghc/9.2.2/lib/ghc-9.2.2/lib/../lib/aarch64-osx-ghc-9.2.2/ghc-bignum-1.2 -L/Users/tom/.ghcup/ghc/9.2.2/lib/ghc-9.2.2/lib/../lib/aarch64-osx-ghc-9.2.2/ghc-prim-0.8.0 -L/Users/tom/.ghcup/ghc/9.2.2/lib/ghc-9.2.2/lib/../lib/aarch64-osx-ghc-9.2.2/rts-1.0.2 -lm -ldl -lffi
error: clang: error: invalid linker name in argument '-fuse-ld=lld'


Failed to build exe:hsc2hs from hsc2hs-0.68.8.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/hsc2hs-0.68.8-39697ba7.log ):
Configuring executable 'hsc2hs' for hsc2hs-0.68.8..
Preprocessing executable 'hsc2hs' for hsc2hs-0.68.8..
Building executable 'hsc2hs' for hsc2hs-0.68.8..
[ 1 of 12] Compiling ATTParser        ( src/ATTParser.hs, dist/build/hsc2hs/hsc2hs-tmp/ATTParser.o )
[ 2 of 12] Compiling Compat.ResponseFile ( src/Compat/ResponseFile.hs, dist/build/hsc2hs/hsc2hs-tmp/Compat/ResponseFile.o )
[ 3 of 12] Compiling Compat.TempFile  ( src/Compat/TempFile.hs, dist/build/hsc2hs/hsc2hs-tmp/Compat/TempFile.o )
[ 4 of 12] Compiling Common           ( src/Common.hs, dist/build/hsc2hs/hsc2hs-tmp/Common.o )
[ 5 of 12] Compiling Flags            ( src/Flags.hs, dist/build/hsc2hs/hsc2hs-tmp/Flags.o )
[ 6 of 12] Compiling HSCParser        ( src/HSCParser.hs, dist/build/hsc2hs/hsc2hs-tmp/HSCParser.o )
[ 7 of 12] Compiling C                ( src/C.hs, dist/build/hsc2hs/hsc2hs-tmp/C.o )
[ 8 of 12] Compiling CrossCodegen     ( src/CrossCodegen.hs, dist/build/hsc2hs/hsc2hs-tmp/CrossCodegen.o )
[ 9 of 12] Compiling Paths_hsc2hs     ( dist/build/hsc2hs/autogen/Paths_hsc2hs.hs, dist/build/hsc2hs/hsc2hs-tmp/Paths_hsc2hs.o )
[10 of 12] Compiling UtilsCodegen     ( src/UtilsCodegen.hs, dist/build/hsc2hs/hsc2hs-tmp/UtilsCodegen.o )
[11 of 12] Compiling DirectCodegen    ( src/DirectCodegen.hs, dist/build/hsc2hs/hsc2hs-tmp/DirectCodegen.o )
[12 of 12] Compiling Main             ( src/Main.hs, dist/build/hsc2hs/hsc2hs-tmp/Main.o )
Linking dist/build/hsc2hs/hsc2hs ...
clang: error: invalid linker name in argument '-fuse-ld=lld'
`gcc' failed in phase `Linker'. (Exit code: 1)

Failed to build primitive-0.7.4.0.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/prmtv-0.7.4.0-4f8a5dbe.log ):
Configuring library for primitive-0.7.4.0..
Preprocessing library for primitive-0.7.4.0..
Building library for primitive-0.7.4.0..
[ 1 of 12] Compiling Control.Monad.Primitive ( Control/Monad/Primitive.hs, dist/build/Control/Monad/Primitive.o, dist/build/Control/Monad/Primitive.dyn_o )
[ 2 of 12] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, dist/build/Data/Primitive/Array.o, dist/build/Data/Primitive/Array.dyn_o )
[ 3 of 12] Compiling Data.Primitive.MVar ( Data/Primitive/MVar.hs, dist/build/Data/Primitive/MVar.o, dist/build/Data/Primitive/MVar.dyn_o )
[ 4 of 12] Compiling Data.Primitive.MachDeps ( Data/Primitive/MachDeps.hs, dist/build/Data/Primitive/MachDeps.o, dist/build/Data/Primitive/MachDeps.dyn_o )
[ 5 of 12] Compiling Data.Primitive.Internal.Operations ( Data/Primitive/Internal/Operations.hs, dist/build/Data/Primitive/Internal/Operations.o, dist/build/Data/Primitive/Internal/Operations.dyn_o )
ld.lld: builderMainLoop: posix_spawnp: illegal operation (Inappropriate ioctl for device)

Failed to build splitmix-0.1.0.4.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/spltmx-0.1.0.4-9ce2336d.log ):
Configuring library for splitmix-0.1.0.4..
Preprocessing library for splitmix-0.1.0.4..
Building library for splitmix-0.1.0.4..
[1 of 4] Compiling Data.Bits.Compat ( src-compat/Data/Bits/Compat.hs, dist/build/Data/Bits/Compat.o, dist/build/Data/Bits/Compat.dyn_o )
[2 of 4] Compiling System.Random.SplitMix.Init ( src/System/Random/SplitMix/Init.hs, dist/build/System/Random/SplitMix/Init.o, dist/build/System/Random/SplitMix/Init.dyn_o )
ld.lld: builderMainLoop: posix_spawnp: illegal operation (Inappropriate ioctl for device)

Failed to build tidal-link-1.0.1. The failure occurred during the configure
step.
Build log ( /Users/tom/.cabal/logs/ghc-9.2.2/tdl-lnk-1.0.1-e1d0b6c4.log ):
Configuring library for tidal-link-1.0.1..
cabal-3.6.2.0: Missing dependency on a foreign library:
* Missing (or bad) C library: c++
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

cabal: Failed to build clock-0.8.3 (which is required by tidal-1.9.2). See the
build log above for details.
Failed to build exe:hsc2hs from hsc2hs-0.68.8 (which is required by
tidal-1.9.2). See the build log above for details.
Failed to build primitive-0.7.4.0 (which is required by tidal-1.9.2). See the
build log above for details.
Failed to build splitmix-0.1.0.4 (which is required by tidal-1.9.2). See the
build log above for details.
Failed to build tidal-link-1.0.1 (which is required by tidal-1.9.2). See the
build log above for details.

Lots of output to consider there, but one highlight is GHC 9.2.2. As I recall, Tidal 1.9.2 requires GHC 9.4.2. Updating your GHC would be a good next step.

1 Like

thank you! I'll try that next