由买买提看人间百态

topics

全部话题 - 话题: mpicc
(共0页)
I****y
发帖数: 1498
1
来自主题: Programming版 - 【请教】mpicc 和 mpiCC编译问题
请教各位高手关于在linux下编译并行程序的两个问题,其中涉及到C语言编译器和C++
编译器的区别。
1. 我需要先编译一个lib,叫ParMetis,它是SuperLU_dist(并行SuperLU解线性稀疏方
程组)所需要的。 该库ParMetis需要用支持mpi的编译器编译,默认的mpicc可以编译,
也可以生成*.a的库文件,但有如下warning:
warning #266: function declared implicitly
GKfree(&your_adjncy, &your_adjwgt, &line, LTERM);
由于我的程序中有C++的成份,所以我改用mpiCC (支持mpi的C++编译器)来编译库
ParMetis. 却得到如下错误:
initpart.c(420): error: identifier "__GKfree" is undefined
GKfree(&bestwhere, &perm, LTERM);
我仔细找了一下,在rename.h里有如下语句
#define GKfree __GKfree
b*****e
发帖数: 762
2
来自主题: Linux版 - 设置环境变量求助。
老板给了我一个128核的服务器的supervisor的权限,叫我跑模拟。 但是我不能正确装
软件。老板的账户ssh进去可以正常工
作,他也给了我几个环境变量:
PATH=/usr/local/bin:/usr/lib64/qt-
3.3/bin:/usr/kerberos/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/lib64/openmpi/1.
4-
gcc/bin:/usr/lib64/openmpi/1.4-gcc/lib
LD_LIBRARY_PATH=/usr/lib64/openmpi/1.4-gcc/lib
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
QTLIB=/usr/lib64/qt-3.3/lib
MPICC=/usr/lib64/openmpi/1.4-gcc/bin/mpicc
MPIEXEC=/usr/lib64/openmpi/1.4-gcc/bin/mpiexec
LIBS=/usr/lib64/openmpi/1.4-gcc/lib/libmpi_cx... 阅读全帖
k****5
发帖数: 546
3
来自主题: Linux版 - Fortran complier
大气模型软件需要cluster吧。是cluster,一定会预装pgi,intel.
如果自己编译玩玩:
intel v12 is free for academic.
if use gfortran, understand each options first, then find matching ones in
gfortran. check manpages. 如果linking library 出问题,需要gcc 再编译一下。
大气模型软件一般会用mpi, 用mpicc编译就行了。看看mpicc -compile-info 信息,确
定编译mpi的compiler 是gcc.
t****t
发帖数: 6806
4
来自主题: Programming版 - 【请教】mpicc 和 mpiCC编译问题
it said "__GKfree" is undefined, so the #define was recognized.
search for the declaration of __GKfree. C allows implicit declaration of
function, while C++ does not. if can't find, just declare one yourself.
t****t
发帖数: 6806
5
来自主题: Programming版 - 【请教】mpicc 和 mpiCC编译问题
for 2, you probably need to enclose the declaration of fortran/C functions
by
extern "C" { ... }
you can do this:
#ifdef __cplusplus
extern "C" {
#endif
#include .....
#include ....
#ifdef __cplusplus
}
#endif
I****y
发帖数: 1498
6
来自主题: Programming版 - 【请教】mpicc 和 mpiCC编译问题
太感谢trust的讲解了,
终于明白了原来C++是不支持implicit declearation的,
现在问题是GKfree的函数已经定义了,但为什么它没有被替换成__GKfree呢,define不
就是字符替换吗? 很奇怪为什么C++不能识别。
另外,C++里面有一个好的功能是用域。我有一个库是用C++写的,如果改用C编译器的
话,好像它不能识别域,怎么能让 C也能够识别域呢?
谢谢,鞠躬
p****s
发帖数: 32405
7
来自主题: Programming版 - 【请教】mpicc 和 mpiCC编译问题
你又打错他的名字了,
事实上本版95%的人不能正确拼写他的id, 可见这个名字取得很失败...
记住, thrust一定要H了才能使用!
先H, 再使用
一万遍
P********e
发帖数: 2610
8
来自主题: Programming版 - 【请教】mpicc 和 mpiCC编译问题

当然不是.
test using the #if defined and #ifdef
没办法,用file做域来区别,#include
t****t
发帖数: 6806
9
来自主题: Programming版 - 【请教】mpicc 和 mpiCC编译问题
1. how did you define/declare it?
did you define/declare using "GKfree", but declared BEFORE
#define GKfree __GKfree
?
2. Of course you can't use namespace (I assume you meant namespace) in C. If
you must, declare wrapper function in C++.
v***n
发帖数: 5085
10
mpiCC?
呵呵 我都是malloc的

b******h
发帖数: 2732
11
来自主题: Linux版 - 请教一个Openmpi编译的问题
Linux菜鸟,刚开始用linux+openmpi,自己有一个C++的Project,但是改写后用
mpiCC编译的时候总是报错,说是不认得其他include的 source files...不过单独的一
个source file没问题,不知道是不是用MPI的话,所有的code都必须要放在单独一个C
++ source file里呢?
希望高手们能给指点一下,谢谢阿!
c*******h
发帖数: 1096
12
来自主题: Programming版 - 有人发现最近valgrind有问题么?
一个简单的mpi程序
#include
int main(int argc, char *argv[]) {
MPI_Init(&argc, &argv);
MPI_Finalize();
return 0;
}
mpicc编译了之后valgrind一跑就crash
==27777== Memcheck, a memory error detector
==27777== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==27777== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==27777== Command: a.out
==27777==
==27777== Warning: ignored attempt to set SIGRT32 handler in sigaction();
==27777== the SIGRT32 signal is used int... 阅读全帖
(共0页)