First time here? Checkout the FAQ!
x
0 votes
by (640 points)

Hi everyone,

I am compiling openCARP on a new machine. I keep getting the following error:

[ 28%] Generate a C header file defining some information about the build

Traceback (most recent call last):

  File "/home/username/openCARP/simulator/build_info.py", line 204, in <module>

    print_build_info(filename)

  File "/home/username/openCARP/simulator/build_info.py", line 184, in print_build_info

    git_info = generate()

  File "/home/username/openCARP/simulator/build_info.py", line 161, in generate

    info = git(os.path.dirname(os.path.abspath(__file__)))

  File "/home/username/openCARP/simulator/build_info.py", line 108, in git

    result = run(['git', 'rev-list', '--all', '--count'])

  File "/home/username/openCARP/simulator/build_info.py", line 35, in run

    proc = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE)

  File "/home/username/.conda/envs/openCarpEnv/lib/python3.8/subprocess.py", line 854, in __init__

    self._execute_child(args, executable, preexec_fn, close_fds,

  File "/home/username/.conda/envs/openCarpEnv/lib/python3.8/subprocess.py", line 1702, in _execute_child

    raise child_exception_type(errno_num, err_msg, err_filename)

FileNotFoundError: [Errno 2] No such file or directory: 'git'

gmake[2]: *** [simulator/build_info.h] Error 1

gmake[1]: *** [simulator/CMakeFiles/carp.dir/all] Error 2

gmake: *** [all] Error 2

it is not my first time in compiling openCARP and I haven't had this kind of problem before. I am pretty sure dependencies are correctly installed and also if I run git --version I get "git version 2.34.1".

Thank you in advance,

Edoardo

1 Answer

0 votes
by (640 points)
Ok, I figured out how to solve this. I'll report here in case of future similar issues.

Just run `which git` and replace 'git' in the python script with its output. In my case the problem was that I was using a git installed through a conda environment, thus the path was not usr/bin/git, but /home/username/.conda/envs/EnvName/bin/git.

Maybe a more elegant solution with export can be provided, but honestly this one worked fine for me and I did not tried other paths.
by (100 points)
Hi!,

I am trying to install openCARP on a node cluster with no Internet acces. I have followed the tips given in the webpage and also on the openCARP installation video on youtube. I believe I have all the modules needed, but when I do "cmake --build" i get the same error as Edoardo back:

[ 12%] Generate a C header file defining some information about the build
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Traceback (most recent call last):
  File "/home/sandra/OPENCARP/openCARP-master/simulator/build_info.py", line
    print_build_info(filename)
  File "/home/sandra/OPENCARP/openCARP-master/simulator/build_info.py", line
    git_info = generate()
  File "/home/sandra/OPENCARP/openCARP-master/simulator/build_info.py", line
    info = git(os.path.dirname(os.path.abspath(__file__)))
  File "/home/sandra/OPENCARP/openCARP-master/simulator/build_info.py", line
    result = run(['git', 'rev-list', '--all', '--count'])
  File "/home/sandra/OPENCARP/openCARP-master/simulator/build_info.py", line
    raise Exception(tpl.format(' '.join(cmd)))
Exception: execution of command "git rev-list --all --count" failed
gmake[2]: *** [simulator/build_info.h] Error 1
gmake[1]: *** [simulator/CMakeFiles/carp.dir/all] Error 2
gmake: *** [all] Error 2

I run "which git" and get back the path usr/bin/git, which is already exported to the PATH. Any ideas on why this error happens and how I could fix it? Many thanks.

Lucia
Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
...