
Linux
文章平均质量分 57
随遇而安随缘一世
这个作者很懒,什么都没留下…
展开
-
AptGet/Howto
ContentsPackage management with APTIntroduction to APTCommandsInstallation commandsauto-aptMaintenance commandsRemoval commandsSearch commandsTypical转载 2014-04-28 23:56:23 · 904 阅读 · 0 评论 -
CMake 手册详解(16-20)
CMD#35 : foreach 对一个list中的每一个变量执行一组命令。 foreach(loop_var arg1 arg2 ...) COMMAND1(ARGS ...) COMMAND2(ARGS ...) ... endforeach(loop_var) 所有的foreach和与之匹配的endforeach命令之间的命令会被记录下来而不会被调用转载 2014-07-27 22:39:15 · 8453 阅读 · 0 评论 -
makefile里PHONY的相关介绍
Phony TargetsPHONY 目标并非实际的文件名:只是在显式请求时执行命令的名字。有两种理由需要使用PHONY 目标:避免和同名文件冲突,改善性能。如果编写一个规则,并不产生目标文件,则其命令在每次make 该目标时都执行。例如: clean: rm *.o temp因为"rm"命令并不产生"clean"文件,则每次执行"make clean"的时候,该命转载 2014-07-27 09:29:12 · 503 阅读 · 0 评论 -
如何自己编写Makefile
相信很多朋友都有过这样的经历,看着开源项目中好几页的makefile文件,不知所云。在日常学习和工作中,也有意无意的去回避makefile,能改就不写,能用ide就用ide。其实makefile并没有想象的那么难写,只要你明白了其中的原理,自己实践几次。你也可以自己写makefile,让别人对你头来羡慕的目光。 下面本人介绍一下自己的学习成果,初学阶段,欢迎大家多多指正。 简单转载 2014-07-27 09:46:29 · 460 阅读 · 0 评论 -
makefile学习笔记
#。对于一般多字符变量的引用必须使用括号了标记,否则make将把变量名的首字母作为作为变量而不是整个字符串(“$PATH”在Makefile中实际上是“$(P)ATH”)。# 这一点和shell中变量的引用方式不同。shell中变量的引用可以是“${xx}”或者“$xx”格式。但在Makefile中多字符变量名的引用只能是“$(xx)”或者“${xx}”格式。name1 := $(转载 2014-07-27 09:48:56 · 758 阅读 · 0 评论 -
CMake手册详解 (11-15)
CMD#29:find_file 查找一个文件的完整路径。 find_file( name1 [path1 path2 ...]) 这是该命令的精简格式,对于大多数场合它都足够了。它与命令find_file( name1 [PATHS path1 path2 ...])是等价的。 find_file( name | NAM转载 2014-07-27 22:34:24 · 5078 阅读 · 0 评论 -
.PHONY 作用
./PHONY 来显示的指名一个目标是伪目标,有两个作用一个是改善性能,另外一个是来避免冲突。例如我写了这样一个Makefile[cpp] view plaincopytest1:main.o file1.o file2.o file3.o cc -o test1 main.o file1.o file2.o file3转载 2014-07-27 09:26:51 · 917 阅读 · 0 评论 -
makfile中.PHONY的认识
install:foo install -m 644 foo /usr/bin.PHONY: install 看以上makefile的片段,使用了.PHONY这个目标,下面详细介绍她的用法.来源:点击打开链接.PHONY是一个特殊工作目标(special target) 它用来指定一个假想的工作目标,也就是说它后面的并不是一个实际文件,而且肯定转载 2014-07-27 09:28:40 · 488 阅读 · 0 评论 -
makefile 中制定shell
或者在make后面加 SHELL=/bin/bash解决make SHELL=/bin/bash很早以前,初次学习Linux,最先了解的就是那几种shell,但是的感觉就是没感觉,只是把shell看成是如DOS类的语言嘛,最终目的还是要在shell下运行chmod a+x的可执行程序,所以无所谓哪种shell,从来也没把这当回事。做Linux开发的嘛,不会写Makefile,也会读转载 2014-07-27 19:41:08 · 1719 阅读 · 0 评论 -
gcc -rdynamic参数解释
选项 -rdynamic 用来通知链接器将所有符号添加到动态符号表中(目的是能够通过使用 dlopen 来实现向后跟踪)-rdynamicPass the flag ‘-export-dynamic’ to the ELF linker, on targets that supportit. This instructs the linker to add all symbols,原创 2014-07-27 23:57:13 · 7759 阅读 · 1 评论 -
CMake 手册详解(3-5)
生成器这一节确实没有很多料,纯粹的流水账;不过为了完整,也还是给它一点篇幅吧。下一章将开始我们真正的主题:-)=================================================生成器 在CMake 2.8.3平台上,CMake支持下列生成器:Borland Makefiles: 生成Borland makefile。MSYS Makefiles转载 2014-07-27 22:32:34 · 1833 阅读 · 0 评论 -
gcc/g++ 静态动态库 混链接.
我的环境: centos6 x64. gcc4.4.7在使用gcc/g++ 编译程序时我们希望指向一些库是使用静态的链接方式. 另外的一些是动态的方式.我以boost 为例.如果我们要使用静态库则是这样的:# g++ main.cpp -lpthread /usr/lib64/libboost_thread.a /usr/lib64/libb转载 2014-07-27 23:59:14 · 1406 阅读 · 0 评论 -
如何自己编写Makefile(高级篇)
上篇文章介绍了makefile的编写方法,相信大家有所收获。本文继续深入makefile,看看还有哪些高级用法可以大大提升我们的工作效率。本文是接着上篇博文——如何自己编写Makefile的,因此如果没有看过上篇文章的,建议先阅读一遍,以便更好地理解本文。 在规则中使用通配符 一个简单的例子 clean: rm -f *.o 表示删除所有转载 2014-07-27 09:45:54 · 507 阅读 · 0 评论 -
makefile中的all和.PHONY的作用
请编写一个makefile同时编译、链接下面两个程序:main1.c:#includeint main(void){ printf("main1\n");}main2.c:#includeint main(void){ printf("main2\n");}【分析】:这里需要生成两个转载 2014-07-27 09:50:42 · 1907 阅读 · 2 评论 -
CMake 手册详解(1-2)
公司的一个项目使用CMake作为跨平台构建工具;业务有需求,当然要好好研读一下官方的技术手册。目前的计划是先把官方手册翻译一下,了解清楚CMake中的各种命令、属性和变量的用法。同时在工作中也会阅读CMake的真实源码,后续会基于此陆续写一些工程中使用CMake的心得。CMake的版本也在不停更新,有些新的命令和变量会随着版本更新添加进来,这是后事了,暂且不管;现在锁定CMake 2.8.3作为手转载 2014-07-27 22:28:22 · 4187 阅读 · 0 评论 -
CMake 手册详解(21-23)
上个月为了一个新加的功能披星戴月,没有时间照顾博文,很长时间木有更新。一直到长假即将收假,才有了时间重新打理这行将荒芜的文章。所以嘛,这次一定要多翻译些,好弥补下上个月的缺失~~============================================================================CMD#58: option 为用户提供一个可选项。 o转载 2014-07-27 22:39:27 · 4379 阅读 · 0 评论 -
gdb的一些常规使用
1. cmake支持gdb的实现,首先在CMakeLists.txt下加入SET(CMAKE_BUILD_TYPE "Debug") 在下面加入:SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall"转载 2014-07-27 23:16:01 · 586 阅读 · 0 评论 -
(个人摘要)make工具的用法
make工具是什么在DOS时期编写汇编程序的时候,编译器和链接器基本上不用什么参数,命令只有区区两条:Masm xxx.asm;Link xxx.obj;只要做个批处理把xxx换成%1,然后在命令行键入asm.bat xxx就万事大吉了,很是方便。Win32编程就不一样了,不管编译器还是链接器都需要加上必要的选项,文件列表也多了起来,如链接器的命令行参数中要列出ob转载 2014-07-27 09:48:29 · 732 阅读 · 0 评论 -
GNU make中文手册
关于本书本文瑾献给所有热爱Linux的程序员!本文档版权所有,禁止用于任何商业行为。本文比较完整的讲述GNU make工具,涵盖GNU make的用法、语法。同时重点讨论如何为一个工程编写Makefile。作为一个Linux程序员,make工具的使用以及编写Makefile是必需的。系统、详细讲述make的中文资料比较少,出于对广大中文Linuxer的支持,本人在工作之余,花了18个多月时转载 2014-07-27 19:40:11 · 1343 阅读 · 0 评论 -
CMake 手册详解(6-10)
CMD#6:add_library 使用指定的源文件向工程中添加一个库。 add_library( [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] source1 source2 ... sourceN) 添加一个名为的库文件,该库文件将会根据调用的命令里列出的源文件来创建。对应于逻辑目转载 2014-07-27 22:34:25 · 4096 阅读 · 0 评论 -
有关g++的-rdynamic选项
选项 -rdynamic 用来通知链接器将所有符号添加到动态符号表中 (目的是能够通过使用 dlopen 来实现向后跟踪) -rdynamic Pass the flag ‘-export-dynamic’ to the ELF linker, on targets that support it. This instructs the linker to add all symb转载 2014-07-27 23:58:23 · 6521 阅读 · 0 评论 -
Linux GCC常用命令
1简介2简单编译2.1预处理2.2编译为汇编代码(Compilation)2.3汇编(Assembly)2.4连接(Linking)3多个程序文件的编译4检错5库文件连接5.1编译成可执行文件5.2链接5.3强制链接时使用静态链接库1简介GCC 的意思也只是 GNU C Compiler 而已。转载 2014-07-28 00:06:06 · 522 阅读 · 0 评论 -
Alternatives to GNU Screen for Linux Terminal Multitasking
TmuxAs a rewrite of GNU Screen, tmux offers a variety of improvements. Some of the most important include a client-server model, which allows you to connect to a tmux session from multiple locatio转载 2014-07-29 01:11:25 · 805 阅读 · 0 评论 -
dvtm || dynamic virtual terminal manager
Tiling window management for the consolemenuNewsDownloadWhy dvtm?DevelopmentInstallationFirst stepsConfigurationCommand line optionsFAQ转载 2014-07-29 01:12:25 · 5836 阅读 · 0 评论 -
For loops in R: how to do a “continue”
In R, you can use “for” loops just like in most other programming languages. Sometimes when you are looping through items and you encounter a certain condition, you want to skip over an item and mov转载 2014-08-19 09:29:06 · 1608 阅读 · 0 评论 -
linux常用命令大全(转)
OSX 的文件系统OSX 采用的Unix文件系统,所有文件都挂在跟目录 / 下面,所以不在要有Windows 下的盘符概念。你在桌面上看到的硬盘都挂在 /Volumes 下。比如接上个叫做 USBHD的移动硬盘,桌面上会显示出一个硬盘图标,它实际在哪里呢?在终端里执行 ls /Volumes/USBHD, 看看显示出的是不是这个移动硬盘的内容。根目录位置是转载 2014-09-27 23:28:52 · 699 阅读 · 0 评论 -
Vim的分屏功能
Vim的分屏功能分屏启动Vim使用大写的O参数来垂直分屏。vim -On file1 file2 ...使用小写的o参数来水平分屏。vim -on file1 file2 ...注释: n是数字,表示分成几个屏。启动Vim后进行分屏水平分屏。:split垂直分屏。:vsplit关闭分屏关闭当前窗口。转载 2014-10-07 22:36:10 · 1989 阅读 · 0 评论 -
User Command Area
The User Command Area (UCA) consists of the bottom two lines of the terminal screen where most interaction with the tasks takes place. The user can type task-related commands in the UCA and Hermes c转载 2014-10-27 23:14:39 · 817 阅读 · 0 评论 -
The probability of variable
templateclass GM, class ACC>00250 InferenceTermination00251 Inference::modeFromFactorMarginal(00252 std::vector& conf00253 ) const00254 {00255 const GM& gm = graphicalModel();00256 std转载 2014-10-21 04:14:10 · 748 阅读 · 0 评论 -
I/O Redirection
There are always three default files [1] open, stdin (the keyboard), stdout (the screen), and stderr (error messages output to the screen). These, and any other open files, can be redirected. Redire转载 2014-10-21 08:59:12 · 966 阅读 · 0 评论 -
Changing caption width in latex
In this post I will discuss how to change the width of the figure caption. You can use the same technique to change the width of the other caption (like table caption). Here I am using the caption pac转载 2015-04-22 23:31:27 · 1357 阅读 · 0 评论 -
linux 默认的include在哪?
#include 中的module.h默认是在哪个目录下呢?我在/usr/include/linux下并没有找到这个文件。另外想问一下,不同内核版本的linux头文件是不是一样的。比如:我在2.6.20内核的系统上,用2.6.10的头文件会不会有问题。网友回复:1我的 module.h是在 内核编译好了的目录下的,不是在/usr/include/linux下,2在2.转载 2015-04-17 06:04:44 · 1213 阅读 · 0 评论 -
Install and use GSL library
The packages for GSL can be found hereYou can install just the library by using: apt-get install libgsl0ldblYou can also install the development package and binary using: apt-get install gsl原创 2015-04-17 06:06:03 · 874 阅读 · 0 评论 -
Quick-R
Built-in FunctionsAlmost everything in R is done through functions. Here I'm only refering to numeric and character functions that are commonly used in creating or recoding variables.Numeric F转载 2014-08-15 20:18:32 · 987 阅读 · 0 评论 -
Bash scripting Tutorial
This bash script tutorial assumes no previous knowledge of bash scripting.As you will soon discover in this quick comprehensive bash scripting guide, learning the bash shell scripting is very easy tas转载 2014-08-15 20:03:23 · 988 阅读 · 0 评论 -
Dvtm -- 平铺式终端
如果你使用过 Dwn 或 Awesome 这种平铺式窗口管理器,一定对这种显示方式印象深刻,现在即使在纯终端下,也可以平铺一把。Dvtm 是一款仿照平铺式窗口管理器的虚拟终端,可以将多个终端界面同时显示出来,并支持随时创建和切换。直接在终端运行 dvtm 即可启动。dvtm 的中的命令通过 Mod 键( 默认为 Ctrl+g ),再配合字母来激活。 Mo转载 2014-07-29 08:16:01 · 1151 阅读 · 0 评论 -
Why doesn't .bashrc run automatically?
put some alias commands in my .bashrc file, so that they might be loaded everytime I open a new Terminal window. Yet this doesn't happen.I have to select run script: in the Terminal>Preference原创 2014-08-19 12:01:24 · 706 阅读 · 0 评论 -
linux命--find
·find path -option [ -print ] [ -exec -ok command ] {} \;find命令的参数;pathname: find命令所查找的目录路径。例如用.来表示当前目录,用/来表示系统根目录。-print: find命令将匹配的文件输出到标准输出。-exec: find命令对匹配的文件执行该参数所给出转载 2014-08-23 07:57:41 · 727 阅读 · 0 评论 -
linux grep命令
1.作用Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来。grep全称是Global Regular Expression Print,表示全局正则表达式版本,它的使用权限是所有用户。2.格式grep [options]3.主要参数[options]主要参数:-c:只输出匹配行的计数。-I:不区分大 小写(转载 2014-08-23 07:55:04 · 635 阅读 · 0 评论 -
glibc
红帽企业 Linux 4 提供的 glibc 可以执行附加的内部数据健全检查,从而在尽可能早的时候发现和保护数据被破坏。在默认的情况下,当被破坏的数据被发现时,与以下相似的错误信息会被显示在标准的错误输出上(如果 stderr 没有打开,会被记录在 syslog 中): *** glibc detected *** double free or corruption: 0x0转载 2014-08-10 10:10:20 · 642 阅读 · 0 评论