小编ste*_*ver的帖子

第一次在 Ubuntu 14.04 上运行 C++ 程序

运行以下简单 C++ 程序的命令是什么?

#include <iostream>
using namespace std;

// main () is where program execution begins
int main()
{
  cout << "Hello World";        // prints Hello World

  return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++

8
推荐指数
1
解决办法
7万
查看次数

将 GCC 从 5.2.1 降级到 4.9 Ubuntu 15.10

由于程序兼容性问题,我需要将 GCC 降级到至少 4.9

我该怎么做呢?谢谢。

编辑:该程序是 Blender 并且正在尝试进行 GPU 渲染。控制台踢出的具体错误是

CUDA version 7.5 detected, build may succeed but only CUDA 6.5 is officially supported.
Compiling CUDA kernel ...
"/usr/local/cuda/bin/nvcc" -arch=sm_52 -m64 --cubin "/usr/share/blender/2.76/scripts/addons/cycles/kernel/kernels/cuda/kernel.cu" -o "/home/matthew/.config/blender/2.76/cache/cycles_kernel_sm52_3A157B804910758CA7C526B5EF063D78.cubin" --ptxas-options="-v" --use_fast_math -I"/usr/share/blender/2.76/scripts/addons/cycles/kernel" -DNVCC -D__KERNEL_CUDA_VERSION__=75
In file included from /usr/local/cuda/bin/../targets/x86_64-linux/include/cuda_runtime.h:76:0,
                 from <command-line>:0:
/usr/local/cuda/bin/../targets/x86_64-linux/include/host_config.h:115:2: error: #error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
 #error -- unsupported GNU version! gcc versions later than 4.9 are not supporte
  ^
CUDA kernel compilation failed, …
Run Code Online (Sandbox Code Playgroud)

blender gcc 15.10

8
推荐指数
1
解决办法
5万
查看次数

构建 xar 源错误:没有 libcrypto?

我正在从源代码(https://github.com/mackyle/xar)构建 xar 。它抱怨我没有 OpenSSL,但我有它(我的系统安装了 openssl 包,我的 lib 目录中有 libcrypto.so.1.1.1 文件)。

以下是构建 xar 时来自 ./configure 命令的错误消息:

...
checking for OpenSSL_add_all_ciphers in -lcrypto... no
configure: error: Cannot build without libcrypto (OpenSSL)
...
Run Code Online (Sandbox Code Playgroud)

我的 openssl 库有什么问题?

openssl

8
推荐指数
3
解决办法
3242
查看次数

如何在Ubuntu中打开hdf文件

我在打开 hdf 文件时遇到严重问题,但显示 nc 文件不关联,解决此问题并给出建议。

16.04

8
推荐指数
2
解决办法
2万
查看次数

Project R 安装问题

我不知道将这一行放在文件中的何处。或者是否有可能以某种方式通过外壳实现它?我正在使用 14.04。

安装

要获取最新的 R 包,请添加如下条目

deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu trusty/ 或者

deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu precise/ 或者

deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu lucid/

在您的 /etc/apt/sources.list 文件中,替换 <my.favorite.cran.mirror>为您最喜欢的 CRAN 镜像的实际 URL。有关CRAN 镜像列表,请参阅http://cran.r-project.org/mirrors.html。要安装完整的 R 系统,请使用

sudo apt-get update
sudo apt-get install r-base

我的镜子是: http://stat.ethz.ch/CRAN/

r 14.04

7
推荐指数
1
解决办法
9476
查看次数

ubuntu 16.04 上的 Matlab 问题

我在启动 Matlab 时遇到了问题。我收到以下错误:MATLAB 崩溃文件:/home/user/matlab_crash_dump.4765-1:

------------------------------------------------------------------------
       Segmentation violation detected at Tue Apr 26 20:24:15 2016
------------------------------------------------------------------------

Configuration:
  Crash Decoding      : Disabled
  Crash Mode          : continue (default)
  Current Graphics Driver: Unknown hardware 
  Current Visual      : 0x20 (class 4, depth 24)
  Default Encoding    : UTF-8
  GNU C Library       : 2.23 stable
  Host Name           : chaos
  MATLAB Architecture : glnxa64
  MATLAB Root         : /usr/local/MATLAB/MATLAB_Production_Server/R2015a
  MATLAB Version      : 8.5.0.197613 (R2015a)
  OpenGL              : hardware
  Operating System    : Linux 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC …
Run Code Online (Sandbox Code Playgroud)

matlab

5
推荐指数
1
解决办法
7506
查看次数

如何比较 2 个文件中的数据以识别常见和独特的数据?

如何比较 2 个文件中的数据以识别常见和独特的数据?我不能一行一行地做,因为我有文件 1,其中包含 100 个 id/codes/number-set,我想将文件 2 与文件 1 进行比较。

问题是文件 2 包含文件 1 中的数据子集以及文件 2 独有的数据,例如:

file 1      file 2
1            1
2            a
3            2
4            b
5            3 
6            c
Run Code Online (Sandbox Code Playgroud)

如何比较两个文件以识别每个文件共有和唯一的数据?diff似乎无法完成这项工作。

text command-line files

4
推荐指数
2
解决办法
2万
查看次数

将日期/时间列表从 GMT 转换为 PST

如果我自己运行命令,它似乎工作正常。例如使用:

date --date='TZ="PST" Sun Jan 01 05:00:10 2017'
Run Code Online (Sandbox Code Playgroud)

太平洋标准时间 2016 年 12 月 31 日星期六 21:00:10

但是,我正在尝试使用带有日期/时间列表的输入文件,并且所有引号都有问题,似乎无法使其正常工作。我的输入文件(示例名称dates.input 看起来像:

$ cat dates.input 
Sun Jan 01 06:49:33 2017
Sun Jan 01 05:44:17 2017
Sun Jan 01 05:43:23 2017
Sun Jan 01 05:39:13 2017
Sun Jan 01 05:00:10 2017
Run Code Online (Sandbox Code Playgroud)

我遇到问题的命令是:

while read i; do "date --date='TZ="PST" ${i}'"; done < dates.input
Run Code Online (Sandbox Code Playgroud)

这使

bash: date --date='TZ=PST Sun Jan 01 06:49:33 2017': command not found...
bash: date --date='TZ=PST Sun Jan 01 05:44:17 2017': command not found... …
Run Code Online (Sandbox Code Playgroud)

command-line bash date

4
推荐指数
1
解决办法
2018
查看次数

错误:用户名错误;读取 /etc/crontab 时

我想将文件从服务器复制到已安装在服务器上的 NFS。

为此,我配置了一个 crontab 将这些文件复制到 NFS。通过手动输入命令,文件已成功复制,但通过使用 crontab 自动化主题,它总是告诉我 Error: bad username; while reading /etc/crontab

这是 crontab 配置:

# m h dom mon dow user  command

17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )

52 6    1 * *   root    test …
Run Code Online (Sandbox Code Playgroud)

nfs cron rsync

4
推荐指数
1
解决办法
1万
查看次数

如何解决意外标记“(”附近的语法错误

我有一个带有一行代码的脚本 ab_script.sh

mv !(hd) "/mediafolder/sd/${PWD##*/}"
Run Code Online (Sandbox Code Playgroud)

user@debianpc:/mediafolder/sd/01051 dance$我得到的文件夹中运行脚本时

syntax error near unexpected token `('
Run Code Online (Sandbox Code Playgroud)

如果我在终端中复制这一行并将其作为命令运行,则一切正常。

command-line

3
推荐指数
1
解决办法
6099
查看次数

标签 统计

command-line ×3

14.04 ×1

15.10 ×1

16.04 ×1

bash ×1

blender ×1

c++ ×1

cron ×1

date ×1

files ×1

gcc ×1

matlab ×1

nfs ×1

openssl ×1

r ×1

rsync ×1

text ×1