How do I build a gvim executable - linux

I have successfully built vim on linux (centOS). However, the ./configure, make, make install trilogy didn't build a gvim executable. Yet, I can start the gui version with vim -g. I seem to remember that when I built vim (and gvim) in other occasions, that also the executable gvim was built. So, is there a flag that I can pass to ./configure so that the executable gvim is also built. Or am I missing something completely different?

If you can start the GUI with vim -g or with :gui then you already have your executable. Perhaps something went wrong during make install: gvim (in /usr/bin/ or wherever) should be a link to vim.
Also, the standard instructions for compiling vim are a little different from the usual ./configure; make; make install since vim has a make rule to run configure. From vim74/src/INSTALL:
2. Unix
=======
Summary:
1. make run configure, compile and link
2. make install installation in /usr/local
I remember a discussion a while ago on the vim mailing list about changing this to be more standard, but I do not think that is going to happen.

I use this settings to build vim
./configure \
--prefix=/path \
--enable-pythoninterp \
--enable-cscope \
--enable-fontset \
--with-x \
--with-features=huge
but it's just an example, you should always experiment with the settings to find the one that fits your case, the autocompletition feature on the bash helps with the configure script too, so it's easy to find new flags that way.

Related

Vim could not load libpython3.7m.a with python3 from Anaconda

I'm trying to use Anaconda python3.7 + vim 8.1 + jedi-vim on Rocks 7.0 (Manzanita) but I get an error saying that libpython3.7m.a cannot be loaded and I can't find a solution.
First things first. I have to compile vim by myself because the vim installed by default has only +python and I have to use python3.
I cloned the git and, following several other suggestions found online I configure vim with
./configure --enable-cscope --enable-multibyte --enable-python3interp=dynamic --with-features=huge --with-python-config-dir=/home/mazzi/miniconda3/lib/python3.7/config-3.7m-x86_64-linux-gnu --with-tlib=ncurses --enable-fail-if-missing --prefix=/home/mazzi/.local
The prefix is due to the fact that I don't have root access and its output of can be found here. Please note that during the whole procedure I had to stay inside a conda environment, otherwise the configuration would fail saying that no python3 was found.
I then make, with this output, and make install with this other output.
I check vim version and everything seems ok.
Finally, I start vim normally (/home/mazzi/.local/bin is on the PATH, before the system paths, and the vim command points to ~/.local/bin/vim) and type :py3 pass but I get the following error:
E370: Could not load library libpython3.7m.a
E263: Sorry, this command is disabled, the Python library could not be loaded.
What can I do?
Additional info
Some of my sources:
https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source (without sudo and just to be clear I did not try YouCompleteMe due to some issues in the past that forced me to go to jedi-vim)
https://gist.github.com/hxhc/778d7c3a3ad491dedf3675a47275a979
Compiling vim 8.0 with Python 3 support resulting in SIGABRT
https://github.com/Valloric/YouCompleteMe/issues/2855#issuecomment-352181535

Vim Latex Suite can't find latex command using Pathogen

Background
I was having dual boot issues with Windows 10 and Ubuntu 17.10, which eventually resulted in a boot loop and since I need Ubuntu 16.04.3 for an Operating Systems class I decided to load up an ISO into one of my USBs with Rufus, reformat my Windows partitions from GPT to NTFS to get around some nasty bootmg/efi issues and here we are, good as new, except for one thing...
Problem
The only thing I haven't been able to successfully reinstall has been Latex Suite for Vim. Installation last time had been an easy extraction into .vim, but after some deliberation I elected to use Pathogen.
I've installed Pathogen using
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Which works for color schemes, etc., and every other aspect of latex-suite save for compiling, generating this every time I try to compile (using \ll):
/bin/bash: latex: command not found
I installed texlive which does then allow me to compile using vim, but I'd prefer not to use this solution if I don't have to (in fact I've already removed it, its more of a plan b for now given it's obstructive and non-intuitive compilation errors). I looked at the other questions asking how to install Latex Suite through pathogen and didn't see anything else similar to what I'm working on; below is self-explanatory in regards to installation structure.
~/.vim/bundle$ ls
vim-archery vim-latex-1.10.0
Obvious running pdflatex and latex can't be found because they are not in my $PATH but I was under the impression that with a good, recommended package manager like Pathogen I wouldn't need to which is what originally raised the red flag for me as its whole job is to modify the runtime path. I thought maybe trying sudo vim text.tex might work in case there hadn't been adequate permissions for Pathogen to modify runtime path but no dice.
.vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
colorscheme archery
let g:tex_flavor='latex'
set sw=2

Subversion CLI default text editor on Linux

While there is no shortage of information on how to set a text editor for the Subversion Command Line Interface to use (see here, here, and here for example), I can't figure out where my local system is getting the text editor information from.
On my system, when I perform an svn commit, it opens vim for a commit message. Since this is what I want, I never really thought about it. This has always just worked. However, recently a co-worker was trying to commit, and it failed with an error saying the editor was not set. I never went out of my way to set an editor, so I am very confused about this.
I am running Ubuntu 12.04 and I have compiled and installed the Subversion CLI client version 1.8.10 from source code. Previous to that, I was using whatever Ubuntu's Canonical system installed with apt-get install subversion.
The Using External Editors section of the Subversion Book states the following possibilities for setting the text editor:
--editor-cmd command-line option
SVN_EDITOR environment variable
editor-cmd runtime configuration option
VISUAL environment variable
EDITOR environment variable
Possibly, a fallback value built into the Subversion libraries (not present in the official builds)
I have investigated these places and have not found how the default text editor is set on my computer:
Not using --editor-cmd option when committing
SVN_EDITOR environment variable not set
editor-cmd is not set in either my ~/.subversion/config, nor in /etc/subversion/config. Both of these files exist, but the line is commented out.
VISUAL environment variable not set
EDITOR environment variable not set
I'm downloading the official repository, so there should be no fallback.
There must be another place where the default can be set. Does anybody know?
Edit: There was a suggestion that Subversion might be calling /usr/bin/editor, and this is not set up on my co-worker's machine. I discovered that /usr/bin/editor is set up the same on both my system and my co-worker's system.
When you download the source directly (and build it - assuming you have the build dependencies met) you specify (or you can omit it) the default fallback editor. Normally source builds are done with something like this on Ubuntu (assume I have extracted/downloaded the subversion 1.8.10 source from here):
./configure
make
sudo make install
Notice the ./configure command above doesn't specify any options. The defaults will install to the prefix /usr/local . Prior to issuing those commands (on Ubuntu 12.04) I ran sudo apt-get build-dep subversion . I then did the commands above to build and install. I made sure that options 1-5 (In the OPs question) were not satisfied and then tried to commit a change to a repository. I got this as a response:
svn: E205007: Commit failed (details follow):
svn: E205007: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options
svn: E205007: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found
Since I didn't remove the official Ubuntu subversion I had to run mine as /usr/local/bin/svn to make sure I was using the one I built. I could have used sudo apt-get remove subversion to remove the official one as well just to make sure.
Now if one runs these commands to rebuild the source:
make clean
./configure --with-editor=/usr/bin/editor
make
sudo make install
One should find that if options 1 to 5 are not satisfied and this version of subversion is run it should default to running whatever /usr/bin/editor points to. On Ubuntu that will depend on what alternative is being used.
So when Ubuntu does an official build where does their fallback editor come from? I went to the 12.04 source repository for subversion at this link . On the right hand side I downloaded the diff file subversion_1.6.17dfsg-3ubuntu3.4.diff.gz . I opened up the diff file Ubuntu uses and scrolling down you can find they use this set of ./configure options (flags):
confflags := \
--prefix=/usr \
--libdir=$(libdir) \
--mandir=\$${prefix}/share/man \
--with-apr=/usr \
--with-apr-util=/usr \
--with-neon=/usr \
--with-serf=/usr \
--with-berkeley-db=:::db \
--with-sasl=/usr \
--with-editor=/usr/bin/editor \
--with-ruby-sitedir=/usr/lib/ruby \
--with-swig=/usr \
--with-kwallet \
--with-gnome-keyring
The bold entry shows that they use /usr/bin/editor as their fallback.
I have built subversion 1.8.10 from source on Ubuntu 12.04 and got the expected behavior. This suggests one of these possibilities:
On one of the systems the options 1 through 5 is actually met.
One version of subversion was built with the --with-editor configure flag (either directly or indirectly). The fallback would point to whatever the --with-editor configure flag was set to.
On one of the systems the wrong version of subversion is being run. One possibility is that the official subversion on Ubuntu is in fact being used. If that is the case it was built to use /usr/bin/editor as a fallback.
On one of your systems you have an alias (or equivalent) for svn that specifies an editor. Aliases would be specified in a startup script like ~/.bashrc, ~/.bash_profile, /etc/bash.bashrc for example.
I think the normal way to specify this on Linux and other Unix-like systems, is to set the VISUAL environment variable (for GUI editors) or the EDITOR variable (for editors running in a terminal).
Try this:
update-alternatives --display editor
Run strings on your svn binary to see if it mentions Vim or any related env vars inside.
Also committing under strace -f may reveal something.
Set this in your .bashrc file.
Don't forget to "source .bashrc" or reopen terminal.
export SVN_EDITOR='vim'

