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

Build issue on older CMake #9

Open
nigelsim opened this issue Apr 19, 2022 · 0 comments
Open

Build issue on older CMake #9

nigelsim opened this issue Apr 19, 2022 · 0 comments

Comments

@nigelsim
Copy link

nigelsim commented Apr 19, 2022

I'm trying to use wmm2020 within a containerised app, but I'm hitting a failure under some build conditions, so I'm documenting these here so it may help others, and maybe there is an opportunity to tighten up the dependency ranges.

When I build with CMake 3.13.4 using the following:

FROM python:3.9-slim-buster
RUN apt-get update && apt-get install -y python3-dev cmake \
    && rm -rf /var/lib/apt/lists/* \
    && pip install --no-cache-dir --upgrade setuptools \
    && pip install --no-cache-dir . \
    && python -c 'import wmm2020' \
    && apt-get remove -y --purge python3-dev cmake \
    && apt-get autoremove -y

I get

...
SetCTestConfiguration:BuildDirectory:/usr/local/lib/python3.9/site-packages/wmm2020/build
SetCTestConfiguration:SourceDirectory:/usr/local/lib/python3.9/site-packages/wmm2020
Cannot instantiate test handler ctest_build
has no project to build. If this is a "built with CMake" project, verify that CTEST_CMAKE_GENERATOR and CTEST_PROJECT_NAME are set.
CTEST_PROJECT_NAME is usually set in CTestConfig.cmake. Verify that CTestConfig.cmake exists, or CTEST_PROJECT_NAME is set in the script, or PROJECT_NAME is passed as an argument to ctest_build.
Alternatively, set CTEST_BUILD_COMMAND to build the project with a custom command line. error from command
CMake Error at /usr/local/lib/python3.9/site-packages/wmm2020/setup.cmake:107 (message):
  Build and test failed.


-- SKIP: ctest_test(): returncode: 0; CMake error code: -1
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/wmm2020/__init__.py", line 1, in <module>
    from .base import wmm, wmm_point
  File "/usr/local/lib/python3.9/site-packages/wmm2020/base.py", line 16, in <module>
    build()
  File "/usr/local/lib/python3.9/site-packages/wmm2020/build.py", line 23, in build
    subprocess.check_call([exe, "-S", str(file), "-VV"])
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/ctest', '-S', '/usr/local/lib/python3.9/site-packages/wmm2020/setup.cmake', '-VV']' returned non-zero exit status 255.

However, building with a newer distro and CMake 3.18.4

FROM python:3.9-slim-bullseye
RUN apt-get update && apt-get install -y python3-dev cmake \
    && rm -rf /var/lib/apt/lists/* \
    && pip install --no-cache-dir --upgrade setuptools \
    && pip install --no-cache-dir . \
    && python -c 'import wmm2020' \
    && apt-get remove -y --purge python3-dev cmake \
    && apt-get autoremove -y

Everything builds fine.

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

1 participant