[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [creduce-bugs] [C-Reduce] build errors when using configure or cmake
Hi, Kwonsoo! I've answered some specific questions inline below, but my
general advice is this:
+ Download and use the precompiled LLVM/Clang 4.0 binaries for your platform.
http://releases.llvm.org/download.html
+ When you run `configure` or `cmake`, be sure to specify CC=clang, too.
If the suggestions in this email doesn't help you resolve the problems you are
encoutnering, please follow up and specify the version of Clang that you are
using. Thanks!
Kwonsoo Chae <kwonsoo.chae@gmail.com> writes:
> I am currently trying to build the latest version (commit 862dc3b) of
> C-Reduce. But I face some errors when I "make".
>
> 1) when using 'configure'
>
> In the C-Reduce directory (after cloning from the Github repository),
> chaekwonsoo@chaekwonsoo-910S5K:~/creduce_currdev$ ./configure CXX=clang++
In the command above, you probably also want to specify CC=clang.
That doesn't really explain why `clang++` would crash. What version of
`clang++` are you using in this example? I'm guessing that it was an old
version, since in the CMake-based transcript later in your email, I see that
you built your own version of LLVM/Clang.
> make[2]: Entering directory `/home/chaekwonsoo/creduce_currdev/clang_delta'
>
> clang++ -DHAVE_CONFIG_H -I. -I.. -I"/usr/local/include/clang"
> -I/usr/local/include -fPIC -fvisibility-inlines-hidden -std=c++11
> -fno-exceptions -fno-rtti -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D_DEBUG
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
> -fno-rtti -fno-exceptions -g -O3 -fno-strict-aliasing -Wall -Wextra
> -Wno-long-long -Wno-unused-parameter -Wno-missing-field-initializers -MT
> clang_delta-AggregateToScalar.o -MD -MP -MF
> .deps/clang_delta-AggregateToScalar.Tpo -c -o clang_delta-AggregateToScalar.o
> `test -f 'AggregateToScalar.cpp' || echo './'`AggregateToScalar.cpp
>
> make[2]: *** [clang_delta-AggregateToScalar.o] segmentation fault (memory dump)
As for the CMake-based build:
> chaekwonsoo@chaekwonsoo-910S5K:~/creduce_currdev$ export
> CXX=~/my-clang-directory/bin/clang++
> chaekwonsoo@chaekwonsoo-910S5K:~/creduce_currdev$ cmake .
Here again, you probably also want to specify CC=clang, or else you'll end up
mixing GCC and Clang++. (And you ended up with with kind of an old GCC, too!
See the output below.)
> ---------------------------------------------
> -- The C compiler identification is GNU 4.8.4
> -- The CXX compiler identification is Clang 4.0.0
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> [ 78%] Building CXX object clang_delta/CMakeFiles/clang_delta.dir/TransformationManager.cpp.o
>
> /home/chaekwonsoo/creduce_currdev/clang_delta/TransformationManager.cpp:104:14: error: use of
> undeclared identifier 'IK_C'
>
> if ((IK == IK_C) || (IK == IK_PreprocessedC)) {
I get the impression that you are using the development version of LLVM/Clang,
not an official 4.0 release. Is that right?
The master git branch of C-Reduce, as well as offical releases of C-Reduce, is
compatible with official release versions of LLVM/Clang. The current C-Reduce
release is compatible with the LLVM/Clang 4.0 release.
We have a separate git branch, called `llvm-svn-compatible` where we try to
stay compatible with the current development version of LLVM/Clang. If you've
built the current development version of LLVM/Clang, you want to use the
`llvm-svn-compatible` version of C-Reduce.
Unless you have a specific reason to use a development version of LLVM/Clang, I
suggest that you simply download and use the prebuilt LLVM/Clang 4.0 package
that is appropriate for your platform. You can find the prebuilt binary
packages here: http://releases.llvm.org/download.html
Does that make sense?
If you are still having trouble after these suggestions, please follow up. In
particular, identify the specific version of LLVM/Clang that you are using and
how it was built.
Thanks! ---
Eric.
--
-------------------------------------------------------------------------------
Eric Eide <eeide@cs.utah.edu> . University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX