emacs-libvterm
emacs-libvterm copied to clipboard
Cannot compile: `No rule to make target 'libvterm-prefix/src/libvterm/.libs/libvterm.a'`
Following the guide of manual installation,
❯ make
[ 8%] Performing update step for 'libvterm'
[ 16%] No configure step for 'libvterm'
[ 25%] Performing build step for 'libvterm'
[ 33%] No install step for 'libvterm'
[ 41%] Completed 'libvterm'
[ 66%] Built target libvterm
make[2]: *** No rule to make target 'libvterm-prefix/src/libvterm/.libs/libvterm.a', needed by '../vterm-module.so'. Stop.
make[1]: *** [CMakeFiles/Makefile2:153: CMakeFiles/vterm-module.dir/all] Error 2
make: *** [Makefile:104: all] Error 2
What system are you using?
What system are you using?
@Sbozzolo Clear Linux. I've installed dependencies.
Have you tried with cmake -DUSE_SYSTEM_LIBVTERM=no ..
?
@Sbozzolo
I just tried cmake -DUSE_SYSTEM_LIBVTERM=no ..
and then make
, it gives me same result:
❯ make install
[ 8%] Performing update step for 'libvterm'
[ 16%] No configure step for 'libvterm'
[ 25%] Performing build step for 'libvterm'
[ 33%] No install step for 'libvterm'
[ 41%] Completed 'libvterm'
[ 66%] Built target libvterm
make[2]: *** No rule to make target 'libvterm-prefix/src/libvterm/.libs/libvterm.a', needed by '../vterm-module.so'. Stop.
make[1]: *** [CMakeFiles/Makefile2:153: CMakeFiles/vterm-module.dir/all] Error 2
make: *** [Makefile:104: all] Error 2
I am seeing the exact same error message on NixOS using both cmake ..
and cmake -DUSE_SYSTEM_LIBVTERM=no ..
I'm closing this now as I resolved the issue. Details below.
--
On my system, livterm.la
is installed in /usr/lib64
by system's package manager.
But the header file vterm.h
is not installed.
I manually compiled libvterm
from upstream source repo and installed library and header in /usr/local/lib
and /usr/local/include
. When building THIS package, I told cmake
the correct path to the header and library. It works.
In addition, I also tried to copied the header to /usr/include
, and ask cmake
to use it, with the library file from my system's package manager. It ALSO worked.
So it seems to me that, the true cause for the error I saw is the lack of header file.
Thanks for your report. If this is the problem, I don't understand why -DUSE_SYSTEM_LIBVTERM=no
doesn't work. When the option is set, libvterm
should be compiled cleanly and locally by emacs-libvterm
.
Thanks for your report. If this is the problem, I don't understand why
-DUSE_SYSTEM_LIBVTERM=no
doesn't work. When the option is set,libvterm
should be compiled cleanly and locally byemacs-libvterm
.
@Sbozzolo I think I used the same build directory last time. Could that be the cause?
Maybe, you can test this by trying again with a different directory. To make the test meaningful you should also revert back the changes that you manually made to get thigs to work.
Lucius Hu [email protected] writes:
Thanks for your report. If this is the problem, I don't understand why
-DUSE_SYSTEM_LIBVTERM=no
doesn't work. When the option is set,libvterm
should be compiled cleanly and locally byemacs-libvterm
.@Sbozzolo I think I used the same build directory last time. Could that be the cause?
@Sbozzolo
Hi removed the library and header files I compiled from my system. And created a new build directory,
after cmake
, it has the following settings:
-
LIBVTERM_INCLUDE_DIR
:LIBVTERM_INCLUDE_DIR-NOTFOUND
-
USE_SYSTEM_LIBVTERM
:ON
Running make
would returns the error
make[2]: *** No rule to make target 'libvterm-prefix/src/libvterm/.libs/libvterm.a', needed by '../vterm-module.so'. Stop.
make[1]: *** [CMakeFiles/Makefile2:152: CMakeFiles/vterm-module.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
Now replace USE_SYSTEM_LIBVTERM
's value by OFF
, as you suggested, and run make clean && make
,
the same error appears again.
This time I build libvterm
from source and installed it with prefix /usr/local
, without setting any compiler flags, library path, or include path.
In a clean build directoy, run cmake
and it detects the libvterm
library and header, with these settins:
-
LIBVTERM_INCLUDE_DIR
:/usr/local/include
-
LIBVTERM_LIBRARY
:/usr/local/lib/libvterm.so
-
USE_SYSTEM_LIBVTERM
: ON
It compiles normally. ( And if I replace the LIBVTERM_LIBRARY
by the one installed by my system package manager, it also compiles. )
To sum up, whether the build directory is clean or not, is not the cause of this bug.
The problem is the lack of vterm.h
file, even USE_SYSTEM_LIBVTERM
is set to OFF
.
Please verify, and I will reopen this issue.
Can confirm this on nixos. Also getting this error with -DUSE_SYSTEM_LIBVTERM=no
make[2]: *** No rule to make target 'libvterm-prefix/src/libvterm/.libs/libvterm.a', needed by '../vterm-module.so'. Stop.
Can confirm this on nixos. Also getting this error with
-DUSE_SYSTEM_LIBVTERM=no
...
@liaowang11 I haven't seen this issue recently. I will keep this thread open since it's still bothering some users.
Problem still exists on NixOS -- I check out the repo, do the cmake .. && make
dance, and get the error above. Manually setting the LIBVTERM_*
env vars to the location in the nix store succeeds.
This problem occurs on macOS with the libtool installed vi nix. But when I switched to use libtool installed via brew, clean the build directory and build it again. Out of surprise, it compiled success.
This comment may be helpful to reveal the root cause of this issue. :)
Problem still exists on NixOS. Can anyone guide how to fix it?
For people using NixOS, adding this seems to fix the issue. Use this instead of just mentioning Emacs in home.packages
.
programs.emacs = {
enable = true;
extraPackages = epkgs: [ epkgs.vterm ];
};
ref: https://github.com/hlissner/doom-emacs/tree/develop/modules/term/vterm#libvterm
I'm also seeing this on Ubuntu within WSL
I see this on my M1 mac running the following Emacs build
GNU Emacs 28.1 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2022-05-11
For people using NixOS,
And for people using Nix on darwin (via nix-darwin), the following works when using https://github.com/nix-community/emacs-overlay
{ pkgs, inputs, system, ... }:
let
emacsPgtkWithXwidgets = inputs.emacs-overlay.packages.${system}.emacsPgtk.override {
withXwidgets = true;
};
myEmacs = emacsPgtkWithXwidgets.overrideAttrs (oa: {
buildInputs = oa.buildInputs ++ lib.optionals pkgs.stdenv.isDarwin
[ pkgs.darwin.apple_sdk.frameworks.WebKit ];
});
in
(pkgs.emacsPackagesFor myEmacs).emacsWithPackages (epkgs: [
epkgs.vterm
])