Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

HIE errors on startup #1541

Open
Open
@LeanderK

Description

@LeanderK

This is the log:

2020-01-03 17:55:33.948008 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 1.0.0.0, Git revision 704ed3c982ce350f6aafbf4854e91da1e2a1d1c2 (dirty) (3528 commits) x86_64 ghc-8.6.5
2020-01-03 17:55:33.968581 [ThreadId 4] - Current directory:/Users/LeanderK/Documents/Haskell/hasktorch-comcat
2020-01-03 17:55:33.969844 [ThreadId 4] - Operating system:darwin
2020-01-03 17:55:34.069305 [ThreadId 4] - Cabal-Helper dirs: ["/Users/LeanderK/Documents/Haskell/hasktorch-comcat","/Users/LeanderK/Documents/Haskell/hasktorch-comcat/File.hs"]
2020-01-03 17:55:40.320621 [ThreadId 4] - Cradle directory:/Users/LeanderK/Documents/Haskell/hasktorch-comcat
2020-01-03 17:55:40.322384 [ThreadId 4] - Use Stack GHC
2020-01-03 17:55:40.973545 [ThreadId 4] - Project GHC version:8.6.5
2020-01-03 17:55:40.974105 [ThreadId 4] - hie exe candidates :["hie-8.6.5","hie-8.6","hie"]
2020-01-03 17:55:40.976355 [ThreadId 4] - found hie exe at:/Users/LeanderK/.local/bin/hie-8.6.5
2020-01-03 17:55:40.97713 [ThreadId 4] - args:["--lsp"]
2020-01-03 17:55:40.977523 [ThreadId 4] - launching ....



