AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-4156

cd1's questions

Martin Hope
cd1
Asked: 2009-09-10 06:33:03 +0800 CST

创建用户后创建主目录

  • 85

我创建了一些用户:

$ useradd john

我忘了指定参数-m来创建主目录并将骨架文件复制给每个用户。现在我想这样做,并且我不想重新创建所有用户(必须有更简单的方法)。那么,有没有办法创建用户目录和复制骨架文件呢?

我考虑过创建目录,将它们分配给相应的用户,复制所有骨架文件并将它们分配给相应的用户。但是如果有这样的命令useradd -m不会再次创建用户,而是创建目录,那就更好了。

linux
  • 12 个回答
  • 224888 Views
Martin Hope
cd1
Asked: 2009-08-18 12:19:09 +0800 CST

如何使用多台计算机作为一个集群?

  • 1

我有 7 台计算机运行带有四核处理器的 Gentoo Linux,我希望能够将程序的执行分发到所有这些计算机。我有一些多线程程序,我想使用集群上的所有 28 个可用 CPU,而不是在每个节点上运行 7 个程序副本。

这就像distcc的想法:我有我的 C/C++ 项目,如果我用distcc而不是编译源代码gcc,它会将编译过程分发到多台计算机,即使在 Makefile 中我也不必更改任何内容。

对于集群,如果我不必更改程序源代码中的任何内容会更好(尽管我认为这是不可能的)。但如果需要,我可以更改程序以使用外部 API。

linux cluster
  • 4 个回答
  • 447 Views
Martin Hope
cd1
Asked: 2009-07-04 09:58:50 +0800 CST

无法通过网络使 distcc 工作

  • 1

我正在尝试使用distcc通过网络使用多台计算机编译 C/C++ 程序。我现在只使用两台计算机,但我打算在与这两台计算机一起使用时使用更多。

我正在使用 Gentoo,我distcc在两台机器上都安装了以下命令:

[user@pc ~]$ 出现 distcc

我正在使用的机器的 IP/名称是:10.0.0.47 (qc7) 和 10.0.0.46 (qc6)。这些计算机是相同的,我在它们上都安装了完全相同的软件包,并且我distcc以相同的方式进行了配置。

我将机器名称设置为distcc-config:

[user@pc ~]$ distcc-config --set-hosts "qc6 qc7"

我更改了文件/etc/conf.d/distcc以允许两台机器:

...
DISTCCD_OPTS="${DISTCCD_OPTS} --allow 10.0.0.46 --allow 10.0.0.47"
...

之后,我刚刚启动了服务:

[user@pc ~]$ /etc/init.d/distccd 启动

我尝试编译一个简单的 C++ 程序,其中包含一个类 ( .hand .cc) 和一个包含该main函数的文件。代码如下:

人.h

#include <string>

using namespace std;

class Person {
  private:
    string name_;
    int age_;

  public:
    Person(string, int);

    string name() const { return name_; }
    int age() const { return age_; }

    void set_name(string name) { name_ = name; }
    void set_age(int age) { age_ = age; }
};

个人.cc

#include "person.h"

Person::Person(string name, int age)
    : name_(name), age_(age) {}

主文件

#include <iostream>
#include "person.h"

using namespace std;

int main() {
    Person cd1("Cristian",22);
    cout << "hi, my name is " << cd1.name() << " and I'm " << cd1.age() << " years old." << endl;
    return 0;
}

生成文件

CC=g++
CFLAGS=-墙

人:main.o person.o
$(CC) $(CFLAGS) -o person main.o person.o

person.o: person.cc person.h
$(CC) $(CFLAGS) -c person.cc

main.o: main.cc person.h
$(CC) $(CFLAGS) -c main.cc

如果我只运行:

[user@pc ~]$ 制作

不使用distcc,代码编译得很好。但如果我运行:

[user@pc ~]$ make CC=distcc

链接阶段给了我一个错误。这是输出:

distcc -Wall -c main.cc
distcc -Wall -c person.cc
distcc -Wall -o person main.o person.o
main.o:在函数“全局构造函数键控到 main”:
main.cc :(.text+ 0xa): 未定义引用`std::ios_base::Init::Init()'
main.cc:(.text+0x19): 未定义引用`std::ios_base::Init::~Init()'
main .o:在函数'main'中: main.cc:(.
text+0x5a):未定义引用'std::basic_string, std::allocator >::basic_string(char const*, std::allocator const&)'
main .cc:(.text+0x80): 未定义引用`std::basic_string, std::allocator >::_Rep::_S_empty_rep_storage'
main.cc:(.text+0xa4): 未定义引用`std::basic_string , std::allocator >::basic_string(std::basic_string, std::分配器 > const&)'
main.cc:(.text+0xb3): undefined reference to `std::cout'
main.cc:(.text+0xb8): undefined reference to `std::basic_ostream >& std::__ostream_insert >(std:: basic_ostream >&, char const*, long)'
main.cc:(.text+0xc5): undefined reference to `std::cout'
main.cc:(.text+0xce): undefined reference to `std::basic_ostream >& std::__ostream_insert >(std::basic_ostream >&, char const*, long)'
main.cc:(.text+0xe3): 未定义对`std::basic_ostream >& std::__ostream_insert >(std ::basic_ostream >&, char const*, long)'
main.cc:(.text+0xed): undefined reference to `std::basic_ostream >::operator<<(int)'
main.cc:(.text+ 0x102): 对`std::basic_ostream >& std:: 的未定义引用__ostream_insert >(std::basic_ostream >&, char const*, long)'
main.cc:(.text+0x182): 未定义引用 `std::basic_ostream >::put(char)'
main.cc:(.text+0x18a): 未定义引用`std::basic_ostream >::flush ()'
main.cc:(.text+0x1d9): undefined reference to `std::__throw_bad_cast()'
main.cc:(.text+0x208): undefined reference to `std::basic_string, std::allocator > ::_Rep::_M_destroy(std::allocator const&)'
main.cc:(.text+0x243): 未定义引用`std::basic_string, std::allocator >::_Rep::_M_destroy(std::allocator const&)'
main.cc:(.text+0x277): undefined reference to `std::basic_string, std::allocator >::_Rep::_M_destroy(std::allocator const&)'
main.cc:(.text+ 0x292): 未定义引用`std::basic_string, std::allocator >::~basic_string()'
main.cc:(.text+0x2af): 未定义引用 `std::basic_string, std::allocator >::~basic_string()'
main.cc:(.text+0x2bc): 未定义引用`std:: basic_string, std::allocator >::~basic_string()'
main.o:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
person.o: In function `Person::Person(std::basic_string, std: :allocator >, int)':
person.cc:(.text+0x15): undefined reference to `std::basic_string, std::allocator >::basic_string(std::basic_string, std::allocator > const&)'
person.o:在函数‘Person::Person(std::basic_string, std::allocator >, int)’中:
person.cc:(.text+0x45): 未定义引用‘std::basic_string, std::分配器 >::basic_string(std::basic_string, std::allocator >常量&)'
person.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
distcc[26001] ERROR: compile (null) on localhost failed
make: *** [person] Error 1

[粗体线是唯一与 相关的distcc,其他都是编译器输出。]

好像distcc找不到基本库。我应该怎么做才能distcc使用网络上的多台计算机编译这个程序?是我错过了一些配置吗?

networking gentoo
  • 2 个回答
  • 736 Views
Martin Hope
cd1
Asked: 2009-05-29 11:38:07 +0800 CST

如果同一个用户,在同一个域上禁用 SSH 身份验证

  • 3

我想在同一域上的两台计算机之间使用同一用户使用 SSH,但我不想输入密码。这是一个例子:

[user@pc1 ~]$ ssh pc2

如果pc1和pc2在同一个域中,使用 NIS 身份验证,并且我使用同一个用户(因为我没有指定一个)通过 SSH 登录,我希望我不必再次输入密码,因为我在pc1登录时已经这样做了。

linux authentication password ssh
  • 5 个回答
  • 1812 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve