Deploying the Cangjie Runtime
To ensure that the executable programs of Cangjie can run properly in different OS environments, Cangjie provides a runtime environment. This environment enables Cangjie executable programs to access memory and other system resources, such as the Cangjie dynamic libraries that the programs depend on when they are running.
Installing the complete Cangjie toolchain includes installing the Cangjie code compilation environment and Cangjie runtime. For details, see Installing the Cangjie Toolchain. If you do not need to compile code and only need to run executable programs, you can deploy the runtime independently in the environment.
This section describes how to deploy the Cangjie runtime.
Note that if you use a Cangjie static link library during compilation, the runtime module is embedded in the compiled executable file. In this case, you do not need to deploy the runtime; instead, directly run the compiled executable file in your environment.
Linux
-
Visit the official release channel of Cangjie and download the installation package that mathces your platform architecture.
cangjie-sdk-linux-x64-x.y.z.tar.gz: Linux edition of the Cangjie toolchain applicable to x86_64cangjie-sdk-linux-aarch64-x.y.z.tar.gz: Linux edition of the Cangjie toolchain applicable to aarch64
-
Decompress the downloaded installation package to a proper directory.
A directory named
cangjieis generated in the current working directory, storing all the content of the Cangjie toolchain.The
runtimedirectory in thecangjiedirectory stores all Cangjieruntimedynamic libraries. -
Run the following command in the operating environment to deploy the
runtime(replace${CANGJIE_HOME}with the path of thecangjiedirectory and${hw_arch}with the actual hardware architecture):export LD_LIBRARY_PATH=${CANGJIE_HOME}/runtime/lib/linux_${hw_arch}_llvm:${LD_LIBRARY_PATH}
macOS
-
Visit the official release channel of Cangjie and download the installation package that mathces your platform architecture.
cangjie-sdk-mac-x64-x.y.z.tar.gz: macOS edition of the Cangjie toolchain applicable to x86_64cangjie-sdk-mac-aarch64-x.y.z.tar.gz: macOS edition of the Cangjie toolchain applicable to aarch64/arm64
-
Decompress the downloaded installation package to a proper directory.
A directory named
cangjieis generated in the current working directory, storing all the content of the Cangjie toolchain.The
runtimedirectory in thecangjiedirectory stores all Cangjieruntimedynamic libraries. -
Run the following command in the operating environment to deploy the
runtime(replace${CANGJIE_HOME}with the path of thecangjiedirectory and${hw_arch}with the actual hardware architecture):export DYLD_LIBRARY_PATH=${CANGJIE_HOME}/runtime/lib/darwin_${hw_arch}_llvm:${LD_LIBRARY_PATH}
Windows
-
Visit the official release channel of Cangjie and download the installation package that mathces your platform architecture.
cangjie-sdk-windows-x64-x.y.z.zip: Cangjie toolchain for Windows (x86_64)
-
Decompress the downloaded installation package to a proper directory.
A directory named
cangjieis generated in the current working directory, storing all the content of the Cangjie toolchain.The
runtimedirectory in thecangjiedirectory stores all Cangjieruntimedynamic libraries. -
The following describes how to deploy the
runtimein three environments. Select one of them based on usage habits and environment configurations. (Replace${CANGJIE_HOME}with the path of thecangjiedirectory and${hw_arch}with the actual hardware architecture.)-
In Windows environments, run the following command:
set "PATH=${CANGJIE_HOME}\runtime\lib\windows_x86_64_llvm;%PATH%;" -
In PowerShell environments, run the following command:
$env:PATH = "${CANGJIE_HOME}\runtime\lib\windows_x86_64_llvm;" + $env:Path -
In MSYS shell or Bash environments, run the following command:
export PATH=${CANGJIE_HOME}/runtime/lib/windows_x86_64_llvm
-