Closed char101 closed 11 years ago
I would like some advice on this too. I was not able to get it to work, I am getting errors on the final step. Here's my console output for the last 2 steps:
JG@JG-PC ~/ycm_build
$ cmake -D"PYTHON_LIBRARIES:PATH=/cygdrive/c/Python27/libs/python27.lib" -D"PYT
HON_INCLUDE_DIRS:PATH=/cygdrive/c/Python27/include" -G "Unix Makefiles" . ~/vim
files/bundle/YouCompleteMe/cpp
-- The C compiler identification is GNU 3.4.4
-- The CXX compiler identification is GNU 3.4.4
CMake Warning at /usr/share/cmake-2.8.9/Modules/Platform/CYGWIN.cmake:15 (messag
e):
CMake no longer defines WIN32 on Cygwin!
(1) If you are just trying to build this project, ignore this warning or
quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or in
the CMake cache. If later configuration or build errors occur then this
project may have been written under the assumption that Cygwin is WIN32.
In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead.
(2) If you are developing this project, add the line
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
at the top of your top-level CMakeLists.txt file or set the minimum
required version of CMake to 2.8.4 or higher. Then teach your project to
build on Cygwin without WIN32.
Call Stack (most recent call first):
/usr/share/cmake-2.8.9/Modules/CMakeSystemSpecificInformation.cmake:36 (INCLUD
E)
CMakeLists.txt:19 (project)
-- Check for working C compiler: /usr/bin/gcc.exe
-- Check for working C compiler: /usr/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Your C++ compiler does NOT support C++11, compiling in C++03 mode.
-- Found PythonLibs: /cygdrive/c/Python27/libs/python27.lib (found suitable vers
ion "2.7.3", required is "2")
NOT using libclang, no semantic completion for C/C++/ObjC will be available
-- Found PythonInterp: /cygdrive/c/Python27/python.exe (found version "2.7.3")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /cygdrive/c/Users/JG/ycm_build
JG@JG-PC ~/ycm_build
$ make ycm_core .
Scanning dependencies of target BoostParts
[ 0%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/s
rc/gregorian/date_generators.cpp.o
[ 1%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/s
rc/gregorian/gregorian_types.cpp.o
[ 2%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/s
rc/gregorian/greg_month.cpp.o
[ 3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/s
rc/gregorian/greg_weekday.cpp.o
[ 3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/s
rc/posix_time/posix_time_types.cpp.o
[ 4%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/exception/s
rc/clone_current_exception_non_intrusive.cpp.o
[ 5%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/
src/codecvt_error_category.cpp.o
In file included from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/Boo
stParts/libs/filesystem/src/codecvt_error_category.cpp:22:
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/config.hpp:49:5: #error Configuration not supported: Boost.Filesystem V3 and
later requires std::wstring support
In file included from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/Boo
stParts/libs/filesystem/src/codecvt_error_category.cpp:23:
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:16:5: #error Configuration not supported: Boost.Filesystem V3
and later requires std::wstring support
In file included from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/Boo
stParts/libs/filesystem/src/codecvt_error_category.cpp:23:
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:64: error: `wstring' is not a member of `std'
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:64: error: `wstring' is not a member of `std'
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:64: error: template argument 1 is invalid
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:64: error: explicit specialization of non-template `<type err
or>'
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:98: error: `std::wstring' has not been declared
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:109: error: `std::wstring' has not been declared
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:150: error: `std::wstring' has not been declared
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp: In function `void boost::filesystem::path_traits::convert(co
nst wchar_t*, const wchar_t*, int&, const boost::filesystem::path_traits::codecv
t_type&)':
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:155: error: request for member `append' in `to', which is of
non-class type `int'
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp: At global scope:
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:160: error: `std::wstring' has not been declared
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp: In function `void boost::filesystem::path_traits::convert(co
nst wchar_t*, int&, const boost::filesystem::path_traits::codecvt_type&)':
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:164: error: invalid conversion from `const wchar_t*' to `int'
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp: At global scope:
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:177: error: expected unqualified-id before '&' token
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:177: error: expected `,' or `...' before '&' token
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp: In function `void boost::filesystem::path_traits::dispatch(i
nt)':
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:179: error: `c' undeclared (first use this function)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:179: error: (Each undeclared identifier is reported only once
for each function it appears in.)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:180: error: `to' undeclared (first use this function)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:180: error: `cvt' undeclared (first use this function)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:180: error: no matching function for call to `convert(<type e
rror>, <type error>, <type error>, <type error>)'
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:99: note: candidates are: void boost::filesystem::path_traits
::convert(const char*, const char*, int&, const boost::filesystem::path_traits::
codecvt_type&)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:105: note: void boost::filesystem::path_trait
s::convert(const wchar_t*, const wchar_t*, std::string&, const boost::filesystem
::path_traits::codecvt_type&)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:111: note: void boost::filesystem::path_trait
s::convert(const char*, int&, const boost::filesystem::path_traits::codecvt_type
&)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:120: note: void boost::filesystem::path_trait
s::convert(const wchar_t*, std::string&, const boost::filesystem::path_traits::c
odecvt_type&)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:132: note: void boost::filesystem::path_trait
s::convert(const char*, const char*, std::string&, const boost::filesystem::path
_traits::codecvt_type&)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:142: note: void boost::filesystem::path_trait
s::convert(const char*, std::string&, const boost::filesystem::path_traits::code
cvt_type&)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:152: note: void boost::filesystem::path_trait
s::convert(const wchar_t*, const wchar_t*, int&, const boost::filesystem::path_t
raits::codecvt_type&)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:162: note: void boost::filesystem::path_trait
s::convert(const wchar_t*, int&, const boost::filesystem::path_traits::codecvt_t
ype&)
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp: At global scope:
/cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/filesyst
em/path_traits.hpp:224: error: `std::wstring' has not been declared
BoostParts/CMakeFiles/BoostParts.dir/build.make:195: recipe for target `BoostPar
ts/CMakeFiles/BoostParts.dir/libs/filesystem/src/codecvt_error_category.cpp.o' f
ailed
make[3]: *** [BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/codecvt_e
rror_category.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:142: recipe for target `ycm/CMakeFiles/ycm_core.dir/rule' f
ailed
make[1]: *** [ycm/CMakeFiles/ycm_core.dir/rule] Error 2
Makefile:122: recipe for target `ycm_core' failed
make: *** [ycm_core] Error 2
@char101, can you elaborate on this:
Add these defined to the project definitions
BOOST_PYTHON_SOURCE
BOOST_ALL_NO_LIB
What file do I need to edit, and what exact edit do I need to make? Thanks.
I compiled it using visual studio 2012 express, so it may be different with gcc on cygwin.
@char101, Hmmm... do you know what these variables do? Did you give them values (paths?) or just set them to true?
I am like 3 hours deep into this process now (lolz!) and I think I am like 5 mins away from success, but it's an elusive 5 minutes.
BOOST_PYTHON_SOURCE -> this makes the library exports the function not imports them BOOST_ALL_NO_LIB -> this prevents boost autolinking
As I said, these are platform specific, so it may not be required with gcc in cygwin.
As your compile error, have you checked that the package libstdc++ has been installed.
@char101, I installed it, but am still getting the same compiler error. Anything else I can try?
I think you need to upgrade your gcc, it's pretty old. Latest version is 4.7.2.
@char101, I upgraded cygwin to use gcc 4.5.3. That got my further but not all the way. What do you make of this new error:
$ make ycm_core .
Scanning dependencies of target BoostParts
[ 0%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/date_generators.cpp.o
[ 1%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/gregorian_types.cpp.o
[ 2%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/greg_month.cpp.o
[ 3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/greg_weekday.cpp.o
[ 3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/posix_time/posix_time_types.cpp.o
[ 4%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/exception/src/clone_current_exception_non_intrusive.cpp.o
[ 5%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/codecvt_error_category.cpp.o
[ 6%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/operations.cpp.o
[ 7%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path.cpp.o
[ 7%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path_traits.cpp.o
[ 8%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/portability.cpp.o
[ 10%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/unique_path.cpp.o
[ 11%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/utf8_codecvt_facet.cpp.o
[ 11%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/windows_file_codecvt.cpp.o
[ 12%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/arg_to_python_base.cpp.o
In file included from /cygdrive/c/Python27/include/Python.h:86:0,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/python/detail/wrap_python.hpp:142,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/python/detail/prefix.hpp:13,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/python/handle.hpp:8,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/python/converter/arg_to_python_base.hpp:7,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/libs/python/src/converter/arg_to_python_base.cpp:6:
/cygdrive/c/Python27/include/intobject.h:45:35: error: expected initializer before ‘PyInt_AsUnsignedLongLongMask’
In file included from /cygdrive/c/Python27/include/Python.h:88:0,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/python/detail/wrap_python.hpp:142,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/python/detail/prefix.hpp:13,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/python/handle.hpp:8,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/boost/python/converter/arg_to_python_base.hpp:7,
from /cygdrive/c/Users/JG/vimfiles/bundle/YouCompleteMe/cpp/BoostParts/libs/python/src/converter/arg_to_python_base.cpp:6:
/cygdrive/c/Python27/include/longobject.h:49:44: error: ‘__int64’ was not declared in this scope
/cygdrive/c/Python27/include/longobject.h:51:1: error: ‘__int64’ does not name a type
/cygdrive/c/Python27/include/longobject.h:52:35: error: expected initializer before ‘PyLong_AsUnsignedLongLong’
/cygdrive/c/Python27/include/longobject.h:53:35: error: expected initializer before ‘PyLong_AsUnsignedLongLongMask’
/cygdrive/c/Python27/include/longobject.h:54:1: error: ‘__int64’ does not name a type
BoostParts/CMakeFiles/BoostParts.dir/build.make:379: 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:142: recipe for target `ycm/CMakeFiles/ycm_core.dir/rule' failed
make[1]: *** [ycm/CMakeFiles/ycm_core.dir/rule] Error 2
Makefile:122: recipe for target `ycm_core' failed
make: *** [ycm_core] Error 2
@char101, I implemented items 1. and 3. from your list. Still unsure about 2. though, so left that out. I'll take a closer look at it later.
@jonahx I strongly recommend using the Microsoft stack on Windows. You don't need to install the full Visual Studio, you can just use the Windows SDK which will come with all of the compilers and build tools you'll need.
@jonahx
Try adding -D"__int64=long long" to your cmake command line
@Valloric
I believe that when compiling with boost thread statically, the user is supposed to implement boost::tss_cleanup_implemented
@char101 Yeah I got the fact that YCM should be implementing it, it's just that how it's supposed to be implemented is what eludes me. I could just leave it empty, sure, and it seems that shouldn't be an issue, but it still leaves a bad taste in my mouth.
I'll probably just implement it as an empty function.
@char101 Could you please try to build YCM on Windows with the latest changes? You shouldn't have to make any modifications to get it to compile now, but I don't have a Windows machine nearby to verify. It would be great if you could.
@Valloric
I just tried to compile it. There are some things that still need to be fixed
The bind
and make_shared
issues seem strange to me since my files use a using declaration to specify that they want the boost versions.
It's obvious Windows support will have to wait until I try to compile it myself there, which should be soon.
That's because visual c++ uses argument dependent lookup so it found two version of the bind function.
@Valloric, I have installed the windows SDK per your suggestion, and also upbdated you script using ":BundleInstall!". I'm not sure what to do next, as it does not appear that the SDK installation put any binary name cmake in my path. Do I need to use another tool, or use another build process? Thanks.
You need to download and install cmake first. http://www.cmake.org/cmake/resources/software.html On Feb 5, 2013 9:28 PM, "jonahx" notifications@github.com wrote:
@Valloric https://github.com/Valloric, I have installed the windows SDK per your suggestion, and also upbdated you script using ":BundleInstall!". I'm not sure what to do next, as it does not appear that the SDK installation put any binary name cmake in my path. Do I need to use another tool, or use another build process? Thanks.
— Reply to this email directly or view it on GitHubhttps://github.com/Valloric/YouCompleteMe/issues/19#issuecomment-13167825.
I have the SDK and cmake, both successfully installed. The problem is that cmake needs a compiler configured, and "cl.exe" is missing from the windows SDK folder. I found this post about the problem:
and uninstalled everything relating to visual studio, searched both program files folders to make sure cl.exe was gone, then uninstalled and reinstalled the SDK, but still not cl.exe in it.
The latest windows SDK is not supplied with a compiler anymore. I suggest you install visual studio express 2012 (if runnning windows 7/8), it already included windows SDK or install visual studio express 2010 (if running xp) and install the windows SDK too.
@char101, Thanks. I have done that, and I seem to be making some progress. In cmake, I had to select Visual Studio 11. The configuration and the output of running it looks like this: http://i.imgur.com/UARCJt7.png
I am not sure what to do next. Running "make ycm_core ." resulted in:
make: *\ No rule to make target `ycm_core'. Stop.
Double click on the resulted .sln file in the build directory, the solution will open in visual studio IDE. Right click on ycm_core project and choose build.
In related news, would anyone be so kind to host a pre-compiled .exe
somewhere?
Here it is
https://docs.google.com/file/d/0BwihXEEuntymeW5iNndrVzNUYmc/edit?usp=sharing
Note
@char101 Thanks for sharing the .pyd
. Question though, what are the paths etc which you've configured?
Should I just put clang.dll
in YouCompleteMe/python/
? And where should ycm_core.pyd
go?
Anything else?
Thanks in advance!
@jbremer yes, you should put ycm_core.pyd and libclang.dll under YouCompleteMe/python. Later, if it works, you will need to configure .ycm_extra_conf.py as described in the F.A.Q.
@jbremer
That .pyd wasn't compiled with clang support. And you'd need to put in in youcompleteme/python directory. Does clang even compileable with visual studio?
Clang offers some binary packages on their website, including clang.dll
(which should then be renamed to libclang.dll
I think.)
If you'd be able to (try to) compile YouCompleteMe with clang
support, that'd be awesome, of course.. ;)
I was in fact able to get your DLL to work :) But it's a shame if we're not going to use the Clang support.
Could I impose for either a rebuild of the above ycm_core.pyd or instructions on getting this to work with cygwin? I am running into pretty much every error described above. When I downloaded @devfom file however, YCM Tells me that YCM Core is too old and I need to recompile. I do not have access to Visual Studio, as I am one of the few Satanist Windows users at my shop, and we don't do win development.
this plugin should be included by default on next Vim release :)
@Valloric, the problem with bind
and make_shared
still exists. As pointed above this is caused by ADL and I guess there is no other way to get this working on Windows other than correctly prefix this calls with boost::
. Current state is quite annoying because of necessity of fixing these calls by hand any time when C++ code base changes. If you wish, I can make a pull request for this change.
Pull request welcome for that, why wouldn't they be?
Could someone please build both a 32-bit and 64-bit version binaries of the pyd file?
Hi,
So, I have successfully compiled this on windows, and it works.
Here are some notes from my experience compiling it