clang

基础服务系列-Mac 安装Python3

一笑奈何 提交于 2020-04-29 17:03:14
前言 本例采用brew安装。未安装brew,参考 Mac 安装Brew 。 安装步骤 search brew search python3 ==> Formulae boost-python3 python3 ✔ python@3 ✔ python@3.8 If you meant "python3" specifically: It was migrated from homebrew/cask to homebrew/core. Install brew install python3 bash_profile vi ~/.bash_profile alias python="/usr/local/bin/python3" source ~/.bash_profile 查看版本 python Python 3.7.6 (default, Apr 2 2020, 12:41:48) [Clang 11.0.0 (clang-1100.0.33.17)] on darwin Type "help", "copyright", "credits" or "license" for more information. 来源: oschina 链接: https://my.oschina.net/wuxinshui/blog/4258492

【转】Python3中遇到UnicodeEncodeError: 'ascii' codec can't encode characters in ordinal not...

帅比萌擦擦* 提交于 2020-04-29 02:41:39
【转】Python3中遇到UnicodeEncodeError: 'ascii' codec can't encode characters in ordinal not in range(128) 现象 打印任何一种包含有中文的对象,字典、列表、DataFrame、或字符串。比如: print ( ' 中文 ' ) 控制台报错: Traceback (most recent call last): File "printcn.py", line 1, in <module> print('\u4e2d\u6587') UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) 换另外一台机器可以正常显示 中文 。或者在PyCharm里执行也可以正常显示。只有在命令行控制台会报错。 我的环境是MacOS 10.13.3 中文,Anaconda3 5.0.1 Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 6 2017, 12:04:38) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin

Python3中遇到UnicodeEncodeError: 'ascii' codec can't encode characters in ordinal not in...

笑着哭i 提交于 2020-04-29 02:40:30
Python3中遇到UnicodeEncodeError: 'ascii' codec can't encode characters in ordinal not in range(128) 现象 打印任何一种包含有中文的对象,字典、列表、DataFrame、或字符串。比如: print('中文') 控制台报错: Traceback (most recent call last): File "printcn.py", line 1, in <module> print('\u4e2d\u6587') UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) 换另外一台机器可以正常显示 中文 。或者在PyCharm里执行也可以正常显示。只有在命令行控制台会报错。 我的环境是MacOS 10.13.3 中文,Anaconda3 5.0.1 Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 6 2017, 12:04:38) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin Type "help"

高德APP启动耗时剖析与优化实践(iOS篇)

China☆狼群 提交于 2020-04-21 03:22:12
前言 最近高德地图APP完成了一次启动优化专项,超预期将双端启动的耗时都降低了65%以上,iOS在iPhone7上速度达到了400毫秒以内。就像产品们用后说的,快到不习惯。算一下每天为用户省下的时间,还是蛮有成就感的,本文做个小结。 (文中配图均为多才多艺的技术哥哥手绘) 启动阶段性能多维度分析 要优化,首先要做到的是对启动阶段的各个性能纬度做分析,包括主线程耗时、CPU、内存、I/O、网络。这样才能更加全面的掌握启动阶段的开销,找出不合理的方法调用。 启动越快,更多的方法调用就应该做成按需执行,将启动压力分摊,只留下那些启动后方法都会依赖的方法和库的初始化,比如网络库、Crash库等。而剩下那些需要预加载的功能可以放到启动阶段后再执行。 启动有哪几种类型,有哪些阶段呢? 启动类型分为: Cold:APP重启后启动,不在内存里也没有进程存在。 Warm:APP最近结束后再启动,有部分在内存但没有进程存在。 Resume:APP没结束,只是暂停,全在内存中,进程也存在。 分析阶段一般都是针对Cold类型进行分析,目的就是要让测试环境稳定。为了稳定测试环境,有时还需要找些稳定的机型,对于iOS来说iPhone7性能中等,稳定性也不错就很适合,Android的Vivo系列也相对稳定,华为和小米系列数据波动就比较大。 除了机型外,控制测试机温度也很重要,一旦温度过高系统还会降频执行

How should the heap-buffer-overflow error message be read?

