Haskell cabal install: missing C library iw - haskell

I'm running Fedora 19 x64, and
I'm trying to install xmobar via cabal install. After installing a bunch of dependencies, I'm stuck at
cabal: Missing dependency on a foreign library:
* Missing C library: iw
I can't find anything about this iw library and I'm a bit lost at how to continue.
I've got all of the standard c libs installed, as far as I can tell.
sudo yum install glibc-common glibc glibc-devel glibc-headers glibc-utils glibc-devel glib2-devel gcc-c++ gcc
Loaded plugins: auto-update-debuginfo, langpacks, refresh-packagekit
Package glibc-common-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-devel-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-headers-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-utils-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-devel-2.17-18.fc19.x86_64 already installed and latest version
Package glib2-devel-2.36.3-3.fc19.x86_64 already installed and latest version
Package gcc-c++-4.8.1-1.fc19.x86_64 already installed and latest version
Package gcc-4.8.1-1.fc19.x86_64 already installed and latest version
Nothing to do

Under Ubuntu the same workaround:
cabal: Missing dependency on a foreign library:
* Missing C library: iw
was resolved though I thought that it can be also two libraries for C language build tools:
liwc : Tools for manipulating C source code
iwyu : Analyze #includes in C and C++ source files
after these additions & libiw-dev library new xmobar was compiled.

Libraries are packaged differently by your OS. For fedora, if you're missing library A, you often will find packages named libA and libA-devel. Luckily, you don't need to guess - instead just ask yum what packages has some file of interest. Below, I asked about the shared object file libiw.so.
yum whatprovides *libiw.so*
...
1:wireless-tools-devel-29-9.1.fc19.x86_64 : Development headers for the
: wireless-tools package
Repo : fedora
Matched from:
Filename : /usr/lib64/libiw.so
1:wireless-tools-29-9.1.fc19.x86_64 : Wireless ethernet configuration tools
Repo : installed
Matched from:
Provides : libiw.so.29()(64bit)
Filename : /lib64/libiw.so.29
I'm surprised Fedora would install without these packages, but if that's the case then obtaining the packages is just a yum install command away.

For anyone trying to install xmobar through cabal on arch,
the missing package that includes iw is called wireless_tools.
You can install that with
pacman -S wireless_tools

Related

CMake : Could NOT find Qt5FontDatabaseSupport

I got the following error after running cmake for this :
Could NOT find Qt5FontDatabaseSupport (missing:
Qt5FontDatabaseSupport_LIBRARY Qt5FontDatabaseSupport_INCLUDE_DIR) (found
version "5.12.8")
I cannot find any package with that name in my linux repository.
That is one of the dependencies for the Qt QPA plugin , as stated in the CMakeLists.txt comments.
I use Kubuntu 20.04 with cmake 3.16 and Qt5.12.
Thanks.
Most likely you don't have the build dependencies installed. Qt5FontDatabaseSupport is part of the gui Qt module, for which the headers and devel files are installed with the qtbase5-dev package.
Kwin has many more build dependencies than qtbase, so the best if you install all of them with:
sudo apt build-dep kwin
at once, or with
sudo apt build-dep kwin-wayland
if you want to hack it under wayland.

Haskell cabal install wx: missing C library wx_gtk2u_webview-3.0

