mlampros / OpenImageR

Image processing Toolkit in R
https://mlampros.github.io/OpenImageR/
57 stars 10 forks source link

Build fails on Travis-CI #4

Closed ck37 closed 7 years ago

ck37 commented 7 years ago

Hello,

I'm using OpenImageR due to the dependency with KernelKnn, and am running into an issue where OpenImageR fails to build on Travis-CI.

See the build log here: https://travis-ci.org/ck37/SuperLearner/builds/198726145#L1023

hog_features.cpp: In function ‘arma::rowvec hog_cpp(arma::mat, int, int)’:
hog_features.cpp:33:60: error: could not convert ‘{{-0x00000000000000001, 0, 1}, {-0x00000000000000002, 0, 2}, {-0x00000000000000001, 0, 1}}’ from ‘<brace-enclosed initializer list>’ to ‘arma::mat {aka arma::Mat<double>}’
hog_features.cpp:34:60: error: could not convert ‘{{-0x00000000000000001, -0x00000000000000002, -0x00000000000000001}, {0, 0, 0}, {1, 2, 1}}’ from ‘<brace-enclosed initializer list>’ to ‘arma::mat {aka arma::Mat<double>}’
make: *** [hog_features.o] Error 1
ERROR: compilation failed for package ‘OpenImageR’

Any ideas? It's working fine in Appveyor so it's hard to say why Travis-CI can't compile it.

Actually, look at the code for KernelKnn, there does not seem to be a need to require OpenImageR as it is only used in a vignette. What about moving OpenImageR to Suggests? https://github.com/mlampros/KernelKnn/search?utf8=%E2%9C%93&q=OpenImageR

Thanks, Chris

mlampros commented 7 years ago

Hello and I'm sorry for the late reply,

If I remember correctly I got a similar error when building OpenImageR due to an older gcc/g++ version. I had to include the following to my .travis.yml to overcome the issue,


language: r
warnings_are_errors: false
sudo: required
cache: packages

os:
  - linux

compiler:
  - gcc

env:
  global:
    - R_BUILD_ARGS="--no-build-vignettes --no-manual"
    - R_CHECK_ARGS="--no-build-vignettes --no-manual --as-cran"

  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test -y; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq install gcc-4.8; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq install g++-4.8; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.8 90; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libgfortran3; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install r-base-dev; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libarmadillo-dev; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libarmadillo2; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libopenblas-dev; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libblas-dev liblapack-dev; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libarpack++2-dev; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gfortran; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so.3 /usr/lib/libgfortran.so; fi

please test it and let me know.

ck37 commented 7 years ago

Thanks, yeah I did get it to work. I think though it would still be good to consider removing the OpenImageR requirement from KernelKnn, since it's only used in a vignette and OpenImageR has a lot of dependencies.

mlampros commented 7 years ago

yes you are right, the problem is that I just saw your comment and I already submitted the newer version of KernelKnn to CRAN a few minutes ago. Is it ok if I remove OpenImageR as a dependency from KernelKnn next week?

ck37 commented 7 years ago

Definitely, that would be great - really appreciate it!

mlampros commented 7 years ago

I removed OpenImageR and irlba as dependencies from KernelKnn. I also modified slightly the .travis.yml.

ck37 commented 7 years ago

Awesome, appreciate it!