不想你离开。 提交于 2020-04-18 05:38:26
问题 I wanted to know how the following error message should be read. In particular: (1) what do things such as fa (heap left redzone) and fd (freed heap region) mean? (2) What is the significance of the 00s and 05s. (3) What is the significance of the memory block being pointed to (0x0c067fff8010)? (4) What is a wild pointer? (5) Why is the fa on the line with the memory block that has an arrow to it in square brackets ([fa])? Compilation Command clang++ test.cpp -fsanitize=address -D_LIBCPP

程序编译流程与 GCC 编译器

故事扮演 提交于 2020-04-16 15:38:18
【推荐阅读】微服务还能火多久?>>> 在上世纪 7-80 年代,应用最为广泛的 UNIX 操作系统通常是一个闭源的商业软件。1983 年,麻省理工学院的程序员理查德·斯托曼提出了 GNU 计划,希望发展出一套完整的、开发源代码的操作系统以取代 UNIX,志在创建一个完全兼容 UNIX 的自由软件生态环境。 我们知道,一个完整的操作系统是需要包含许多软件的,除了最重要的操作系统内核之外,还需要有编辑器,编译器,Shell、视窗系统等等一系列软件作为支撑。直到 1989 年,GNU 计划中的其他部份都已经完成了,独缺一个操作系统内核。 1990 年,自由软件基金会开始将 Hurd 内核加入 GUN 计划。第二年,Linux 诞生,由于 Linux 诞生即开源,其良好的开放性使得几乎所有 GNU 计划中的、运行于用户空间的软件都可以在 Linux 上使用。于是许多开发者开始转向于 Linux,参与了 Linux 的开发与修改,Linux 也逐步成为了最受欢迎的 GNU 软件开发及运行平台。相反的,Hurd 内核直到 2013 年为止都还没能发布稳定的版本。 1992 年,Linux 与 GNU 计划结合,一个完全自由的操作系统正式诞生了。当时,理查德·斯托曼主张,因为 Linux 使用了许多的 GNU 软件,所以应该正名为 GNU/Linux,但这一提议并没有得到 Linux

What is the correct way of providing header-filter for clang-tidy in Cmake?

纵然是瞬间 提交于 2020-04-16 05:48:11
问题 I have projects that sets Clang-tidy configuration as following set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=google-*,cppcoreguidelines-*;") However, I have noticed that it was checking all the files that are not even in the current repo like /opt/ros/melodic/include/ros/console.h and all the .h/.hpp files of submodules... I tried to add a regex to filter the target .h files but couldn't get it working... I have given absolute path for a single .hpp file but it was still evaluating /opt/ros

Clang 10 fails to link C++ application with CMake on macOS 10.12

戏子无情 提交于 2020-04-15 10:51:27
问题 I have a Jenkins build server running macOS 10.12. I am compiling a C++ application using the latest Clang 10 (not AppleClang) with CMake 3.17. The error I get is: The C++ compiler "/Users/XXX/llvm/bin/clang++" is not able to compile a simple test program. It fails with the following output: ld: unknown option: -platform_version clang-10: error: linker failed with exit code 1 This works fine with Clang 9 on the same server and Clang 10 works fine on macOS 10.15 with all other build tools and

LLVM / Clang 8 Compilation of OpenMP Code in Windows

淺唱寂寞╮ 提交于 2020-04-15 02:57:48
问题 I'm using the Windows version of Clang (LLVM) 8 under Windows. I'm compiling a code which uses OpenMP. Under the lib folder of Clang there are 2 files which are OpenMP related: libomp.lib . libiomp5md.dll . My questions are: When I compile the code I use the flags -Xclang -fopenmp for the compiler. In in GCC and ICC using the flags tell the compiler to link the OpenMP library automatically. What about Clang? Does it do it automatically or must I link with libomp.lib manually? Is there a way

LLVM / Clang 8 Compilation of OpenMP Code in Windows

戏子无情 提交于 2020-04-15 02:57:37
问题 I'm using the Windows version of Clang (LLVM) 8 under Windows. I'm compiling a code which uses OpenMP. Under the lib folder of Clang there are 2 files which are OpenMP related: libomp.lib . libiomp5md.dll . My questions are: When I compile the code I use the flags -Xclang -fopenmp for the compiler. In in GCC and ICC using the flags tell the compiler to link the OpenMP library automatically. What about Clang? Does it do it automatically or must I link with libomp.lib manually? Is there a way