This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: YouCompleteMe build fails: problem with LONG_BIT in pyport.h or ld missing python lib


On Dec 19 11:57, D wrote:
> Whitedwarf <whitedwarf <at> tura-home.de> writes:
> > /home/matu_gr/.vim/bundle/YouCompleteMe/cpp/BoostParts/libs/python/src/
> converter/arg_to_python_base.cpp:6:
> > /usr/include/python2.7/pyport.h:886:2: Fehler: #error "LONG_BIT
> > definition appears wrong for platform (bad gcc/glibc config?)."
> >  #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc
> > config?)."
> >   ^
> > [...]
> > System/versions: win7-64, cygwin64 with cygwin-gcc installed in 32- and
> > 64-bit versions, https://github.com/Valloric/YouCompleteMe
> 
> I've been having the same problem as you, though YCM compiles fine under 32-
> bit Cygwin. I don't think that using the i686 compilers is the way to go 
> because, as said at the top of this page (https://github.com/Valloric/
> YouCompleteMe/wiki/Windows-Installation-Guide):
> 
> "Before starting this installation procedure, it's critically important 
> that you understand that the architecture (x86 vs x86-64) that you build 
> ycm_core.pyd for has to match the architecture of the python27.dll on your 
> system and the architecture of the Vim binary you will be running. All 
> three need to match, otherwise things won't work."
> 
> I have also tried downloading older versions of YCM, up to August 2013, 
> because that's when the author of the YCM installation for Cygwin guide 
> (see link above) wrote his guide. Still the same LONG_INT error.
> 
> I hope a solution for this emerges.

The solution for this is a bit of header file debugging.  Quite
obviously, LONG_BIT is defined wrongly at some point in the header
files, so you have to find out what part of the project is doing that.
Keep in mind that sizeof(long) is 8 on 64 bit Cygwin[1][2].

The test in pyport.h which errors out here is basically this:

  #ifndef LONG_BIT
  #define LONG_BIT (8 * SIZEOF_LONG)
  #endif

  #if LONG_BIT != 8 * SIZEOF_LONG
  #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  #endif

SIZEOF_LONG is correctly defined as 8 in pyconfig.h.  If LONG_BIT would
be undefined at this point, pyport.h would correctly define LONG_BIT to 64
here.  So it's evident that some other header defines LONG_BIT wrongly,
probably to 32, because somebody wrongly assumes that sizeof(long) is
always 4 on Cygwin.


Corinna


[1] http://cygwin.com/faq/faq.html#faq.programming.64bitporting
[2] http://cygwin.com/faq/faq.html#faq.programming.64bitporting-fail

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpSHXchSctga.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]