Here is the reproducer
When I run cabal build foofoo
, then the following error occurs.
Building executable 'foofoo' for foofoo-0.1.0.0...
<command line>: /nix/store/9h6k3lj5dw777hs6dzkw924lx4m62sqf-gsl-2.8/lib/libgsl.so: undefined symbol: cblas_ctrmv
Error: [Cabal-7125]
Failed to build exe:foofoo from foofoo-0.1.0.0.
There is no context provided, so I don’t know why cabal looks up the symbol. While I know that I added hmatrix-gsl as a dependency, I don’t understand symbol lookup happening in the build stage.
The following is the result of cabal build foofoo --verbose
, but I can’t find any hint from it.
Configuration is affected by the following files:
- cabal.project
Build profile: -w ghc-9.8.4 -O1
In order, the following will be built:
- foofoo-0.1.0.0 (exe:foofoo) (file app/Main.hs changed)
Executing install plan in parallel using Just 8 threads.
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/tmp
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/cache
Using self-exec internal setup method with build-type Simple and args:
["act-as-setup","--build-type=Simple","--","--working-dir=/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/foofoo","build","--verbose=2","--builddir=/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo"]
/nix/store/n7ar7icxa6sh6cr3y9aq619xbyvzv1nw-cabal-install-3.14.2.0/bin/.cabal-wrapped
act-as-setup --build-type=Simple --
--working-dir=/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/foofoo
build --verbose=2
--builddir=/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo
Including the following directories in PATH:
- /home/bglgwyng/.cabal/bin
Including the following environment variable overrides:
-
foofoo_datadir=/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/foofoo/.
Running: /nix/store/n7ar7icxa6sh6cr3y9aq619xbyvzv1nw-cabal-install-3.14.2.0/bin/.cabal-wrapped act-as-setup '--build-type=Simple' -- '--working-dir=/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/foofoo' build '--verbose=2' '--builddir=/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo'
Component build order: executable 'foofoo'
Running: /nix/store/av09skr6hs60k9q70a684ypgg4v0j3ii-ghc-9.8.4-with-packages/bin/ghc-pkg init /home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/package.conf.inplace
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/autogen
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/autogen
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/autogen
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/autogen
Preprocessing executable 'foofoo' for foofoo-0.1.0.0...
Building executable 'foofoo' for foofoo-0.1.0.0...
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo
creating
/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/foofoo-tmp
Wanted module build ways(executable 'foofoo'): [StaticWay]
Final module build ways(executable 'foofoo'): [StaticWay]
Running: /nix/store/av09skr6hs60k9q70a684ypgg4v0j3ii-ghc-9.8.4-with-packages/bin/ghc --make -no-link -fbuilding-cabal-package -O -static -outputdir /home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/foofoo-tmp -odir /home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/foofoo-tmp -hidir /home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/foofoo-tmp -hiedir /home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/foofoo-tmp/extra-compilation-artifacts/hie -stubdir /home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/foofoo-tmp -i -iapp -i/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/foofoo-tmp -i/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/autogen -i/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/global-autogen -I/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/autogen -I/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/global-autogen -I/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/foofoo-tmp -optP-include -optP/home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/build/foofoo/autogen/cabal_macros.h -this-unit-id foofoo-0.1.0.0-inplace-foofoo -hide-all-packages -Wmissing-home-modules -no-user-package-db -package-db /home/bglgwyng/.cabal/store/ghc-9.8.4-6de5/package.db -package-db /home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/packagedb/ghc-9.8.4 -package-db /home/bglgwyng/Documents/GitHub/ghc-typelits-knownnat-fails-build/dist-newstyle/build/x86_64-linux/ghc-9.8.4/foofoo-0.1.0.0/x/foofoo/package.conf.inplace -package-id base-4.19.2.0-213b -package-id ghc-typelits-knownnat-0.7.13-Lr0qQrA5hAd5DsF2uqN7s4 -package-id hmatrix-gsl-0.19.0.1-8XOjr9s3Boq2ooB3aOLIFC -XHaskell2010 app/Main.hs -Wall -fplugin GHC.TypeLits.KnownNat.Solver -hide-all-packages
<command line>: /nix/store/9h6k3lj5dw777hs6dzkw924lx4m62sqf-gsl-2.8/lib/libgsl.so: undefined symbol: cblas_ctrmv
Error: [Cabal-7125]
Failed to build foofoo-0.1.0.0-inplace-foofoo.
CallStack (from HasCallStack):
dieWithException, called at src/Distribution/Client/ProjectOrchestration.hs:1241:21 in cabal-install-3.14.2.0-BnTiwbjjLNE5bYFohs0LgY:Distribution.Client.ProjectOrchestration
Can someone explain this issue and how to solve it?