Failed to build vim on Windows with DYNAMIC_PYTHON=yes and DYNAMIC_PYTHON3=no

156 views
Skip to first unread message

Masatoshi SUGIURA

unread,
Oct 3, 2015, 10:45:41 PM10/3/15
to vim_dev
Hi all,

I tried to build vim on Windows,
but the build is failed with DYNAMIC_PYTHON=yes and DYNAMIC_PYTHON3=no.

I tested like below (with Visual Studio 2010):

> set BASEDIR=%CD%
> set VS2012_64_VCVARS="c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
> call %VS2012_64_VCVARS% amd64
> cd %BASEDIR%\src
> nmake -f make_mvc.mak PYTHON="C:\Python27" PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON3="C:\Python34" PYTHON3_VER=34 DYNAMIC_PYTHON3=no

and it failes:

> cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 /Fo.\ObjCYHAMD64/ /Ox /GL -DNDEBUG /Zl /MT -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DFEAT_BIG /Fd.\ObjCYHAMD64/ /Zi /I "C:\Python34\Include" /I "C:\Python34\PC" if_python3.c
> if_python3.c
> if_python3.c(835) : error C2065: 'hinstPy3' : undeclared identifier
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
> Stop.

As far as I found out, build is only failed with the pattern is DYNAMIC_PYTHON=yes and DYNAMIC_PYTHON3=no and other pattern is OK.

I think this problem fixed with the attached diff.
Could check that?
fix_pydyn_py3nodyn.diff

Bram Moolenaar

unread,
Oct 4, 2015, 10:23:51 AM10/4/15
to Masatoshi SUGIURA, vim_dev
This function is only called once from if_python.c, when both python and
python3 are compiled in. And only for Unix. So the #if should use an
AND between DYNAMIC_PYTHON and DYNAMIC_PYTHON3 and UNIX.


--
How To Keep A Healthy Level Of Insanity:
15. Five days in advance, tell your friends you can't attend their
party because you're not in the mood.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

h_east

unread,
Oct 7, 2015, 7:21:04 AM10/7/15
to vim_dev, sgu...@gmail.com
Hi Bram,

2015-10-4 (Sun) 23:23:51 UTC+9 Bram Moolenaar:


> Masatoshi Sugiura wrote:
>
> > I tried to build vim on Windows,
> > but the build is failed with DYNAMIC_PYTHON=yes and DYNAMIC_PYTHON3=no.
> >
> > I tested like below (with Visual Studio 2010):
> >
> > > set BASEDIR=%CD%
> > > set VS2012_64_VCVARS="c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
> > > call %VS2012_64_VCVARS% amd64
> > > cd %BASEDIR%\src
> > > nmake -f make_mvc.mak PYTHON="C:\Python27" PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON3="C:\Python34" PYTHON3_VER=34 DYNAMIC_PYTHON3=no
> >
> > and it failes:
> >
> > > cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 /Fo.\ObjCYHAMD64/ /Ox /GL -DNDEBUG /Zl /MT -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DFEAT_BIG /Fd.\ObjCYHAMD64/ /Zi /I "C:\Python34\Include" /I "C:\Python34\PC" if_python3.c
> > > if_python3.c
> > > if_python3.c(835) : error C2065: 'hinstPy3' : undeclared identifier
> > > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
> > > Stop.
> >
> > As far as I found out, build is only failed with the pattern is
> > DYNAMIC_PYTHON=yes and DYNAMIC_PYTHON3=no and other pattern is OK.
> >
> > I think this problem fixed with the attached diff.
> > Could check that?
>
> This function is only called once from if_python.c, when both python and
> python3 are compiled in. And only for Unix. So the #if should use an
> AND between DYNAMIC_PYTHON and DYNAMIC_PYTHON3 and UNIX.

Not only Unix.
I think Masatoshi's patch is right.
And patch 7.4.890 is wrong.


Look for combination of DYNAMIC_PYTHON and DYNAMIC_PYTHON result on build.

enable DYNAMIC_PYTHON enable DYNAMIC_PYTHON3 Build result
yes yes OK
yes no NG <---- *1
no yes OK
no no OK

His patch fixes *1.

--
Best regards,
Hirohito Higashi (a.k.a h_east)

Bram Moolenaar

unread,
Oct 7, 2015, 8:37:46 AM10/7/15
to h_east, vim_dev, sgu...@gmail.com
I tried this on Unix and it works. The call does have #ifdef UNIX.
Perhaps there is another change that matters?

--
"So this is it," said Arthur, "we are going to die."
"Yes," said Ford, "except...no! Wait a minute!" He suddenly lunged across
the chamber at something behind Arthur's line of vision. "What's this
switch?" he cried.
"What? Where?" cried Arthur, twisting around.
"No, I was only fooling," said Ford, "we are going to die after all."
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

h_east

unread,
Oct 7, 2015, 9:48:46 AM10/7/15
to vim_dev, h.eas...@gmail.com, sgu...@gmail.com
Hi Bram,

2015-10-7 (Wed) 21:37:46 UTC+9 Bram Moolenaar:

Yes, I understood.
But in the case of Windows requires his patch.

Masatoshi SUGIURA

unread,
Oct 8, 2015, 11:45:46 AM10/8/15
to vim_dev
2015年10月7日水曜日 22時48分46秒 UTC+9 h_east:
Hi Bran and h_east,

I confirmed that my problem had been fixed with patch 7.4.890. Thank you for fixing it.

h_east

unread,
Oct 8, 2015, 12:01:15 PM10/8/15
to vim_dev
Hi, Masatoshi and Bram,

2015-10-9 (Fri) 0:45:46 UTC+9 Masatoshi SUGIURA:
Oh, I realy understand. Sorry for bad suggestion :-)
Reply all
Reply to author
Forward
0 new messages