Setup CI for VC10 with all dependency in place

doducthanhbk's Avatar

doducthanhbk

27 Jan, 2015 10:12 PM

Hi,

I need to set up a CI build for a project hosted in github. The build must be in Windows, Microsoft Visual Studio 2010. And the build command can be cmake.

The challenge here is to set up correct build steps for the project as it depends on several other external tools/library (e.g., protobuf, zlib). Now in POSIX system, I can set up to run some command line like this:

  - sudo apt-get -qq install libprotobuf-dev
  - sudo apt-get -qq install protobuf-compiler
  - blah blah

Now I understand that I have to set up an appveyor.yml do do all of this. How can I do this in a Windows system. Note I am a potential customer, and if I can set up this CI easily, I would be stick with appveyor for quite a while.

Thanks for your help.

  1. Support Staff 1 Posted by Feodor Fitsner on 28 Jan, 2015 12:48 AM

    Feodor Fitsner's Avatar

    Hi,

    How would you pull those dependencies on Windows (I mean, normally, without AppVeyor)? Is it a msys involved?

    Found this: https://wiki.alliedmods.net/Compiling_libprotobuf#Windows - seems like you can grab zip and then build lib from sources.

  2. 2 Posted by doducthanhbk on 28 Jan, 2015 01:44 AM

    doducthanhbk's Avatar

    Normally, I would have to download zips manually (i.e, right click, save as target, yes windows does not have wget :( ). And some dependencies does not allow you to build from command line (i.e, you have

    Alternatively, I would think somehow in the source folder I would have a folder where I put all headers and precompile library there. Then I would modify my cmakelists.txt to find library files and headers there. Then I would build using cmake. This would work, right?

    Assuming all the above will work, I will have to create a appveyor.yml find to do all those steps. How would I do that? This is the first time I am working with CI and AppVeyor), hence this newbie question.

    Thanks.

  3. Support Staff 3 Posted by Feodor Fitsner on 28 Jan, 2015 02:51 AM

    Feodor Fitsner's Avatar

    There is a number of ways to download files on build server:
    http://www.appveyor.com/docs/how-to/download-file
    http://www.powershellatoms.com/basic/download-file-website-powershell/

    Yes, you could have build dependencies either in the repo (say lib and include folders) or a zip file that is downloaded during the build.

    You can start from configuring everything on UI and then export settings into YAML if you want to keep them in the repo.

  4. 4 Posted by doducthanhbk on 28 Jan, 2015 03:40 AM

    doducthanhbk's Avatar

    Thanks! I'll go with creating a folder first then.

    A follow up question. since I'll build using Cmake, is it readily available? (i.e., i don't have to specify an installation on the yml file.)

  5. Support Staff 5 Posted by Feodor Fitsner on 28 Jan, 2015 03:43 AM

    Feodor Fitsner's Avatar

    Yeah, there is CMake 2.8 available on build workers: http://www.appveyor.com/docs/installed-software

    -Feodor

  6. 6 Posted by doducthanhbk on 28 Jan, 2015 09:01 PM

    doducthanhbk's Avatar

    I also need Visual Studio 2010 but the UI option does not have that. How can I specify this on the UI. Moreover, where can I add the CMake step.

    For instance I want to the script to do something like this.

    mkdir _build
    cd _build
    cmake .. -G "Visual Studio 10 2010"
    cmake --build .

    Thank you.

  7. 7 Posted by doducthanhbk on 28 Jan, 2015 09:25 PM

    doducthanhbk's Avatar

    cmake .. -Wno-dev -G "Visual Studio 10 2010"
    CMake Error: Could not create named generator Visual Studio 10 2010
    Command exited with code 1

    I am having this error message. It seems like VC10 is not supported?

  8. Support Staff 8 Posted by Feodor Fitsner on 28 Jan, 2015 10:32 PM

    Feodor Fitsner's Avatar

    There is no full VS 2010 on build workers - only Express editions: http://www.appveyor.com/docs/installed-software

    Maybe you should use a different name for generator?

    -Feodor

  9. 9 Posted by doducthanhbk on 28 Jan, 2015 11:08 PM

    doducthanhbk's Avatar

    Now I hit this error
    cmake .. -G "Visual Studio 10"
    CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
      execute_process given COMMAND argument with no value.
    Call Stack (most recent call first):
      C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
      C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
      CMakeLists.txt:15 (project)
     
     
    -- The C compiler identification is unknown
    CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
      execute_process given COMMAND argument with no value.
    Call Stack (most recent call first):
      C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
      C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:127 (CMAKE_DETERMINE_COMPILER_ID)
      CMakeLists.txt:15 (project)
     
     
    -- The CXX compiler identification is unknown
    -- Could NOT find PROTOBUF (missing: PROTOBUF_LIBRARY)
    -- Found PythonInterp: C:/Python27/python.exe (found version "2.7.8")
    -- Looking for include file pthread.h
    CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component):
      get_filename_component called with incorrect number of arguments
    Call Stack (most recent call first):
      CMakeLists.txt:2 (PROJECT)
     
     
    CMake Error: Internal CMake error, TryCompile configure of cmake failed
    -- Looking for include file pthread.h - not found
    -- Found Threads: TRUE
    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the CMake files:
    PROTOBUF_LITE_LIBRARY (ADVANCED)
        linked by target "orc" in directory C:/projects/orc/src
     
    -- Configuring incomplete, errors occurred!
    See also "C:/projects/orc/_vc10/CMakeFiles/CMakeOutput.log".
    See also "C:/projects/orc/_vc10/CMakeFiles/CMakeError.log".
    Command exited with code 1

    It seems that Cmake cannot find c compiler. How would I fix that With full VC10, I can do something like:
    & "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

    But not sure how I would do that with VC express.

    Thanks

  10. 10 Posted by doducthanhbk on 29 Jan, 2015 01:49 AM

    doducthanhbk's Avatar

    Well I was able to work around with this option:

    cmake -DCMAKE_MAKE_PROGRAM=C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe -G "Visual Studio 10" ..

    Now I hit another error:
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h(26): fatal error C1083: Cannot open include file: 'ammintrin.h':

    Some header is missing. This seems like an error with the build agent environment itself. Can you take a look?

    This link:
    http://wishmesh.com/2011/04/fatal-error-c1083-cannot-open-include-file-ammintrin-h-no-such-file-or-directory/

    mentioned install SP1 solve the problem

  11. 11 Posted by doducthanhbk on 29 Jan, 2015 01:50 AM

    doducthanhbk's Avatar
  12. Support Staff 12 Posted by Feodor Fitsner on 29 Jan, 2015 02:08 AM

    Feodor Fitsner's Avatar

    I see. Dealt with issue before. Will fix that today/tomorrow while deploying a new image.

  13. 13 Posted by doducthanhbk on 29 Jan, 2015 02:10 AM

    doducthanhbk's Avatar

    Awesome! Just keep me posted. Thanks

  14. 14 Posted by doducthanhbk on 29 Jan, 2015 06:30 PM

    doducthanhbk's Avatar

    Hi Feodor. Any update on this? Thank you.

  15. Support Staff 15 Posted by Feodor Fitsner on 29 Jan, 2015 06:58 PM

    Feodor Fitsner's Avatar

    Working on it. Will be available today.

    -Feodor

  16. 16 Posted by doducthanhbk on 29 Jan, 2015 10:38 PM

    doducthanhbk's Avatar

    Hi Feodor, can you please give me an estimated time s that you guy can get it fix. I need this information to tell my boss when I could integrate the whole CI pipeline. Thank you.

  17. Support Staff 17 Posted by Feodor Fitsner on 29 Jan, 2015 11:02 PM

    Feodor Fitsner's Avatar

    Sure, by 11pm PST it should be ready.

    -Feodor

  18. 18 Posted by doducthanhbk on 29 Jan, 2015 11:54 PM

    doducthanhbk's Avatar

    Thanks! Looking towards to the fix. :)

  19. Support Staff 19 Posted by Feodor Fitsner on 30 Jan, 2015 06:51 AM

    Feodor Fitsner's Avatar

    OK, it's been fixed. Give it another try and let me know how it goes.

  20. 20 Posted by doducthanhbk on 30 Jan, 2015 02:22 PM

    doducthanhbk's Avatar

    It works great now. Thank you!

  21. 21 Posted by doducthanhbk on 30 Jan, 2015 02:29 PM

    doducthanhbk's Avatar

    A follow up question. How do I automatically trigger the build for every commit on github?

  22. Support Staff 22 Posted by Feodor Fitsner on 30 Jan, 2015 02:31 PM

    Feodor Fitsner's Avatar

    You should already have a webhook setup for that GitHub repository, no?

  23. 23 Posted by doducthanhbk on 30 Jan, 2015 02:46 PM

    doducthanhbk's Avatar

    No, I am a newbie in github. :( still searching for that. If you have a good pointer, please let me know. Thank you.

  24. Support Staff 24 Posted by Feodor Fitsner on 30 Jan, 2015 02:53 PM

    Feodor Fitsner's Avatar

    On General tab of project settings you can see webhook URL. Open repository settings on GitHub, then Webhooks and make sure this webhook is added there. If not then add it with "push" and "pull_request" events.

  25. 25 Posted by doducthanhbk on 30 Jan, 2015 02:56 PM

    doducthanhbk's Avatar

    Thank you. I found that page. It asks for a "payload URL". Which URL I should put it. In my appveyor settings page, there is a badge tab which as a bunch of URL (SVG, raster, etc). Which one I should put?

  26. Support Staff 26 Posted by Feodor Fitsner on 30 Jan, 2015 02:58 PM

    Feodor Fitsner's Avatar

    The URL is on General tab.

    ...but that strange it wasn't added automatically.

  27. 27 Posted by doducthanhbk on 30 Jan, 2015 03:12 PM

    doducthanhbk's Avatar

    Ok, got it. And it works! Thank you so much!

  28. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:53 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

01 Oct, 2024 04:27 PM
26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM