我使用的是Mac OS X Sierra,我发现clang(LLVM版本8.1.0(clang-802.0.38))不支持OpenMP:当我运行时clang -fopenmp program_name.c,我收到以下错误:
clang: error: unsupported option '-fopenmp'
似乎clang不支持-fopenmp旗帜.
我在自制软件中找不到任何openmp库.根据LLVM网站,LLVM已经支持OpenMP.但是在编译期间我找不到启用它的方法.
这是否意味着Mac中的默认clang不支持OpenMP?你能提供什么建议吗?
(当我切换到GCC编译相同的程序(使用gcc安装brew install gcc --without-multilib)时,编译成功.)
我正在配置Tomcat以支持HTTP(在端口8080上)和HTTPS(端口8443).在server.xml中,如果我这样配置:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
<Connector port="8443" protocol="HTTP/1.1"
SSLEnabled="true"
scheme="https"
secure="true"
Server=""
keystoreFile="conf/.keystore"
keystorePass="password"
maxThreads="150"
maxSpareThreads="75"
minSpareThreads="25"
clientAuth="false" sslProtocol="TLS"
URIEncoding="UTF-8"
/>
Run Code Online (Sandbox Code Playgroud)
对http:// SERVER_IP:8080的所有访问都将定向到https:// SERVER_IP:8443.如何禁用重定向,并允许http和https访问?
我试图删除redirectPort="8443",但它不起作用.
当我使用awk和grep来解析日志文件时,我有一个问题.日志文件包含一些带有数字的字符串,例如
Amount: 20
Amount: 30.1
Run Code Online (Sandbox Code Playgroud)
我使用grep来解析关键字"Amount"的行,然后使用awk获取金额并做一笔总和:
命令如下:
cat mylog.log | grep Amount | awk -F 'Amount: ' '{sum+=$2}END{print sum}'
这对我来说可以.但是,有时mylog.log文件不包含关键字"Amount".在这种情况下,我想打印0,但上面的awk命令将不打印任何内容.当grep什么都不返回时,如何让awk打印出来呢?