google-deepmind/tree

pip install fails (my cmake doesn't recognize the -j2 argument)

andrewmoise opened this issue · 3 comments

For some reason my cmake fails when called with -j2. This is Debian Buster; output from "pip3 install dm-tree" includes:

  -- Configuring done
  -- Generating done
  -- Build files have been written to: /tmp/pip-req-build-m4qplzqm/build/temp.linux-x86_64-3.7
  Unknown argument -j2
  Usage: cmake --build <dir> [options] [-- [native-options]]
  Options:
    <dir>          = Project binary directory to be built.
    -j [<jobs>] --parallel 

(snip)

      File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '-j2', '--config', 'Release']' returned non-zero exit status 1.
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-m4qplzqm/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-z7_q1blr/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-req-build-m4qplzqm/

I changed it locally to call "cmake -j 2" instead of "cmake -j2" and it seemed to work (line 111 in setup.py). I can send a PR for it if that's useful?

Command '['cmake', '--build', '.', '-j 2', '--config', 'Release']' returned non-zero exit status 1.
i've remove '-j 2'

FYI, it's recommended to use CMake 3.12 or higher which supports -j. CMake 3.12 release notes

Thanks for chiming in @wookayin!