avogadro icon indicating copy to clipboard operation
avogadro copied to clipboard

travis-ci for avogadro ?

Open miroi opened this issue 8 years ago • 15 comments

Greetings,

on my fork I am playing with setting the travis-ci.yml control builds script, see https://github.com/miroi/avogadro/blob/master/.travis.yml .

The current buildup with the travis-ci crashed here, https://travis-ci.org/miroi/avogadro/builds/136269618 , with Avogadro's cmake issues:

Would you please be interested to have travis-ci CI-builds control of pull requests for for Avogadro ? If yes, I can fix Avogadro's CMake, together with setting the travis-ci.

0.00s$ cd avogadro
before_script.3
0.01s$ ls -lt
total 8
drwxrwxr-x 6 travis travis 4096 Jun  8 21:10 src
-rw-rw-r-- 1 travis travis  241 Jun  8 21:10 CMakeLists.txt
before_script.4
0.00s$ mkdir build
before_script.5
0.00s$ cd build
0.62s$ cmake ..
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at src/CMakeLists.txt:39 (include):
  include called with wrong number of arguments.  include() only takes one
  file.
CMake Error at src/CMakeLists.txt:74 (qt4_automoc):
  Unknown CMake command "qt4_automoc".
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as
    cmake_minimum_required(VERSION 3.5)
  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

miroi avatar Jun 09 '16 11:06 miroi

Yes, this would be cool. Thanks!

ghutchis avatar Jun 09 '16 16:06 ghutchis

@miroi: Seeing how I managed to break the build without noticing (didn't have the Python module configured to be built, see #871), I would also like to say that having some kind of CI would be very helpful! Thank you in advance!

DavidToneian avatar May 20 '17 21:05 DavidToneian

Sorry, I didn't have time to play with travis-ci-4-avogadro. Please feel free to take semi-product and adapt it accordingly.

Would be good to test avogadro i) for the proper compilation, and, ii), for an executable's short self test, like ./avogadro --selftest/, in text mode.

miroi avatar May 20 '17 22:05 miroi

Well, I tried again, still can not set up travis-ci due to various failure in avogadro's cmake.

https://travis-ci.org/miroi/avogadro/builds/244935418

CMake Error at src/CMakeLists.txt:196 (install):
  install TARGETS given no RUNTIME DESTINATION for executable target
  "avogadro-app".

what is in "avogadro/src/CMakeLists.txt", is

install(TARGETS avogadro-app RUNTIME DESTINATION ${BIN_INSTALL_DIR}
  ${Avogadro_INSTALL_DESTINATIONS_ARGS})

seems ${BIN_INSTALL_DIR} is not defined ?

miroi avatar Jun 20 '17 14:06 miroi

Also, when installing Avogadro on remote CI server, would be good to tell exactly what packages are needed. This would save me time for travic-ci tuning...

miroi avatar Jun 20 '17 14:06 miroi

Hi guys,

fresh CI build failed, https://travis-ci.org/miroi/avogadro/builds/306317709#L6187 , I guess this is undefined variable in include(${QT_USE_FILE}) command...

miroi avatar Nov 23 '17 14:11 miroi

well, again buildup crash, https://travis-ci.org/miroi/avogadro/builds/379552655#L6224-L6249

miroi avatar May 16 '18 07:05 miroi

Well, CMake in Avogadro is showing many flaws, like empty variables BIN_INSTALL_DIR= Avogadro_INSTALL_DESTINATIONS_ARGS=

Are there any plans for fixing CMake ? Without proper cmake one can not utilize CI services....

miroi avatar May 16 '18 09:05 miroi

No way with this CMake on remote CI worker, https://travis-ci.org/miroi/avogadro/builds ....

miroi avatar May 16 '18 09:05 miroi

Well, it seems that CMakeLists.txt files in subdirectories are not getting defined variables from the top CMakeLists.txt file on travis-ci worker. Any help ?

miroi avatar May 16 '18 10:05 miroi

it happens that one subdirectory does not see include files from another subdirectory....

/home/travis/build/miroi/avogadro/avogadro/src/aboutdialog.cpp:32:29: fatal error: avogadro/global.h: No such file or directory
 #include <avogadro/global.h>

( https://travis-ci.org/miroi/avogadro/builds/379655892 )

miroi avatar May 16 '18 10:05 miroi

Well, currently, Avogadro's CMake does not see include files form libavogadro/ directory:

#include <avogadro/molecule.h>
#include <avogadro/residue.h>
#include <avogadro/atom.h>
#include <avogadro/neighborlist.h>

Any help ?

miroi avatar May 16 '18 13:05 miroi

I haven't been following this, but Avogadro's CMake code does this in a normal build locally, and travis is just about replicating what a local build is doing on their container service. If you can't reproduce this on a local build it would likely be the driver script that is at fault, and I would look to that as the most likely culprit. We are building a number of CMake-based projects in travis, including the Avogadro 2 stuff.

The error you see is very strange, we clearly have cmake_minimum_required(VERSION 2.8.9) as the first line of the CMakeLists.txt code.

cryos avatar May 16 '18 15:05 cryos

Hi again,

this travis-ci worker is using cmake 3.9, probably this is causing that cmake does not see important variables in subdirectories. What do you think, Rado ( @bast ) ?

miroi avatar May 16 '18 19:05 miroi

I doubt it, I am using CMake 3.11.1 locally on Linux and it is configuring just fine. I will see if I can take a look at travis later, but the CMake warnings on configure make me think something deeper is wrong - we do specify the version, and we add the include directories, and the MOC warnings don't make sense either.

cryos avatar May 16 '18 19:05 cryos