Skip to content

Add .travis.yml and test target#12

Closed
dmjio wants to merge 4 commits into
masterfrom
travis
Closed

Add .travis.yml and test target#12
dmjio wants to merge 4 commits into
masterfrom
travis

Conversation

@dmjio

@dmjio dmjio commented Nov 5, 2019

Copy link
Copy Markdown
Member

No description provided.

Comment thread arrayfire.cabal Outdated
@chessai

chessai commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator

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

@dmjio

dmjio commented Nov 5, 2019

Copy link
Copy Markdown
Member Author

@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

@noughtmare

Copy link
Copy Markdown

@chessai try passing the -v3 flag to cabal.

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

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

@chessai chessai closed this Nov 6, 2019
@chessai chessai reopened this Nov 6, 2019
@noughtmare

Copy link
Copy Markdown

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

@noughtmare

noughtmare commented Nov 6, 2019

Copy link
Copy Markdown

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.

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

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

@noughtmare

Copy link
Copy Markdown

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

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

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

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

changed cabal to ${CABAL}. typo

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

use $WITHCOMPILER

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

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

@noughtmare

Copy link
Copy Markdown

Now we're seeing real errors 🎉

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

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'

@noughtmare

Copy link
Copy Markdown

That was fixed in #17

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

ok, rebasing

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

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

@noughtmare

Copy link
Copy Markdown

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

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator
/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

@noughtmare

noughtmare commented Nov 6, 2019

Copy link
Copy Markdown

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

hmm. that is strange.

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

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

@noughtmare

Copy link
Copy Markdown

Yes, I think so.

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

now we at least see the same error on both.

@noughtmare

noughtmare commented Nov 6, 2019

Copy link
Copy Markdown

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

noughtmare commented Nov 6, 2019

Copy link
Copy Markdown

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)

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

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

@noughtmare

Copy link
Copy Markdown

Yes, that would also work.

@noughtmare

Copy link
Copy Markdown

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

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

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

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

failure on push is spurious.

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

actually, those have to be persisting, because a lot of them are actually used during install. so i'm less worried about that. for example, if the extension to PATH to include $CABALHOME/bin didn't persist, the hspec-discover failure would still be occurring.

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

extending LD_LIBRARY_PATH worked.

Test suite now fails with:

Failures:
  test/ArrayFire/ArithSpec.hs:31:7: 
  1) ArrayFire.Arith, Arith tests, Should take cubed root
       expected: ArrayFire Array
                 [1 1 1 1]
                     3.0000 
                 
        but got: ArrayFire Array
                 [1 1 1 1]
                     3.0000 
                 
  To rerun use: --match "/ArrayFire.Arith/Arith tests/Should take cubed root/"
Randomized with seed 938744424

Which i think is a problem with floating point arithemtic

@noughtmare

Copy link
Copy Markdown
test/ArrayFire/ArithSpec.hs:31:7: 
1) ArrayFire.Arith, Arith tests, Should take cubed root
     expected: ArrayFire Array
               [1 1 1 1]
                   3.0000 

      but got: ArrayFire Array
               [1 1 1 1]
                   3.0000 

🤔

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

perhaps we should add a shouldBeEps :: Array Double -> ArrayFire Double -> Expectation that compares for equality within some epsilon.

Comment thread test/ArrayFire/ArithSpec.hs Outdated
@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

push failure is spurious

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

nice. it built and passed.

@chessai

chessai commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator

added ghc 8.6.5 and 8.4.4.

@chessai

chessai commented Nov 7, 2019

Copy link
Copy Markdown
Collaborator

Configure fails on older ghcs/cabal 2.4. Havent looked into it.

@chessai

chessai commented Nov 8, 2019

Copy link
Copy Markdown
Collaborator

i am going to get arrayfire locally so i can test without travis. i don't know why configure is failing on older ghcs, but not 881 with cabal 3.0

@noughtmare

Copy link
Copy Markdown

lapack spec: failing with "free(): invalid next size (normal)"

I get a similar error message in #13 (comment).

- use haskell-ci
- download arrayfire installer and unpack to /opt/arrayfire/
- remove Ord tests from test suite
- use shouldBeEps for comparing Array Double

nix updates

- change shellHooks to use runhaskell instead of cabal-v1
- extend LD_LIBRARY_PATH to include $AF_LIB
- ghcid shellHook uses -fno-nocode
- get tests to build and _almost_ pass
@chessai

chessai commented Nov 20, 2019

Copy link
Copy Markdown
Collaborator

just trying to appease travis right now, because locally everything is fine.

@chessai

chessai commented Nov 20, 2019

Copy link
Copy Markdown
Collaborator

OK, we now have CI for GHC 8.4.4, 8.6.5, and 8.8.1. @noughtmare @dmjio please review when you have time.

@chessai

chessai commented Nov 20, 2019

Copy link
Copy Markdown
Collaborator

have to add back LAPACK/doctest tests

@dmjio

dmjio commented Jun 7, 2026

Copy link
Copy Markdown
Member Author

We have a working nix build w/ GitHub CI for linux / osx now, #67 #69

@dmjio dmjio closed this Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants