Arch/GentooLinux开发环境构建与常用软件一览

摘要:
编辑EmacsArch Linuxyay ScrangemacsGentoo Linuxsudomeerge-a skclangemacsvisal工作室代码Gentoo Linux sudomegere-a skapp编辑器/videal工作室代码发布文本Gentoo linux sudomege-askapp编辑器/汇编-
编辑器

Emacs

  • Arch Linux

    yay -S clang emacs
    
  • Gentoo Linux

    sudo emerge --ask clang emacs
    

visual-studio-code

  • Gentoo Linux
    sudo emerge --ask app-editors/visual-studio-code
    

sublime-text

  • Gentoo Linux
    sudo emerge --ask app-editors/sublime-text
    
Git
  • Gentoo Linux
    sudo emerge --ask dev-vcs/git
    
Makefile
  • makefile三要素
    Target : Depend
    `TAB` Command
    

makefile的变量说明

  • $@ => Target

  • $^ => All Depend

  • $< => First dependency

  • $? => The first change of dependency

  • 自定义变量

    Objfile=xxx.c xxx.c xxx.c
    # Use variable
    app:$(Objfile)
    gcc -----
    

基础格式

  • 最简单一个模板, 但文件数量多了的话每次make都会逐个编译.
    app:main.c add.c sub.c div.c mul.c
        gcc -o app -I ./includemain.c add.c sub.c div.c mul.c
    

更新版本

  • 先编译为.o文件, 如果源码未修改则不编译
    ObjFile=main.o add.o sub.o div.o mul.o
    app:$(ObjFile)
        gcc -o app -I./include $(ObjFile)
    
    main.o:main.c
        gcc -c main.c -I ./include
    add.o:add.c
        gcc -c add.c -I ./include
    sub.o:sub.c
        gcc -c sub.c -I ./include
    div.o:div.c
        gcc -c div.c -I ./include
    mul.o:mul.c
        gcc -c mul.c -I ./include
    

万能模板

  • 一个可以重复使用makefile模板

    # Get all .c files
    SrcFiles=$(wildcard *.c)
    # Convert the .c to .o
    ObjFiles=$(patsubst %.c,%.o,$(SrcFiles))
    
    all:app app1
    
    app:$(ObjFiles)
        gcc -o $@ -I./include $(ObjFiles)
    app1:$(ObjFiles)
        gcc -o $@ -I./include $(ObjFiles)
    %.o:%.c
        gcc -o $@ -c $^ -I ./include
    
    test:
        @echo $(SrcFiles)
        @echo $(ObjFiles)
    
    # Non-target statement
    .PHONY:clean all
    
    clean:
        -rm *.o
        -rm app app1
    
  • @: Stands for Don't print command

  • -: Stands for Don't handle error

GDB

使用Gdb

  • 若要使用gdb就在gcc编译的时候添加上-g参数来支持gdb.

  • 在gdb中运行程序

    • r(un): 执行程序
    • start: 执行程序并在main函数位置暂停
    • n(ext): 执行下一条指令
    • s(tep): 执行下一条指令并进入子函数
    • q(uit): 退出gdb
  • 设置程序参数

    set args xx xx(as: set args 10 9)
    
  • 显示main函数的参数

    show args
    
  • 打印变量的值

    p variable
    
  • 打印变量类型

    ptype variable
    
  • 设置变量的值

    set argc=4
    
    set argv[1]="12" ## or
    set argv[2]="7"
    

添加与删除程序断点

  • 根据行号添加断点

    b numberline (as: b 15)
    
  • 根据函数名添加断点

    b function name (as: b hello)
    
  • 根据文件名定位到xx行添加断点

    b file:xx (as b text.c:15)
    
  • 删除程序断点

    d(el) number(as d 1)
    

显示与跳转断点

  • 显示程序断点

    info b (get breakpoint number)
    
  • 跳转到下一个断点

    c(ontinue) (jump to next program breakpoint)
    

条件断点与显示程序代码

  • 条件断点

    b line if i == 1
    
  • 显示程序代码

    l(ist) show the code, show 10 line by default
    - l -- Display the file where the main function is located
    - l filename:line
    

数据追踪

  • 添加数据追踪

    display variablename (for use tracking)
    
  • 显示数据追踪的行号

    info display(get the data tracking number)
    
  • 取消显示数据追踪

    undisplay number
    
开发库

OpenGL

  • 安装
    sudo emerge --ask x11-apps/mesa-progs
    
    glxinfo | grep rendering
    
    sudo glxgears
    
开发环境

语言环境

Python环境

  • 安装ipython
    sudo emerge --ask dev-python/ipython
    

Java环境

  • 安装配置文件的默认JDK运行
    sudo emerge --ask --oneshot virtual/jdk
    

集成开发环境(IDE)

CodeBlocks

  • Gentoo Linux
    sudo emerge --ask dev-util/codeblocks
    

Qt-Creator

  • Gentoo Linux
    sudo emerge --ask dev-qt/qt-creator
    
    sudo emerge --ask dev-qt/qt-docs
    

Android Studio

  • Gentoo Linux
    sudo emerge --ask dev-util/android-studio
    

