in reply to Re^6: installing WWW::Curl::Easy perl module in OS X 10.12.6
in thread installing WWW::Curl::Easy perl module in OS X 10.12.6
[ns3:~/src/WWW-Curl-4.17] root# sudo perlbrew switch system A sub-shell is launched with system as the activated perl. Run 'exit' +to finish it. sh-3.2#
I did notice, however, that the file being referenced by the error (/usr/lib/libCurl.dylib):MODULE = WWW::Curl PACKAGE = WWW::Curl::Easy PREFIX = curl_easy_
... is part of the system curl library, not the latest curl 7.58.0 version that I installed with brew:[ns3:~/linkrabbit] administrator% ./linkrabbit.pl -s iq Can't find 'boot_WWW__Curl' symbol in /usr/lib/libCurl.dylib at /Users/administrator/src/WWW-Curl-4.17/lib/WWW/Curl/Easy.pm line 9 +.
I tried changing the symlink to point to my brewed libcurl 7.58.0 version, but the OS would not let me (not even as SU or SUDO), which is for the best and kept me from messing things up entirely. I wondered how I might tell my perl program to use the version 7.58.0 specific libCurl.dylib file, without changing the exiting symlink. I then Googled across this epic Mac OS X perl tidbit from PerlMonks:[ns3:~/linkrabbit] administrator% ls -alG /usr/lib/libCurl.dylib lrwxr-xr-x 1 root wheel 15B 27 Sep 22:44 /usr/lib/libCurl.dylib - +> libcurl.4.dylib [ns3:/usr/lib] administrator% sudo locate libcurl.4.dylib /usr/lib/libcurl.4.dylib /usr/local/Cellar/curl/7.51.0/lib/libcurl.4.dylib /usr/local/Cellar/curl/7.56.1/lib/libcurl.4.dylib /usr/local/Cellar/curl/7.58.0/lib/libcurl.4.dylib [ns3:/usr/lib] administrator%
[ns3:~/src/WWW-Curl-4.17] administrator% perl Makefile.PL The version is libcurl 7.58.0 Found curl.h in /usr/local/Cellar/curl/7.58.0/include/curl/curl.h
I did a force install, and noticed more OS version warnings. At the end of the XML::LibXML force compile, I end up with 4 warnings and 2 errors, e.g.:[ns3:~/linkrabbit] administrator% sudo cpan install XML::LibXML Loading internal null logger. Install Log::Log4perl for logging messag +es CPAN: Storable loaded ok (v2.56) Reading '/Users/administrator/.cpan/Metadata' Database was generated on Sun, 11 Feb 2018 22:17:03 GMT Running install for module 'XML::LibXML' CPAN: Digest::SHA loaded ok (v5.95) CPAN: Compress::Zlib loaded ok (v2.069) Checksum for /Users/administrator/.cpan/sources/authors/id/S/SH/SHLOMI +F/XML-LibXML-2.0132.tar.gz ok CPAN: YAML loaded ok (v1.24) CPAN: CPAN::Meta::Requirements loaded ok (v2.140) CPAN: Parse::CPAN::Meta loaded ok (v1.4417) CPAN: CPAN::Meta loaded ok (v2.150005) CPAN: Module::CoreList loaded ok (v5.20160506) Configuring S/SH/SHLOMIF/XML-LibXML-2.0132.tar.gz with Makefile.PL enable native perl UTF8 running xml2-config...failed The installed version of libxml2 VERSION 2.9.4 is not compatible with XML::LibXML (and probably buggy)!
What the heck? Did I not just solve these problems when I installed WWW-Curl-4.17 in the first place?... have they come back to haunt me?[ns3:~/src/WWW-Curl-4.17] administrator% sudo cpan --force install XML +::LibXML <snip> ld: warning: ld: warning: object file (IO.o) was built for newer OSX v +ersion (10.12) than being linked (10.4)object file (poll.o) was built + for newer OSX version (10.12) than being linked (10.4) <snip> In file included from Curl.xs:574: ./curlopt-constants.c:19:58: error: non-void function 'constant' shoul +d return a value [-Wreturn-type] if (strEQ(name, "DID_MEMORY_FUNC_TYPEDEFS")) return CURL_D +ID_MEMORY_FUNC_TYPEDEFS; ^ ./curlopt-constants.c:136:49: error: use of undeclared identifier 'CUR +L_STRICTER' if (strEQ(name, "STRICTER")) return CURL_STRICTER; <snip> 4 warnings and 2 errors generated. make: *** [Curl.o] Error 1 SZBALINT/WWW-Curl-4.17.tar.gz /usr/bin/make -- NOT OK [ns3:~/src/WWW-Curl-4.17] administrator%
I checked my versions of libcurl, etc:[ns3:~/src/XML-LibXML-2.0132] administrator% perl Makefile.PL DEBUG=1 enable native perl UTF8 running xml2-config...xml2-config --version xml2-config --libs xml2-config --cflags failed The installed version of libxml2 VERSION 2.9.4 is not compatible with XML::LibXML (and probably buggy)! You may continue at your own risk using 'perl Makefile.PL FORCE=1', bu +t:
I decided to try installing the latest libxml2 stable 2.9.7, and Include its path in the perl call:[ns3:~/linkrabbit] administrator% ls -l /usr/lib/libxml* -rwxr-xr-x 1 root wheel 2.2M 18 Jan 21:35 /usr/lib/libxml2.2.dylib lrwxr-xr-x 1 root wheel 15B 27 Sep 22:44 /usr/lib/libxml2.dylib - +> libxml2.2.dylib [ns3:~/linkrabbit] administrator% grep LIBXML_DOTTED_VERSION < /usr/in +clude/libxml2/libxml/xmlversion.h * LIBXML_DOTTED_VERSION: #define LIBXML_DOTTED_VERSION "2.9.4" [ns3:~/linkrabbit] administrator% xmllint --version xmllint: using libxml version 20904 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv +1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude +ICU ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules + Debug Zlib [ns3:~/linkrabbit] administrator% xsltproc --version Using libxml 20904, libxslt 10129 and libexslt 817 xsltproc was compiled against libxml 20904, libxslt 10129 and libexslt + 817 libxslt 10129 was compiled against libxml 20904 libexslt 817 was compiled against libxml 20904 [ns3:~/linkrabbit] administrator%
OK, so I am not convincing perl to use the newly installed. Light bulb goes off, the newly exported path from my .bash_profile does get inherited by my favoured tcsh shell. At least for now I can compile under bash (let us ensure to add the new paths to tcsh as well):[ns3:~/linkrabbit] administrator% brew install libxml2 <snip> ==> Downloading https://homebrew.bintray.com/bottles/libxml2-2.9.7.sie +rra.bottle.tar.gz ###################################################################### +## 100.0% ==> Pouring libxml2-2.9.7.sierra.bottle.tar.gz ==> Caveats This formula is keg-only, which means it was not symlinked into /usr/l +ocal, because macOS already provides this software and installing another ve +rsion in parallel can cause all kinds of trouble. If you need to have this software first in your PATH run: echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.bash_pro +file For compilers to find this software you may need to set: LDFLAGS: -L/usr/local/opt/libxml2/lib CPPFLAGS: -I/usr/local/opt/libxml2/include For pkg-config to find this software you may need to set: PKG_CONFIG_PATH: /usr/local/opt/libxml2/lib/pkgconfig If you need Python to find bindings for this keg-only formula, run: echo /usr/local/opt/libxml2/lib/python2.7/site-packages >> /usr/loca +l/lib/python2.7/site-packages/libxml2.pth mkdir -p /Users/administrator/Library/Python/2.7/lib/python/site-pac +kages echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-pa +ckages")' >> /Users/administrator/Library/Python/2.7/lib/python/site- +packages/homebrew.pth ==> Summary 🍺 /usr/local/Cellar/libxml2/2.9.7: 281 files, 10.4MB [ns3:~/linkrabbit] administrator% echo 'export PATH="/usr/local/opt/li +bxml2/bin:$PATH"' >> ~/.bash_profile <logout/login> [ns3:~] administrator% cd ~/src/XML-LibXML-2.0132 [ns3:~/src/XML-LibXML-2.0132] administrator% perl Makefile.PL -I/usr/l +ocal/opt/libxml2/include enable native perl UTF8 running xml2-config...failed The installed version of libxml2 VERSION 2.9.4 is not compatible with XML::LibXML (and probably buggy)!
More dependencies, argh! :) Back to cpanm (under bash), and I manage to install XML-LibXML-2.0132:ns3:XML-LibXML-2.0132 administrator$ cd ~/src/XML-LibXML-2.0132 ns3:XML-LibXML-2.0132 administrator$ perl Makefile.PL -I/usr/local/opt +/libxml2/include enable native perl UTF8 running xml2-config...untested Note: libxml2 2.9.7 was not tested with this XML::LibXML version. Checking for ability to link against xml2...yes Checking if your kit is complete... Looks good Warning: prerequisite XML::NamespaceSupport 1.07 not found. Warning: prerequisite XML::SAX 0.11 not found. Warning: prerequisite XML::SAX::Base 0 not found. Warning: prerequisite XML::SAX::Exception 0 not found. Generating a Unix-style Makefile Writing Makefile for XML::LibXML Writing MYMETA.yml and MYMETA.json ns3:XML-LibXML-2.0132 administrator$
Note to self, always try to compile under bash if it does not work under tsch, or be seriously sure about adding the new paths added by installers to my .tsch profile... unless I am missing something that would make this automatic?ns3:XML-LibXML-2.0132 administrator$ sudo cpanm XML::LibXML --> Working on XML::LibXML Fetching http://www.cpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0132 +.tar.gz ... OK Configuring XML-LibXML-2.0132 ... OK ==> Found dependencies: XML::SAX::Base, XML::SAX::Exception, XML::SAX, + XML::NamespaceSupport --> Working on XML::SAX::Base Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-Base-1.09. +tar.gz ... OK Configuring XML-SAX-Base-1.09 ... OK Building and testing XML-SAX-Base-1.09 ... OK Successfully installed XML-SAX-Base-1.09 --> Working on XML::SAX Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-0.99.tar.g +z ... OK Configuring XML-SAX-0.99 ... OK ==> Found dependencies: XML::NamespaceSupport --> Working on XML::NamespaceSupport Fetching http://www.cpan.org/authors/id/P/PE/PERIGRIN/XML-NamespaceSup +port-1.12.tar.gz ... OK Configuring XML-NamespaceSupport-1.12 ... OK Building and testing XML-NamespaceSupport-1.12 ... OK Successfully installed XML-NamespaceSupport-1.12 Building and testing XML-SAX-0.99 ... OK Successfully installed XML-SAX-0.99 Building and testing XML-LibXML-2.0132 ... OK Successfully installed XML-LibXML-2.0132 4 distributions installed ns3:XML-LibXML-2.0132 administrator$
|
|---|