Skip to main content

How to solve the cabal ld: library not found issue on Mac OS X

Today, after upgrading haskell platform, bumped onto a strange cabal installer problem:
$ cabal install distributive-0.4.4 Resolving dependencies...
[1 of 1] Compiling Main ( /var/folders/2k/6dnfg_x43_a21poayfbpnby40000gn/T/distributive-0.4.4-27117/distributive-0.4.4/dist/setup/setup.hs, /var/folders/2k/
6dnfg_x43_a21poayfbpnby40000gn/T/distributive-0.4.4-27117/distributive-0.4.4/dist/setup/Main.o )
Linking /var/folders/2k/
6dnfg_x43_a21poayfbpnby40000gn/T/distributive-0.4.4-27117/distributive-0.4.4/dist/setup/setup ...
Configuring distributive-0.4.4...
Building distributive-0.4.4...
Preprocessing library distributive-0.4.4...
[1 of 2] Compiling Data.Distributive.Generic ( src/Data/Distributive/Generic.hs, dist/build/Data/Distributive/Generic.o )
[2 of 2] Compiling Data.Distributive ( src/Data/Distributive.hs, dist/build/Data/Distributive.o )
ld: library not found for -lHStransformers-compat-0.3.3.4-ghc7.8.3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Failed to install distributive-0.4.4
cabal: Error: some packages failed to install:
distributive-0.4.4 failed during the building phase. The exception was:
ExitFailure 1


The solution was to change the install-dirs in ~/.cabal/config,
i.e.

     install dirs user
       prefix: /Users/myuser/Library/Haskell

     install dirs global
       prefix: /Library/Haskell

Why? See this section in the cabal FAQ.

Comments

Popular posts from this blog

How to program SPI flash memory on Digilent Nexys4 and other 7th generation devices using Vivado 2014.x

Update: The methods described below work also on Vivado 2015! Please let me know if you had any issues with other Vivado versions.

The information in the official user guides and tutorials seems to be fragmentary and sometimes out-of-date, that's why I decided to fill in this gap, not waiting for the official Xilinx updates. Our goal is to show how to program the SPI flash memory of the 7th generation Xilinx devices with Vivado 2014 on example of Nexys4 board.

Note: before we start, we assume you already have a working project, that means the generated bitstream file works on your device. If not, you may want to go directly to the Program the SPI flash section to test your Nexys4 board with prepared .mcs file.
PlanConfigure the hardware to work with SPI flash memoryRegenerate the bitstream fileConvert the bitstream file into the "Prom" formatProgram the SPI flashBoot the device Configure the hardware to work with SPI flash memory Open the synthesized or implemented design…

How to fix 'ImportError: cannot import name QtCore' on Debian Linux

What to do if such import error occurs? >>> import PySide
>>> from PySide import QtCore
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name QtCore

1. Try to locate where your pyside is installed: $ locate PySide ... /usr/lib/python2.7/dist-packages/PySide
/usr/lib/python2.7/dist-packages/PySide/__init__.py
/usr/lib/python2.7/dist-packages/PySide/__init__.pyc
/usr/lib/python2.7/dist-packages/PySide/phonon.so
/usr/lib/python2.7/dist-packages/PySide/QtCore.so
/usr/lib/python2.7/dist-packages/PySide/QtDeclarative.so
/usr/lib/python2.7/dist-packages/PySide/QtGui.so
/usr/lib/python2.7/dist-packages/PySide/QtHelp.so ...

Hint: use this to update your file index:

$ sudo updatedb
2. The solution is easy: add this to your ~/.bashrc (or ~/.<shell>rc you actually have). export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/python2.7/dist-packages/PySide

Improve your negatives scanning

My personal experience of scanning negatives used to be rather poor: pale colours, blurry details, colour noise, etc. On the picture below the same image scanned from 35mm negative some while ago is compared to the improved one. The techniques described below are applied to the image on the right. Both scans are done via Plustek OpticFilm 8100 scanner. The sequence and logic of operations is what matters the most, and thus, they will be applicable to a wide range of other devices.

Improving negative scan process. A picture taken in Marseille, France. Kiev 4a, Kodak Portra 160.

The main idea is to allow your scanner to acquire an image with highest possible resolution avoiding scanner software image processing as much as possible. And only then the image can be digitally altered  in dedicated software (GIMP, Photoshop). Why? Because some of software scanner features, i.e. dust removal, grain reduction, decrease the image quality, i.e. blurring the fine details of acquired image. As in…