Compiling Python Api in WIndows 10

Submitted by trying_to_code on Fri, 09/15/2017 - 03:05

Hi there. I'm familiar with Freeling from some years now. I'm trying to compile the python api in windows 10 with no luck yet. I've been learning a lot for a few months but I'm not really a coder (at all, actually I studied linguistics) so I thank in advance for any help I can get (hopefully understandable for me).

Im compiling the API with Visual C++ 2008 64bit Command Prompt, I have python 3.6 installed, freeling 4.0, MinGW, Boost 1.53, swigwin-3.0.12. I overcame some dificulties but I'm now completely stuck. The error says that it can't find boost/version.hpp and I checked many times and it is there. My environment variable is: 'C:\local\boost_1_53_0' and version is in path: 'C:\local\boost_1_53_0\boost\boost.hpp'. I tried changing boost path to ''C:\local\boost_1_53_0\boost\", but nothing. I think that it is looking for boost in the wrong place but no idea how to find that out and less how to correct it.

This is what I get:

C:\Users\bpwinter\Downloads\FreeLing-master (1)\FreeLing-master\APIs\python>nmake -f makefile

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

g++ -shared -o freeling_pythonAPI.cxx -lfreeling -IC:\freeling/include -LC:\freeling/lib -IC:\Python34\include -fPIC -std=gnu++0x
freeling_pythonAPI.cxx:1:0: warning: -fPIC ignored for target (all code is position independent)
/* ----------------------------------------------------------------------------
In file included from C:\freeling/include/freeling.h:33:0,
from freeling_pythonAPI.cxx:3281:
C:\freeling/include/freeling/version.h:36:29: fatal error: boost/version.hpp: No such file or directory
compilation terminated.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\g++.EXE"' : return code '0x1'

I am not very familiar with MSVC, but my guess is that command-line mode probably does not take into account environment variables (which are for the IDE compiler
So, I'd say you need to add the flag "-IC:\local\boost_1_53_0" to the compilation command.

If you manage to compile python API in windows, a Makefile and a small readme will be welcome by many users ;)