How to install cangjie on Linux mint 22.1

概述

仓颉编程语言是一款面向全场景智能的新一代编程语言,主打原生智能化、天生全场景、高性能、强安全。主要应用于鸿蒙原生应用及服务应用等场景中,为开发者提供良好的编程体验。

今天,我们介绍一下仓颉语言在Linux mint 22.1上的安装。

下载

  • https://cangjie-lang.cn/download

在这里插入图片描述
考虑到截止目前为止还没有一个可用的长期稳定版本,所以,我们这里下载半年更新版。

在这里插入图片描述
对于PC电脑来说,目前基本上都是x64架构,也称为AMD64架构,所以,我们选择下载Cangjie-0.53.18-linux_x64.tar.gz

解压

下载结束以后,我们将其解压到用户目录下的目录.cangjie中。

tar -zxvf Cangjie-0.53.18-linux_x64.tar.gz
mv cangjie ~/.cangjie

配置

解压后的目录结构如下:

lwk@qwfys:~$ ll .cangjie/
total 48
drwxr-x---  8 lwk lwk 4096 Mar 16 18:10 ./
drwxr-x--- 38 lwk lwk 4096 Mar 16 18:30 ../
drwxr-x---  2 lwk lwk 4096 Feb 28  2023 bin/
-rwxr-x---  1 lwk lwk 1458 Feb 28  2023 envsetup.sh*
drwxr-x---  4 lwk lwk 4096 Feb 28  2023 lib/
drwxr-x---  4 lwk lwk 4096 Feb 28  2023 modules/
-rwxr-x---  1 lwk lwk 9078 Feb 28  2023 README.md*
drwxr-x---  3 lwk lwk 4096 Feb 28  2023 runtime/
drwxr-x---  4 lwk lwk 4096 Feb 28  2023 third_party/
drwxr-x---  5 lwk lwk 4096 Feb 28  2023 tools/
lwk@qwfys:~$

envsetup.sh是一个环境变量初始化脚本,执行命令

source ~/.cangjie/envsetup.sh

以后,在当前会话中,就可以正常使用仓颉的命令行工具了。

为方便每次登录账号以后,系统都能自动帮我们完成仓颉语言环境变量的初始化工作,我们其添加到用户目录的.bashrc文件的末尾。命令如下:

tee -a ~/.bashrc <<-EOF
export CANGJIE_DIR="$HOME/.cangjie"
[[ -s "$HOME/.cangjie/envsetup.sh" ]] && source "$HOME/.cangjie/envsetup.sh"
EOF

查看

通过上述配置,我们退出当前账号,重新登录一次,就可以正常使用了。

cjc

查看一下cjc命令是否可以正常使用。

