LaTeXindent fail in VSCode: Can't locate Log/Log4perl.pm - visual-studio-code

I'm using LaTeX Workshop on VSCode to build pdf using LaTeX and I'm getting this error in the Output console when I save the .tex file.
Formatting with command latexindent
-c,d:path_to_folder,d:path_to_folder/__latexindent_temp.tex,-y=defaultIndent:
' '
Formatting failed with exit code 2
stderr: Can't locate Log/Log4perl.pm in #INC (you may need to install the Log::Log4perl module) (#INC contains: C:/Program Files/MiKTeX/scripts/latexindent C:/Perl64/site/lib C:/Perl64/lib) at C:/Program Files/MiKTeX/scripts/latexindent/LatexIndent/LogFile.pm line 22.
The problem is only related to the formatting stuff because the build runs successfully generating the pdf as supposed.
What I did:
Opened the CPAN Client of my Windows 10
Run install Log::Log4perl (it installed also other packages like Log::Dispatch::File and
YAML::Tiny)
Rebooted the system
Checked that Log4perl is installed and it is
I also tryied to install Log4perl through VSCode cmd but I'm getting this wierd error:
Running make for E/ET/ETJ/Log-Log4perl-1.53.tar.gz
to undefined at C:/Perl64/site/lib/ExtUtils/Install.pm line 141.
make: *** [pm_to_blib] Error 255
ETJ/Log-Log4perl-1.53.tar.gz
"C:\Program Files (x86)\GnuWin32\bin\make.exe" -- NOT OK
Failed during this command:
ETJ/Log-Log4perl-1.53.tar.gz : make NO
Any suggestions?

I figured it out in the end! To solve the error do:
Download latexindent.exe
Edit Latex-workshop › Latexindent:
Path in the Latex Workshop VSCode extension settings with the
latexindent.exe path

Related

Installing Perl in VSCode

I am trying to go back in time a little and play around with Perl once again. I have a Mac and VSCode installed and did the following:
brew install perl to install perl
this installs perl at /opt/homebrew/bin/perl and perl --version returns "This is perl 5, version 34, subversion 0 (v5.34.0) built for darwin-thread-multi-2level"
cpanm Perl::LanguageServer to install the language server
and in VSCode I install the Perl extension by Gerald Richter (v2.3.0)
However, when I open create a new text file and set Perl as the file's language, I get the following error message:
ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xc700080, needed 0xfb80080)
[Info - 12:52:54 PM] Connection to server got closed. Server will restart.
ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xc700080, needed 0xfb80080)
[Info - 12:52:54 PM] Connection to server got closed. Server will restart.
ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xc700080, needed 0xfb80080)
[Info - 12:52:54 PM] Connection to server got closed. Server will restart.
ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xc700080, needed 0xfb80080)
[Info - 12:52:54 PM] Connection to server got closed. Server will restart.
ListUtil.c: loadable library and perl binaries are mismatched (got handshake key 0xc700080, needed 0xfb80080)
[Error - 12:52:54 PM] Connection to server got closed. Server will not be restarted.
FOLLOW-UP:
In the meantime I uninstalled homebrew perl (brew uninstall perl), and rely on the already installed /usr/bin/perl ("This is perl 5, version 30, subversion 3 (v5.30.3) built for darwin-thread-multi-2level").
Using this version, I could install the language server and get it to run in VSCode. All I needed to do is select "File"->"Save Workspace As" to assign the ${workspace} variable of VSCode.
However, now I run into a new problem, as when I press F-5 (Run), I get the following error message:
Can't locate Perl/LanguageServer/DebuggerInterface.pm in #INC (you may need to install the Perl::LanguageServer::DebuggerInterface module) (#INC contains: /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.3 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30).
BEGIN failed--compilation aborted.
The library in question in ~/perl5/lib/perl5/Perl/LanguageServer. I assume I would have to add this directory to the module search path of VSCode - however not sure how.
FOLLOW-UP 2:
The module path can be added in the settings.json file belonging to the module. To get there click on "Perl" in the lower right corner of VSCode, and select "Configure 'Perl' based language settings" in the menu that pops up. This opens the settings.json file.
Once there, add the following line:
"perl.perlInc": [ "/Users/divingtobi/perl5/lib/perl5" ],
and you should be good to go. For some reason it has to be the full path, and ~/ is not interpolated.
On OS/X 12.6:
open cpan
cpan[1]> force install AnyEvent::IO (ignore warnings)
cpan[2]> force install Coro (ignore warnings)
cpan[3]> install Perl::LanguageServer
start VSC
install perl extention
have fun with perl & VSC

Command line tools not accessible from Eclipse on OSX

