일부 병렬 연산을 수행하기 위해 내 Linux 컴퓨터 (CentOS 6.4)에 MPICH (ver 3.0.4)를 설치했습니다. 나는이 명령을 내 MPICH 설치를 테스트하기 위해 (예를 들어 MPICH 설치 패키지와 함께 제공) "pmandel.c"를 컴파일하려고 :는 mpicc로 pmandel.c를 컴파일 할 수 없습니다.
mpicc pmandel.c -o pmandel.out
하지만 이러한 오류 반환 :
pmandel.c: In function ‘main’:
pmandel.c:279: warning: passing argument 2 of ‘bind’ from incompatible pointer type
/usr/include/sys/socket.h:115: note: expected ‘const struct sockaddr *’ but argument is of type ‘struct sockaddr_in *’
pmandel.c:282: warning: passing argument 2 of ‘bind’ from incompatible pointer type
/usr/include/sys/socket.h:115: note: expected ‘const struct sockaddr *’ but argument is of type ‘struct sockaddr_in *’
pmandel.c:296: warning: passing argument 2 of ‘getsockname’ from incompatible pointer type
/usr/include/sys/socket.h:119: note: expected ‘struct sockaddr * __restrict__’ but argument is of type ‘struct sockaddr_in *’
/tmp/cclNv8nA.o: In function `exponential_complex':
pmandel.c:(.text+0x2fc2): undefined reference to `exp'
pmandel.c:(.text+0x2fd1): undefined reference to `cos'
pmandel.c:(.text+0x2fe5): undefined reference to `sin'
/tmp/cclNv8nA.o: In function `absolute_complex':
pmandel.c:(.text+0x3330): undefined reference to `sqrt'
collect2: ld returned 1 exit status
과 출력되지 않습니다. 또한 "mpiC++"로 시도, "mpiCC"mpicxx "아무 소용이 ...하지만 모두.
나는
다음은 경고 (오류 제외)이며 소스 코드를 변경할 수 있습니다 전자 코드를 제거하십시오. 'pmandel.out'이 생성되어 실행 가능해야한다고 생각합니다. –
내 게시물에 오류 중 일부가 누락되어 편집했습니다. thanks – gnome
링커에 의해 트리거 된 오류는 라이브러리가 누락되었습니다. 스위치'-lm'을 사용하여 다시 컴파일하십시오. – Spiros