无法在 CentOS 6 上编译 Crypt::Sodium
Unable to compile Crypt::Sodium on CentOS 6
系统安装的Perl是5.10.1版本,我知道是旧的;这些是基于 RHEL 的发行版的乐趣!无论我使用 cpan
,还是下载模块和 make
,我都会得到相同的结果:
/usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -typemap /usr/share/perl5/ExtUtils/typemap Sodium.xs > Sodium.xsc && mv Sodium.xsc Sodium.c
Error: Cannot parse function definition from 'crypto_generichash_state * T_PTRREF' in Sodium.xs, line 715
Error: 'crypto_generichash_state *' not in typemap in Sodium.xs, line 735
Error: 'crypto_generichash_state *' not in typemap in Sodium.xs, line 739
Error: 'crypto_generichash_state *' not in typemap in Sodium.xs, line 748
make: *** [Sodium.c] Error 1
line 715 周围的部分如下所示:
TYPEMAP: <<EOT
crypto_generichash_state * T_PTRREF
EOT
我假设 "not in typemap" 错误是第一个错误的结果,但我对 Perl 模块的构建方式完全没有经验;我什至不确定这个 XS 是什么东西。关于如何继续的任何建议?
Centos 6 自带的ExtUtils::ParseXS
版本不支持内嵌typemap
。安装最新的 ExtUtils::ParseXS
和 libsodium
应该可以解决这个问题。
来自 https://perldoc.perl.org/perlxstypemap.html#Anatomy-of-a-typemap:
Traditionally, typemaps needed to be written to a separate file, conventionally called typemap
in a CPAN distribution. With ExtUtils::ParseXS (the XS compiler) version 3.12 or better which comes with perl 5.16, typemaps can also be embedded directly into XS code using a HERE-doc like syntax:
TYPEMAP: <<HERE
...
HERE
where HERE
can be replaced by other identifiers like with normal Perl HERE-docs. All details below about the typemap textual format remain valid.
系统安装的Perl是5.10.1版本,我知道是旧的;这些是基于 RHEL 的发行版的乐趣!无论我使用 cpan
,还是下载模块和 make
,我都会得到相同的结果:
/usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -typemap /usr/share/perl5/ExtUtils/typemap Sodium.xs > Sodium.xsc && mv Sodium.xsc Sodium.c
Error: Cannot parse function definition from 'crypto_generichash_state * T_PTRREF' in Sodium.xs, line 715
Error: 'crypto_generichash_state *' not in typemap in Sodium.xs, line 735
Error: 'crypto_generichash_state *' not in typemap in Sodium.xs, line 739
Error: 'crypto_generichash_state *' not in typemap in Sodium.xs, line 748
make: *** [Sodium.c] Error 1
line 715 周围的部分如下所示:
TYPEMAP: <<EOT
crypto_generichash_state * T_PTRREF
EOT
我假设 "not in typemap" 错误是第一个错误的结果,但我对 Perl 模块的构建方式完全没有经验;我什至不确定这个 XS 是什么东西。关于如何继续的任何建议?
Centos 6 自带的ExtUtils::ParseXS
版本不支持内嵌typemap
。安装最新的 ExtUtils::ParseXS
和 libsodium
应该可以解决这个问题。
来自 https://perldoc.perl.org/perlxstypemap.html#Anatomy-of-a-typemap:
Traditionally, typemaps needed to be written to a separate file, conventionally called
typemap
in a CPAN distribution. With ExtUtils::ParseXS (the XS compiler) version 3.12 or better which comes with perl 5.16, typemaps can also be embedded directly into XS code using a HERE-doc like syntax:TYPEMAP: <<HERE ... HERE
where
HERE
can be replaced by other identifiers like with normal Perl HERE-docs. All details below about the typemap textual format remain valid.