$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test更新仓库软件列表
$ sudo apt-get update
删除一个ppa并rollback到稳定版本稍微麻烦一些,需要下一个叫ppa-purge的工具先
$ sudo apt-get install ppa-purge删除刚才添加的ppa
$ sudo ppa-purge ppa:ubuntu-toolchain-r/test然后会自动帮你downgrade或者remove软件.
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test更新仓库软件列表
$ sudo apt-get update
$ sudo apt-get install ppa-purge删除刚才添加的ppa
$ sudo ppa-purge ppa:ubuntu-toolchain-r/test然后会自动帮你downgrade或者remove软件.
#include <inttypes.h> #include <stdio.h> int main() { uint64_t a = 90; printf("test uint64_t : %" PRIu64 "\n", a); return 0; }如果是使用C++编译器编译上述代码,有时候会报如下错误
main.cpp: In function ‘int main()’: main.cpp:9:30: error: expected ‘)’ before ‘PRIu64’ main.cpp:9:47: warning: spurious trailing ‘%’ in format [-Wformat]解决方法是在inttypes.h这个头文件前加上一个__STDC_FORMAT_MACROS宏定义
#define __STDC_FORMAT_MACROS #include <inttypes.h>
1≤≤x
unsigned long long
或者uint64_t
, 1≤≤32
却是0. 如果需要2^32或者更大的数, 需要用1ULL≤≤32
#include <stdio.h> #include <stdint.h> #include <inttypes.h> int main( void ) { uint64_t a = 1ULL << 32; uint64_t b = 1 << 32; printf( "a = %016"PRIx64", b = %016"PRIx64"\n", a, b); return 0; }
a = 0000000100000000, b = 0000000000000000
$ autoconf configure.ac > configure $ chmod +x configure $ ./configure参见A brief introduction to autoreconf
$ autoreconf -is $ ./configure $ make参见Using autoreconf to Update configure Scripts
$ LDFLAGS="-L/opt/local/lib" CXXFLAGS="-I/opt/local/include"\ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" ./configure或者csh底下
$ env LDFLAGS="-L/opt/local/lib" CXXFLAGS="-I/opt/local/include"\ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" ./configureconfigure的常用参数包括
$ ldd a.out linux-vdso.so.1 => (0x00007fff4c5ff000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f55df989000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f55df5ea000) /lib64/ld-linux-x86-64.so.2 (0x00007f55dfc3b000)
$ nm mypair.o 000001c4 s EH_frame1 000001a5 s __GLOBAL__I_mypair.cc 00000254 s __GLOBAL__I_mypair.cc.eh 00000153 s __Z41__static_initialization_and_destruction_0ii 0000022c s __Z41__static_initialization_and_destruction_0ii.eh U __ZNKSs4sizeEv U __ZNKSsixEm U __ZNSt8ios_base4InitC1Ev U __ZNSt8ios_base4InitD1Ev 0000012c S __ZSt3minImERKT_S2_S2_ 000001e0 S __ZSt3minImERKT_S2_S2_.eh 00000000 t __ZStL17__verify_groupingPKcmRKSs 00000204 s __ZStL17__verify_groupingPKcmRKSs.eh 000002a8 b __ZStL8__ioinit U ___cxa_atexit U ___dso_handle U ___gxx_personality_v0 00000104 t ___tcf_0 00000278 s ___tcf_0.eh
$ strip a.out
$ pkg-config --modversion openssl 0.9.8j也可以用--cflags以及--libs查询在Makefile里使用一个library所需要使用的include的路径和其他选项。比如:
$ pkg-config --cflags thrift -I/usr/local/include/thrift $ pkg-config --libs thrift -L/usr/local/lib -lthriftpkg-config中的library数据库是通过搜索特定路径下的一系列xxx.pc文件来建立的。每个.pc文件对应一个library,包括了这个library的一些metadata。可以通过如下命令来查看当前数据库中包含了哪些library了。
$ pkg-config --list-all
Cloning into hashfilter... fatal: '/var/local/indefero/git/repositories/myproj.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly折腾了很久, 后来发现原来Indefero上新建的project是没有repo的. 第一次使用的时候需要自己import.所以要在自己的目录里
git init git add . git commit -m "initial import" git remote add origin git@a.b.c.d:yourproj.git git push origin master然后就可以在Indefero上看见自己的source tree了
sudo adduser foo
sudo adduser foo admin
sudo addgroup bar
groups foo
/proc/interrupts
中记录了当前各种IRQ的number和它们的来源:$cat /proc/interrupts CPU0 CPU1 0: 570 0 IO-APIC-edge timer 1: 2 0 IO-APIC-edge i8042 7: 0 0 IO-APIC-edge parport0 8: 1 0 IO-APIC-edge rtc0 9: 0 0 IO-APIC-fasteoi acpi 12: 4 0 IO-APIC-edge i8042 16: 0 0 IO-APIC-fasteoi uhci_hcd:usb3 17: 0 0 IO-APIC-fasteoi uhci_hcd:usb4, uhci_hcd:usb6 18: 0 0 IO-APIC-fasteoi uhci_hcd:usb7 20: 1104815 0 IO-APIC-fasteoi ata_piix, ata_piix 22: 187848 0 IO-APIC-fasteoi ehci_hcd:usb1 23: 1110 0 IO-APIC-fasteoi ehci_hcd:usb2, uhci_hcd:usb5 43: 4747272 0 PCI-MSI-edge radeon 44: 97360 0 PCI-MSI-edge hda_intel 45: 4284421 0 PCI-MSI-edge eth0 NMI: 0 0 Non-maskable interrupts LOC: 36071250 31250448 Local timer interrupts SPU: 0 0 Spurious interrupts PMI: 0 0 Performance monitoring interrupts IWI: 0 0 IRQ work interrupts RES: 1218335 677796 Rescheduling interrupts CAL: 3889 6659 Function call interrupts TLB: 137697 175959 TLB shootdowns TRM: 0 0 Thermal event interrupts THR: 0 0 Threshold APIC interrupts MCE: 0 0 Machine check exceptions MCP: 533 533 Machine check polls ERR: 1 MIS: 0比如这里可以看出,我的机器有两个CPU(其实是dual core)
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <match target="pattern"> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Times New Roman</string> <string>Times</string> <string>Georgia</string> <string>Bitstream Vera Serif</string> <string>DejaVu Serif</string> <string>SimSun</string> <string>NSimSun</string> <string>Microsoft YaHei</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>DejaVu Sans</string> <string>Ubuntu</string> <string>Arial</string> <string>Helvetica</string> <string>Microsoft YaHei</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>DejaVu Sans Mono</string> <string>Courier</string> <string>Courier New</string> <string>Microsoft YaHei</string> </edit> </match> </fontconfig>有几点说明:
minicom重启board, minicom的屏幕上会出现菜单
1......Program Flash via XModem Download 2......Version 3......Boot System选择1 ,然后确认. 这时候出现
Erasing blocks ............ Start XModem dowmload...这个时候先按几下回车,再接着按Ctrl-a s表示send文件, 然后出现如下的菜单来选择不同的protocol
+-[Upload]--+ | zmodem | | ymodem | | xmodem | | kermit | | ascii | +-----------+选择xmodem,这时候会出现文件对话框,让你选择哪一个bin文件来升级BIOS. 选择之后, 我发现总是出现incomplete 或者根本就没有progress. 需要多send几次. 就可以了