Android Studio 下载fastutil.jar文件连接失败

  • 解决方法: 换国内的源.
  • 打开项目文件中的buld.gradle
  • buildscriptallprojectsrepositories 中分别注释掉jcenter()
  • buildscriptallprojectsrepositories 分别添加: maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
  • 继续在 buildscriptrepositories 添加: maven{url "https://jitpack.io"}
    Arch/GentooLinux开发环境构建与常用软件一览第1张

Mysql数据库

Install dev-db/mariadb

  • 安装mariadb

    sudo emerge --ask mariadb
    
  • To have Mariadb startd automatically at boot, add it to the default runlevel

    sudo rc-update add mysql default
    
    sudo rc-service mysql start
    
  • The configuration will create a database, set proper permissions, and assist you in creating a secure root password(this is for the Mariadb root account, which is not related to the linux root account)

    sudo emerge --config dev-db/mariadb
    
    • if the event Mariadb configuration fails due 'localhost' as hostname, update the system hostname variable to a name other than 'localhost' in /etc/conf.d/hostname
      • sed -i 's/localhost/larry/g' /etc/conf.d/hostname
      • rc-service hostname restart
      • emerge –config dev-db/mariadb
  • When the database is set up and running, conncet to MariaDB using the mysql client application

    mysql -u root -p
    
嵌入式

电子电路设计

KiCad

  • Arch Linux
    yay -S kicad
    
    yay -S kicad-library-3d
    
截图工具
  • flameshot自带图像处理的截图工具
    sudo emerge --ask media-gfx/flameshot
    
多媒体

图像处理

  • Gimp

    sudo emerge --ask media-gfx/gimp
    
  • Krita

    sudo emerge --ask media-gfx/krita
    

图形绘图

思维导图

  • Freeplace
    • 直接去官网下载

数学绘图

  • geogebra
    sudo emerge --ask sci-mathematics/geogebra
    

三维动画

  • Blender
    sudo emerge --ask --verbose blender
    

图片浏览器

  • shotwell
    sudo emerge --ask media-gfx/shotwell
    

视频播放器

  • SMPlayer
    sudo emerge --ask --verbose media-video/smplayer
    
浏览器

Google-Chrome

安装Chrome

  • Emerge
    sudo emerge --ask www-client/google-chrome
    

Saladict(翻译)

  • github 从源码创建

    git clone git@github.com:crimx/ext-saladict.git
    cd ext-saladict
    yarn install
    yarn pdf
    
  • Add a .env file following the .env.example format(leave cmpty if you don't use these dictionaries).

    yarn bulid
    
  • Artifacts can be found in build/

  • Saladict安装与下载

    https://pictureknow.com/extensions
    
    • then search "saladict"
  • Chrome插件

    google address bar:
    chrome://extensions/
    

Firefox

  • Gentoo
    sudo emerge --ask www-client/firefox
    
字典工具
  • goldendict
    sudo emerge --ask app-text/goldendict
    
办公软件

PDF渲染器

  • Evince
    sudo emerge --ask app-text/evince
    

表格字处理

  • libreoffice
    sudo emerge --ask app-office/libreoffice
    

免责声明:文章转载自《Arch/GentooLinux开发环境构建与常用软件一览》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Linux的环境变量配置在/etc/profile或/etc/profile.d/*.sh文件中的区别是什么?golang-指针,函数,map下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

微服务架构介绍

作者:老刘链接:https://www.zhihu.com/question/55511712/answer/860169294来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 一、微服务架构介绍 微服务架构(Microservice Architecture)是一种架构概念,旨在通过将功能分解到各个离散的服务中以实现对解决方...

linux下卸载apache方法小结

方法一 代码如下: 1.root@server ~]# rpm -qa|grep httpdhttpd-2.2.3-11.el5_2.centos.4httpd-manual-2.2.3-11.el5_2.centos.4 说明:rpm –qa | grep httpd命令是为了把httpd相关的包都列出来, 我上面的例子是Linux默认安装apache...

【web/app】charles抓包https/模拟弱网/设置断点/修改接口请求值或返回值/压测

charles几个常用功能 charles本质一是一个代理服务器,可以抓移动端也可以抓web端,都需要安装证书   1,抓包https网页:(如未配置,会显示unknown) 第一步:安装证书 if 移动端,首先:给手机安装SSL证书 手机和电脑在同一wifi下,手机wifi配置http代理,ip是电脑ip,端口一般默认8888 安装SSL证书到手机,...

npm script 自动打开浏览器 All In One

npm script 自动打开浏览器 All In One npm script 自动打开浏览器,bin open / node.js 兼容 mac/pc API It uses the command open on macOS, start on Windows and xdg-open on other platforms. source-code...

Windows Phone开发工具初体验【转载】

Windows Phone开发工具在MIX 2010上火热登场了。Windows Mobile开发者们压抑许久的热情终于爆发出来,对于Windows Phone的华丽转身,开发者们褒贬不一,有人对Silverlight、 XNA等新技术充满期待,有人对放弃以前版本兼容性、不支持C++开发满腹怨言。 无论如何,Windows Phone为我们带来了新的用户体...

ERP和SAP的区别

1、定义不同 ERP即(Enterprise Resource Planning)企业资源计划,由美国Gartner Group 公司于1990年提出。 ERP叫企业资源计划,既是一种管理思想,也是一种企业应用软件,只作为管理思想,ERP体现“集成管理、共享数据、最优化资源利用”等的思想;作为软件,它实际上就是一种管理信息系统,但是这种管理信息系统是基于统...