github : https://github.com/carla-simulator/carla
Install document : https://carla.readthedocs.io/en/0.9.15/build_windows/
CMake, Make, Git, 7Zip, Python3 을 설치 히야 한다.
CMake generates standard build files from simple configuration files.
Git is a version control system to manage CARLA repositories.
Make generates the executables. It is necessary to use Make version 3.81, otherwise the build may fail. If you have multiple versions of Make installed, check that you are using version 3.81 in your PATH when building CARLA. You can check your default version of Make by running make --version
.
7Zip is a file compression software. This is required for automatic decompression of asset files and prevents errors during build time due to large files being extracted incorrectly or partially.
Python3 x64 is the main scripting language in CARLA. Having a x32 version installed may cause conflict, so it is highly advisable to have it uninstalled.
처음 작업 시 python 최신 버전 3.11 로 설치 후 carla 를 빌드 했었다.
SystemError: type Boost.Python.enum has the Py_TPFLAGS_HAVE_GC flag but has no traverse function
관련 Link
따라서 downgrade Python 3.8.x (나는 3.8.10) 으로 설치 해서 해결.
# pip, setuptools, wheel 설치.
C:\Users\d4r6j>pip3 install --upgrade pip
Requirement already satisfied: pip in c:\users\d4r6j\appdata\local\programs\python\python311\lib\site-packages (24.0)
C:\Users\d4r6j>pip3 install --user setuptools
Requirement already satisfied: setuptools in c:\users\d4r6j\appdata\local\programs\python\python311\lib\site-packages (65.5.0)
C:\Users\d4r6j>pip3 install --user wheel
Collecting wheel
Downloading wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
Downloading wheel-0.42.0-py3-none-any.whl (65 kB)
---------------------------------------- 65.4/65.4 kB 706.9 kB/s eta 0:00:00
Installing collected packages: wheel
WARNING: The script wheel.exe is installed in 'C:\Users\d4r6j\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed wheel-0.42.0
Get the 2019 version of Visual Studio from here. Choose Community for the free version. Use the Visual Studio Installer to install three additional elements:
Install add options.
Windows
button and searching for x64
. Be careful not to open a x86_x64
prompt..NET framework 4.6.2. In the Workloads section, choose .NET desktop development and then in the Installation details panel on the right, select .NET Framework 4.6.2 development tools
. This is required to build Unreal Engine.
It is also possible to use Visual Studio 2022
using the above steps and substituting the Windows 8.1 SDK for the Windows 11/10 SDK
. To override the default Visual Studio 2019 Generator in CMake, specify GENERATOR="Visual Studio 17 2022"
when using the makefile commands (see table). You may specify any generator that works with the build commands as specific in the build scripts, for a full list run cmake -G
(Ninja has been tested to work for building LibCarla
so far).
build 3번 실패 이후에 (내용은 밑에 있을 예정..)
VS2022
에서VS2019
로 맞추긴 했으나,VS2022
로도 가능할 듯 보인다. 아래와 같은 warning 이 계속 올라올 것 같긴 하다. 설정을 좀 잡아주면 될터인데..
Detected compiler newer than Visual Studio 2019,
please update min version checking
만약 윈도로 할 예정이면.. 그래 그냥 2019 로 하는게.. 정신 건강에 이로울 듯. 내가 원하는건 car simulation 이니까 ㅋ
우왕 ㅋ 언리얼 엔진을 이렇게 접해보고, 내 프로젝트에 사용하게 되서 기쁨!! ㅋ
To build the modified version of Unreal Engine:
1. In a terminal, navigate to the location you want to save Unreal Engine and clone the carla branch:
git clone --depth 1 -b carla https://github.com/CarlaUnreal/UnrealEngine.git .
Note
Keep the Unreal Engine folder as close as C:\\
as you can because if the path exceeds a certain length then Setup.bat
will return errors in step 3.
git clone --depth 1 -b carla https://github.com/CarlaUnreal/UnrealEngine.git .
> git clone --depth 1 -b carla https://github.com/CarlaUnreal/UnrealEngine.git .
Cloning into '.'...
remote: Repository not found.
fatal: repository 'https://github.com/CarlaUnreal/UnrealEngine.git/' not found
Epic Games 로긴, 권한, 등으로 코드 접근해야..
> git clone --depth 1 -b carla https://github.com/CarlaUnreal/UnrealEngine.git .
Cloning into '.'...
remote: Enumerating objects: 111593, done.
remote: Counting objects: 100% (111593/111593), done.
remote: Compressing objects: 100% (92083/92083), done.
remote: Total 111593 (delta 16416), reused 111536 (delta 16408), pack-reused 0
Receiving objects: 100% (111593/111593), 256.67 MiB | 10.89 MiB/s, done.
Resolving deltas: 100% (16416/16416), done.
Updating files: 100% (138005/138005), done.
2. Run the configuration scripts:
Setup.bat
GenerateProjectFiles.bat
> GenerateProjectFiles.bat
Setting up Unreal Engine 4 project files...
Binding IntelliSense data... 100%
Writing project files... 100%
.NET v4.6.2 framework 을 설치 하지 않으면 하기 오류가 발생.
> GenerateProjectFiles.bat
Setting up Unreal Engine 4 project files...
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(12
48,5): error MSB3644: .NETFramework,Version=v4.6.2의 참조 어셈블리를 찾을 수 없습니다. 이 문제를 해결하려면 이 프레임워 크 버전용 개발자 팩(SDK/타기팅 팩)을 설치하거나
, 애플리케이션 대상을 변경합니다. https://aka.ms/msbuild/developerpacks에서 .NET Framework 개발자 팩을 다운로드할 수 있 습니다. [C:\CarlaUnreal\Engine\
Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj]
GenerateProjectFiles ERROR: UnrealBuildTool failed to compile.
error MSB3644: .NETFramework,Version=v4.6.2
Install .Net Framework v4.6.2
이상한데..
.NET 한글 언어 설치파일
로 하면 에러가 생기는거 같다..? 두 번 시도 했다가.NET 영어 언어 설치파일
로 바꾸니 정상으로 설치 되었다. 일단 이렇게 킵 하고, 나중에 더 확인해보자.
3. Compile the modified engine:
Open the UE4.sln
file inside the source folder with Visual Studio 2019
.
In the build bar ensure that you have selected 'Development Editor', 'Win64'
and 'UnrealBuildTool'
options. Check this guide if you need any help.
In the solution explorer, right-click UE4 and select Build.
unreal 4 build.
========== 모두 다시 빌드: 50 성공, 0 실패, 22 건너뛰기 ==========
========== 다시 빌드이(가) 오후 10:38에 완료되었으며, 03:40:43.880 시간이(가) 걸림 ==========
4. Once the solution is compiled you can open the engine to check that everything was installed correctly by launching the executable Engine\Binaries\Win64\UE4Editor.exe
.
The button above will take you to the official repository of the project. Either download from there and extract it locally or clone it using the following command:
git clone https://github.com/carla-simulator/carla
Download the latest assets to work with the current version of CARLA by running the following command in the CARLA root folder:
Update.bat
> Update.bat
20231108_c5101a5
http://carla-assets.s3.amazonaws.com/20231108_c5101a5.tar.gz
Downloading "http://carla-assets.s3.amazonaws.com/20231108_c5101a5.tar.gz"...
The assets will be downloaded and extracted to the appropriate location if have 7zip installed
. If you do not have this software installed, you will need to manually extract the file contents to Unreal\CarlaUE4\Content\Carla
.
install 7-zip : 7-Zip
약 50분 후…
Everything is Ok
Size: 25125959680
Compressed: 21562285126
Deleting C:\carla\Unreal\CarlaUE4\Content\Carla\20231108_c5101a5.tar.gz
7-Zip 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20
Scanning the drive for archives:
1 file, 25125959680 bytes (24 GiB)
Extracting archive: C:\carla\Unreal\CarlaUE4\Content\Carla\20231108_c5101a5.tar
--
Path = C:\carla\Unreal\CarlaUE4\Content\Carla\20231108_c5101a5.tar
Type = tar
Physical Size = 25125959680
Headers Size = 22896128
Code Page = UTF-8
Characteristics = POSIX PREFIX ASCII
Comment =
{
pax_global_header
comment=c5101a5b22a16bd4d66eb0e239b8f405d893dc82
}
Everything is Ok
Folders: 1374
Files: 43337
Size: 25091979777
Compressed: 25125959680
Deleting C:\carla\Unreal\CarlaUE4\Content\Carla\20231108_c5101a5.tar
Content has been successfully installed in "C:\carla\Unreal/CarlaUE4/Content/Carla"!
Exiting...
C:\carla>
To download the assets for a specific version of CARLA:
\Util\ContentVersions.txt
. This document contains the links to the assets for all CARLA releases.Unreal\CarlaUE4\Content\Carla
. If the path doesn't exist, create it. tar -xvzf <assets_file_name>.tar.gz.tar -C C:\path\to\carla\Unreal\CarlaUE4\Content\Carla
It is necessary to set an environment variable so that CARLA can find the Unreal Engine installation folder. This allows users to choose which specific version of Unreal Engine is to be used. If no environment variable is specified, then CARLA will search for Unreal Engine in the windows registry and use the first version it finds there.
To set the environment variable:
Advanced System Settings
or search for Advanced System Settings
in the Windows search bar.Advanced
panel open Environment Variables...
.New...
to create the variable.UE4_ROOT
and choose the path to the installation folder of the desired Unreal Engine installation.This section outlines the commands to build CARLA.
Windows
key and searching for x64
.이 작업은 visual studio 에서 제공하는 command prompt 에서 진행.
There are two parts to the build process for CARLA, compiling the client and compiling the server.
The following command compiles the Python API client:
make PythonAPI
dependencies/include\carla/road/element/RoadInfoMarkRecord.h(1): warning C4819: 현재 코드 페이지(949)에서 표시할 수 없는 문자가 파일에 들어 있습니다. 데이터가 손실되지 않게 하려면 해당 파일을 유니코드 형식으로 저장하십시오.
C:\carla\PythonAPI\carla\source\libcarla\OSM2ODR.cpp(7): fatal error C1083: 포함 파일을 열 수 없습니다. 'OSM2ODR.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
-[BuildPythonAPI]: Carla lib for python has been successfully installed in "C:\carla\PythonAPI\carla\dist"!
'OSM2ODR.h': No such file or directory
https://github.com/carla-simulator/carla/issues/3320
It seems like Xerces can't be installed properly, here is one solution I found.
Install Xerces by conda install -c anaconda xerces-c
Then find Anaconda3 folder, copy-paste everything from Anaconda3\pkgs\xerces-c-3.2.3-ha925a31_0\Library
to carla\Build\xerces-c-3.2.3-install
.
Next, copy-paste file xerces-c_3.lib
from carla\Build\xerces-c-3.2.3-install\lib
to folder carla\PythonAPI\carla\dependencies\lib
Delete folder carla\Build\osm2odr-visualstudio
, then make PythonAPI
.
Folder carla\PythonAPI\carla\dist
should now be available.
내 case 에서는 같은 오류로,
'OSM2ODR.h': No such file or directory
가 유지되었다.
https://github.com/carla-simulator/carla/issues/6898
same issue for me.
I changed .\Util\BuildTools\BuildOSM2ODR.bat
line 112 from
cmake -G %GENERATOR% %PLATFORM%^
to
cmake -G %GENERATOR% -A x64^
then the error: CMake Error: The source directory "C:/build-carla/carla-0.9.15/Build/osm2odr-visualstudio/x64"
does not exist. disappeared, and make PythonAPI successed.
Compile complete!!!
The following command compiles and launches Unreal Engine. Run this command each time you want to launch the server or use the Unreal Engine editor:
make launch
The project may ask to build other instances such as UE4Editor-Carla.dll
the first time. Agree in order to open the project. During the first launch, the editor may show warnings regarding shaders and mesh distance fields. These take some time to be loaded and the map will not show properly until then.
위와 같은 error 등으로 설치 중단이 될 경우, 실제 다른 dependency (zlib 등) 도 컴파일이 되어서 make clean 으로 깔끔하게 지워지지 않으니, 실제 BUILD 폴더를 날리고 다시 설치한다.
> make launch
찰흙 덩어리에서 물체의 형태로 변화되는 중.. ㅋ