public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* YouCompleteMe build fails: problem with LONG_BIT in pyport.h or ld missing python lib
@ 2013-11-06 15:10 Whitedwarf
  2013-12-19 12:45 ` D
  0 siblings, 1 reply; 3+ messages in thread
From: Whitedwarf @ 2013-11-06 15:10 UTC (permalink / raw)
  To: cygwin

Hi all,

I'm trying to install (i.e., mainly, build) the vim plugin YouCompleteMe
in cygwin64 on a x86_64 machine and got stuck.

The first error message was


[ 11%] Building CXX object
BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/arg_to_python_base.cpp.o
In file included from /usr/include/python2.7/Python.h:58:0,
                 from
/home/matu_gr/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/detail/wrap_python.hpp:142,
                 from
/home/matu_gr/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/detail/prefix.hpp:13,
                 from
/home/matu_gr/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/handle.hpp:8,
                 from
/home/matu_gr/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/converter/arg_to_python_base.hpp:7,
                 from
/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?)."
  ^
BoostParts/CMakeFiles/BoostParts.dir/build.make:402: recipe for target
'BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/arg_to_python_base.cpp.o'
failed
make[3]: ***
[BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/arg_to_python_base.cpp.o]
Error 1
CMakeFiles/Makefile2:78: recipe for target
'BoostParts/CMakeFiles/BoostParts.dir/all' failed
make[2]: *** [BoostParts/CMakeFiles/BoostParts.dir/all] Error 2
CMakeFiles/Makefile2:212: recipe for target
'ycm/CMakeFiles/ycm_support_libs.dir/rule' failed
make[1]: *** [ycm/CMakeFiles/ycm_support_libs.dir/rule] Error 2
Makefile:148: recipe for target 'ycm_support_libs' failed
make: *** [ycm_support_libs] Error 2


I've tried to work around with (as mentioned in
https://github.com/Valloric/YouCompleteMe/issues/66 )

-DPYTHON_INCLUDE_DIR=/usr/include/python2.7
-DPYTHON_LIBRARY=/usr/lib/libpython2.7.dylib

but this did not help. (CMake configuration reports the same libs if not
provided explicitly anyway.)


Then I've tried to reset the compilers CMake uses: using
-DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER, I've set the compilers
first to /usr/bin/x86_64-pc-cygwin-gcc and
/usr/bin/x86_64-pc-cygwin-g++, respectively; then to
/usr/bin/i686-pc-cygwin-gcc and /usr/bin/i686-pc-cygwin-g++. But now I get:


Linking CXX shared library ycm_core.pyd
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld:
cannot find -lpython2.7
collect2: Fehler: ld gab 1 als Ende-Status zurück
ycm/CMakeFiles/ycm_core.dir/build.make:390: recipe for target
'ycm/ycm_core.pyd' failed
make[3]: *** [ycm/ycm_core.pyd] Error 1
CMakeFiles/Makefile2:168: recipe for target
'ycm/CMakeFiles/ycm_core.dir/all' failed
make[2]: *** [ycm/CMakeFiles/ycm_core.dir/all] Error 2
CMakeFiles/Makefile2:212: recipe for target
'ycm/CMakeFiles/ycm_support_libs.dir/rule' failed
make[1]: *** [ycm/CMakeFiles/ycm_support_libs.dir/rule] Error 2
Makefile:148: recipe for target 'ycm_support_libs' failed
make: *** [ycm_support_libs] Error 2


Do you have any ideas or experience on how to fix this?

Best regards,

whitedwarf


System/versions: win7-64, cygwin64 with cygwin-gcc installed in 32- and
64-bit versions, https://github.com/Valloric/YouCompleteMe

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: YouCompleteMe build fails: problem with LONG_BIT in pyport.h or ld missing python lib
  2013-11-06 15:10 YouCompleteMe build fails: problem with LONG_BIT in pyport.h or ld missing python lib Whitedwarf
@ 2013-12-19 12:45 ` D
  2013-12-19 14:02   ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: D @ 2013-12-19 12:45 UTC (permalink / raw)
  To: cygwin

