ghdl / ghdl-language-server

Language server based on ghdl
MIT License
92 stars 8 forks source link

Wrong library reference in a default install #150

Open r2com opened 1 year ago

r2com commented 1 year ago

I have built and installed ghdl in: /home/r2com/eda/install/ghdl/

Then I went back to the source ghdl folder and ran: pip install .

That did install the ghdl which I was able to run in command line.

However, when in Sublime I configured LSP to use it, I got error:

  File "/home/r2com/.local/lib/python3.11/site-packages/pyGHDL/libghdl/__init__.py", line 155, in _get_libghdl_path
    raise Exception(f"Cannot find libghdl {basename}")
Exception: Cannot find libghdl libghdl-3_0_0_dev.so

I know that this file is located after ghdl-ls install in: /home/r2com/.local/lib/python3.11/site-packages/

The init.py at line 155 tries to look in ../../lib folder for this file, but if executed from ghdl-ls location there is No such folder (although there is just necessary .so file)

So the way I fixed it, is just created a symbolic link "lib" which points to: /home/r2com/eda/install/ghdl/lib

The above folder is the install folder of ghdl, which has lib folder where necessary .so file located.

After that my ghdl-ls works OK in Sublime.

So... reason I posted this is to show you what exists, and whether there is more proper way to fix it? or did I miss some step during install?

tgingold commented 1 year ago

Weird, I use a similar setup.

What is the output of ghdl --dispconfig ? And the output of ghdl-ls --disp-config ?

r2com commented 1 year ago

Here are the printouts:

r2com@eda1:~/projects/temp/ghdl-cosim/vhpidirect/shared/shghdl$ ghdl --dispconfig
Paths at configuration:
compiler command: libexec/gcc/x86_64-pc-linux-gnu/12.2.0/ghdl1
assembler command (--AS= or as): as
linker command (--LINKER=, CC, or cc): cc
default lib prefix: lib

command line prefix (--PREFIX): (not set)
environment prefix (GHDL_PREFIX): (not set)
exec prefix (from program name): /home/r2com/eda/install/ghdl

library prefix: /home/r2com/eda/install/ghdl/lib/ghdl
library directory: /home/r2com/eda/install/ghdl/lib/ghdl
compiler path: /home/r2com/eda/install/ghdl/libexec/gcc/x86_64-pc-linux-gnu/12.2.0/ghdl1
assembler path: /usr/bin/as
linker path: /usr/bin/cc

default library paths:
 /home/r2com/eda/install/ghdl/lib/ghdl/ieee/v93/
 /home/r2com/eda/install/ghdl/lib/ghdl/

And another:

r2com@eda1:~/projects/temp/ghdl-cosim/vhpidirect/shared/shghdl$ ghdl-ls --disp-config
command line prefix (--PREFIX): (not set)
environment prefix (GHDL_PREFIX): (not set)
exec prefix (from program name): /home/r2com/eda/install/ghdl

library prefix: /home/r2com/eda/install/ghdl/lib/ghdl
library directory: /home/r2com/eda/install/ghdl/lib/ghdl
python:
sys.platform: linux, os.name: posix
3.11.1 (main, Dec 31 2022, 10:23:59) [GCC 12.2.0]
tgingold commented 1 year ago

So what is the issue ? Why is the library reference wrong ?