# 安装libexpat

#### 操作步骤

1. 执行以下命令下载安装包。

```
cd
/path/to
wget https://github.com/libexpat/libexpat/archive/refs/tags/R_2_4_7.tar.gz -O libexpat-2.4.7.tar.gz
tar xf libexpat-2.4.7.tar.gz
```


2. 执行以下命令进入源码目录并安装。

```
cd libexpat-R_2_4_7/expat
cmake . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX=
/path/to/libexpat
make -j 64
make install
```


3. 执行以下命令设置环境变量。

```
export PATH=
/path/to/libexpat
/bin:$PATH
export LD_LIBRARY_PATH=
/path/to/
libexpat
/lib64:$LD_LIBRARY_PATH
export INCLUDE=
/path/to/libexpat/
include:$INCLUDE
```