Whitedwarf <whitedwarf <at> tura-home.de> writes:

> 
> Hi all,
> 
> I'm trying to install (i.e., mainly, build) the vim plugin YouCompleteMe
> in cygwin64 on a x86_64 machine and got stuck.
> 
> The first error message was
> 
> [ 11%] Building CXX object
> BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/
arg_to_python_base.cpp.o
> In file included from /usr/include/python2.7/Python.h:58:0,
>                  from
> /home/matu_gr/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/
detail/wrap_python.hpp:142,
>                  from
> /home/matu_gr/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/
detail/prefix.hpp:13,
>                  from
> /home/matu_gr/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/
handle.hpp:8,
>                  from
> /home/matu_gr/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/
converter/arg_to_python_base.hpp:7,
>                  from
> /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?)."
>   ^
> BoostParts/CMakeFiles/BoostParts.dir/build.make:402: recipe for target
> 'BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/
arg_to_python_base.cpp.o'
> failed
> make[3]: ***
> [BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/
arg_to_python_base.cpp.o]
> Error 1
> CMakeFiles/Makefile2:78: recipe for target
> 'BoostParts/CMakeFiles/BoostParts.dir/all' failed
> make[2]: *** [BoostParts/CMakeFiles/BoostParts.dir/all] Error 2
> CMakeFiles/Makefile2:212: recipe for target
> 'ycm/CMakeFiles/ycm_support_libs.dir/rule' failed
> make[1]: *** [ycm/CMakeFiles/ycm_support_libs.dir/rule] Error 2
> Makefile:148: recipe for target 'ycm_support_libs' failed
> make: *** [ycm_support_libs] Error 2
> 
> I've tried to work around with (as mentioned in
> https://github.com/Valloric/YouCompleteMe/issues/66 )
> 
> -DPYTHON_INCLUDE_DIR=/usr/include/python2.7
> -DPYTHON_LIBRARY=/usr/lib/libpython2.7.dylib
> 
> but this did not help. (CMake configuration reports the same libs if not
> provided explicitly anyway.)
> 
> Then I've tried to reset the compilers CMake uses: using
> -DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER, I've set the compilers
> first to /usr/bin/x86_64-pc-cygwin-gcc and
> /usr/bin/x86_64-pc-cygwin-g++, respectively; then to
> /usr/bin/i686-pc-cygwin-gcc and /usr/bin/i686-pc-cygwin-g++. But now I 
get:
> 
> Linking CXX shared library ycm_core.pyd
> /usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld:
> cannot find -lpython2.7
> collect2: Fehler: ld gab 1 als Ende-Status zurück
> ycm/CMakeFiles/ycm_core.dir/build.make:390: recipe for target
> 'ycm/ycm_core.pyd' failed
> make[3]: *** [ycm/ycm_core.pyd] Error 1
> CMakeFiles/Makefile2:168: recipe for target
> 'ycm/CMakeFiles/ycm_core.dir/all' failed
> make[2]: *** [ycm/CMakeFiles/ycm_core.dir/all] Error 2
> CMakeFiles/Makefile2:212: recipe for target
> 'ycm/CMakeFiles/ycm_support_libs.dir/rule' failed
> make[1]: *** [ycm/CMakeFiles/ycm_support_libs.dir/rule] Error 2
> Makefile:148: recipe for target 'ycm_support_libs' failed
> make: *** [ycm_support_libs] Error 2
> 
> Do you have any ideas or experience on how to fix this?
> 
> Best regards,
> 
> whitedwarf
> 
> 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.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: YouCompleteMe build fails: problem with LONG_BIT in pyport.h or ld missing python lib
  2013-12-19 12:45 ` D
@ 2013-12-19 14:02   ` Corinna Vinschen
  0 siblings, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2013-12-19 14:02 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2657 bytes --]

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 #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-19 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-06 15:10 YouCompleteMe build fails: problem with LONG_BIT in pyport.h or ld missing python lib Whitedwarf
2013-12-19 12:45 ` D
2013-12-19 14:02   ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).