2020-01-03 17:55:41.12167 [ThreadId 4] - Run entered for HIE(hie-8.6.5) Version 1.0.0.0, Git revision 704ed3c982ce350f6aafbf4854e91da1e2a1d1c2 (dirty) (3528 commits) x86_64 ghc-8.6.5
2020-01-03 17:55:41.128316 [ThreadId 4] - Current directory:/Users/LeanderK/Documents/Haskell/hasktorch-comcat
2020-01-03 17:55:41.128448 [ThreadId 4] - args:["--lsp"]
2020-01-03 17:55:42.217548 [ThreadId 4] - Cabal-Helper dirs: ["/Users/LeanderK/Documents/Haskell/hasktorch-comcat","/Users/LeanderK/Documents/Haskell/hasktorch-comcat/File.hs"]
2020-01-03 17:55:45.902927 [ThreadId 4] - Use Stack GHC
2020-01-03 17:55:46.755292 [ThreadId 31] - Use Stack GHC
Using hie version: Version 1.0.0.0, Git revision 704ed3c982ce350f6aafbf4854e91da1e2a1d1c2 (dirty) (3528 commits) x86_64 ghc-8.6.5
Using hoogle db at: /Users/LeanderK/.hoogle/default-haskell-5.0.17.hoo
2020-01-03 17:55:47.509161 [ThreadId 37] - New cradle: /Users/LeanderK/Documents/Haskell/hasktorch-comcat/src/LibHaskComcat.hs
2020-01-03 17:55:47.513706 [ThreadId 37] - Cabal-Helper dirs: ["/Users/LeanderK/Documents/Haskell/hasktorch-comcat","/Users/LeanderK/Documents/Haskell/hasktorch-comcat/src/LibHaskComcat.hs"]
2020-01-03 17:55:50.238888 [ThreadId 37] - Found cradle: Cradle {cradleRootDir = "/Users/LeanderK/Documents/Haskell/hasktorch-comcat", cradleOptsProg = CradleAction: Cabal-Helper-Stack}
hasktorch-0.2.0.0: unregistering (local file changes: /Users/LeanderK/.stack/snapshots/x86_64-osx/5aec64b20ecf8cf33e0eb72f42c2084efb78fa3c898d1f2d32a00...)
hasktorch-comcat-0.1.0.0: unregistering (missing dependencies: hasktorch)
hasktorch       > configure (lib)
hasktorch       > Configuring hasktorch-0.2.0.0...
hasktorch       > build (lib)
hasktorch       > Preprocessing library for hasktorch-0.2.0.0..
hasktorch       > Building library for hasktorch-0.2.0.0..
hasktorch       > copy/register
hasktorch       > Installing library in /Users/LeanderK/Documents/Haskell/hasktorch-comcat/.stack-work/install/x86_64-osx/939c413ab4a7d2343bb3a9b2ece27ffbd63771fd22078232752ce434eb022688/8.6.5/lib/x86_64-osx-ghc-8.6.5/hasktorch-0.2.0.0-J7gmn6ENwry3iNUclTAeCb
hasktorch       > Registering library for hasktorch-0.2.0.0..
hasktorch-comcat> configure (lib + exe)
Configuring hasktorch-comcat-0.1.0.0...
Completed 2 action(s).
hie-8.6.5: 
lookupSymbol failed in relocateSection (relocate external)
/Users/LeanderK/Documents/Haskell/hasktorch-comcat/.stack-work/install/x86_64-osx/939c413ab4a7d2343bb3a9b2ece27ffbd63771fd22078232752ce434eb022688/8.6.5/lib/x86_64-osx-ghc-8.6.5/libtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0/libHSlibtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0.a: unknown symbol `__ZN3c1010Dispatcher10findSchemaERKNS_12OperatorNameE'
hie-8.6.5: 
lookupSymbol failed in relocateSection (RELOC_GOT)
/Users/LeanderK/Documents/Haskell/hasktorch-comcat/.stack-work/install/x86_64-osx/939c413ab4a7d2343bb3a9b2ece27ffbd63771fd22078232752ce434eb022688/8.6.5/lib/x86_64-osx-ghc-8.6.5/libtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0/libHSlibtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0.a: unknown symbol `__ZN3c1019UndefinedTensorImpl10_singletonE'
hie-8.6.5: 
lookupSymbol failed in relocateSection (RELOC_GOT)
/Users/LeanderK/Documents/Haskell/hasktorch-comcat/.stack-work/install/x86_64-osx/939c413ab4a7d2343bb3a9b2ece27ffbd63771fd22078232752ce434eb022688/8.6.5/lib/x86_64-osx-ghc-8.6.5/libtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0/libHSlibtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0.a: unknown symbol `__ZN3c1019UndefinedTensorImpl10_singletonE'
GHC runtime linker: fatal error: I found a duplicate definition for symbol
   __ZN3c1013intrusive_ptrINS_10TensorImplENS_19UndefinedTensorImplEE7retain_Ev
whilst processing object file
   /Users/LeanderK/Documents/Haskell/hasktorch-comcat/.stack-work/install/x86_64-osx/939c413ab4a7d2343bb3a9b2ece27ffbd63771fd22078232752ce434eb022688/8.6.5/lib/x86_64-osx-ghc-8.6.5/libtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0/libHSlibtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0.a
The symbol was previously defined in
   /Users/LeanderK/Documents/Haskell/hasktorch-comcat/.stack-work/install/x86_64-osx/939c413ab4a7d2343bb3a9b2ece27ffbd63771fd22078232752ce434eb022688/8.6.5/lib/x86_64-osx-ghc-8.6.5/libtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0/libHSlibtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0.a(Native.o)
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.
hie-8.6.5: 
lookupSymbol failed in relocateSection (RELOC_GOT)
/Users/LeanderK/Documents/Haskell/hasktorch-comcat/.stack-work/install/x86_64-osx/939c413ab4a7d2343bb3a9b2ece27ffbd63771fd22078232752ce434eb022688/8.6.5/lib/x86_64-osx-ghc-8.6.5/libtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0/libHSlibtorch-ffi-1.3.0.0-3VEeYCkllchEBgLlVLOxv0.a: unknown symbol `__ZN3c1019UndefinedTensorImpl10_singletonE'
2020-01-03 17:56:13.800489 [ThreadId 63] - Ghc error on cradle initialisation: "unable to load package `libtorch-ffi-1.3.0.0'"
2020-01-03 17:56:13.837999 [ThreadId 37] - ghcDispatcher:Got error for a request: IdeError {ideCode = OtherError, ideMessage = "\"unable to load package `libtorch-ffi-1.3.0.0'\"", ideInfo = Null} with mid: Nothing
2020-01-03 17:56:13.839307 [ThreadId 37] - New cradle: /Users/LeanderK/Documents/Haskell/hasktorch-comcat/src/LibHaskComcat.hs
2020-01-03 17:56:13.842853 [ThreadId 37] - Cabal-Helper dirs: ["/Users/LeanderK/Documents/Haskell/hasktorch-comcat","/Users/LeanderK/Documents/Haskell/hasktorch-comcat/src/LibHaskComcat.hs"]
2020-01-03 17:56:17.50854 [ThreadId 37] - Found cradle: Cradle {cradleRootDir = "/Users/LeanderK/Documents/Haskell/hasktorch-comcat", cradleOptsProg = CradleAction: Cabal-Helper-Stack}
2020-01-03 17:56:19.647879 [ThreadId 143] - Ghc error on cradle initialisation: "panic! (the 'impossible' happened)\n  (GHC version 8.6.5 for x86_64-apple-darwin):\n\tDynamic linker not initialised\n\nPlease report this as a GHC bug:  http://www.haskell.org/ghc/reportabug\n"
2020-01-03 17:56:19.648594 [ThreadId 37] - ghcDispatcher:Got error for a request: IdeError {ideCode = OtherError, ideMessage = "\"panic! (the 'impossible' happened)\\n  (GHC version 8.6.5 for x86_64-apple-darwin):\\n\\tDynamic linker not initialised\\n\\nPlease report this as a GHC bug:  http://www.haskell.org/ghc/reportabug\\n\"", ideInfo = Null} with mid: Nothing

The setup is quite complex, it's a project that depends on hasktorch. Create a new stack project with the hasktorch-project on the top-level as a git-submodule (git submodule add here-hasktorch-link), cd into hasktorch and follow the setup-instructions for hasktorch. Then add this as the top-level stack.yaml .

# This file was automatically generated by 'stack init'
#
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# https://docs.haskellstack.org/en/stable/yaml_configuration/

# Resolver to choose a 'specific' stackage snapshot or a compiler version.
# A snapshot resolver dictates the compiler version and the set of packages
# to be used for project dependencies. For example:
#
# resolver: lts-3.5
# resolver: nightly-2015-09-21
# resolver: ghc-7.10.2
#
# The location of a snapshot can be provided as a file or url. Stack assumes
# a snapshot provided as a file might change, whereas a url resource does not.
#
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-14.19

# User packages to be built.
# Various formats can be used as shown in the example below.
#
# packages:
# - some-directory
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
#   subdirs:
#   - auto-update
#   - wai
packages:
- .
# Dependency packages to be pulled from upstream that are not in the resolver.
# These entries can reference officially published versions as well as
# forks / in-progress versions pinned to a git hash. For example:
#
# extra-deps:
# - acme-missiles-0.3
# - git: https://github.com/commercialhaskell/stack.git
#   commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
#

extra-include-dirs:
    - hasktorch/deps/libtorch/include/torch/csrc/api/include
    - hasktorch/deps/libtorch/include

extra-lib-dirs:
    - hasktorch/deps/libtorch/lib
    - hasktorch/deps/mklml/lib

extra-deps:
    - categories-1.0.7@sha256:e707f8ac06eac755cb508aa67de64ab2e33ce1c54aebb6f43f64c615aa5234f6,1636
    - template-0.2.0.10@sha256:f822de4d34c45bc84b33a61bc112c15fedee6fa6dc414c62b10456395a868f85
    - inline-c-0.9.0.0
    - inline-c-cpp-0.4.0.0
    - ../hasktorch/codegen
    - ../hasktorch/libtorch-ffi
    - ../hasktorch/hasktorch

# Override default flag values for local packages and extra-deps
# flags: {}

# Extra package databases containing global packages
# extra-package-dbs: []

# Control whether we use the GHC we find on the path
# system-ghc: true
#
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=2.1"
#
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
#
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor

EDIT:
one also needs to depend on:

dependencies:
- hasktorch
- libtorch-ffi

in package.yaml

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions