0

I am trying to install and use the carla codebase to run some AV simulations. The docs for this are here: https://carla.readthedocs.io/en/latest/build_windows/#part-one-prerequisites. I am currently struggling with the "1. Compile the Python API client:" section. In particular, I cannot run the following command:

    make PythonAPI

When I try to run this command I get the following error:

C:\Users\mathe\Code\av-project\carla-trial\carla>C:\ProgramFilesmathe\GnuWin32\bin\make.exe PythonAPI
-[Setup]: [Batch params]: --boost-toolset msvc-14.2 --all
-[Setup]: Asynchronous jobs:  8
-[Setup]: Boost toolset:      msvc-14.2
-[Setup]: Install directory:  "C:\Users\mathe\Code\av-project\carla-trial\carla\Build\"
-[Setup]: Installing zlib...
    -[install_zlib]: [Batch params]: --build-dir "C:\Users\mathe\Code\av-project\carla-trial\carla\Build\"
    -[install_zlib]: Not downloading zlib because already exists the folder "C:\Users\mathe\Code\av-project\carla-trial\carla\Build\zlib-source\".
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is MSVC 19.29.30148.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - broken
CMake Error at C:/ProgramFilesmathe/CMake/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Users/mathe/Code/av-project/carla-trial/carla/Build/zlib-source/build/CMakeFiles/CMakeScratch/TryCompile-ud76ey

    Run Build Command(s):C:/ProgramFilesmathe/CMake/bin/cmake.exe -E env VERBOSE=1 nmake -f Makefile /nologo cmTC_f1eab\fast &&    C:\Program Files (x86)\GnuWin32\bin\make.exe  -f CMakeFiles\cmTC_f1eab.dir\build.make /nologo -L                  CMakeFiles\cmTC_f1eab.dir\build
    'C:\Program' is not recognized as an internal or external command,
    operable program or batch file.
    NMAKE : fatal error U1077: 'C:\Program' : return code '0x1'
    Stop.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!

    -[install_zlib]: [CMAKE ERROR] An error ocurred while executing cmake command.
    -[install_zlib]: [CMAKE ERROR] Possible causes:
    -[install_zlib]:                - Make sure "CMake" is installed.
    -[install_zlib]:                - Make sure it is available on your Windows "path".
    -[install_zlib]:                - Make sure you have cmake 3.12.4 or higher installed.
    -[install_zlib]: Exiting with error...

-[Setup]:
   Ok, and error ocurred, don't panic!
   We have different platforms where you can find some help :)

   - Make sure you have read the documentation:
       http://carla.readthedocs.io/en/latest/how_to_build_on_windows/

   - If the problem persists, you can ask on our Github's "Building on Windows" issue:
       https://github.com/carla-simulator/carla/issues/21

   - Or just use our Discord channel!
       We'll be glad to help you there :)
       https://discord.gg/42KJdRj
make: * [setup] Error 1

C:\Users\mathe\Code\av-project\carla-trial\carla>
C:\Users\mathe\Code\av-project\carla-trial\carla>
C:\Users\mathe\Code\av-project\carla-trial\carla>make PythonAPI
'make' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\mathe\Code\av-project\carla-trial\carla>

I have installed Visual Studio 2019 Community and I am running all of these commands in the command line which is found in Visual Studio->Tools->Command Line->Developer Command Prompt.

In the error above it says that it fails trying to run the following command:

"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe"

And the error it gives afterwards is:

    'C:\Program' is not recognized as an internal or external command

I assumed this is because the folder "Program Files (x86)" has the space character in it which means that the command line is interpreting just the first part of that filepath as the command and when it hits the space character it interprets everything after this as inputs into the command.

I actually encountered this error before when running the make which is why I've created the folder "ProgramFilesmathe" without any space characters and copied the "make" folder into here. That's why you can see I've run the following command in the very first line: C:\ProgramFilesmathe\GnuWin32\bin\make.exe PythonAPI instead of make PythonAPI as it says in the doc I've linked.

In order to try to solve this problem I've added the following two paths to my Path variable in the environment variables:

C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86

and

C:/ProgramFilesmathe/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86

I added this 2nd one because I also copied and pasted the contents of the Microsoft Visual Studio directory over to ProgramFilesmathe hoping that I could implement the same soluton as before (but this didn't work).You can see that these have been added because when I run the command echo %Path% I get the following output:

C:\Users\mathe\Code\av-project\carla-trial\carla>echo %Path% C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Microsoft\IntelliCode\CLI; C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86 ;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\devinit;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\MATLAB\R2020a\bin;C:\Program Files\Git\cmd;C:\ProgramFilesmathe\CMake\bin;C:\Program Files\CMake\bin; C:\ProgramFilesmathe\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86 ; C:\ProgramFilesmathe\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86 ;C:\Users\mathe\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\mathe\AppData\Local\Programs\Python\Python39;C:\Users\mathe\AppData\Local\Microsoft\WindowsApps;C:\Users\mathe\AppData\Local\GitHubDesktop\bin;C:\Users\mathe\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\CMake\bin;C:\ProgramFilesmathe\CMake\bin; C:\ProgramFilesmathe\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86 ; C:\ProgramFilesmathe\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86 ;;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja

C:\Users\mathe\Code\av-project\carla-trial\carla>

I am not sure what to do here as I have run out of ideas of what to try. Also is there a better work around to the problem introduced by the character in "Program Files (x86)" than the one I have implemented above? I have encountered this issue before and I did a similar hacky workaround.

hokge
  • 1
  • 1
  • "_'C:\Program' is not recognized as an internal or external command,_" looks like someone (you or the carla maintainers, or CMake) didn't do their job right with shell quoting. "_CMake Error at C:/ProgramFilesmathe/CMake/share/..._" this is a weird path to have on your system... did you make ":/ProgramFilesmathe" yourself? – starball Apr 23 '23 at 21:24
  • Yeah I made that myself. I made that folder and pasted the "make" contents into it because I couldn't run the "make PythonAPI" command because of the character in the path "C:/Program Files/...". – hokge Apr 23 '23 at 21:54

0 Answers0