TALP-UPC / FreeLing

FreeLing project source code
Other
252 stars 96 forks source link

Building from source on Windows with PHP API #84

Closed Sedaj closed 5 years ago

Sedaj commented 5 years ago

Hello,

i've tried to build v4.1. from source and I'm currently stuck on unsuccessful installation. Note that i am not c++ programmer.

Installed software:

Windows 7 
1. VS community with C++ compiler (2017)
2. .NET Framework 4.7
3. cMake 3.13.1
4. zlib 1.2.11 built from source
5. boost 1.68.0 x64
6. ICU v57.1
7. Python 2.7.15
8. Swig 3.0.12

Command, that i've used to build freeling

cmake .. -DCMAKE_INSTALL_PREFIX=C:\FREELING\freeling -DZLIB_INCLUDE_DIR=C:\FREELING\dependencies\zlib\include -DZLIB_LIBRARY=C:\FREELING\dependencies\zlib\lib\zlibd.lib -DBOOST_ROOT=C:\FREELING\dependencies\boost -DICU_ROOT=C:\FREELING\dependencies\icu -DSWIG_DIR=C:\FREELING\dependencies\swig -DSWIG_EXECUTABLE=C:\FREELING\dependencies\swig\swig.exe -DPHP_API=ON -G "NMake Makefiles"

then

nmake install

I've followed the steps from https://talp-upc.gitbook.io/freeling-4-1-user-manual/installation/installation-source/installation-windows . I've read documentation several times, i tried the command without api support, i tried different versions of libraries, but i'm still not able to build it.

The cmake command went without problems, the nmake command returned:

[ 52%] Building CXX object src/libfreeling/CMakeFiles/freeling.dir/lang_ident/la
ng_ident.cc.obj
lang_ident.cc
Unknown compiler version - please run the configure tests and report the results

C:\FREELING\freeling\src\libfreeling\lang_ident\lang_ident.cc(104): warning C426
7: 'argument': conversion from 'size_t' to 'int', possible loss of data
[ 53%] Building CXX object src/libfreeling/CMakeFiles/freeling.dir/language.cc.o
bj
language.cc
Unknown compiler version - please run the configure tests and report the results

C:\FREELING\freeling\src\libfreeling\language.cc(365): warning C4267: 'return':
conversion from 'size_t' to 'int', possible loss of data
C:\FREELING\freeling\src\libfreeling\language.cc(394): warning C4267: 'return':
conversion from 'size_t' to 'int', possible loss of data
C:\FREELING\freeling\src\libfreeling\language.cc(402): warning C4267: 'return':
conversion from 'size_t' to 'int', possible loss of data
C:\FREELING\freeling\src\libfreeling\language.cc(460): warning C4018: '>': signe
d/unsigned mismatch
C:\FREELING\freeling\src\libfreeling\language.cc(464): warning C4018: '>': signe
d/unsigned mismatch
C:\FREELING\freeling\src\libfreeling\language.cc(523): error C2039: 'list': is n
ot a member of 'freeling::word::iterator'
C:\FREELING\freeling\src\include\freeling/morfo/language.h(382): note: see decla
ration of 'freeling::word::iterator'
C:\FREELING\freeling\src\libfreeling\language.cc(523): error C2955: 'std::iterat
or': use of class template requires template argument list
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.1
6.27023\include\xutility(4293): note: see declaration of 'std::iterator'
C:\FREELING\freeling\src\libfreeling\language.cc(523): error C2039: '++': is not
 a member of 'std::iterator<_Category,_Ty,_Diff,_Pointer,_Reference>'
C:\FREELING\freeling\src\libfreeling\language.cc(564): error C2039: 'list': is n
ot a member of 'freeling::word::const_iterator'
C:\FREELING\freeling\src\include\freeling/morfo/language.h(411): note: see decla
ration of 'freeling::word::const_iterator'
C:\FREELING\freeling\src\libfreeling\language.cc(564): error C2039: 'const_itera
tor': is not a member of '`global namespace''
C:\FREELING\freeling\src\libfreeling\language.cc(564): error C3083: 'const_itera
tor': the symbol to the left of a '::' must be a type
C:\FREELING\freeling\src\libfreeling\language.cc(564): error C2039: '++': is not
 a member of '`global namespace''
C:\FREELING\freeling\src\libfreeling\language.cc(681): warning C4267: 'return':
conversion from 'size_t' to 'int', possible loss of data
C:\FREELING\freeling\src\libfreeling\language.cc(1337): warning C4267: '=': conv
ersion from 'size_t' to 'int', possible loss of data
C:\FREELING\freeling\src\libfreeling\language.cc(1340): warning C4267: '=': conv
ersion from 'size_t' to 'int', possible loss of data
C:\FREELING\freeling\src\libfreeling\language.cc(1381): warning C4267: '=': conv
ersion from 'size_t' to 'int', possible loss of data
C:\FREELING\freeling\src\libfreeling\language.cc(1384): warning C4267: '=': conv
ersion from 'size_t' to 'int', possible loss of data
C:\FREELING\freeling\src\libfreeling\language.cc(1598): warning C4267: '+=': con
version from 'size_t' to 'int', possible loss of data
C:\FREELING\freeling\src\libfreeling\language.cc(1604): warning C4267: 'return':
 conversion from 'size_t' to 'int', possible loss of data
NMAKE : fatal error U1077: 'C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\141
6~1.270\bin\Hostx64\x64\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017
\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '
0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017
\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '
0x2'
Stop.

any help will be apprieciated. Thanks

lluisp commented 5 years ago

I am not a windows programmer, but the message "Unknown compiler version - please run the configure tests and report the results" seems to point to some problem with the compiler (somet version issue probably)

You can try with "nmake VERBOSE=1" to see if you get more details about what is the problem

Maybe a MSVC forum would be more indicated. I found this: https://stackoverflow.com/questions/47004187/visual-studio-unknown-compiler-version-after-upgrading

It also seems a known issue related to boost and MSVC17, not to FreeLing: https://studiofreya.com/2018/01/06/visual-studio-2017-with-cpp17-and-boost/

Sedaj commented 5 years ago

ok i have successfully built version 4.0 with Visual Studio 2013 on Windows 7. Thank you for help