A few rough edges building on linux - clang

Discuss issues related to installing or building
marlowa
Posts: 117
Joined: Sun Oct 25 2015 10:52 am

A few rough edges building on linux - clang

Post by marlowa »

I noticed a few rough edges when trying to build doxpress on linux. The first was that it doesn't do the simple check of seeing if CopperSpice is installed and that CS_HOEM is defined. The next problem was a compilation error because of a dependency on clang that isn't checked:

make[2]: Entering directory '/home/marlowa/Downloads/DoxyPress-1.2.0/bin'
depbase=`echo src/parser_clang.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DPACKAGE_NAME=\"DoxyPress\" -DPACKAGE_TARNAME=\"doxypress\" -DPACKAGE_VERSION=\"1.2.0\" -DPACKAGE_STRING=\"DoxyPress\ 1.2.0\" -DPACKAGE_BUGREPORT=\"info@copperspice.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"doxypress\" -DVERSION=\"1.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FORK=1 -DHAVE_GETPID=1 -DSIZEOF_SIZE_T=8 -I. -I/usr/local/include -I/usr/local/include/QtCore -I/usr/local/include/QtXml -I../src -g -O2 -std=c++11 -MT src/parser_clang.o -MD -MP -MF $depbase.Tpo -c -o src/parser_clang.o ../src/parser_clang.cpp &&\
mv -f $depbase.Tpo $depbase.Po
../src/parser_clang.cpp:25:27: fatal error: clang-c/Index.h: No such file or directory
#include <clang-c/Index.h>
^
compilation terminated.
Makefile:1059: recipe for target 'src/parser_clang.o' failed

The funny thing is, configure started off by detecting that gcc was being used. This made me think that it could be bult with gcc. Must it be built with clang instead? What is the dependency here? I think it should check for the dependency in configure rather than blowing up in the compile.
ansel
Posts: 152
Joined: Fri Apr 10 2015 8:23 am

Re: A few rough edges building on linux - clang

Post by ansel »

marlowa wrote:I noticed a few rough edges when trying to build doxpress on linux. The first was that it doesn't do the simple check of seeing if CopperSpice is installed and that CS_HOEM is defined. The next problem was a compilation error because of a dependency on clang that isn't checked:

The funny thing is, configure started off by detecting that gcc was being used. This made me think that it could be bult with gcc. Must it be built with clang instead? What is the dependency here? I think it should check for the dependency in configure rather than blowing up in the compile.
You raise a couple of good points here. I responded about the CS_HOME issue on your other post a few moments ago. As to your question about clang, it is a bit more involved.
  • DoxyPress definitely can be built with GCC, and is built this way in our CI system.
  • DoxyPress links with libClang, whose headers must be present on your development system
  • This issue should be diagnosed at configure time.
We will take steps to ensure this dependency is correctly diagnosed at configure time.

Thanks for your report.
Ansel Sermersheim
CopperSpice Cofounder
marlowa
Posts: 117
Joined: Sun Oct 25 2015 10:52 am

Re: A few rough edges building on linux - clang

Post by marlowa »

ansel wrote: You raise a couple of good points here. I responded about the CS_HOME issue on your other post a few moments ago. As to your question about clang, it is a bit more involved.
  • DoxyPress definitely can be built with GCC, and is built this way in our CI system.
  • DoxyPress links with libClang, whose headers must be present on your development system
I tried to install the headers using synaptic package manager. It offered versions 3.4.0 and 3.5.0. Neither worked. I then tried building clang from source and installing. That didn't seem to install the Index.h header either. Which version of clang should I be using? Can you recommend a package for installing it please?
marlowa
Posts: 117
Joined: Sun Oct 25 2015 10:52 am

Re: A few rough edges building on linux - clang

Post by marlowa »

marlowa wrote:
ansel wrote: You raise a couple of good points here. I responded about the CS_HOME issue on your other post a few moments ago. As to your question about clang, it is a bit more involved.
  • DoxyPress definitely can be built with GCC, and is built this way in our CI system.
  • DoxyPress links with libClang, whose headers must be present on your development system
I tried to install the headers using synaptic package manager. It offered versions 3.4.0 and 3.5.0. Neither worked. I then tried building clang from source and installing. That didn't seem to install the Index.h header either. Which version of clang should I be using? Can you recommend a package for installing it please?
I am still stuck on the error:

./src/parser_clang.h:23:27: fatal error: clang-c/Index.h: No such file or directory

I tried installing c-clang. First I tried version 3.4, then 3.5. Neither worked. The header file is nowhere to be found.

I would really like to get doxypress built on linux. This would enable me to give a stack trace for when it core dumps when mis-handling the tab character in one of my files when the tabstop is set to 8. I have no hope of finding the cause on Windows where I first noticed the problem, but I thought I would be able to get more info on linux.
ansel
Posts: 152
Joined: Fri Apr 10 2015 8:23 am

Re: A few rough edges building on linux - clang

Post by ansel »

Yes, these errors can be tough to find. We have found the problem and resolved this particular core dump issue. We have not cut a new release yet because we are tracking down some potentially related issues with the Markdown parser.

With respect to the clang headers, since you mention synaptic I am presuming you are building either on Debian or Ubuntu. For either OS the headers we are using are contained in package 'libclang-3.5-dev'. In both cases the compile and link flags should be appended to as follows:

Code: Select all

  CXXFLAGS+=" -I/usr/lib/llvm-3.5/include"
  LDFLAGS+=" -L/usr/lib/llvm-3.5/lib -lclang"
We are working to make the detection of the clang libraries more automatic during the configuration process.
Ansel Sermersheim
CopperSpice Cofounder
marlowa
Posts: 117
Joined: Sun Oct 25 2015 10:52 am

Re: A few rough edges building on linux - clang

Post by marlowa »

ansel wrote:With respect to the clang headers, since you mention synaptic I am presuming you are building either on Debian or Ubuntu. For either OS the headers we are using are contained in package 'libclang-3.5-dev'. In both cases the compile and link flags should be appended to as follows:

Code: Select all

  CXXFLAGS+=" -I/usr/lib/llvm-3.5/include"
  LDFLAGS+=" -L/usr/lib/llvm-3.5/lib -lclang"
We are working to make the detection of the clang libraries more automatic during the configuration process.
Thanks Ansel, this is just the info I was looking for. I assumed that configure would somehow work this out.
marlowa
Posts: 117
Joined: Sun Oct 25 2015 10:52 am

Re: A few rough edges building on linux - clang

Post by marlowa »

marlowa wrote:
ansel wrote:With respect to the clang headers, since you mention synaptic I am presuming you are building either on Debian or Ubuntu. For either OS the headers we are using are contained in package 'libclang-3.5-dev'. In both cases the compile and link flags should be appended to as follows:

Code: Select all

  CXXFLAGS+=" -I/usr/lib/llvm-3.5/include"
  LDFLAGS+=" -L/usr/lib/llvm-3.5/lib -lclang"
I just tried to build 1.2.4 from source on linux. It is still gaving the same problem. I find there is nothing about this in the README file and no INSTALL FILE. Without this information I think I am not the only one that would try to build it by spotting the configure script and just running it, followed by make.
marlowa wrote:
ansel wrote: We are working to make the detection of the clang libraries more automatic during the configuration process.
Thanks Ansel, this is just the info I was looking for. I assumed that configure would somehow work this out.
Looks like it still needs to do this.
barbara
Posts: 447
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: A few rough edges building on linux - clang

Post by barbara »

I have added a link to our documentation in the README files for DoxyPress and DoxyPressApp. The documentation explains how to build from source. The following is the same link you will find in the README:

http://www.copperspice.com/docs/doxypre ... press.html


The documentation for the clang specific information is located on the following documentation page:

http://www.copperspice.com/docs/doxypress/parsing.html


Barbara
marlowa
Posts: 117
Joined: Sun Oct 25 2015 10:52 am

Re: A few rough edges building on linux - clang

Post by marlowa »

barbara wrote:I have added a link to our documentation in the README files for DoxyPress and DoxyPressApp. The documentation explains how to build from source. The following is the same link you will find in the README:

http://www.copperspice.com/docs/doxypre ... press.html

The documentation for the clang specific information is located on the following documentation page:

http://www.copperspice.com/docs/doxypress/parsing.html
Barbara
I have followed these instructions but it still doesn't build. I still get the same error. The header file Index.h is not under /usr/lib/llvm-3.7/include. What am I doing wrong?
ansel
Posts: 152
Joined: Fri Apr 10 2015 8:23 am

Re: A few rough edges building on linux - clang

Post by ansel »

I have followed these instructions but it still doesn't build. I still get the same error. The header file Index.h is not under /usr/lib/llvm-3.7/include. What am I doing wrong?
Can you let us know which platform and version you are building on?
Ansel Sermersheim
CopperSpice Cofounder
Post Reply