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

Improve the way we figure out whether cmake command is available #262

Open
bast opened this issue Feb 18, 2020 · 0 comments
Open

Improve the way we figure out whether cmake command is available #262

bast opened this issue Feb 18, 2020 · 0 comments

Comments

@bast
Copy link
Member

bast commented Feb 18, 2020

Currently we do this:

    p = Popen(
        '{0} --version'.format(cmake_command),
        shell=True,
        stdin=PIPE,
        stdout=PIPE)
    if not ('cmake version' in p.communicate()[0].decode('UTF-8')):
        sys.stderr.write('   This code is built using CMake\n\n')
        sys.stderr.write('   CMake is not found\n')
        sys.stderr.write('   get CMake at http://www.cmake.org/\n')
        sys.stderr.write('   on many clusters CMake is installed\n')
        sys.stderr.write('   but you have to load it first:\n')
        sys.stderr.write('   $ module load cmake\n')
        sys.exit(1)

It seems this is not robust and a case has been reported where the output contains "cmake3 version". I think we should better check for the return code instead of grepping for a string.

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