如何解决使用make时的PVM库并行虚拟机安装问题
我正在尝试安装PVM库(https://netlib.org/pvm3/pvm3.4.6.tgz)
我已成功将包提取到$ HOME
中
按照自述文件的说明,我在$ HOME / .bashrc文件的末尾设置了环境变量PVM_ROOT = $ HOME / pvm3,并将文件$ HOME / pvm / lib / bashrc.stub的内容附加到.bashrc中。并取消注释行'export PATH = $ PATH:$ PVM_ROOT / lib / PVM_ARCH'和'export PATH = $ PATH:$ PVM_ROOT / bin / PVM_ARCH'
重新打开bash之后,我所有的env变量都在那里,所以我猜直到那里都很好。
但是然后我进入〜/ pvm3,当我输入'make'时,我第一次收到警告列表:
这是我第一次运行时收到的警告示例
cc -DIMA_LINUX -I../../include -I../../tracer -I../../src -DSYSVSIGNAL -DNOWAIT3 -DRSHCOMMAND=\"/usr/bin/rsh\" -DNEEDENDIAN -DFDSETNOTSTRUCT -DHASERRORVARS -DCTIMEISTIMET -DSYSERRISCONST -DNOTMPNAM -DUSESTRERROR -DSYSVSTR -DHASSTDLIB -DSYSVBFUNC -c ../../console/job.c
../../console/job.c:150:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
150 | job_init()
| ^~~~~~~~
../../console/job.c:175:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
175 | job_free(jp)
| ^~~~~~~~
../../console/job.c:224:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
224 | obuf_free(jp,op)
| ^~~~~~~~~
../../console/job.c:240:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
240 | obuf_dump(jp)
| ^~~~~~~~~
../../console/job.c:252:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
252 | checkoutput(jp,cc,len,cod,src)
| ^~~~~~~~~~~
其结尾为:
cc -I../../include -I../../src -DIMA_LINUX -DSYSVSIGNAL -DNOWAIT3 -DRSHCOMMAND=\"/usr/bin/rsh\" -DNEEDENDIAN -DFDSETNOTSTRUCT -DHASERRORVARS -DCTIMEISTIMET -DSYSERRISCONST -DNOTMPNAM -DUSESTRERROR -DSYSVSTR -DHASSTDLIB -DSYSVBFUNC -c ../../pvmgs/pvmgroups.c
../../pvmgs/pvmgroups.c:37:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
37 | main()
| ^~~~
../../pvmgs/pvmgroups.c: In function ‘main’:
../../pvmgs/pvmgroups.c:41:10: warning: implicit declaration of function ‘gs_getgstid’; did you mean ‘gs_gettid’? [-Wimplicit-function-declaration]
41 | gstid = gs_getgstid();
| ^~~~~~~~~~~
| gs_gettid
cc -I../../include -I../../src -DIMA_LINUX -DSYSVSIGNAL -DNOWAIT3 -DRSHCOMMAND=\"/usr/bin/rsh\" -DNEEDENDIAN -DFDSETNOTSTRUCT -DHASERRORVARS -DCTIMEISTIMET -DSYSERRISCONST -DNOTMPNAM -DUSESTRERROR -DSYSVSTR -DHASSTDLIB -DSYSVBFUNC -o pvmgroups pvmgroups.o libgpvm3.a -L../../lib/LINUX -lpvm3
cp pvmgroups ../../bin/LINUX
cp libgpvm3.a ../../lib/LINUX
case xt in xt ) echo ranlib; ranlib ../../lib/LINUX/libgpvm3.a ;; esac
ranlib
cp pvmgs ../../lib/LINUX
make[2] : leaving directory « /home/thesylio/pvm3/pvmgs/LINUX »
done building group server and library
make[1] : leaving directory « /home/thesylio/pvm3 »
如果再试一次,我会收到此消息:
./lib/aimk -here -f ./conf/`./lib/pvmtmparch`.def -f ./Makefile.aimk default
making in . for LINUX
make[1] : entering directory « /home/thesylio/pvm3 »
building in src
cd src; ../lib/aimk CC="cc" F77="f77" install
making in LINUX/ for LINUX
make[2] : entering directory « /home/thesylio/pvm3/src/LINUX »
make[2]: nothing to do for « install ».
make[2] : leaving directory « /home/thesylio/pvm3/src/LINUX »
done building in src
building tracer
cd tracer; ../lib/aimk CC="cc" F77="f77" install
making in LINUX/ for LINUX
make[2] : entering directory « /home/thesylio/pvm3/tracer/LINUX »
ar rcv libpvmtrc.a trcmess.o trcfile.o trccompat.o trccompatglob.o trcutil.o trclib.o
r - trcmess.o
r - trcfile.o
r - trccompat.o
r - trccompatglob.o
r - trcutil.o
r - trclib.o
ranlib libpvmtrc.a
cc -O -DIMA_LINUX -DSYSVSIGNAL -DNOWAIT3 -DRSHCOMMAND=\"/usr/bin/rsh\" -DNEEDENDIAN -DFDSETNOTSTRUCT -DHASERRORVARS -DCTIMEISTIMET -DSYSERRISCONST -DNOTMPNAM -DUSESTRERROR -DSYSVSTR -DHASSTDLIB -DSYSVBFUNC -o tracer tracer.o cmd.o trcglob.o -L../../lib/LINUX -L../../tracer/LINUX -lpvmtrc -lpvm3
cc -O -DIMA_LINUX -DSYSVSIGNAL -DNOWAIT3 -DRSHCOMMAND=\"/usr/bin/rsh\" -DNEEDENDIAN -DFDSETNOTSTRUCT -DHASERRORVARS -DCTIMEISTIMET -DSYSERRISCONST -DNOTMPNAM -DUSESTRERROR -DSYSVSTR -DHASSTDLIB -DSYSVBFUNC -o trcsort trcsort.o -L../../lib/LINUX -L../../tracer/LINUX -lpvmtrc -lpvm3
make[2] : leaving directory « /home/thesylio/pvm3/tracer/LINUX »
done building tracer
building console
cd console; ../lib/aimk CC="cc" F77="f77" install
making in LINUX/ for LINUX
make[2] : entering directory « /home/thesylio/pvm3/console/LINUX »
cc -DIMA_LINUX -I../../include -I../../tracer -I../../src -DSYSVSIGNAL -DNOWAIT3 -DRSHCOMMAND=\"/usr/bin/rsh\" -DNEEDENDIAN -DFDSETNOTSTRUCT -DHASERRORVARS -DCTIMEISTIMET -DSYSERRISCONST -DNOTMPNAM -DUSESTRERROR -DSYSVSTR -DHASSTDLIB -DSYSVBFUNC -o pvm cons.o cmds.o job.o trc.o -L../../tracer/LINUX -L../../lib/LINUX -lpvmtrc -lpvm3
cp pvm ../../lib/LINUX
make[2] : leaving directory « /home/thesylio/pvm3/console/LINUX »
done building console
building libfpvm
cd libfpvm; ../lib/aimk CC="cc" F77="f77" install
making in LINUX/ for LINUX
make[2] : entering directory « /home/thesylio/pvm3/libfpvm/LINUX »
make[2]: nothing to do for « install ».
make[2] : leaving directory « /home/thesylio/pvm3/libfpvm/LINUX »
done building libfpvm
building group server and library
cd pvmgs; ../lib/aimk CC="cc" F77="f77" install
making in LINUX/ for LINUX
make[2] : oentering directory « /home/thesylio/pvm3/pvmgs/LINUX »
make[2]: Nothing to do « install ».
make[2] : leaving directory « /home/thesylio/pvm3/pvmgs/LINUX »
done building group server and library
make[1] : leaving directory « /home/thesylio/pvm3 »
我不知道它是否有效,但是无论如何,我尝试调用pvm并有效:
~/pvm$ pvm
pvm> halt
halt
completed
xpvm命令找不到,并且 我以为没关系,所以尝试了pvm3 / examples
中给出的代码示例之一$ cc -o hello hello.c
hello.c:37:10: fatal error: pvm3.h no such file or directory of this type
37 | #include "pvm3.h"
| ^~~~~~~~
compilation terminated.
好的,http://www.netlib.org/pvm3/faq_html/node62.html上的文档为此类问题提供了答案
$ cc -o hello -I$PVM_ROOT/include hello.c
hello.c:39:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
39 | main()
| ^~~~
/usr/bin/ld : /tmp/ccEvHgbT.o : in function « main » :
hello.c:(.text+0x1e) : undefined reference to « pvm_mytid »
/usr/bin/ld : hello.c:(.text+0x51) : undefined reference to « pvm_spawn »
/usr/bin/ld : hello.c:(.text+0x69) : undefined reference to« pvm_recv »
/usr/bin/ld : hello.c:(.text+0x7f) : undefined reference to « pvm_bufinfo »
/usr/bin/ld : hello.c:(.text+0x8e) : undefined reference to « pvm_upkstr »
/usr/bin/ld : hello.c:(.text+0xc4) : undefined reference to « pvm_exit »
collect2: error: ld returned 1 exit status
然后我关注了该网站http://parallel.vub.ac.be/documentation/pvm/troubleshooting.html#compile2
$ cc -o hello -I$PVM_ROOT/include -L$HOME/pvm3/lib/pvm3 hello.c
hello.c:39:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
39 | main()
| ^~~~
/usr/bin/ld : /tmp/ccmzt4MN.o : in function « main » :
hello.c:(.text+0x1e) : undefined reference to « pvm_mytid »
/usr/bin/ld : hello.c:(.text+0x51) : undefined reference to « pvm_spawn »
/usr/bin/ld : hello.c:(.text+0x69) : undefined reference to« pvm_recv »
/usr/bin/ld : hello.c:(.text+0x7f) : undefined reference to « pvm_bufinfo »
/usr/bin/ld : hello.c:(.text+0x8e) : undefined reference to « pvm_upkstr »
/usr/bin/ld : hello.c:(.text+0xc4) : undefined reference to « pvm_exit »
collect2: error: ld returned 1 exit status
我尝试使用gcc和cc,尝试了不同的发行版:64位计算机上的kali-rolling 2020.3和32和64位计算机上的ubuntu-20.04.1。
我计划尝试使用cshell而不是bash,但我认为是makefile使其变得困难,或者也许我没有很好地指定体系结构。我也不是普通的C程序员,所以我可能犯了一些明显的错误。
我也将其安装在Windows 10上,但不要着急了
谢谢您的时间
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。