IHaskell / IHaskell

A Haskell kernel for the Jupyter project.
MIT License
2.59k stars 257 forks source link

iHaskell and Jupyter #442

Closed mango314 closed 9 years ago

mango314 commented 9 years ago

In order to play with iHaskell, I created both a cabal sandbox and python virtualenv to do cabal install ihaskell and still use iPython2. The rest of my computer uses iPython 3.

When I looked this morning there was no jupyter branched. It had been merged. Does that mean we can install from github?

I created a separate cabal sandbox for the github branch, cloned into there and tried ./build.sh all It installs for a while but then failed:

pango-0.13.0.5 depends on cairo-0.13.1.0 which failed to install.
parsers-0.12.1.1 depends on charset-0.3.7 which failed to install.
pointed-4.2 depends on contravariant-1.3 which failed to install.
profunctors-4.4.1 depends on contravariant-1.3 which failed to install.
reducers-3.10.3.1 depends on contravariant-1.3 which failed to install.
repa-3.3.1.2 failed during the final install step. The exception was:
ExitFailure 1
semigroupoids-4.3 depends on contravariant-1.3 which failed to install.
static-canvas-0.2.0.0 depends on contravariant-1.3 which failed to install.
trifecta-1.5.1.3 depends on charset-0.3.7 which failed to install.
vector-instances-3.3.0.1 depends on contravariant-1.3 which failed to install.
vector-space-0.9 depends on MemoTrie-0.6.2 which failed to install.
vector-space-points-0.2.1 depends on MemoTrie-0.6.2 which failed to install.
wl-pprint-extras-3.5.0.4 depends on contravariant-1.3 which failed to install.

This is suspicious since it is installing into my main Cabal instead of the sandbox

Installing library in
/home/jdm/.cabal/lib/x86_64-linux-ghc-7.8.4/MemoTrie-0.6.2

Then maybe I forgot to use the build script from within the sandbox

cabal exec ./build.sh all
cabal: The program './build.sh' is required but it could not be found.
gibiansky commented 9 years ago

There's a few things going on here.

  1. ./build.sh all now builds all the display packages as well. If you only want IHaskell, use ./build.sh ihaskell. It uses cabal install internally so I'm not sure whether it's usable with a sandbox...
  2. If you want to use cabal install, run cabal install ./ipython-kernel ./ghc-parser . to install IHaskell and all its local dependencies. Note that right now new versions of ihaskell and ipython-kernel are not on Hackage.
  3. IHaskell github master now supports only IPython 3.
  4. You can use the scripts linux-install.sh and macosx-install.sh to install on those respective platforms (but this does not use sandboxes).

If you want the display packages, you need to install cairo, which is a bit tricky, but *-install.sh does that for you as well.

mango314 commented 9 years ago

I cloned the github repository and ran ./linux-install.sh it runs for a while and returns me

cabal: Error: some packages failed to install:
arithmoi-0.4.1.1 failed during the building phase. The exception was:
ExitFailure 1
diagrams-1.2 depends on arithmoi-0.4.1.1 which failed to install.
diagrams-contrib-1.1.2.5 depends on arithmoi-0.4.1.1 which failed to install.
ihaskell-diagrams-0.2.0.0 depends on arithmoi-0.4.1.1 which failed to install.
ihaskell-magic-0.2.0.0 depends on magic-1.1 which failed to install.
magic-1.1 failed during the configure step. The exception was:
ExitFailure 1

This is the arithmoi library used for number theory.

gibiansky commented 9 years ago

I have not tested linux-install.sh; @FranklinChen may want to chime in.

However for arithmoi you can install it manually with

cabal install arithmoi==0.4.*

or

cabal install arithmoi==0.4.* -fllvm
FranklinChen commented 9 years ago

I'll fire up my Linux VM tomorrow, but suspect build.sh may need to be changed so that the following simply uses the Darwin -llvm flag for both Mac and Linux?

if [ `uname` = Darwin ]; then
  echo CMD: cabal install --constraint "arithmoi -llvm" -j $INSTALL_DIRS --force-reinstalls --max-backjumps=-1 --reorder-goals
  cabal install --constraint "arithmoi -llvm" -j $INSTALL_DIRS --force-reinstalls --max-backjumps=-1 --reorder-goals
else
  echo CMD: cabal install -j $INSTALL_DIRS --force-reinstalls --constraint "arithmoi==0.4.*" --max-backjumps=-1 --reorder-goals
  cabal install -j $INSTALL_DIRS --force-reinstalls --constraint "arithmoi==0.4.*" --max-backjumps=-1 --reorder-goals
fi
gibiansky commented 9 years ago

@FranklinChen Sounds good; if that's all it takes that'll be an easy fix.

gibiansky commented 9 years ago

Re-open if you encounter any more issues; hopefully linux-install.sh will work now.