KingSejong 설치 가이드
모든 주요 플랫폼을 위한 상세한 설치 가이드
작성일: 2025-11-10 대상: macOS, Linux (Ubuntu, Debian, Fedora, CentOS), Windows
📋 목차
사전 요구사항
모든 플랫폼에서 다음이 필요합니다:
필수 구성 요소
- C++23 지원 컴파일러:
- GCC 12 이상
- Clang 15 이상
- MSVC 2022 이상 (Visual Studio 17.0+)
- CMake 3.20 이상
- Git
선택 사항
- GoogleTest (자동 다운로드됨)
- Python 3.8+ (벤치마크 실행용)
- Node.js 26 LTS (플레이그라운드·문서 사이트·VS Code 확장 개발용, 최소 22.12)
macOS 설치
1. Xcode Command Line Tools 설치
bash
xcode-select --install2. Homebrew 설치 (선택사항)
bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"3. CMake 설치
Homebrew 사용:
bash
brew install cmake또는 공식 다운로드:
- cmake.org에서 다운로드
4. KingSejong 빌드
bash
# 저장소 클론
git clone https://github.com/kingsejong-lang/kingsejong-lang.git
cd kingsejong-lang
# 빌드 디렉토리 생성
mkdir build && cd build
# CMake 설정
cmake ..
# 빌드 (병렬 빌드 -j4)
make -j4
# 테스트 실행
ctest --output-on-failure5. 실행 파일 경로
빌드 후 실행 파일은 다음 위치에 생성됩니다:
build/bin/kingsejong6. 환경 변수 설정 (선택사항)
bash
# ~/.zshrc 또는 ~/.bash_profile에 추가
export PATH="/path/to/kingsejong-lang/build/bin:$PATH"
# 적용
source ~/.zshrc # zsh
# 또는
source ~/.bash_profile # bashLinux 설치
Ubuntu / Debian 계열
1. 시스템 업데이트
bash
sudo apt update
sudo apt upgrade -y2. 필수 패키지 설치
bash
sudo apt install -y \
build-essential \
cmake \
git \
pkg-config3. 최신 GCC 설치 (Ubuntu 20.04 이하인 경우)
bash
# GCC 12 설치
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install -y gcc-12 g++-12
# 기본 컴파일러로 설정
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 120
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 1204. KingSejong 빌드
bash
# 저장소 클론
git clone https://github.com/kingsejong-lang/kingsejong-lang.git
cd kingsejong-lang
# 빌드
mkdir build && cd build
cmake ..
make -j$(nproc)
# 테스트
ctest --output-on-failureFedora / CentOS / RHEL 계열
1. 필수 패키지 설치
Fedora:
bash
sudo dnf install -y \
gcc-c++ \
cmake \
git \
makeCentOS 8+:
bash
sudo dnf install -y \
gcc-toolset-12 \
cmake \
git \
make
# GCC 12 활성화
scl enable gcc-toolset-12 bash2. KingSejong 빌드
bash
# 저장소 클론
git clone https://github.com/kingsejong-lang/kingsejong-lang.git
cd kingsejong-lang
# 빌드
mkdir build && cd build
cmake ..
make -j$(nproc)
# 테스트
ctest --output-on-failureArch Linux
bash
# 필수 패키지 설치
sudo pacman -S --needed base-devel cmake git
# 빌드
git clone https://github.com/kingsejong-lang/kingsejong-lang.git
cd kingsejong-lang
mkdir build && cd build
cmake ..
make -j$(nproc)Windows 설치
방법 1: Visual Studio 2022 사용 (권장)
1. Visual Studio 2022 설치
- Visual Studio 2022 다운로드
- 워크로드 선택:
- "C++를 사용한 데스크톱 개발"
- 개별 구성 요소 확인:
- MSVC v143 - VS 2022 C++ x64/x86 빌드 도구
- CMake용 C++ 도구
- C++23 지원
2. Git 설치
- Git for Windows 다운로드 및 설치
3. CMake 설치 (Visual Studio에 포함되지 않은 경우)
- cmake.org에서 Windows 인스톨러 다운로드
- 설치 시 "Add CMake to the system PATH" 선택
4. KingSejong 빌드
PowerShell 또는 CMD 사용:
powershell
# 저장소 클론
git clone https://github.com/kingsejong-lang/kingsejong-lang.git
cd kingsejong-lang
# 빌드 디렉토리 생성
mkdir build
cd build
# CMake 설정
cmake .. -G "Visual Studio 17 2022" -A x64
# 빌드
cmake --build . --config Release
# 테스트
ctest --output-on-failure -C Release5. 실행
powershell
.\bin\Release\kingsejong.exe ..\examples\hello.ksj방법 2: MinGW-w64 사용
1. MSYS2 설치
- MSYS2 다운로드 및 설치
2. 필수 패키지 설치
MSYS2 터미널에서:
bash
# 패키지 업데이트
pacman -Syu
# 개발 도구 설치
pacman -S --needed \
mingw-w64-x86_64-gcc \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-make \
git3. KingSejong 빌드
bash
# 저장소 클론
git clone https://github.com/kingsejong-lang/kingsejong-lang.git
cd kingsejong-lang
# 빌드
mkdir build && cd build
cmake .. -G "MinGW Makefiles"
mingw32-make -j4
# 테스트
ctest --output-on-failure설치 확인
설치가 완료되면 다음을 테스트하세요:
1. 버전 확인
bash
# macOS/Linux
./bin/kingsejong --version
# Windows
.\bin\Release\kingsejong.exe --version예상 출력:
KingSejong v0.1.02. REPL 실행
bash
# macOS/Linux
./bin/kingsejong
# Windows
.\bin\Release\kingsejong.exe예상 출력:
KingSejong REPL v0.1.0
명령어: .exit 종료 | .help 도움말 | .clear 초기화 | .vars 변수목록
>>>간단한 코드 테스트:
>>> 출력("안녕하세요!")
안녕하세요!
>>> x = 10 + 20
>>> 출력(x)
30
>>> .exit3. 예제 실행
bash
# macOS/Linux
./bin/kingsejong ../examples/hello.ksj
# Windows
.\bin\Release\kingsejong.exe ..\examples\hello.ksj예상 출력:
안녕, KingSejong!4. 테스트 스위트 실행
bash
ctest --output-on-failure예상 출력:
100% tests passed, 0 tests failed out of 330+문제 해결
일반적인 문제
1. CMake 버전 오류
오류:
CMake Error: CMake 3.20 or higher is required해결:
- 최신 CMake 설치: https://cmake.org/download/
2. C++23 컴파일러 없음
오류:
The compiler does not support C++23해결 (Linux):
bash
# GCC 12+ 설치
sudo apt install gcc-12 g++-12 # Ubuntu/Debian
sudo dnf install gcc-toolset-12 # Fedora/CentOS해결 (macOS):
bash
# Xcode Command Line Tools 업데이트
xcode-select --install해결 (Windows):
- Visual Studio 2022 최신 버전 설치
3. GoogleTest 다운로드 실패
오류:
Failed to download GoogleTest해결:
bash
# 수동으로 GoogleTest 설치 후 빌드 재시도
cd build
cmake .. -DBUILD_TESTING=OFF # 테스트 비활성화
make -j44. 메모리 부족 (빌드 실패)
오류:
c++: fatal error: Killed signal terminated program cc1plus해결:
bash
# 병렬 빌드 수 줄이기
make -j1 # 또는 -j25. Windows에서 경로 오류
오류:
Cannot find file: examples/hello.ksj해결:
powershell
# 백슬래시 사용 또는 상대 경로 확인
.\bin\Release\kingsejong.exe ..\examples\hello.ksj플랫폼별 문제
macOS
문제: Xcode Command Line Tools 설치되지 않음
bash
xcode-select --install문제: Permission denied
bash
sudo make install # /usr/local에 설치 시Linux
문제: 헤더 파일 없음
bash
sudo apt install build-essential # Ubuntu/Debian
sudo dnf groupinstall "Development Tools" # Fedora문제: libstdc++ 버전 불일치
bash
# 최신 libstdc++ 설치
sudo apt install libstdc++6Windows
문제: MSVC 찾을 수 없음
powershell
# Visual Studio Developer Command Prompt 사용
# 또는 환경 변수 설정
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"문제: DLL 없음
- Release 빌드 사용 (정적 링크)
- 또는 필요한 DLL을 실행 파일과 같은 디렉토리에 복사
추가 리소스
- 공식 문서: 문서 사이트 (저장소의
docs/) - 튜토리얼: TUTORIAL.md
- 예제: ../examples/
- 문제 보고: GitHub Issues
다음 단계
설치가 완료되면:
즐거운 코딩 되세요! 🎉