首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装Perl和PDL

安装Perl和PDL
EN

Stack Overflow用户
提问于 2017-04-11 21:09:10
回答 1查看 1K关注 0票数 0

我目前正在尝试安装perl PDL,但没有成功,因为我想自动化一些数据分析和图形生成。

不幸的是,我甚至无法毫无问题地安装必要的模块,更不用说创建一个小脚本来处理我的数据文件了。

我对Perl有一些粗浅的经验,但并不花哨,我使用的是Windows10 x64。

最初,我选择了Astro草莓Perlv5.24安装,然后是x64::FITS::Header、Convert::UU、OpenGL和PDL的ppm安装,如http://pdl.perl.org/?page=install所示。然而,Inline::C的安装出现了问题,在尝试了PDL_Book_Latest http://sourceforge.net/projects/pdl/files/PDL/2.4.10/PDL-Book-20120205.pdf/download第5页上列出的示例后,没有出现任何图像,也没有图像文件出现在我能想到要搜索的任何位置。回到Google,仍然找不到关于这个问题来源的任何信息,所以我决定回到起点,使用一个旧版本,希望它能更好地记录下来。

因此,通过Windows安装程序对话框卸载草莓perl,删除包含" strawberry“的草莓文件夹和注册表项。然后是perl的新安装,带有Padre IDE v5.14 -也许一些调试功能将有助于定位错误。开始安装相同的模块(Astro::FITS::Header,Convert::UU,OpenGL,PGPLOT)。Astro和Convert运行得很好,但OpenGL开始抛出关于ExtUtils::F77的错误,我显然在几个小时的搜索后找不到这些错误。我去安装这个模块,它一直给出'gfortan‘是一个未知命令的错误……据我所知,PDL的想法是为了避免fortran和C,到目前为止,我几乎没有找到关于这个安装问题的信息。

所以我决定尝试另一种方法。我从cpan安装了ppm模块,并通过ppm命令重复了初始安装过程。这一次我得到了:

“在SOFTPKG.中的C:/Dwimperl/perl/site/lib/PPM. at行1462处找到未知元素'PROVIDE‘。”

因此,我的问题如下:

我是否遗漏了安装过程中的一些关键步骤?我的系统是否真的处理得很糟糕,如果是这样的话,是否有任何可能的工作?我尝试了两个不同版本的事实是否容易造成路径问题,这可能是这个问题的根源?

有没有人能提供一种替代方案,最好不要太复杂,以便在Windows10上使用给定的perl安装来安装PDL?

编辑1:

以下是我在尝试安装Inline::C时遇到的错误的代码,这显然是PDL的先决条件

code deleted to make space for updates...

编辑3:

我在路径指定的目录中重新安装了GnuWin32,而不是更改路径,然后再次尝试安装。Inline::C给出了相同的'diff‘和'rm’错误。所以我运行"cpanm --notest 'package'“来安装Inline::C,然后运行PDL,两个都说他们成功了。但是,即使使用'--notest‘cpanm也无法安装OpenGL和PGPLOT。

最终的目标是能够使用PGPLOT中的函数生成图形:例如

代码语言:javascript
复制
# use PDL;
# use PDL::Graphics::PGPLOT;
# imag(sin(rvals(200,200)+1));

当然,如果PGPLOT不能安装,这就不起作用了。

编辑4:

尝试了@Dr.Avalange在sourceforge https://sourceforge.net/p/pogl/bugs/26/找到的修复,注意到我似乎有这个文件的多个副本。

Here

这正常吗?

编辑5:因此我卸载了perl,删除了在%APPDATA%、%USERPROFILE%和C:/DWIM中找到的任何延迟文件,然后运行ccleaner以防遗漏任何东西。

然后,我下载了Strawberry perl 5.24.1 x64 for Windows并安装了它。

在此之后,我按照http://pdl.perl.org/?page=install运行了'cpanm Astro::FITS::Header',cpanm 'Convert-UU‘和'cpanm OpenGL’。这一切都运行得很好。然后我运行了'cpanm PDL‘,它安装了内联、Pegex、Win32::Mutex和Module::Compile依赖项。但是,如果在Inline::C中出现了您之前提到的相同错误。

我之前已经安装了GetGnuWin32,所以我不确定为什么它不能工作。Windows ' PATH‘环境(不是PATH-根据高级系统对话框不存在)被标注为

在这个目录中我有文件夹GetGnuWin32,它应该已经安装了你提供的链接中的所有软件包,除非我错过了一个补充步骤来正确安装它?因此,我重新下载了DiffUtils安装程序并运行它,安装到\programfiles(x86) (默认选项)。然后我重新运行'cpanm PDL‘。

我仍然收到同样的'diff‘错误信息。那么,DiffUtils是不是没有正确安装?(我确实在尝试和安装之后关闭并重新打开了命令行)

编辑6:

因此,在使用--notest安装PDL和PGPLOT之后,我尝试运行以下测试,但失败了。见下文

代码语言:javascript
复制
C:\Windows\system32>perldl
perlDL shell v1.357
 PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
 'COPYING' in the PDL distribution. This is free software and you
 are welcome to redistribute it under certain conditions, see
 the same file for details.
ReadLines, NiceSlice, MultiLines  enabled
Reading PDL/default.pdl...
Found docs database C:/Strawberry/perl/site/lib/PDL/pdldoc.db
Type 'help' for online help
Type 'demo' for online demos
Loaded PDL v2.017 (supports bad values)

Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended)

                                                                                                                        pdl> use PDL::Graphics//PLplot
Unknown regexp modifier "/P" at (eval 62) line 4, at end of line
Unknown regexp modifier "/L" at (eval 62) line 4, at end of line
Unknown regexp modifier "/t" at (eval 62) line 4, at end of line
BEGIN not safe after errors--compilation aborted at (eval 62) line 5, <DATA> line 207.

                                                                                                                        pdl> use PDL::Graphics::PLplot
Can't locate PDL/Graphics/PLplot.pm in @INC (you may need to install the PDL::Graphics::PLplot module) (@INC contains: C:/Strawberry/perl/site/lib/MSWin32-x64-multi-thread C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib .) at (eval 72) line 5.
BEGIN failed--compilation aborted

                                                                                                                        pdl> use PDL

                                                                                                                        pdl> use lib 'C:/Strawberry/perl/site/lib/PDL/Graphics'

                                                                                                                        pdl> use PGPLOT

                                                                                                                        pdl> use PDL::Graphics::PGPLOT

                                                                                                                        pdl> imag(sin(rvals(200,200)+1))
Undefined subroutine &PDL::Graphics::PGPLOT::pgqinf called at C:/Strawberry/perl/site/lib/PDL/Graphics/PGPLOT.pm line 408, <DATA> line 90.

                                                                                                                        pdl> exit

C:\Windows\system32>cpanm PDL::Graphics::PGPLOT::pgqinf
! Finding PDL::Graphics::PGPLOT::pgqinf on cpanmetadb failed.
! Finding PDL::Graphics::PGPLOT::pgqinf () on mirror http://www.cpan.org failed.
! Couldn't find module or a distribution PDL::Graphics::PGPLOT::pgqinf

C:\Windows\system32>cpan PDL::Graphics::PGPLOT::pgqinf
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: CPAN::SQLite loaded ok (v0.211)
Database was generated on Thu, 13 Apr 2017 13:49:14 GMT


C:\Windows\system32>

已经有一个目录问题了,但我设法把它指向了我认为的正确方向。我还尝试安装图形'cpanm‘说安装成功,但是没有.pm文件,只在另一个目录中有一个图形,所以使用PDL::.pd::PLplot失败,因为没有.pm文件可以找到。

编辑:7所以这次重试ppm install http://www.sisyphusion.tk/ppm/PGPLOT.ppd似乎起作用了,因为你提供的解释中的链接不再使用http://www.kalinabears.com.au/w32perl/pgplot-5.2.2-mingw32.tar.bz2 http://jrfonseca.home.dyndns.org/projects/gnu-win32/software/ported/patches/pgplot-5.2.2-mingw32.diff.gz,虽然这似乎起作用了,但没有列出安装所需的文件的痕迹,除非它们只是为了这个特定的方法?

代码语言:javascript
复制
pgplot/bin/cpgplot.dll
pgplot/bin/pgplot.dll
pgplot/bin/grfont.dat
pgplot/include/cpgplot.h
pgplot/lib/cpgplot.a
pgplot/lib/pgplot.a

最后,再次尝试该示例会得到以下结果:没有错误,但也没有图像...

代码语言:javascript
复制
Microsoft Windows [version 10.0.14393]
(c) 2016 Microsoft Corporation. Tous droits réservés.

C:\Windows\system32>perldl
perlDL shell v1.357
 PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
 'COPYING' in the PDL distribution. This is free software and you
 are welcome to redistribute it under certain conditions, see
 the same file for details.
ReadLines, NiceSlice, MultiLines  enabled
Reading PDL/default.pdl...
Found docs database C:/Strawberry/perl/site/lib/PDL/pdldoc.db
Type 'help' for online help
Type 'demo' for online demos
Loaded PDL v2.017 (supports bad values)

Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended)

pdl> use PDL

pdl> use PDL::Graphics::PGPLOT

pdl> imag(rvals(200,200)+1)
 %PGPLOT, Unable to read font file: grfont.dat
 %PGPLOT, Use environment variable PGPLOT_FONT to specify the location of the PGPLOT grfont.dat file.
Displaying 200 x 200 image from 1 to 142.421356201172, using 240 colors (16-255)...

pdl> $ENV{PGPLOT_FONT} = "C:/Strawberry/perl/site/lib/PGPLOT/pgplot_supp"

pdl> imag(rvals(200,200)+1)
Displaying 200 x 200 image from 1 to 142.421356201172, using 240 colors (16-255)...

pdl>
EN

回答 1

Stack Overflow用户

发布于 2017-04-11 23:25:01

在从法语翻译后,我可以看到您的系统中没有diff。要么安装diff ( gnu32:http://gnuwin32.sourceforge.net/的一部分),要么直接跳过测试。另请参阅:

https://github.com/ingydotnet/inline-c-pm/issues/60

对于Strawberry 5.24.1,只需在命令提示符下输入以下命令:

代码语言:javascript
复制
cpanm --notest PDL

或者,如果你想看正在发生的一切:

代码语言:javascript
复制
cpanm -v --notest PDL

这将需要一些时间来运行。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43346886

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档