lwk@qwfys:~$ cjc --help
Usage:cjc [option] file...Options:--diagnostic-format <value> Diagnostic format. Candidate modes: <value>=json                <value>=noColor             <value>=default             --scan-dependency           Get the package(s) which the current package depends on--no-sub-pkg                The package doesn't have sub-packages--cfg <value>               User defined contion to compile--debug-macro               Enable debug macro--parallel-macro-expansion  Enable parallel macro expansion-g                          Enable compile debug version target--trimpath <value>          Remove a specified path prefix in debuginfo-s, --strip-all             Strip the symbol table from executable and dynamic library--test                      Enable compile test--mock <value>              Specify whether mock features are enabled, or disabled, or a runtime exception is thrown when trying to use mock features<value>=on                  <value>=off                 <value>=runtime-error       -o, --output <value>        Specify product name or output directory when compiling a package--output-dir <value>        Specify output directory (it affects '--output' option)--static-std                Statically link packages of the std module--dy-std                    Dynamically link packages of the std module--static-libs               Statically link packages of other modules except std--dy-libs                   Dynamically link packages of other modules except std--lto <value>               Enable LTO to either 'full' or 'thin' (Not available for Windows target)<value>=full                <value>=thin                --profile-compile-time      Print time spent of all phases in the compilation--profile-compile-memory    Print memory usage of all phases in the compilation--fchir-constant-propagationEnable constant propagation optimizaion in CHIR--fno-chir-constant-propagationDisable constant propagation optimizaion in CHIR--fchir-function-inlining   Enable function inlining optimizaion in CHIR--fno-chir-function-inliningDisable function inlining optimizaion in CHIR--fchir-devirtualization    Enable devirtualization optimizaion in CHIR--fno-chir-devirtualization Disable devirtualization optimizaion in CHIR--sanitizer-coverage-inline-8bit-countersEnable sanitizer-coverage-inline-8bit-counters in CHIR--sanitizer-coverage-inline-bool-flagEnable sanitizer-coverage-inline-bool-flag in CHIR--sanitizer-coverage-trace-pc-guardEnable sanitizer-coverage-trace-pc-guard in CHIR--sanitizer-coverage-pc-tableEnable sanitizer-coverage-pc-table in CHIR--sanitizer-coverage-stack-depthEnable sanitizer-coverage-stack-depth in CHIR--sanitizer-coverage-trace-comparesEnable sanitizer-coverage-trace-compares in CHIR--sanitizer-coverage-trace-memcmpEnable sanitizer-coverage-trace-memcmp in CHIR--sanitizer-coverage-level=0sancov level 0--sanitizer-coverage-level=1sancov level 1--sanitizer-coverage-level=2sancov level 2--sanitizer-coverage-level <value>Set sanitizer-coverage level--int-overflow <value>      Specify default integer overflow strategy: <value>=throwing            <value>=wrapping            <value>=saturating          --fast-math                 Enable fast-math mode--link-options <value>      Options directly passed to linker-L, --library-path <value>  Add directory to library search path-l, --library <value>       Link library-B, --toolchain <value>     Use toolchain binaries and object files at the given directory--target <value>            Generate code for the given target platform--target-cpu <value>        Generate instructions for the given target processor (Experimental)--sysroot <value>           Set the system root directory under which bin, lib and include can be found--output-type <value>       Specify output file type<value>=exe                 emit executable (default)<value>=staticlib           emit static library<value>=dylib               emit dynamic library-O0                         Optimization level 0 (default)-O, -O1                     Optimization level 1-O2                         Optimization level 2-Os                         Optimization level s, like -O2 with extra optimizations for size-Oz                         Optimization level z, like -Os but reduces code size further-O<value>                   Set Optimization level--module-name <value>       Tell compiler name of the module-p, --package               Specify package directory to be compiled--import-path <value>       Add .cjo search path--incremental-compile       Enable incremental compilation.--save-temps <value>        Save intermediate compilation results. <value>: path to save temp files.-Woff, --warn-off <value>   Suppress a specific group of warning<value>=all                 <value>=unused              <value>=driver-arg          <value>=deprecated          <value>=unsupport-compile-source  <value>=package-import      <value>=parser              <value>=semantics           <value>=interpreter         -Won, --warn-on <value>     Report a specific group of warning<value>=all                 <value>=unused              <value>=driver-arg          <value>=deprecated          <value>=unsupport-compile-source  <value>=package-import      <value>=parser              <value>=semantics           <value>=interpreter         --error-count-limit <value> Emit specified <number> of errors only. Available options: all, <number> (8 by default)-V, --verbose               Enable verbose-v, --version               Print compiler version information -h, --help                  Show usage--compile-macro             Options to compile the macro define package--coverage                  Enable coverage--experimental              Enable experimental options-j, --jobs <value>          Number of tasks to run at once--apc, --aggressive-parallel-compileEnable agrressive parallel compile--fobf-string               Enable string literal obfuscation--fno-obf-string            Disable string literal obfuscation--fobf-const                Enable constant literal obfuscation--fno-obf-const             Disable constant literal obfuscation--fobf-layout               Enable code layout obfuscation--fno-obf-layout            Disable code layout obfuscation--fobf-cf-flatten           Enable control flow flatten obfuscation--fno-obf-cf-flatten        Disable control flow flatten obfuscation--fobf-cf-bogus             Enable control flow bogus obfuscation--fno-obf-cf-bogus          Disable control flow bogus obfuscation--fobf-all                  Enable all obfuscations--fobf-export-symbols       Obfuscate export symbols when layout obfuscation is enabled--fno-obf-export-symbols    Don't obfuscate export symbols when layout obfuscation is enabled--obf-sym-input-mapping <value>Specify the input files of symbol mapping for layout obfuscation--obf-sym-output-mapping <value>Specify the output file of symbol mapping for layout obfuscation--obf-apply-mapping-file <value>Supply user-defined symbol mapping file for layout obfuscation--obf-sym-prefix <value>    Specify the prefix of obfuscated symbols for layout obfuscation--fobf-source-path          Obfuscate source path of symbols when layout obfuscation is enabled--fno-obf-source-path       Don't obfuscate source path of symbols when layout obfuscation is enabled--fobf-line-number          Obfuscate line number of symbols when layout obfuscation is enabled--fno-obf-line-number       Don't obfuscate line number of symbols when layout obfuscation is enabled--obf-config <value>        Specify obfuscation configure file--obf-level <value>         Specify obfuscation level. Available value: 1 to 10 (5 by default)--obf-seed <value>          Specify random seed for obfuscation algorithm. Available value: <number>--disable-reflection        Disable reflection--stack-trace-format <value>Specify stack trace format<value>=default             <value>=simple              <value>=all                 --pgo-instr-gen             PGO instrumentation--pgo-instr-use <value>     Read PGO instrumentation profile--discard-eh-frame          Discard the eh_frame section
lwk@qwfys:~$
lwk@qwfys:~$ cjpm --help
Cangjie Package ManagerUsage:cjpm [subcommand] [option]Available subcommands:init             Init a new cangjie modulecheck            Check the dependenciesupdate           Update cjpm.locktree             Display the package dependencies in the source codebuild            Compile the current modulerun              Compile and run an executable producttest             Unittest a local package or moduleclean            Clean up the target directoryinstall          Install a cangjie binaryuninstall        Uninstall a cangjie binaryAvailable options:-h, --help       help for cjpm-v, --version    version for cjpmUse "cjpm [subcommand] --help" for more information about a command.
lwk@qwfys:~$

cjpm

我们再来查看一下命令cjpm是否可以正常使用:

lwk@qwfys:~$ cjpm --help
Cangjie Package ManagerUsage:cjpm [subcommand] [option]Available subcommands:init             Init a new cangjie modulecheck            Check the dependenciesupdate           Update cjpm.locktree             Display the package dependencies in the source codebuild            Compile the current modulerun              Compile and run an executable producttest             Unittest a local package or moduleclean            Clean up the target directoryinstall          Install a cangjie binaryuninstall        Uninstall a cangjie binaryAvailable options:-h, --help       help for cjpm-v, --version    version for cjpmUse "cjpm [subcommand] --help" for more information about a command.
lwk@qwfys:~$

小结

今天我们带领大家完成了仓颉语言运行时环境的在Linux mint 22.1上的安装。以下几点,大家需要着重注意:

  • 版本

从实践角度来说,我们在生产环境始终需要注意的就是安装长期维护版,即LTS。由于截止目前为止,LTS还没有发布,所以这时暂且安装半年维护版。

  • cjpm

仓颉语言提供了仓颉包管理工具cjpm,日后,关于仓颉包管理就可以借助它管理起来。这个包管理工具日后与npm、pip、canda是类似的。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/34992.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

杰理可视化SDK-手机三方通话控制

杰理可视化SDK-手机三方通话控制 手机三方通话功能杰理SDK三方通话控制SDK三方通话状态获取SDK三方通话处理 手机三方通话功能是手机常用的功能之一。本篇文章简单介绍了杰理可视化SDK在蓝牙耳机应用中&#xff0c;当手机存在三方通话来电或正在进行三方通话时&#xff0c;蓝牙…

【二分算法】-- 寻找旋转排序数组中的最小值

文章目录 1. 题目2. 题目解析3. 代码 1. 题目 在线oj 2. 题目解析 解法一&#xff1a;暴力查找最小值 时间复杂度&#xff1a;0(N) 解法二&#xff1a;二分查找算法 【二段性】&#xff1a; A~B&#xff1a;nums[i] > nums[i 1] C~D&#xff1a;nums[i] < nums[i…

音视频入门基础:RTCP专题(1)——RTCP官方文档下载

一、引言 实时传输控制协议&#xff08;Real-time Transport Control Protocol或RTP Control Protocol或简写RTCP&#xff09;是实时传输协议&#xff08;RTP&#xff09;的一个姐妹协议。RTCP由《RFC 3550》定义&#xff08;取代废弃的《RFC 1889》&#xff09;。RTP使用一个…

OrioleDB: 新一代PostgreSQL存储引擎

PostgreSQL 12 引入了可插拔式的表存储方法接口&#xff0c;允许为不同的表选择不同的存储机制&#xff0c;例如用于 OLTP 操作的堆表&#xff08;HEAP、默认&#xff09;、用于 OLAP 操作的列式表&#xff08;Citus&#xff09;&#xff0c;以及用于超快速搜索处理的内存表。 …

1.5 Spring Boot项目打包和运行

本文介绍了如何使用Spring Boot进行项目打包和运行。首先&#xff0c;讲解了如何将Spring Boot项目打包为可执行的JAR包&#xff0c;并直接运行&#xff0c;无需部署到外部Web服务器。接着&#xff0c;介绍了如何将项目打包为WAR包&#xff0c;以便部署到Web容器中&#xff0c;…

2.7 滑动窗口专题:串联所有单词的子串

LeetCode 30. 串联所有单词的子串算法对比分析 1. 题目链接 LeetCode 30. 串联所有单词的子串 2. 题目描述 给定一个字符串 s 和一个字符串数组 words&#xff0c;words 中所有单词长度相同。要求找到 s 中所有起始索引&#xff0c;使得从该位置开始的连续子串包含 words 中所…

vue中,watch里,this为undefined的两种解决办法

提示&#xff1a;vue中&#xff0c;watch里&#xff0c;this为undefined的两种解决办法 文章目录 [TOC](文章目录) 前言一、问题二、方法1——使用function函数代替箭头函数()>{}三、方法2——使用that总结 前言 ‌‌‌‌‌尽量使用方法1——使用function函数代替箭头函数()…

uniapp移动端图片比较器组件,仿英伟达官网rtx光追图片比较器功能

组件下载地址&#xff1a;https://ext.dcloud.net.cn/plugin?id22609 已测试h5和微信小程序&#xff0c;理论支持全平台 亮点&#xff1a; 简单易用 使用js计算而不是resize属性&#xff0c;定制化程度更高 组件挂在后可播放指示线动画&#xff0c;提示用户可以拖拽比较图片…

SDL3 游戏开发 Windows 环境搭建

SDL3 游戏开发 Windows 环境搭建 一、准备工作1.1 必备工具与库安装1.1.1 CMake1.1.2 MinGW-w641.1.3 Ninja1.1.4 Git1.1.5 SDL3 及扩展库1.1.6 VSCode 及插件 二、配置VSCode项目并验证环境2.1 创建测试源文件2.2 编写CMakeLists.txt文件和CMakePresets.json2.2.1 使用VSCode的…

【sql靶场】第13、14、17关-post提交报错注入保姆级教程

目录 【sql靶场】第13、14、17关-post提交报错注入保姆级教程 1.知识回顾 1.报错注入深解 2.报错注入格式 3.使用的函数 4.URL 5.核心组成部分 6.数据编码规范 7.请求方法 2.第十三关 1.测试闭合 2.列数测试 3.测试回显 4.爆出数据库名 5.爆出表名 6.爆出字段 …

esxi,vcenter6.0安装指导

前言 esxi6.0安装和esxi6.7步骤基本一样&#xff0c;可参考vmware esxi vcenter6.7安装教程&#xff08;dell&#xff09; 环境依赖以及安装包 esxi6.0安装包vcenter6.0安装不同于6.7&#xff0c;6.5通过导入ova模版安装&#xff0c;需要安装在windows server 2008或者windo…

BigFoot Decursive lua

BigFoot Decursive lua 一键驱散脚本 国际化 ogg语音提示 初始化

2024山东大学计算机复试上机真题

2024山东大学计算机复试上机真题 2024山东大学计算机复试机试真题 历年山东大学计算机复试上机真题 历年山东大学计算机复试机试真题 在线评测&#xff1a;传动门&#xff1a;pgcode.cn 最长递减子序列 题目描述 输入数字 n&#xff0c;和 n 个整数&#xff0c;输出该数字…

【AI News | 20250316】每日AI进展

AI Repos 1、ReActMCP 将网络搜索能力集成到AI助手中的一个MCP服务&#xff1a;ReActMCP Web Search&#xff0c;相当于给AI装了个搜索引擎&#xff0c;可以实时查找最新的内容。它基于Exa API执行基本和高级网络搜索&#xff0c;高级搜索比如限制搜索的网站范围、指定日期范围…

【大模型实战篇】使用GPTQ量化QwQ-32B微调后的推理模型

1. 量化背景 之所以做量化&#xff0c;就是希望在现有的硬件条件下&#xff0c;提升性能。量化能将模型权重从高精度&#xff08;如FP32&#xff09;转换为低精度&#xff08;如INT8/FP16&#xff09;&#xff0c;内存占用可减少50%~75%。低精度运算&#xff08;如INT8&#xf…

Unity 笔记:在EditorWindow中绘制 Sorting Layer

在Unity开发过程中&#xff0c;可能会对旧资源进行批量修改&#xff0c;一个个手动修改费人费事&#xff0c;所以催生出了一堆批量工具。 分享一下在此过程中绘制 Sorting Layer 面板的代码脚本。 示意图&#xff1a; 在 EditorGUI 和 EditorGUILayer 中内置了 SortingLayerF…

idea更新git代码报错No Git Roots

idea更新git代码报错&#xff1a; No Git Roots None of configured Git roots are under Git. The configured directory must have ".git directory in it.但是本地项目里是存在.git文件的&#xff0c;就是突然间不能更新代码了 然后尝试重新拉新项目代码提示: Git i…

失败的面试经历(ʘ̥∧ʘ̥)

一.面向对象的三大特性 1.封装&#xff1a;将对象内部的属性私有化&#xff0c;外部对象不能够直接访问&#xff0c;但是可以提供一些可以使外部对象操作内部属性的方法。 2.继承&#xff1a;类与类之间会有一些相似之处&#xff0c;但也会有一些异处&#xff0c;使得他们与众…

qt加载VeloView工程

接上一篇点云软件配置与编译&#xff0c;使用qt加载需要先完成编译。编译完成后到编译目录下lidarview-superbuild\common-superbuild\lidarview\build 找到CmakeCache.txt&#xff0c;如下是我的编译目录。 使用QT6.5.3加载了CmakeCache.txt&#xff0c;QT5.14还加载不了cmake…

Windows Qt动态监测系统分辨率及缩放比变化

前言 Windows 显示设置中&#xff0c;可以修改缩放比&#xff0c;所有界面和文字会同比例放大或缩小&#xff0c;在开发桌面程序时&#xff0c; 实时监测Qt应用程序在不同缩放比例下的表现&#xff0c;可以及时调整程序界面以适应不同显示屏幕的需求。 正文 本文通过Qt相关…