dmjio/Julio

Use with julia-1.1.0

tdietert opened this issue · 4 comments

I am struggling to modify the cabal file to get this repo to work with julia-1.1.0, but I think it's because my experience with nix is severely lacking. Do you know of a quick way in which to get this repo building using julia-1.1.0?

I have tried modifying the library: include-dirs and executable: ld-options cabal fields to point to the derivation of julia-1.1.0 that I want to use in my /nix/store and have also modified the the default.nix file to use a newer nixpkgs revision that includes julia-1.1.0. However, no matter what I tweak or modify I can't seem to get the project building.

This is the output of my build:

$ nix-build
these derivations will be built:
  /nix/store/n5ynz60wd1zbfz32wmnrjdblhdj8i94f-julio-0.1.0.0.drv
building '/nix/store/n5ynz60wd1zbfz32wmnrjdblhdj8i94f-julio-0.1.0.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/cclv7n6jr311i5ywwkms1m3iz4lsg37j-ghc-8.6.3.
unpacking sources
unpacking source archive /nix/store/axjdhld7rb2gzivfsppz5033a8nz6wf9-Julio
source root is Julio
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/hakfcg18h12564jj300gyr7r9br0zfwj-julio-0.1.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/68snhp2lz2plb7bw0q27wpan2x39wcjq-julio-0.1.0.0-doc/share/doc/julio-0.1.0.0 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --enable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/mi5krns5p204a3rdn1rj4ajnbqn2809i-ncurses-6.1-20181027/lib --extra-lib-dirs=/nix/store/rd7n0v6mymvyqbw3d307caqc23c8kc71-gmp-6.1.2/lib --extra-include-dirs=/nix/store/va0yp1gqd43vsrw7g11jfibyrbx85nsw-julia-1.0.3/include --extra-lib-dirs=/nix/store/va0yp1gqd43vsrw7g11jfibyrbx85nsw-julia-1.0.3/lib --extra-include-dirs=/nix/store/va0yp1gqd43vsrw7g11jfibyrbx85nsw-julia-1.0.3/include --extra-lib-dirs=/nix/store/va0yp1gqd43vsrw7g11jfibyrbx85nsw-julia-1.0.3/lib
Using Parsec parser
Warning: julio.cabal:40:3: Unknown field: "extra-include-dirs"
Configuring julio-0.1.0.0...
Dependency base -any: using base-4.12.0.0
Dependency base -any: using base-4.12.0.0
Dependency julio -any: using julio-0.1.0.0
Source component graph:
    component lib
    component exe:main dependency lib
Configured component graph:
    component julio-0.1.0.0-DMRJo63rNoMGI9H31QyV3 include base-4.12.0.0
    component julio-0.1.0.0-Fy1D3OMEBqA5xcvYIikbmt-main
        include base-4.12.0.0
        include julio-0.1.0.0-DMRJo63rNoMGI9H31QyV3
Linked component graph:
    unit julio-0.1.0.0-DMRJo63rNoMGI9H31QyV3
        include base-4.12.0.0
        Julia=julio-0.1.0.0-DMRJo63rNoMGI9H31QyV3:Julia
    unit julio-0.1.0.0-Fy1D3OMEBqA5xcvYIikbmt-main
        include base-4.12.0.0
        include julio-0.1.0.0-DMRJo63rNoMGI9H31QyV3
Ready component graph:
    definite julio-0.1.0.0-DMRJo63rNoMGI9H31QyV3 depends base-4.12.0.0
    definite julio-0.1.0.0-Fy1D3OMEBqA5xcvYIikbmt-main
        depends base-4.12.0.0
        depends julio-0.1.0.0-DMRJo63rNoMGI9H31QyV3
Using Cabal-2.4.0.1 compiled by ghc-8.6
Using compiler: ghc-8.6.3
Using install prefix:
/nix/store/hakfcg18h12564jj300gyr7r9br0zfwj-julio-0.1.0.0
Executables installed in:
/nix/store/hakfcg18h12564jj300gyr7r9br0zfwj-julio-0.1.0.0/bin
Libraries installed in:
/nix/store/hakfcg18h12564jj300gyr7r9br0zfwj-julio-0.1.0.0/lib/ghc-8.6.3/x86_64-linux-ghc-8.6.3/julio-0.1.0.0-DMRJo63rNoMGI9H31QyV3
Dynamic Libraries installed in:
/nix/store/hakfcg18h12564jj300gyr7r9br0zfwj-julio-0.1.0.0/lib/ghc-8.6.3/x86_64-linux-ghc-8.6.3
Private executables installed in:
/nix/store/hakfcg18h12564jj300gyr7r9br0zfwj-julio-0.1.0.0/libexec/x86_64-linux-ghc-8.6.3/julio-0.1.0.0
Data files installed in:
/nix/store/hakfcg18h12564jj300gyr7r9br0zfwj-julio-0.1.0.0/share/x86_64-linux-ghc-8.6.3/julio-0.1.0.0
Documentation installed in:
/nix/store/68snhp2lz2plb7bw0q27wpan2x39wcjq-julio-0.1.0.0-doc/share/doc/julio-0.1.0.0
Configuration files installed in:
/nix/store/hakfcg18h12564jj300gyr7r9br0zfwj-julio-0.1.0.0/etc
No alex found
Using ar found on system at:
/nix/store/3xwc1ip20b0p68sxqbjjll0va4pv5hbv-binutils-2.30/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 7.4.0 given by user at:
/nix/store/isg8rxaxkijl9x3hr2gzsf8pqfnqxg3k-gcc-wrapper-7.4.0/bin/gcc
Using ghc version 8.6.3 found on system at:
/nix/store/cclv7n6jr311i5ywwkms1m3iz4lsg37j-ghc-8.6.3/bin/ghc
Using ghc-pkg version 8.6.3 found on system at:
/nix/store/cclv7n6jr311i5ywwkms1m3iz4lsg37j-ghc-8.6.3/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.22.0 found on system at:
/nix/store/cclv7n6jr311i5ywwkms1m3iz4lsg37j-ghc-8.6.3/bin/haddock
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/cclv7n6jr311i5ywwkms1m3iz4lsg37j-ghc-8.6.3/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/cclv7n6jr311i5ywwkms1m3iz4lsg37j-ghc-8.6.3/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/r3znaf3bqz465zg3ja5garkalxfxzskd-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/lwdkm354f3zzsvkf7pqmnc8w6r164b42-binutils-wrapper-2.30/bin/ld
No pkg-config found
Using runghc version 8.6.3 found on system at:
/nix/store/cclv7n6jr311i5ywwkms1m3iz4lsg37j-ghc-8.6.3/bin/runghc
Using strip version 2.30 found on system at:
/nix/store/3xwc1ip20b0p68sxqbjjll0va4pv5hbv-binutils-2.30/bin/strip
Using tar found on system at:
/nix/store/6y95ihqqw5ws23mp74f919d5q49jin9l-gnutar-1.30/bin/tar
No uhc found
Setup: Missing dependency on a foreign library:
* Missing (or bad) C library: julia
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.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

builder for '/nix/store/n5ynz60wd1zbfz32wmnrjdblhdj8i94f-julio-0.1.0.0.drv' failed with exit code 1
error: build of '/nix/store/n5ynz60wd1zbfz32wmnrjdblhdj8i94f-julio-0.1.0.0.drv' failed

The revision I am attempting to use is: bfc3789

dmjio commented

@tdietert thanks for reaching out. I've recently updated the nixpkgs version as well as the Julia version to 1.1.0 (as of this commit). Just clone and nix-build, it will all work.

The julia package has a non-standard directory structure for /lib and /include and no .pc file to configure this properly, so it doesn't play well with nix. This commit uses pkg-config to configure Julia's include / lib dirs while removing the need to hardcode nix paths into the cabal file. Let me know if you need anything else or would like to collaborate further on this project. ✌️

Wonderful, thank you so much! 🙏 I'm currently writing a multi-process/distributed-process map/reduce style program that evaluates some computationally intensive algorithm written in julia in parallel.

If I run into any issues, suggestions, or extensions of the julia interface, I'll let you know via issue or PR 👍

dmjio commented

Sounds pretty awesome, definitely keep me appraised of the progress !