2011-12-09 3 views
1

Ubuntu를 실행하는 32 비트 컴퓨터 인 집 컴퓨터에 Cilk를 성공적으로 설치했습니다. 필자는 32 비트 버전 대신 64 비트 버전을 다운로드 한 것을 제외하고는 64 비트 우분투 netbook에 대한 지식을 최대한 활용하여 프로세스를 복제했습니다. 아래에 복사 한 매우 간단한 cilkexample.c을 실행하려고 할 때, 그러나, 나는 모두가이 라이브러리 파일에 대한 액세스 권한을 가지고 있지 관련된 것처럼 보이는, 아주 아주 많은 오류를 얻을 :Cilk ++ cilkexample.c = stderr의 200 줄

In file included from /usr/include/stdio.h:28, 
       from cilkexample.c:1: 
/usr/include/features.h:323:26: error: bits/predefs.h: No such file or director\ 
y 
/usr/include/features.h:356:25: error: sys/cdefs.h: No such file or directory 
/usr/include/features.h:388:23: error: gnu/stubs.h: No such file or directory 
In file included from cilkexample.c:1: 
/usr/include/stdio.h:36:25: error: bits/types.h: No such file or directory 
/usr/include/stdio.h:161:28: error: bits/stdio_lim.h: No such file or directory 
/usr/include/stdio.h:846:30: error: bits/sys_errlist.h: No such file or directo\ 
ry 
In file included from /usr/include/stdio.h:34, 
       from cilkexample.c:1: 
/usr/local/cilk/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.4/include/stddef.h:\ 
214: error: expected constructor, destructor, or type conversion before ‘typede\ 
f’ 
In file included from cilkexample.c:1: 
/usr/include/stdio.h:49: error: expected constructor, destructor, or type conve\ 
rsion before ‘typedef’ 

등등, 등등, 등등.

#include <stdio.h> 
#include <cilk.h> 

int foo() { 
    return 100; 
} 

int bar() { 
    return 50; 
} 

int cilk_main(int argc, char **argv) { 
    int x, y; 

    x = cilk_spawn foo(); 
    y = cilk_spawn bar(); 
    cilk_sync; 

    printf("Got %d %d, expecting %d %d\n", x, y, 100, 50); 
    return 0; 
} 

가 다시 말하지만, 나는이 구성 문제가 될 수 있다고 생각 : 여기

내가 명령 cilk++ -o cilkexample cilkexample.c 컴파일을 시도하는 파일입니다. 이 코드는 우리 교수가 배포 한 작업 버전에서 수정되지 않고 별도의 컴퓨터에서 테스트되었습니다.

제가 생각할 수있는 마지막 정보 비트는 PATH입니다.

******@********:~/Path/To/Cilk$ echo $PATH 
/usr/local/cilk/bin/:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games 

도움 주셔서 감사합니다.

+0

stdio.h를 포함하기 때문에 설치 파일이 엉망이되어 많은 헤더 파일이 누락 된 것처럼 보입니다. – jv42

+0

@ jv42, 네가 맞다고 생각하지만, 이것에 대해 어떻게해야할지 모르겠다. :) –

답변

3

일부 헤더가 누락 된 것처럼 보입니다. 당신은 헤더가 xxx-dev 패키지로 배포되는 우분투에 있다고 말합니다.

오류가있는 일부 헤더를 찾아서 bits/types.h이 데비안에서 libc6-dev의 일부인 것을 확인한 후에 적어도 그 패키지를 가지고 있는지 확인해야합니다.

파일이 어떤 패키지에 들어 있는지 배포자에게 확인해야하며 지금 데비안 또는 우분투 컴퓨터를 사용할 수있는 권한이 없습니다.

편집 : 자신이 우분투 상자를 찾았으며 최소한 libc6-dev에 나열된 모든 파일이 포함 된 것 같습니다. dpkg-query -S [file]는 패키지 이름을 제공합니다

+0

답변 해 주셔서 감사합니다! 그러나'dpkg-query -S bits/types.h'는'libc6-dev :/usr/include/x86_64-linux-gnu/bits/types.h'를 반환합니다. 게다가'sudo apt-get install libc6-dev'에 대한 응답은 libc6-dev가 가장 최신 버전이라는 것입니다. 그 가능성을 제거하는 것 같습니까? 나는이 컴퓨터를 보통 C 및 C++ 개발을 위해 몇 달 동안 사용 해왔다. –

+0

그 경우에는 해당 패키지의 강제 설치를 시도합니다. –