emacs-libvterm icon indicating copy to clipboard operation
emacs-libvterm copied to clipboard

Cannot compile: `No rule to make target 'libvterm-prefix/src/libvterm/.libs/libvterm.a'`

Open lebensterben opened this issue 4 years ago • 17 comments

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

lebensterben avatar May 22 '20 22:05 lebensterben

What system are you using?

Sbozzolo avatar May 27 '20 15:05 Sbozzolo

What system are you using?

@Sbozzolo Clear Linux. I've installed dependencies.

lebensterben avatar May 27 '20 15:05 lebensterben

Have you tried with cmake -DUSE_SYSTEM_LIBVTERM=no ..?

Sbozzolo avatar May 27 '20 17:05 Sbozzolo

@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

lebensterben avatar Jun 04 '20 20:06 lebensterben

I am seeing the exact same error message on NixOS using both cmake .. and cmake -DUSE_SYSTEM_LIBVTERM=no ..

mtekman avatar Jul 01 '20 22:07 mtekman

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.

lebensterben avatar Aug 10 '20 03:08 lebensterben

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.

Sbozzolo avatar Aug 10 '20 14:08 Sbozzolo

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.

@Sbozzolo I think I used the same build directory last time. Could that be the cause?

lebensterben avatar Aug 10 '20 16:08 lebensterben

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 by emacs-libvterm.

@Sbozzolo I think I used the same build directory last time. Could that be the cause?

Sbozzolo avatar Aug 10 '20 16:08 Sbozzolo

@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.

lebensterben avatar Aug 12 '20 21:08 lebensterben

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.

liaowang11 avatar Jan 31 '21 10:01 liaowang11

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.

lebensterben avatar Jan 31 '21 17:01 lebensterben

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.

tftio avatar Apr 09 '21 18:04 tftio

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. :)

linw1995 avatar Apr 21 '21 15:04 linw1995

Problem still exists on NixOS. Can anyone guide how to fix it?

RohitSingh107 avatar Oct 05 '21 07:10 RohitSingh107

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

meain avatar Oct 13 '21 17:10 meain

I'm also seeing this on Ubuntu within WSL

tarkpate avatar Jun 30 '22 18:06 tarkpate

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

srid avatar Oct 08 '22 01:10 srid

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
      ])

srid avatar Dec 27 '22 14:12 srid