I am using Eclipse on a macOS machine. CMake is present on my machine at /usr/local/bin/cmake and has been installed using Homebrew. Eclipse is at the latest version (2018-09).
I have the following target in a Makefile, which has been set up and is visible from Eclipse:
all:
./configure
Rscript -e "Rcpp::compileAttributes()"
R CMD INSTALL --no-multiarch --with-keep.source .
Inside the configure file, there is this code:
cd src/build;cmake ..
However, when I double click the all target in Eclipse, I get the following message:
make all
./configure
./configure: line 1: cmake: command not found
make: *** [all] Error 127
I remember that some time ago this target worked out of the box on macOS. I can also launch CMake from a terminal without any trouble.
echo $PATH shows different behaviour:
If called from a standard macOS terminal, it yields /usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
If called from a TM Terminal inside Eclipse, it yields /usr/bin:/bin:/usr/sbin:/sbin
What is the most canonical way to have Eclipse detect my CMake installation ?
For macOS High Sierra 10.13.6, the solution provided here works. This must be performed to see the changes immediately.

unable to complie and install perl module: Audio::Scan

i am using "perl 5, version 18, subversion 2 (v5.18.2) built for MSWin32-x86-multi-thread-64int" on windows 7 enterprise(SP1).
I am trying to compile and install a perl module Audio::Scan (.71 version). I downloaded the module from cpan.org, extracted it locally in my machine. It contains readme.win32 text file which states the following:
zlib
The included zlib.lib should just work, if not: Download zlib from http://www.zlib.net/zlib123.zip.
Build from projects/visualc6/zlib.dsw.
Build Win32_LIB_Release Copy zlib.lib into the Audio::Scan win32 directory.
Audio::Scan
Install ActivePerl 5.8.8 or 5.10.0. Open command prompt. Run the vcvars file, for example C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat
perl Makefile.PL
nmake
nmake test
END
I followed all the steps till nmake. The step before nmake i executed like this "perl Makefile.PL make=nmake" as it was generating it dmake style by default. This step goes well.
But in nmake step, i get a lot of warnings followed by the following error:
win32/zlib.lib(./Win32_LIB_Release/crc32.obj):(.text$mn+0x22): undefined reference to #__security_check_cookie#4'
win32/zlib.lib(./Win32_LIB_Release/crc32.obj):(.text$mn+0x1be): undefined reference to#__security_check_cookie#4'
c:/perl/site/lib/auto/mingw/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: win32/zlib.lib(./Win32_LIB_Release/crc32.obj): bad reloc address 0x1be in section `.text$mn'
c:/perl/site/lib/auto/mingw/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2: ld returned 1 exit status NMAKE : fatal error U1077: 'C:\Perl\site\bin\g++.EXE' : return code '0x1'
Stop.
I read this thread http://www.perlmonks.org/?node_id=496624 checked the compiler used to compile perl as follows:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>perl -V:cc..
it returned
cc='gcc';
I am stuck at this point. Any help would be highly appreciated. Sorry for typos if any.

net-ssh2 installation in linux

I am trying to install Net-SSH2 in linux server and it is asking for lots of dependencies.
I installed both libssh2 and openssl, but still it throws the follwoing error.
/opt/script/Net-SSH2-0.52/assertlibcssKKx3q: error while loading shared libraries: libssh2.so.1: cannot open shared object file: No such file or directory
wrong result: 'ssh2'
Can someone tell me whats happening here?
Please find below the installation log
[root#vm Net-SSH2-0.52]# perl Makefile.PL
Subroutine checklibs redefined at inc/Module/Install/CheckLib.pm line 11.
Subroutine assertlibs redefined at inc/Module/Install/CheckLib.pm line 25.
Subroutine _author_side redefined at inc/Module/Install/CheckLib.pm line 39.
The libssh2 library is required by this module. If you don't have it, you can
download it from http://www.libssh2.org; you may also need OpenSSL, which can be
obtained from http://www.openssl.org, or libgcrypt, which can be obtained from
http://www.gnupg.org.
Debian: sudo aptitude install libssh2-1-dev
OpenSUSE: sudo zypper in libssh2-1 libssh2-devel
You can pass your libssh2 lib and include dirs on the command line. E.g.:
perl Makefile.PL lib=$HOME/libssh2/lib inc=$HOME/libssh2/include
To build with libgcrypt instead of OpenSSL, pass 'gcrypt' as a parameter to
Makefile.PL, e.g.:
perl Makefile.PL gcrypt
If you want to build on Windows, see the file BUILDING.WIN32 in the
distribution.
/opt/leo/perlscript/Net-SSH2-0.52/assertlibjmyXurmJ: error while loading shared libraries: libssh2.so.1: cannot open shared object file: No such file or directory
wrong result: 'ssh2'

Emacs Wanderlust error: "no such file or directory, gnutls-cli"

I am trying to open gmail with Emacs. M-x wl yields the following error message.
/usr/bin/mail is not an executable. Setting mail-interactive to t.
Initializing...
Loading mail-mime-setup...done
gnus-mime-setup is not found.
emh-setup is not found.
Updating addresses...done
Checking environment...
Auto plugged off at imap.gmail.com:993
byte-code: Searching for program: no such file or directory, gnutls-cli
Any ideas?
It wants you to install a utility called gnutls-cli. If you're on a Debian-derived distribution, apt-get install gnutls-bin which contains this utility and a few others. If you're on something else, please edit your question to include more details.