Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to install brick via Hackage #308

Closed
greggaree opened this issue Feb 6, 2021 · 11 comments
Closed

failed to install brick via Hackage #308

greggaree opened this issue Feb 6, 2021 · 11 comments

Comments

@greggaree
Copy link

I tried to install brick using:

$ cabal update
$ cabal install brick

I got the following error:

usr/bin/ld.gold: error: cannot find -ltinfo
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
cabal: Failed to build vty-5.32 (which is required by brick-0.60.1). See the
build log above for details.

I am using ghc version 8.10.3.

All seemed to be going well until cabal had to build vty-5.32. Here are excerpts from the log:

Failed to build vty-5.32.
Build log (
/home/greg/.cabal/logs/ghc-8.10.3/vty-5.32-e8149f76df07cb945b7640d4402df4c99f6fcb1b131bdabcda71e1b03305cdd1.log
):
Configuring library for vty-5.32..
Preprocessing library for vty-5.32..
Building library for vty-5.32..
[ 1 of 40] Compiling Codec.Binary.UTF8.Debug ( src/Codec/Binary/UTF8/Debug.hs, dist/build/Codec/Binary/UTF8/Debug.o, dist/build/Codec/Binary/UTF8/Debug.dyn_o )

Later in vty build process:

[21 of 40] Compiling Graphics.Vty.Input.Loop ( src/Graphics/Vty/Input/Loop.hs, dist/build/Graphics/Vty/Input/Loop.o, dist/build/Graphics/Vty/Input/Loop.dyn_o )

<no location info>: warning: [-Wmissed-extra-shared-lib]
    libtinfo.so: cannot open shared object file: No such file or directory
    It's OK if you don't want to use symbols from it directly.
    (the package DLL is loaded by the system linker
     which manages dependencies by itself).

src/Graphics/Vty/Input/Loop.hs:227:42: warning: [-Wunused-record-wildcards]
    No variables bound in the record wildcard match are used
      Possible fix: omit the ‘..’
    |
227 |               , termName = Just theTerm, .. } <- readIORef $ _configRef input
    |                                          ^^
[22 of 40] Compiling Graphics.Vty.Input.Terminfo.ANSIVT ( src/Graphics/Vty/Input/Terminfo/ANSIVT.hs, dist/build/Graphics/Vty/Input/Terminfo/ANSIVT.o, dist/build/Graphics/Vty/Input/Terminfo/ANSIVT.dyn_o )

At the end of vty build:

[40 of 40] Compiling Graphics.Vty.Inline ( src/Graphics/Vty/Inline.hs, dist/build/Graphics/Vty/Inline.o, dist/build/Graphics/Vty/Inline.dyn_o )
/usr/bin/ld.gold: error: cannot find -ltinfo
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
cabal: Failed to build vty-5.32 (which is required by brick-0.60.1). See the
build log above for details.

I tried building brick with cabal using ghc 8.8.4, but it also failed while building vty. From the build log:

Failed to build vty-5.32.
Build log (
/home/greg/.cabal/logs/ghc-8.8.4/vty-5.32-1982a48172cd723683d4dfda5db184b0214cb24d485ed68ee9822e3277c72e62.log
):
Configuring library for vty-5.32..
Preprocessing library for vty-5.32..
Building library for vty-5.32..
[ 1 of 40] Compiling Codec.Binary.UTF8.Debug ( src/Codec/Binary/UTF8/Debug.hs, dist/build/Codec/Binary/UTF8/Debug.o )

Later in the build:

[21 of 40] Compiling Graphics.Vty.Input.Loop ( src/Graphics/Vty/Input/Loop.hs, dist/build/Graphics/Vty/Input/Loop.o )

<no location info>: warning: [-Wmissed-extra-shared-lib]
    libtinfo.so: cannot open shared object file: No such file or directory
    It's OK if you don't want to use symbols from it directly.
    (the package DLL is loaded by the system linker
     which manages dependencies by itself).

At the end of vty build:

collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
cabal: Failed to build vty-5.32 (which is required by brick-0.60.1). See the
build log above for details.
@jtdaugherty
Copy link
Owner

Thanks for the report! This looks like a vty build issue specifically. Which Linux distribution is this occurring on?

@greggaree
Copy link
Author

Ubuntu Mate 18.04 LTS

@jtdaugherty
Copy link
Owner

Do you have any version of libtinfo installed on your system? (If not, you can find out which package provides it by running sudo apt-get install apt-file && sudo apt-file update && apt-file search libtinfo).

@jtdaugherty
Copy link
Owner

@glguy - I'm wondering if you have run into this issue. There have been two Vty patches (here, here) submitted about this issue, but I got stuck trying to figure out why these would make sense in vty. Vty doesn't seem to even have an explicit dependency on ncurses or tinfo, and judging by my google searches (example), this tinfo issue comes up with a ton of Haskell projects on some platforms like Arch and some versions of Ubuntu.

@greggaree
Copy link
Author

I searched /usr/lib and /usr/bin, but couldn't find libtinfo. Are there any other directories I should search?

@jtdaugherty
Copy link
Owner

@greggaree I don't think so; it probably just isn't installed. Your best bet is probably to try the commands I posted above and then install whatever package provides libtinfo.

@greggaree
Copy link
Author

I searched the web and found libtinfo-dev. vyt and brick got built and installed. However, I got a warning at the end:

$ cabal install brick
Resolving dependencies...
Build profile: -w ghc-8.10.3 -O1
In order, the following will be built (use -v for more details):
 - vty-5.32 (lib) (requires build)
 - brick-0.60.1 (lib) (requires build)
Starting     vty-5.32 (lib)
Building     vty-5.32 (lib)
Installing   vty-5.32 (lib)
Completed    vty-5.32 (lib)
Starting     brick-0.60.1 (lib)
Building     brick-0.60.1 (lib)
Installing   brick-0.60.1 (lib)
Completed    brick-0.60.1 (lib)
Warning: You asked to install executables, but there are no executables in
target: brick. Perhaps you want to use --lib to install libraries instead.

Should I have used --lib?

@jtdaugherty
Copy link
Owner

You can find out more information about why you got that warning here. If your goal is to install brick in order to develop against it, I would recommend making a new Haskell package that depends on it, and then running a sandbox build with cabal new-build.

If you just want to try out the demo programs in the library, then I recommend fetching the brick source with git and then running cabal new-build -f demos; that will compile all the demos in programs/ and you'll then be able to run them with cabal new-run -f demos <program name>.

@jtdaugherty
Copy link
Owner

@greggaree Did you get things working?

@greggaree
Copy link
Author

greggaree commented Mar 3, 2021 via email

@jtdaugherty
Copy link
Owner

Okay, great. I'll close this since it's resolved, but I'd love to know what happened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants