arrayfire-haskell icon indicating copy to clipboard operation
arrayfire-haskell copied to clipboard

Add .travis.yml and test target

Open dmjio opened this issue 4 years ago • 44 comments

dmjio avatar Nov 05 '19 06:11 dmjio

Why not use haskell-ci (which is really good), using travis for ubuntu? Unless you can have multiple travis setups for nix and non-nix builds. We could potentially test-drive typhon here for nix

chessai avatar Nov 05 '19 15:11 chessai

@chessai I'll check out haskell-ci tonight, bigger issue is why cabal on ubuntu doesn't respect extra-lib-dirs and extra-include-dirs in the cabal file after cabal configure

dmjio avatar Nov 05 '19 16:11 dmjio

@chessai try passing the -v3 flag to cabal.

noughtmare avatar Nov 06 '19 18:11 noughtmare

why is a travis build not triggering on the most recent commits?

chessai avatar Nov 06 '19 18:11 chessai

@chessai It is working again, but you added -v3 in the wrong place.

noughtmare avatar Nov 06 '19 19:11 noughtmare

The log shows:

/usr/bin/gcc returned ExitFailure 1 with error message:
gcc: error: /opt/arrayfire/lib: No such file or directory

I think this is because of the ld-options field in the cabal file. I think it is best if the entire field is removed completely.

noughtmare avatar Nov 06 '19 20:11 noughtmare

okay, configure seems to succeed now. however, hspec-discover fails.

chessai avatar Nov 06 '19 21:11 chessai

Yes, I fixed that error on my machine by running cabal install hspec-discover.

noughtmare avatar Nov 06 '19 21:11 noughtmare

most recent failure seems spurious (just adding hvr-ppa)

chessai avatar Nov 06 '19 21:11 chessai

changed cabal to ${CABAL}. typo

chessai avatar Nov 06 '19 21:11 chessai

use $WITHCOMPILER

chessai avatar Nov 06 '19 21:11 chessai

sorry, i keep forgetting that git with do weird things with '$'-prefixed strings.

chessai avatar Nov 06 '19 21:11 chessai

Now we're seeing real errors :tada:

noughtmare avatar Nov 06 '19 21:11 noughtmare

okay, the library is building, but running anything is failing with:

/tmp/dist-test.N8AS/dist-newstyle/build/x86_64-linux/ghc-8.8.1/arrayfire-0.1.0.0/build/libHSarrayfire-0.1.0.0-inplace.a(LAPACK.o)(.text+0x71f): error: undefined reference to 'af_pinverse'
/tmp/dist-test.N8AS/dist-newstyle/build/x86_64-linux/ghc-8.8.1/arrayfire-0.1.0.0/build/libHSarrayfire-0.1.0.0-inplace.a(Image.o)(.text+0x48a5): error: undefined reference to 'af_iterative_deconv'
/tmp/dist-test.N8AS/dist-newstyle/build/x86_64-linux/ghc-8.8.1/arrayfire-0.1.0.0/build/libHSarrayfire-0.1.0.0-inplace.a(Image.o)(.text+0x4be4): error: undefined reference to 'af_inverse_deconv'
/tmp/dist-test.N8AS/dist-newstyle/build/x86_64-linux/ghc-8.8.1/arrayfire-0.1.0.0/build/libHSarrayfire-0.1.0.0-inplace.a(LAPACK.o)(.text+0x1000): error: undefined reference to 'af_pinverse'
/tmp/dist-test.N8AS/dist-newstyle/build/x86_64-linux/ghc-8.8.1/arrayfire-0.1.0.0/build/libHSarrayfire-0.1.0.0-inplace.a(Signal.o)(.text+0x4aa): error: undefined reference to 'af_approx1_uniform'
/tmp/dist-test.N8AS/dist-newstyle/build/x86_64-linux/ghc-8.8.1/arrayfire-0.1.0.0/build/libHSarrayfire-0.1.0.0-inplace.a(Signal.o)(.text+0xa6f): error: undefined reference to 'af_approx2_uniform'

chessai avatar Nov 06 '19 21:11 chessai

That was fixed in #17

noughtmare avatar Nov 06 '19 21:11 noughtmare

ok, rebasing

chessai avatar Nov 06 '19 21:11 chessai

once a build with 8.8.1 passes, i will re-add the older ghcs

chessai avatar Nov 06 '19 21:11 chessai

It seems that #23 forgot to also remove the tests for the Ord instance.

noughtmare avatar Nov 06 '19 21:11 noughtmare

/tmp/dist-test.Iv7D/dist-newstyle/build/x86_64-linux/ghc-8.8.1/arrayfire-0.3.0.0/t/test/build/test/test: error while loading shared libraries: libaf.so.3: cannot open shared object file: No such file or directory
Test suite test: FAIL 
Test suite logged to: /tmp/dist-test.Iv7D/dist-newstyle/build/x86_64-linux/ghc-8.8.1/arrayfire-0.3.0.0/t/test/test/arrayfire-0.3.0.0-test.log 
0 of 1 test suites (0 of 1 test cases) passed. 
-----BEGIN CABAL OUTPUT-----
cabal: Tests failed for test:test from arrayfire-0.3.0.0.
-----END CABAL OUTPUT-----

looks like this isnt getting copied in properly

chessai avatar Nov 06 '19 21:11 chessai

It is strange. There are two builds, pr and push, and they give different outputs:

  • https://travis-ci.org/arrayfire/arrayfire-haskell/builds/608426254?utm_source=github_status&utm_medium=notification
  • https://travis-ci.org/arrayfire/arrayfire-haskell/builds/608426245?utm_source=github_status&utm_medium=notification

noughtmare avatar Nov 06 '19 21:11 noughtmare

hmm. that is strange.

chessai avatar Nov 06 '19 21:11 chessai

do i need to remove the Ord tests from the test suite?

chessai avatar Nov 06 '19 21:11 chessai

Yes, I think so.

noughtmare avatar Nov 06 '19 21:11 noughtmare

now we at least see the same error on both.

chessai avatar Nov 06 '19 21:11 chessai

Oh, I think I know how to fix this. The linux documentation of arrayfire mentions that you have to do this:

Given sudo permissions, you can add the ArrayFire libraries via ldconfig like so:

echo /opt/arrayfire/lib64 > /etc/ld.so.conf.d/arrayfire.conf
sudo ldconfig

Otherwise, you will need to set the LD_LIBRARY_PATH environment variable in order to let your shared library loader find the ArrayFire libraries.

noughtmare avatar Nov 06 '19 21:11 noughtmare

I think that is also the reason for the ld-options field in the cabal file.

So another alternative we have is putting:

ld-options: -Wl,-rpath /opt/arrayfire/lib64

back in the cabal file.

(not -Wl,-rpath /opt/arrayfire/lib)

noughtmare avatar Nov 06 '19 21:11 noughtmare

we could do that. would it be better instead to do export LD_LIBRARY_PATH="/opt/arrayfire/lib64:$LD_LIBRARY_PATH"?

chessai avatar Nov 06 '19 21:11 chessai

Yes, that would also work.

noughtmare avatar Nov 06 '19 21:11 noughtmare

I don't know if it carries over from before-install to script, but we will see.

noughtmare avatar Nov 06 '19 21:11 noughtmare

me either. i should probably just do it right after the arrayfire script finishes.

chessai avatar Nov 06 '19 21:11 chessai