Wednesday, June 4, 2014

Vim auto (IntelliSense like) completion using GCCSense & gcc-code-assit


Download and Instructions from:
http://cx4a.org/software/gccsense/

Prerequisites:
http://gcc.gnu.org/install/prerequisites.html

Remember to setup your build environment, GCC, GMP, etc. (PATH, LD_LIBRARY_PATH, etc.)

wget http://cx4a.org/pub/gccsense/gcc-code-assist-0.1-4.4.4.tar.bz2
tar xvf gcc-code-assist-0.1-4.4.4.tar.bz2
cd gcc-code-assist-0.1-4.4.4/
./configure --prefix ~/gcc-code-assist-0.1-4.4.4_install --program-suffix=-code-assist --enable-languages=c,c++ --disable-bootstrap --disable-multilib

Received error:

configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.

Install MPFR to fix error @ http://www.mpfr.org/mpfr-current/#download :

wget http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.gz
tar xzf mpfr-3.1.2.tar.gz
cd mpfr-3.1.2
./configure --prefix=~/mpfr-3.1.2_install 
make
make check
make install

Rerun ./configure... from above but --with-mpfr=~/mpfr-3.1.2_install/

make

Received error:

...console
checking for suffix of object files... configure: error: in `~/gcc-code-assist-0.1-4.4.4/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
...config.log
configure:5031: gcc -c -g -O2 -I/include -DCLOOG_PPL_BACKEND  -I~/mpfr-3.1.2_install//include   conftest.c >&5
conftest.c:12:25: fatal error: cloog/cloog.h: No such file or directory
 #include "cloog/cloog.h"
                         ^CLooG
compilation terminated.

Specified cloog-ppl location:

Rerun ./configure... from above but --with-cloog=/tools/devkits/lnx64/cloog-ppl-0.15.11/

make

Received error:

configure:5009: checking for correct version of CLooG
configure:5031: gcc -c -g -O2 -I/tools/batonroot/rodin/devkits/lnx64/cloog-ppl-0.15.11//include -DCLOOG_PPL_BACKEND  -I/proj/rdi-xco/staff/nikc/tools/archive/mpfr-3.1.2_install//include   conftest.c >&5
In file included from /tools/batonroot/rodin/devkits/lnx64/cloog-ppl-0.15.11//include/cloog/cloog.h:45:0,
                 from conftest.c:12:
/tools/batonroot/rodin/devkits/lnx64/cloog-ppl-0.15.11//include/cloog/ppl_backend.h:34:19: fatal error: ppl_c.h: No such file or directory
 #include <ppl_c.h>
                   ^
compilation terminated.

Rerun ./configure... from above but --with-ppl=/tools/devkits/lnx64/ppl-0.11/

Final configuration command:

./configure --prefix ~/gcc-code-assist-0.1-4.4.4_install --program-suffix=-code-assist --enable-languages=c,c++ --disable-bootstrap --disable-multilib --with-mpfr=~/mpfr-3.1.2_install/ --with-cloog=/tools/devkits/lnx64/cloog-ppl-0.15.11/ --with-ppl=/tools/devkits/lnx64/ppl-0.11/


make

make install

!!! NOTICE: make clean would not correctly clean, I had to manually delete the build-... directory and then rerun before I would make progress.

No comments:

Post a Comment