I want to install and run an example program from the Haskell neural library.
I'm pretty new to this and am not sure on whether the issue is with my installation method, my environment or the library(ies?) itself. How do I get one of the example programs running?
I tried stack install neural and got
Error: [S-4804]
Stack failed to construct a build plan.
While constructing the build plan, Stack encountered the following errors. The 'Stack configuration' refers to the set of package versions specified
by the snapshot (after any dropped packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes all other such packages that
depend on it) and any extra-deps:
In the dependencies for neural-0.3.0.1:
* pipes-zlib needed, but no version is in the Stack configuration (latest matching version is 0.4.4.2).
needed since neural is a build target.
Some different approaches to resolving some or all of this:
* Recommended action: try adding the following to your extra-deps in C:\Users\DELL\AppData\Roaming\stack\global-project\stack.yaml
(project-level configuration):
- pipes-zlib-0.4.4.2@sha256:eabd5aa29a030ecdeade80cfeb1787adc181bcf8fd378cb7b695b2af6cb26af6,1947
After following the recommended action,
While executing the build plan, Stack encountered the error:
[S-7011]
While building package neural-0.3.0.1 (scroll up to its section to
see the error) using:
C:\Users\DELL\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_9p6GVs8J_3.10.1.0_ghc-9.6.4.exe --verbose=1 --builddir=.stack-work\dist\ab060f89 build --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
After this, I tried cabal install neural instead, and got
Failed to build neural-0.3.0.1.
Build log (
C:\cabal\logs\ghc-9.4.8\neural-0.3.0.1-41d9f5ecd7dfa38845ecaf8f9f447447e7958da2.log
):
Preprocessing library for neural-0.3.0.1..
Building library for neural-0.3.0.1..
[ 1 of 22] Compiling Data.MyPrelude ( src\Data\MyPrelude.hs, dist\build\Data\MyPrelude.o )
src\Data\MyPrelude.hs:55:1: warning: [-Wunused-imports]
The import of `Data.Monoid' is redundant
except perhaps to import instances from `Data.Monoid'
To import instances alone, use: import Data.Monoid()
|
55 | import Data.Monoid ((<>))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 2 of 22] Compiling Data.FixedSize.Class ( src\Data\FixedSize\Class.hs, dist\build\Data\FixedSize\Class.o )
.........
|
120 | vtail (Vector v) = Vector $ VS.tail v
| ^
[17 of 22] Compiling Numeric.Neural.Model ( src\Numeric\Neural\Model.hs, dist\build\Numeric\Neural\Model.o )
src\Numeric\Neural\Model.hs:139:10: error:
Duplicate instance declarations:
instance (NFData (s a), NFData (t a)) => NFData (Product s t a)
-- Defined at src\Numeric\Neural\Model.hs:139:10
instance [safe] (Control.DeepSeq.NFData1 f,
Control.DeepSeq.NFData1 g, NFData a) =>
NFData (Product f g a)
-- Defined in `Control.DeepSeq'
|
139 | instance (NFData (s a), NFData (t a)) => NFData (Product s t a) where
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: cabal-3.10.2.1.exe: Failed to build neural-0.3.0.1 (which is requiredby exe:sqrt from neural-0.3.0.1, exe:sin from neural-0.3.0.1 and others). See
the build log above for details.
At this point, I assume it's an issue with the source itself?
When I try installing other related libraries (e.g, grenade) using stack, I get something like
fail (backjumping, conflict set: singletons, template-haskell,
th-desugar)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: grenade, text, singletons,
template-haskell, th-desugar, base
I was able to build
neuralwith Stack, but I started with a clone of the Git repository instead of tryingstack install neural(which looks like it's broken). So, try:The first time, I got a dreaded GHC panic:
which seems to result from some buggy Stack behavior when switching between old and new GHC versions. If you get this error, take a look at the directory referenced at the end of the message (in my case,
/scratch/buhr/haskell/stack/setup-exe-src), delete any interface files in that directory (extension.hi), and try rebuilding.As per @leftroundabout's comment, this might be abandonware, but it may be suitable for flower identification purposes: