vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
547 stars 90 forks source link

build of 0c78f5d505c86e0483fa86564c95cdccd1936142 (master) with --enable-lsp fails due to utf8.h header not being found #281

Closed balducci closed 2 years ago

balducci commented 2 years ago

hello

when building with --enable-lsp I get:

g++ -m64 -Wall -std=c++14 -D_FILE_OFFSET_BITS=64 -DUSEGC  -I. -ILibLsp/lsp/extention/jdtls/ -ILibLsp/JsonRpc/ -ILibLsp/JsonRpc/lsp/extention/jdtls -Ithird_party/threadpool -Ithird_party/utfcpp/source -Ithird_party/rapidjson/include -O3 LibLsp/lsp/utils.cpp -c -o LibLsp/lsp/utils.o
LibLsp/lsp/utils.cpp:17:10: fatal error: utf8.h: No such file or directory
   17 | #include "utf8.h"
      |          ^~~~~~~~
compilation terminated.
make[2]: *** [Makefile:36: LibLsp/lsp/utils.o] Error 1
make[2]: Leaving directory '/home/balducci/tmp/install-us-d/asymptote-8186.d/asymptote-8188/LspCpp'

and, actually, I cannot find any utf8.h header in the cloned master (revno 8188, 0c78f5d505c86e0483fa86564c95cdccd1936142).

The LspCpp/third_party/utfcpp directory, under which I guess the utf8.h header should be found, is empty, even if I clone with --recursive

Is that an oversight or am I missing something?

(BTW: building with --enable-lsp=no works fine)

thanks a lot for your valuable work -gabriele

configuring with:

--with-latex=/usr/share/texmf.local/texmf/tex/latex
--with-context=/usr/share/texmf.local/texmf/tex/context/third
--enable-lsp=yes

building with gcc:

tmpsh:12> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/stow.d/versions/gcc-11.2.0/usr/lib64/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/balducci/tmp/install-us-d/gcc-11.2.0.d/gcc-11.2.0/configure --prefix=/opt/stow.d/versions/gcc-11.2.0/usr --libdir=/opt/stow.d/versions/gcc-11.2.0/usr/lib64 --libexecdir=/opt/stow.d/versions/gcc-11.2.0/usr/lib64 --enable-shared --disable-bootstrap --enable-languages=c,c++,objc,fortran --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC) 
stefanhusmann commented 2 years ago

confirmed

johncbowman commented 2 years ago

If you want to compile with an old c++-11 compiler, then you need to configure with --disable-lsp (or --enable-lsp=no); the language server protocol requires c++-14.

balducci commented 2 years ago

If you want to compile with an old c++-11 compiler, then you need to configure with --disable-lsp (or --enable-lsp=no); the language server protocol requires c++-14.

Actually, I did compile with latest g++ and -std=c++14 (see my original report)

It seems to me that the problem is not the c++ standard, but rather that the utf8.h header is missing from the cloned asymptote repository (probably due to the whole LspCpp/third_party/utfcpp directory being missing)

Am I supposed to clone utfcpp separately and merge it into the asymptote git tree?

johncbowman commented 2 years ago

Sorry for the confusion. I have now cloned utfcpp with git subrepo into my LspCpp fork github.com:vectorgraphics/LspCpp/third_party and pulled that into the asy repo, again with git subrepo. The threadpool third party repo should really be pulled in as subrepo too, but I'll leave that for the upstream developer of LspCpp.

johncbowman commented 2 years ago

Another option would have been to install the utf8cpp-devel package (on Fedora) and change LspCpp/LibLsp/lsp/utils.cpp: #include "utf8.h" to #include <utf8.h>

balducci commented 2 years ago

Sorry for the confusion. I have now cloned utfcpp with git subrepo into my LspCpp fork github.com:vectorgraphics/LspCpp/third_party and pulled that into the asy repo, again with git subrepo. The threadpool third party repo should really be pulled in as subrepo too, but I'll leave that for the upstream developer of LspCpp.

just letting you know that everything is back on track on my side: building with --enable-lsp now works fine

thanks -g