Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Travis CI integration #262

Closed
JM1 opened this issue Aug 2, 2018 · 9 comments
Closed

Update Travis CI integration #262

JM1 opened this issue Aug 2, 2018 · 9 comments

Comments

@JM1
Copy link
Contributor

JM1 commented Aug 2, 2018

Elemental, as of now, is being built using GCC5 and Clang 3.8 on Travis CI (.travis.yml). To discover code/compiler bugs like #259 it might help to add newer compiler revisions, e.g. GCC8 and Clang 6.0.

I would also suggest to remove ccache from .travis.yml because it does not speed up compilation. Actually it slows down compilation, e.g. for GCC5 it is 45 Minutes incl. ccache vs. ~14 Minutes excl. ccache. 45 Minutes (excl. VM boot) is problematic, because Travis CI kills jobs that exceed the maximum time limit of 50 Minutes (incl. VM boot).

An updated .travis.yml for Elemental can be found here (build logs). GCC8 fails to build Elemental because of #259 and the Clang 6.0 crashes during compilation.

What do you think, @poulson ?

@jedbrown
Copy link
Member

jedbrown commented Aug 2, 2018

Looks like CCACHE=yes (and CXX is /usr/lib/ccache/g++-5) in both variants https://travis-ci.org/JM1/Elemental/jobs/411222469#L667.

@JM1
Copy link
Contributor Author

JM1 commented Aug 3, 2018

Upps.. Thanks for spotting this bug! New .travis.yml here (build logs). Actually ccache speeds up GCC builds (16 Minutes incl. ccache vs. >45 Minutes excl. ccache)..

@poulson
Copy link
Member

poulson commented Aug 3, 2018

That SGTM! And thank you for taking the time to look into this!

@jedbrown
Copy link
Member

jedbrown commented Aug 3, 2018

Looks like ccache is not being used for the Clang build. Is there a /usr/lib/ccache/clang++ (without the version number)? Otherwise you can CXX="ccache clang++-3.8".

@JM1
Copy link
Contributor Author

JM1 commented Aug 6, 2018

ccache gives me a headache...

According to man cmake-properties both options -DCMAKE_C_COMPILER_LAUNCHER=ccache and -DCMAKE_CXX_COMPILER_LAUNCHER=ccache are supported e.g. by CMake 3.7, but it seems as if they have no effect on any *.ninja file or Makefile (at least for me).

Setting environment variables CC/CXX (export CC="ccache gcc"; export CXX="ccache g++"; cmake ...) works but then CMake sets e.g. CMAKE_C_COMPILER=/usr/bin/ccache and drops the compiler binary from CMAKE_C_COMPILER. Same holds for CMAKE_CXX_COMPILER. This causes compilation problems e.g. for cmake/external_projects/ElMath/OpenBLAS.cmake (CC=${CMAKE_C_COMPILER}):

[  0%] Performing build step for 'project_openblas'
/usr/bin/ccache: invalid option -- 'D'
Usage:
    ccache [options]
    ccache compiler [compiler options]
    compiler [compiler options]          (via symbolic link)

Options:
    -c, --cleanup         delete old files and recalculate size counters
                          (normally not needed as this is done automatically)
    -C, --clear           clear the cache completely (except configuration)
    -F, --max-files=N     set maximum number of files in cache to N (use 0 for
                          no limit)
    -M, --max-size=SIZE   set maximum size of cache to SIZE (use 0 for no
                          limit); available suffixes: k, M, G, T (decimal) and
                          Ki, Mi, Gi, Ti (binary); default suffix: G
    -o, --set-config=K=V  set configuration key K to value V
    -p, --print-config    print current configuration options
    -s, --show-stats      show statistics summary
    -z, --zero-stats      zero statistics counters

    -h, --help            print this help text
    -V, --version         print version and copyright information

See also <https://ccache.samba.org>.
make[4]: *** [Makefile.prebuild:42: getarch] Error 1
Makefile.system:899: Makefile.: No such file or directory
make[4]: *** No rule to make target 'Makefile.'.  Stop.
make[3]: *** [CMakeFiles/project_openblas.dir/build.make:112: download/OpenBLAS/build/stamp/project_openblas-build] Error 2
make[2]: *** [CMakeFiles/Makefile2:2368: CMakeFiles/project_openblas.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:2380: CMakeFiles/project_openblas.dir/rule] Error 2
make: *** [Makefile:990: project_openblas] Error 2

If cmake is run with -DCMAKE_C_COMPILER="ccache gcc" (cmake -DCMAKE_C_COMPILER="ccache gcc" -DCMAKE_CXX_COMPILER="ccache g++" ...) then cmake throws errors:

  CMake Error at CMakeLists.txt:24 (project):
    The CMAKE_C_COMPILER:
  
      /usr/bin/ccache gcc
  
    is not a full path to an existing compiler tool.
  
    Tell CMake where to find the compiler by setting either the environment
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
    the compiler, or to the compiler name if it is in the PATH.
  
  -- Configuring incomplete, errors occurred!

Same holds for CMAKE_CXX_COMPILER.

On a Debian system man ccache suggests to just prepend /usr/lib/ccache to PATH, but this works only partially because /usr/sbin/update-ccache-symlinks does not add versioned clang compilers, even removes those from /usr/lib/ccache. Manually adding those symlinks in /usr/lib/ccache somehow does not work for Clang compilers so far, but this is something I'm currently investigating..

@JM1
Copy link
Contributor Author

JM1 commented Aug 6, 2018

@JM1
Copy link
Contributor Author

JM1 commented Aug 8, 2018

Bingo! (Build logs). After install: is done, the newly created symlinks are gone, for whatever reason.. So by symlinking Clang in before_script: phase everything works as excepted. Any comments or suggestions about the new .travis.yml?

@poulson
Copy link
Member

poulson commented Aug 8, 2018

You have thought about the .travis.yml much more than I have, so I think it sounds like a great idea, and thank you!

Why not create a PR for it?

@jeffhammond
Copy link
Member

PRs were merged in 2018

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

No branches or pull requests

4 participants