背景:學校超算計算機的perl版本太低無法支持我需要運行的軟體,因此安裝高版本的perl5.32.0或perl5.28.4。由于沒有辦法連接互聯網,所以通過下載perl壓縮包進行手動安裝。
操作:解壓后進入檔案夾,并進行configure,運行代碼為
./Configure -des -Dprefix=~/opt/sysoft/perl-5.32.0/
configure程序中沒有進行報錯,只是在結束是提醒
make: warning: Clock skew detected. Your build may be incomplete.
然后直接在檔案夾下進行make,就會出現各種以.c檔案結尾的錯誤,我不清楚是什么原因,百度搜索了發現有可能是頭檔案混亂造成的,還有可能是語法問題,反正我對C語言也不懂,所以根本就不知道怎么辦?我還考慮是不是不應該用gcc而應該用g++編程就好了呢?求大神幫忙看看到底是什么原因怎么debug呢?5.32.0版本錯誤語法如下:
sv.c: In function ‘Perl_sv_upgrade’:
sv.c:1304: warning: implicit declaration of function ‘_Static_assert’
pp.c: In function ‘Perl_pp_length’:
pp.c:3100: warning: implicit declaration of function ‘_Static_assert’
sv.c: In function ‘Perl_sv_setpviv_mg’:
sv.c:10768: warning: ‘Perl_sv_setpviv’ is deprecated (declared at sv.c:10737)
pp.c: In function ‘Perl_pp_argelem’:
pp.c:7031: warning: value computed is not used
pp_hot.c: In function ‘Perl_pp_padrange’:
pp_hot.c:1189: warning: implicit declaration of function ‘_Static_assert’
pp_sys.c: In function ‘Perl_tied_method’:
pp_sys.c:527: warning: implicit declaration of function ‘_Static_assert’
pp_sys.c: In function ‘Perl_pp_stat’:
pp_sys.c:2949: warning: comparison of unsigned expression < 0 is always false
在我安裝5.28.4版本的時候報錯資訊如下:
locale.c:109: error: expected declaration specifiers or ‘...’ before ‘(’ token
locale.c:109: error: expected declaration specifiers or ‘...’ before string constant
locale.c:109: warning: data definition has no type or storage class
locale.c:109: warning: type defaults to ‘int’ in declaration of ‘_Static_assert’
locale.c:110: error: expected declaration specifiers or ‘...’ before ‘(’ token
locale.c:110: error: expected declaration specifiers or ‘...’ before string constant
locale.c:110: warning: data definition has no type or storage class
locale.c:110: warning: type defaults to ‘int’ in declaration of ‘_Static_assert’
rm -f pod/perl5281delta.pod
cc -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -std=c89 -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings miniperlmain.c
make: *** [locale.o] Error 1
make: *** Waiting for unfinished jobs....
/bin/ln -s perldelta.pod pod/perl5281delta.pod
以上全部都是.c檔案的出的問題,進去locale.c檔案查看,發現是
STATIC_ASSERT_DECL(STRLENs(UTF8NESS_SEP) == 1);
STATIC_ASSERT_DECL(STRLENs(UTF8NESS_PREFIX) == 1)
我也不知道是什么原因導致的報錯。
求求各位大神救救孩子吧
uj5u.com熱心網友回復:
用google搜cc DPERL_CORE fwrapv miniperlmain.c
找到一些帖子
Failure to build since 1.1.8 · Issue #64 · arsv/perl-cross
->你試試 你make是否加了 -jN ,如果有,去掉試試
其他帖子
Bisect.pl broken for 3 commits in blead · Issue #16521 · Perl/perl5
undefined reference to `pthread_getspecific' and error during sh Configure trying to compile perl-5.30.1
你自己參考看看。
別人沒你環境,只能靠你自己一點點:
從錯誤現象 ->查看原始碼 ->分析和推測錯誤原因->反向除錯->最終找到原因 并解決
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/245367.html
