2

I am running Perl 5.16.2 on OSX 10.9.1 and I am having difficulty installing modules from CPAN. I successfully installed

 sudo cpan App::cpanminus

However, when I try something like

 curl -L http://cpanmin.us | perl - --sudo App::cpanminus

I get the error

 Proxy must be specified as absolute URI; ''none'' is not at 
 /loader/0x7fde9483ecd8/App/cpanminus/script.pm line 99.

I've tried resetting the HTTP and FTP proxy variables in the CPAN shell using

 perl -MCPAN -e shell

 cpan[1]>  o conf commit http_proxy=''
 cpan[2]>  o conf commit ftp_proxy='' 

however, the error persists.

Also, when I try to install the following package

 sudo cpanm SGML::Parser::OpenSP

I get the error

 --> Working on SGML::Parser::OpenSP
 Fetching http://www.cpan.org/authors/id/B/BJ/BJOERN/SGML-Parser-OpenSP-0.994.tar.gz ...    OK
 Configuring SGML-Parser-OpenSP-0.994 ... OK
 Building and testing SGML-Parser-OpenSP-0.994 ... FAIL
 ! Installing SGML::Parser::OpenSP failed. 
 See /Users/markclements/.cpanm/work/1392371338.37987/build.log for details. Retry with --force to force install it.

The relevant error is

 OpenSP.xs:26:10: fatal error: 'OpenSP/ParserEventGeneratorKit.h' file not found

UPDATE:

I installed OpenSP using fink and fink installed it in my root directory

 `/sw/include/OpenSP/ParserEventGeneratorKit.h`

The directory sw was created by fink in my root directory. I'm using sudo cpan SGML::Parser::OpenSP but I can't figure out why it can't find this file ParserEventGeneratorKit.h when attempting the build.

Any advice would be greatly appreciated.

Thanks

Mark Clements
  • 465
  • 7
  • 25
  • It should be `Text::CSV`. Case matters. Also, if you installed `App::cpanminus` without `sudo`, would it be in root's path? – TLP Feb 14 '14 at 09:39
  • Hi @TLP, I think I installed it with sudo. How do I check? Sorry, I relatively new to this. – Mark Clements Feb 14 '14 at 09:47
  • You could try `perldoc -l App::cpanminus` to see where it is installed. Why are you not using `cpan` to install `Text::CSV` if that worked for you? – TLP Feb 14 '14 at 09:52
  • @TLP the case sensitivity fixed the `Text::CSV` error. I used `sudo cpanm Text::CSV` but I still have the other issues. I also added a problem I'm having with the `SGML::Parser::OpenSP` module. – Mark Clements Feb 14 '14 at 09:53
  • It failed when building. Are you sure the module is portable to OSX? It may have XS parts which need to be compiled. Did you check the build.log for details like it says? – TLP Feb 14 '14 at 10:01
  • @TLP this seems to be the problem in the build.log file but I have no idea what it means `OpenSP.xs:26:10: fatal error: 'OpenSP/ParserEventGeneratorKit.h' file not found #include ^ 1 error generated.` – Mark Clements Feb 14 '14 at 10:04
  • That means that one of the files in the XS install is missing. Not sure why that would be. – TLP Feb 14 '14 at 10:13
  • @TLP what is XS and can I re-install it? – Mark Clements Feb 14 '14 at 10:14
  • Read http://perldoc.perl.org/perlxs.html for an explanation of XS. This particular file is one that should have been downloaded with your module zipfile. It sounds like a problem with paths. If you try `sudo cpan SGML::Parser::OpenSP` does that work? – TLP Feb 14 '14 at 10:25
  • I tried `sudo cpan SGML::Parser::OpenSP` and I get the same error `OpenSP.xs:26:10: fatal error: 'OpenSP/ParserEventGeneratorKit.h' file not found` – Mark Clements Feb 14 '14 at 10:45
  • http://www.cpan.org/modules/INSTALL.html read the part under the heading `Perl on Mac OSX` – TLP Feb 14 '14 at 10:52
  • @TLP I already installed command line tools. I think the issue is that I need to install OpenSP or OpenJade first, but I'm having difficulty figuring out how because there doesn't seem to be an easy install and I've never installed anything from source code before. – Mark Clements Feb 14 '14 at 10:58
  • I'm no expert in this particular field, but I know that when I used Ubuntu, it was sometimes easier trying to install Perl modules via the package manager, i.e. `sudo apt-get install lib-perl-text-csv` (or whatever it was called). It says that cpanm handles dependencies, though, so it should not be an issue. – TLP Feb 14 '14 at 11:01
  • @TLP Even though when I type `curl -L http://cpanmin.us | perl - --sudo App::cpanminus` I get the error I mentioned, when I type `perldoc -l cpanm` it returns `/usr/bin/cpan` and it appears to be working when I type `sudo cpanm `SGML::Parser::OpenSP` even though the build fails. Do you know why I"m getting this Proxy error along with the same one when I try to `reload index`. – Mark Clements Feb 14 '14 at 11:19
  • I'm going to make a new question on the `SGML::Parser::OpenSP` issue. That way this question is less convoluted. – Mark Clements Feb 14 '14 at 11:19
  • I believe proxy settings are described in the cpan documentation. It looks like somewhere in your settings it says "none" instead of being blank. – TLP Feb 14 '14 at 11:32
  • @TLP yeah I tried the following in the CPAN shell (using `perl -MCPAN -e shell`): `o conf commit http_proxy=''` and `o conf commit ftp_proxy=''` however, the error persists. – Mark Clements Feb 14 '14 at 12:24

1 Answers1

1

Proxy must be specified as absolute URI; ''none'' is not

please check your http_proxy, ftp_proxy etc environment variables. If you don't have a proxy unset them or set them to '' but don't set them to 'none'.

Building and testing SGML-Parser-OpenSP-0.994 ... FAIL

This module needs a C-compiler and the OpenSP libraries (libosp + header files). Unfortunatly this requirement is not checked inside the modules Makefile.PL so it tries to build and the build fails.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172
  • I previously tried the following in the CPAN shell (using `perl -MCPAN -e shell`): `o conf commit http_proxy=''` and `o conf commit ftp_proxy=''` however, the error persists. I have a c compiler installed but I'm not sure what it is I need to do with the OpenSP libraries (libosp and header file). Could you give me more detail and guidance on this? – Mark Clements Feb 14 '14 at 11:54
  • I used fink to install `opensp-bin` and `opensp5-dev`, however, I'm still getting the error `OpenSP.xs:26:10: fatal error: 'OpenSP/ParserEventGeneratorKit.h' file not found`. I can't seem to find anything on how to install OpenSP on OS X. This http://openjade.sourceforge.net/doc/autoconf.htm it's what's recommended for UNIX, but I was hoping fink would take care of it for me. – Mark Clements Feb 14 '14 at 12:20
  • I installed OpenSP using fink and the file `ParserEventGeneratorKit.h` is in the directory `/sw/include/OpenSP/ParserEventGeneratorKit.h`. The directory `sw` was created by fink in my root directory. I'm using `sudo cpan SGML::Parser::OpenSP` but I can't figure out why it can't find this file. – Mark Clements Feb 14 '14 at 16:13
  • /sw/include is probably not in the default search path for for the C compiler. You might try to install the module the verbose way, e.g. download the tar.gz file (http://search.cpan.org/CPAN/authors/id/B/BJ/BJOERN/SGML-Parser-OpenSP-0.994.tar.gz), unpack it, adjust Makefile.PL and then `perl Makefile.PL`, make, make test, make install – Steffen Ullrich Feb 15 '14 at 08:46
  • I used `gcc -x c -v -E /dev/null` to see where my search path for the C compiler is and I get `#include <...> search starts here: /usr/local/include`. The `sw` folder that contains `/sw/include/OpenSP/` is two directory levels above my home directory. Also, I looked into the `Makefile.PL` file, however, I don't see where I would be able to modify anything to address this. Keep in mind, I'm brand new to perl and only have a limited understanding of Linux. Thanks. – Mark Clements Feb 15 '14 at 10:13
  • in Makefile.PL look for INC and set it according to the example in the file. – Steffen Ullrich Feb 15 '14 at 17:49
  • OK, I inserted `-I/sw/include` where it says `INC` and no longer get the error when I type make. However, when I type `make test` it fails and the first thing it reports, along with a lot of other stuff is: – Mark Clements Feb 16 '14 at 03:32
  • `# Failed test 'use SGML::Parser::OpenSP;' # at t/01basic.t line 14. # Tried to use 'SGML::Parser::OpenSP'. # Error: Can't load '/Users/markclements/Downloads/SGML-Parser-OpenSP-0.994/SGML-Parser-OpenSP-0.994/blib/arch/auto/SGML/Parser/OpenSP/OpenSP.bundle' for module SGML::Parser::OpenSP: dlopen(/Users/markclements/Downloads/SGML-Parser-OpenSP-0.994/SGML-Parser-OpenSP-0.994/blib/arch/auto/SGML/Parser/OpenSP/OpenSP.bundle, 2): Symbol not found: __ZN15SGMLApplication11nonSgmlCharERKNS_16NonSgmlCharEventE` But, the `OpenSP.bundle` is in the directory where it says it can't load. – Mark Clements Feb 16 '14 at 03:34
  • I guess that you also need to specify the path to the OpenSP library (libosp). Because you've installed the include files in a non-standard path you've probably installed the library too on a plcae, where the system loader does not expect libraries (/sw/lib or so?). And that's why you get the unresolved symbols when loading the bundle. I'm not familiar with Mac, but on other UNIX you can use LD_LIBRARY_PATH to set alternative lib path and there is also a way to configure the loader to use these path without needed environment variables. But, all this is outside of the perl module. – Steffen Ullrich Feb 16 '14 at 07:15