How to compile bash?

How to compile bash? I did small modifications to the code I got from http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz. I want to see those changes. Can anyone please point to me simple steps to compile bash?
You can first run
cd bash-4.2
./configure --prefix=/usr \
--bindir=/bin \
--htmldir=/usr/share/doc/bash-4.2 \
--without-bash-malloc \
--with-installed-readline
make
make install
Also refer http://www.linuxfromscratch.org/lfs/view/development/chapter06/bash.html for more information
The simplest way to compile Bash is:
cd to the directory containing the source code and type ./configure to configure Bash for your system. If you're using csh on an old version of System V, you might need to type sh ./configure instead to prevent csh from trying to execute configure itself.
Running configure takes some time. While running, it prints messages telling which features it is checking for.
like
/bash-4.2$ ./configure
Type make to compile Bash and build the bashbug bug reporting script.
/bash-4.2$ make
Optionally, type make tests to run the Bash test suite.
/bash-4.2$ make tests
Type make install to install bash and bashbug. This will also install the manual pages and Info file.
/bash-4.2$ make install
The configure shell script attempts to guess correct values for various system-dependent variables used during compilation.

Do you know any tools like smush.it I could on command line?

You may know http://www.smushit.com/ysmush.it/ it is a tool to optimize images (png, jpg, gif)
I'd like to implement a phing task or something, so I'm looking for a similar tool to be used on cli.
I know that smushit is a bundle of several tools, but I don't have time to pack them all together.
Any ideas?
What OS? For Windows, PNGSlim from http://people.bath.ac.uk/ea2aced/tech/png/pngslim.zip is a nice commandline tool. It's a batchfile that runs the same file through a variety of different optimising tools that are out there, and keeps the best of what it gets (or reverts to a backup made at the beginning if it doesn't manage to shave off at least one batch).
Because of commandline limits, it can only do a handful of PNGs at a time, but because it's commandline, it's easy to script something to pass a whole directory through it.
It's pretty slow, but it is being thorough after all; one to leave running overnight.
Check the Image Magick toolkit: http://www.imagemagick.org/Usage/formats/ You can can convert,transform, rotate, up/down scale, overlap , etc. It is available is pretty much all linux distros I know of.
Old question, but you might want to check out littleutils.
To install on Ubuntu / Debian:
Download littleutils
wget -O littleutils.tar.bz2 http://sourceforge.net/projects/littleutils/files/latest/download
Unzip / Untar
tar jxvf littleutils.tar.bz2
Install the dependencies
sudo apt-get install gifsicle pngcrush lzip libpng12-0 libpng12-dev libjpeg-progs p7zip-full
cd into the littleutils directory (check version number)
cd littleutils-1.0.27
Configure and install
./configure --prefix=/usr && make && sudo make install && sudo make install-extra
You'll then be able to use opt-jpg {filename}, opt-png {filename} and opt-gif {filename} direct from the command line.

Resources