My RPM package has this in its dependencies list:
libstdc++.so.6()(64bit)
libstdc++.so.6(CXXABI_1.3)(64bit)
What do the strings in parenthesis mean? And if it is an ABI version, how can I change, replace or delete the dependency?
Depending on your installed gcc/libstdc++ you may need a more recent libstdc++
See also http://glandium.org/blog/?p=1901 and http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
For basic info you can also read http://en.wikipedia.org/wiki/Application_binary_interface
You can'd change, replace, or delete the dependency. If it's required, it's required. You can force it to install but it'll be broken (won't launch).
What you could do is to recompile the code from source.
Related
I'm having trouble uninstalling Cargo-installed packages from my system.
There are packages like rand-0.3.22 that are obviously installed under $HOME/.cargo
ls ~/.cargo/registry/src/github.com-1ecc6299db9ec823/ra
racer-2.0.14/ rand-0.3.22/ rand-0.4.2/
rand-0.4.3/ rand-0.5.5/ rand_core-0.2.1/
rawpointer-0.1.0/ rayon-1.0.2/ rayon-core-1.4.1/
This can also be verified by using cargo pkgid
cargo pkgid -p rand
error: There are multiple `rand` packages in your project, and the specification `rand` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
rand:0.5.5
rand:0.4.3
rand:0.3.22
However, I'm unable to remove that package with cargo uninstall. None of these seem to work:
cargo uninstall rand
cargo uninstall -- rand:0.4.3
cargo uninstall https://github.com/rust-lang/crates.io-index#rand:0.4.3
For any of the commands above I get:
error: invalid package id specification: <name-of-package-i-specified>
This seems like a rather basic operation so I suspect it's something fundamental to how cargo-uninstall is to be used.
Any pointers?
cargo uninstall undoes the effect of cargo install. You did not cargo install rand, because it is just a library, not an executable program. That means it was not installed.
The ~/.cargo/registry is just a cache of build dependencies. Feel free to wipe it anytime; cargo will re-download and re-build whatever it needs when it does.
Yes, it is wrong. Cargo should be using .local, .config and .cache as appropriate; then it would be obvious what you can just clean up. Using arbitrary dot-dirs is an insult at this day and age. It was reported, several times probably. Nobody got around to fixing it yet.
I'm trying to upgrade the dependencies of the pipes-files package, so that it can be included in the latest stack LTS. The pipes-files package does not contain a stack.yaml file, and the pipes-files.cabal file contains quite some upper and lower bounds on its dependencies, e.g.:
base >=4.7 && <4.10
, transformers >=0.3 && <0.6
, transformers-base >=0.3 && <0.6
-- and quite some more ...
Is there a tool that I can run to get the latest versions of each of these dependencies? The closest thing I could find was packdeps but it will require me to search for the dependencies one by one.
Preliminary notes:
hierarchy, a dependency of pipes-files, has the same issue you are trying to work around -- it is not in Stackage and has version bounds outdated with respect to the latest LTS. That means you'll first have to get it to build successfully, and then add your tweaked version of it to the extra-deps in the stack.yaml of pipes-files.
cabal gen-bounds, which "suggest[s] dependency version bounds that conform to Package Versioning Policy", is, in principle, the right tool for the job. However, getting cabal-install to behave according to the restrictions of a Stack-centric environment is not always straightforward. While this seems enough to run cabal gen-bounds from a bash shell in the absence of a Stack-independent GHC installation...
PATH=$PATH:$(stack path --compiler-bin) cabal gen-bounds
... I couldn't figure out how to get it to follow the version restrictions of the Stack(age) snapshot -- in particular, the --package-db option, which can be helpful with commands such as cabal configure, doesn't seem to be accepted by gen-bounds.
As I don't know how to make cabal gen-bounds and Stack cooperate, I will suggest a somewhat more convoluted method, but one that doesn't require using cabal-install directly. It uses Jenga, a tool that can retrieve the version information left implicit by your choice of Stackage snapshot. Jenga is not on Stackage; to install it with Stack, grab the sources from GitHub (or with stack unpack jenga) and then run stack init --solver followed by stack install.
Remove all version bounds from the hierarchy.cabal file (or whatever the relevant .cabal file is).
stack init --solver, to create a stack.yaml file with any extra-deps that might be necessary. (You can use --resolver to explicitly choose the snapshot to be used.)
stack build, as a sanity check that the package is buildable.
In the generated stack.yaml, check whether the extra-deps field is commented out; if so, uncomment it. This is necessary for step #6 to work.
jenga -i hierarchy.cabal, which will print the exact dependency versions Stack would use to build the package.
Paste the versions Jenga gave you into the build-depends of the .cabal file, adjusting then if desired (at a minimum, you'll probably want to relax the minor version bounds for PVP compliance -- e.g. changing base == 4.9.1.0 to base == 4.9.*).
I recently ran into a Cabal issue that I only managed to solve by manually installing transformers-compat with the -f transformers3 flag in my cabal sandbox before running cabal install for my project.
Is there any way to indicate in my application's .cabal file that I depend on a library so that it is built with the specific build flag?
Newer versions of Cabal let you specify constraints in your cabal.project.local or cabal.project file. For example:
constraints: hmatrix +openblas
Is there any way to indicate in my application's .cabal file that I depend on a library so that it is built with the specific build flag?
No, but in your case this is not actually a problem in the solver and is rather and uninformative error (caused by someone's less than judicious uses of flags).
Looks like it's not possible to specify such a dependency via the build-depends field in your .cabal file. buildDepends is defined as [Dependency], where data Dependency = Dependency PackageName VersionRange. You can use cabal install --constraint="transformers-compat +transformers3", though.
Looking at the transformers-compat.cabal file, I think that the solver should be able to figure out the correct flag assignment if you constrain your dependency on transformers appropriately. E.g. build-depends: transformers >= 0.3 && < 0.4 should force the solver to choose transformers-compat +transformers3. If this doesn't work, it may be a bug in the solver.
I also struggled for a long time to find a solution to this problem. I just found one! You have to modify the global cabal configuration file at ~/.cabal/config. Add a constraints line like this to the initial section of the file:
constraints: hmatrix +openblas
This enables the openblas flag for the hmatrix package. It will be used automatically the next time the package is installed. If there is a way to set such a flag locally for a sandbox, I could not find it.
You cannot do this with Cabal.
One way to do this is to use Stack. Edit your stack.yaml to include
flags:
transformers-compat:
transformers3: true
See also the section on flags.
cabal now supports an elegant way to do this similar to stack, through cabal.project configuration options.
package transformers-compat
flags: +transformers3
will add the flag transformers3 when building the package transformers-compat.
There are a couple of ways to constrain the version for installation.
Add lower and upper bounds to package versions in the cabal file like Mikhail mentioned above, example of such a file here
Additionally, you can override the settings in the .cabal file with the flag cabal install --constraint="bar-2.1"
To remove a specific version of a package:
In a sandbox you can unregister a version with cabal sandbox hc-pkg unregister bar-2.1
Global unregistering can be done with this command outside of sandbox ghc-pkg unregister bar-2.1
how can I tell configure to check for version >= x.y of a given Haskell package?
Thanks,
Use cabalvchk: http://hackage.haskell.org/package/cabalvchk-0.2
For example, to verify that the version of parsec is >= 0.4, you could issue:
$ cabalvchk parsec '>= 0.4'
The return code will be zero if the version constraint is satisfied and non-zero otherwise. The version constraint can be anything cabal understands. An optional third parameter can be non-blank to request verbose output.
I don't know much about configure; can you ask it to run a particular command? If so, then ghc-pkg latest should help you out. For example, here's a run on my machine for the zlib package:
% ghc-pkg latest zlib
zlib-0.5.3.1
% ghc-pkg latest --global zlib
zlib-0.5.3.1
% ghc-pkg latest --user zlib
ghc-pkg: cannot find package zlib
zsh: exit 1 ghc-pkg latest --user zlib
The --global should be used for system-wide installations, and no flag at all for user-specific installations. The --user flag should only be used when you want to check whether a user has a local installation of a package (that may override the global one).
Unless you have a reason not to, I recommend ditching configure in favor of cabal. For cabal, the solution here is to first cabal init in your project's directory, then check that you have a line like this in the .cabal file that's created:
build-depends: zlib >= 0.5
The cabal toolchain is the standard for Haskell projects (because it automates and simplifies many things, including dependency-chasing). You can also ask cabal to invoke configure if there are other dependencies. Open a separate question if you'd like more information about this.
Perhaps the better question is: should you? Checking for a specific version number is one of the great arguments in the autoconf world, and the general winner of the debate is the side which says you should never do it. What specific feature of Haskell do you need? Test for that. As a simple example (unrelated to haskell), suppose your program uses inotify so you want the configury to test if it is available. You could just test if the kernel version is > 2.6.13, but then when Joe tries to build your program on his 2.4.xx version in which he has patched in inotify capability, he's going to be really irritated that your program won't work.
You do not care if Haskell > x.y is available. Instead, there is some specific feature of Haskell that you want that was introduced in x.y; test for that feature.
Using ghc-pkg list, you can get a list of installed versions of a package in ascending order. You should hopefully be able to filter through this list looking for a match. (I don't know how to do this with configure, sorry).
$ ghc-pkg list yesod
/home/ahammar/.haskell/lib/ghc-7.0.2/package.conf.d
/home/ahammar/.ghc/x86_64-linux-7.0.2/package.conf.d
yesod-0.8.2.1
yesod-0.9.1
yesod-0.9.2.2
Try something like this:
# Find ghc-pkg, so we can do version checks
AC_ARG_VAR([GHC_PKG], [Path to ghc-pkg])
AC_PATH_PROG([GHC_PKG], [ghc-pkg])
AS_IF([test -z "$GHC_PKG"], [AC_MSG_ERROR([Cannot find ghc-pkg.])])
# Check that the package actually exists
AC_MSG_CHECKING([for Haskell package foo])
AS_IF([$GHC_PKG latest foo > /dev/null 2>&1],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Cannot find foo])])
# Check its version
AC_MSG_CHECKING([if foo is new enough])
foo_ver=`$GHC_PKG latest foo | sed 's/^foo-//'`
# At this point you have the version of foo and the minimum version you want.
# The rest of the test is pretty easy to write, use cut and test to compare the
# version numbers. If it's new enough, AC_MSG_RESULT([yes]).
# If not, AC_MSG_RESULT([no]) and AC_MSG_ERROR([foo is not new enough.])
This is the output from cabal install codec-image-devil:
Resolving dependencies...
Configuring Codec-Image-DevIL-0.2.3...
cabal: Missing dependency on a foreign library:
* Missing C library: IL
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:
Codec-Image-DevIL-0.2.3 failed during the configure step. The exception was:
ExitFailure 1
I tried --extra-include-dirs and --extra-lib-dirs. but they didn't work. so I edited the .cabal in Codec-Image-DevIL-0.2.3.tar.gz. I don't know if I'm even supposed to change that. but it worked for pthread.
I added these two lines:
include-dirs: C:\Users\Rumbold\Documents\libs\IL\include, C:\Users\Rumbold\Documents\libs\pthread\include, .
extra-lib-dirs: C:\Users\Rumbold\Documents\libs\IL\lib, C:\Users\Rumbold\Documents\libs\pthread\lib, .
They are indented so they are in the Library section. I don't know if I got the format for lists right, just something i stumbled upon while googling. The libs and `header files are all in the correct place, I think.
any clue how i can get it to work?
Edit_1:
I got it to work with --extra-include-dirs and --extra-lib-dirs, so I don't need to edit the cabal anymore. but IL still doesn't work. is there a way to find out which files it's looking for?
Wdit_2:
Alright it works. I had to rename DevIL.lib and DevIL.dll to libIL.lib and libIL.dll. (not sure if I had to do both, but that's what I did. also kept them under their old names)
Edit_3:
Getting lots of errors like:
"cabal\Codec-Image-DevIL-0.2.3\ghc-6.12.3/libHSCodec-Image-DevIL-0.2.3.a(DevIL.o):fake:(.text+0x2379):
undefined reference to `ilGetInteger#4'"