[SCore-users-jp] SCASH Omni/OpenMP -omniconfig=scash リンク時エラー

池田晃 j7404007 @ ed.noda.tus.ac.jp
2007年 10月 26日 (金) 11:07:43 JST


SCoreメーリングリストの皆様

東京理科大学の池田と申します。いつもお世話になっております。
投稿は今回が初めてになります。よろしくお願いいたします。

既存のプログラムからOpenMPを用いての並列化を試みていますが、
今回、SCore環境上で実行しようと -omniconfig=scash オプションをつけた際に
リンクエラーが生じてしまったので、その件に関して質問をしたいと思います。

問題をより簡単にするため、サンプルプログラムを用いた際のエラーについて示します。
以下に掲載されたOpenMP/C LAPLACE プログラムを一部改変したものです。
http://www.pccluster.org/faq/ja/reference/scash/getting-started_omp.html


!-- プログラム開始 --

double time1,time2;
double second();

/*
 * Laplace equation with explict method
 *	(originally written by Taiskue Boku (taisuke @ is.tsukuba.ac.jp))
 */
#include <stdio.h>
#include "laplace.h"

double u[XSIZE+2][YSIZE+2],uu[XSIZE+2][YSIZE+2];

main()
{
    int x,y;

    fflush(stdout); /* 追加 */
    /* initalize */
    for(x = 1; x <= XSIZE; x++)
      for(y = 1; y <= YSIZE; y++)
	u[x][y] = sin((double)(x-1)/XSIZE*PI) + cos((double)(y-1)/YSIZE*PI);

    for(x = 0; x < (XSIZE+2); x++){
	u[x][0] = 0.0;
	u[x][YSIZE+1] = 0.0;
	uu[x][0] = 0.0;
	uu[x][YSIZE+1] = 0.0;
    }

    for(y = 0; y < (YSIZE+2); y++){
	u[0][y] = 0.0;
	u[XSIZE+1][y] = 0.0;
	uu[0][y] = 0.0;
	uu[XSIZE+1][y] = 0.0;
    }

    time1 = second();
    lap_main();
    time2 = second();

    printf("time=%g\n",time2-time1);
    exit(0);
}

!-- 以下、変更していないため省略 --


オリジナルとの違いは
fflush(stdout);
の一行を挿入しただけです。

そしてコンパイルとリンク時の表示はこちらです。

[root @ server laplace.omp]# pwd
/opt/score/example/scash/laplace.omp
[root @ server laplace.omp]# omcc -omniconfig=scash -c laplace_omp.c
Compiling 'laplace_omp.c'...
[root @ server laplace.omp]# omcc -omniconfig=scash -c second.c
Compiling 'second.c'...
[root @ server laplace.omp]# omcc -omniconfig=scash -o laplace_omp
laplace_omp.o second.o -lm
laplace_omp.o(.text+0xc): In function `_ompc_main':
: undefined reference to `__G_stdout'
collect2: ld returned 1 exit status
Error 1

コンパイルに関しては特にエラーもなく正常終了しています。
しかしリンクする際に stdout に関してエラーが出てしまいます。
これは stdout を用いたプログラミングは不可能ということでしょうか?
もし対処法があるとしたら、どのようにしたらよろしいでしょうか?

動作環境は
SCore 6.0.2.1
CentOS 4.4
です。
http://www.pccluster.org/score/dist/SCore6.html
に掲載されている最新版のisoファイルからインストールしました。

ご教授よろしくお願いいたします。

参考?
http://www.pccluster.org/pipermail/score-users-jp/2004-January/004388.html

------------------------------------------------------------
東京理科大学 理工学部 経営工学科
大和田研究室 4年 池田 晃
E-mail: j7404007 @ ed.noda.tus.ac.jp
------------------------------------------------------------



SCore-users-jp メーリングリストの案内