I am trying to install wx by cabal install wx
Configuring wxc to build against wxWidgets 3.0
setup: Missing dependency on a foreign library:
* Missing C library: wx_gtk2u_webview-3.0
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.
cabal: Error: some packages failed to install :
wx-0.92.0.0 depends on wxc-0.92.0.0 which failed to install.
wxc-0.92.0.0 failed during the configure step. The exception was:
ExitFailure 1
wxcore-0.92.0.0 depends on wxc-0.92.0.0 which failed to install.
but I have following files in /usr/lib :
/usr/lib/libwx_gtk2u_webview-3.0.so
/usr/lib/libwx_gtk2u_webview-3.0.so.0
/usr/lib/libwx_gtk2u_webview-3.0.so.0.2.0
I have also tried cabal install --extra-lib-dirs=/usr/lib/ wx but to no avail.
I have also tried all the suggestions in cabal install wx Missing C library
I am on archlinux and I have both wxgtk-3.0 and wxgtk-2.8 multilib and normal versions. I also tried reinstalling them.
I just ran into the same problem on Arch; when I tried running cabal with --verbose=3, it looked like libwx_gtk2u_webview-3.0 was present, but it was complaining about libwebkitgtk-1.0 being missing. After I installed the webkitgtk2 package, which provides libwebkitgtk-1.0, wxHaskell installed with no problems.
Try "sudo apt-get install libwxgtk-webview3.0-dev". It worked for me.

Do Cabal recognize packages installed by system package manager

I had lately linker problem during compilation of Haskell code and I wonder whether cabal can find packages installed by OS package manger e.g. I install package X which depends on Y but Y is already installed by package manger (not cabal). Will cabal install it own version of Y? Wouldn't that cause problem when linking?
Yes, Cabal queries GHC to get a list of installed packages, and it will recognize packages installed by your package manager.

No package 'fribidi' found

I try to install module Text::Bidi with cpan but I get the following message:
Package fribidi was not found in the pkg-config search path. Perhaps you should add the directory containing `fribidi.pc' to the
PKG_CONFIG_PATH environment variable
No package 'fribidi' found
at Makefile.PL line 13.
It seems that fribidi is missing.
fribidi should be installed prior to the installation of this module.
I try to:
yum install fribidi
Loaded plugins: refresh-packagekit, security
Setting up Install Process No package fribidi available. Error:
Nothing to do
I search for this issue, but don't find nothing.
**OS: **Oracle Linux 6.6
Oracle only have a package for this for version 4 of their distro. It looks like you'll need to build it from source. See GNU FriBidi.

Fedora - Reinstalling GMP with C++ support

I'm trying to install a library that uses gmp and am running the ./configure on it.
So far, I've gotten past several snags, such as requiring gcc, g++, and m4 by using:
yum install gcc
yum install gcc-g++
yum install m4
Now I'm getting this error:
checking for the GMP library version 4.1.3 or above... no
configure: error: Cannot find GMP version 4.1.3 or higher.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++ interface:
add --enable-cxx to the configuration options.
As such, I tried both installing and updating gmp using yum:
yum install gmp
yum update gmp
Install tells me it's already installed and is v. 5.1.2
Updating says there's nothing to update.
I went to the gmp site and it is currently v. 6.0.0
I downloaded it and ran configure (using --enable-cxx), make, and make install.
Yet, nothing has changed. It still says I have v. 5.1.2 and the configure for the library still says it can't find 4.1.3 and above / try enabling c++.
The gmp files (such as gmp.h) are being placed in /usr/local/lib and /include
I've been at this for hours without any progress. I'm rather new to linux so I imagine there's something I just don't know about.
Am I not installing 6.0.0 correctly to overwrite the already installed one?
Or is there a way to reinstall the original with the c++ option?
Any help would be appreciated. Thanks.
dnf install gmp-devel resolved this for me on rhel
When you manually install something, as you have, it doesn't get installed in the normal /usr/lib directory and therefore it doesn't overwrite it. This is a good thing. In general, you shouldn't mess with files installed by the package manager. (Except in the case that they are config files that are meant to be edited.)
When you install manually, it is installed to /usr/local/lib. Fortunately, GCC and other compilers don't care which directory something is installed in, they will find it (when it's in standard places like /usr/* or /usr/local/*).
Just include the C++ header and add the correct -l library flag.
I figured it out.
Under the --help section of the ./configure for the library I was trying to install, there was actually a feature just for this:
--with-gmp-include=DIR
--with-gmp-lib=DIR
Using these, I was able to get it to install.
Thanks for the help.
I think I was too focused on trying to update the system install of gmp.

Resources