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 CI to test installation with both GNU make and CMake #241

Open
Tracked by #284 ...
tzanio opened this issue Sep 8, 2022 · 10 comments
Open
Tracked by #284 ...

Update CI to test installation with both GNU make and CMake #241

tzanio opened this issue Sep 8, 2022 · 10 comments
Assignees
Labels

Comments

@tzanio
Copy link
Member

tzanio commented Sep 8, 2022

This came up in #239

@justinlaughlin
Copy link
Contributor

Right now it looks like CI already tests make/cmake for both ubuntu and macos. Is the goal for this to add make support to windows? Otherwise maybe we can close this one as complete

@v-dobrev
Copy link
Member

Native Windows builds (i.e. not using cygwin, WSL, msys2, or something like that) with GNU make are not really possible. CMake is the way to go in this case. Therefore, on Windows, it should be sufficient to just test with CMake.

@justinlaughlin
Copy link
Contributor

justinlaughlin commented Jul 26, 2024

so should we close this?

@v-dobrev
Copy link
Member

Post here what PR addresses this issue, and then it should fine to close this.

@justinlaughlin
Copy link
Contributor

#189 is when cmake became the default in matrix. And the include section still has specific setups for different make tests

@v-dobrev
Copy link
Member

The issue mentioned in the top post is about a bug in the install target. I'm not sure the PR you mention above deals with that -- do we have any tests in CI that run the install target in GNU make or CMake?

@justinlaughlin
Copy link
Contributor

The issue mentioned in the top post is about a bug in the install target. I'm not sure the PR you mention above deals with that -- do we have any tests in CI that run the install target in GNU make or CMake?

Maybe I'm misunderstanding, but I thought we already test installation using both make and cmake for ubuntu and macos, and cmake for windows?

@v-dobrev
Copy link
Member

I only see commands that build GLVis and then test it in the CI:

  • build with GNU make:
    - name: build GLVis (make)
    if: matrix.build-system == 'make'
    run: |
    glvis_target="opt"
    [[ ${{ matrix.target }} == "dbg" ]] && glvis_target="debug";
    cd glvis && make ${glvis_target} -j3
  • build with CMake:
    - name: build GLVis (cmake)
    if: matrix.build-system == 'cmake'
    env:
    VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg_cache
    run: |
    build_type="Release"
    [[ ${{ matrix.target }} == "dbg" ]] && build_type="Debug";
    [[ ${{ matrix.os }} == "windows-latest" ]] \
    && toolchain_file="${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
    cd glvis && mkdir build && cd build
    cmake \
    -D CMAKE_TOOLCHAIN_FILE:STRING=${toolchain_file} \
    -D CMAKE_BUILD_TYPE:STRING=${build_type} \
    -D ENABLE_TESTS:BOOL=TRUE \
    -D mfem_DIR:PATH=${GITHUB_WORKSPACE}/${MFEM_TOP_DIR}/build \
    -D GLVIS_BASELINE_SYS=${{ matrix.os }} \
    ..
    cmake --build . --parallel 3 --config "${build_type}"
    shell: bash
  • test on Linux:
    - name: test GLVis (cmake/linux)
    if: matrix.build-system == 'cmake' && matrix.os == 'ubuntu-latest'
    run: |
    cd glvis && cd build
    xvfb-run -a ctest --verbose
    tar czvf test_screenshots.tar.gz tests/test.*.png
  • test on Mac:
    - name: test GLVis (cmake/mac)
    if: matrix.build-system == 'cmake' && matrix.os == 'macos-latest'
    run: |
    cd glvis && cd build
    ctest --verbose

I don't see anything that runs the install target.

@justinlaughlin
Copy link
Contributor

When installed via cmake the install is being tested via tests/CMakeLists.txt which calls tests/glvis_driver.py which executes glvis using a stream file on line 129 .

When installed via make I'm not sure why but it just installs and doesn't test (maybe because the test is performed using cmake?).

We could update the testing to also work for make installations.

@v-dobrev
Copy link
Member

v-dobrev commented Jul 30, 2024

I think you are confusing the build directory with the install directory. The commands in CI build GLVis in the build directory and run it from there. The target called install which performs the installation to the install directory is never run.

With CMake, the install directory is set with the flag -DCMAKE_INSTALL_PREFIX=<install-prefix> and in CI we currently actually do not set it (if not set, the default is a system path like /usr or /usr/local).

With GNU make, the install directory can be set with PREFIX=<install-prefix>/bin on the command line when running make install. The build directory with GNU make is the source directory -- we do not support out-of-source builds.

This issue is about adding a test that invokes the target called install -- there is such a target in both build systems.

Edit: fixed a typo "we support out-of-source builds" -> "we do not support out-of-source builds".

@tzanio tzanio mentioned this issue Aug 7, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants