Building Panda3D with MSVC 2015 and Python 3.5/3.6

Return to Panda Features in Development

Building Panda3D with MSVC 2015 and Python 3.5/3.6

Postby rdb » Tue Apr 19, 2016 9:06 am

Since it is a pain to install the Windows 7 SDK, we often get asked why we haven't switched to MSVC 2015 already. The reason is that we still need to support Windows XP for a non-negligible number of Panda users, and MSVC 2010 is the latest compiler to support it. Given the sizeable market share of Windows XP, I think it would be unwise to drop support for it.

However, since Python 3.5 switched to MSVC 2015 and dropped Windows XP support, it might be a good idea to support both by using 2015 for the Python 3.5 builds, but still keep offering Python 2.7 and 3.4 builds compiled with MSVC 2010 for those who need to continue to support Windows XP.

So, building Panda with MSVC 2015 is now possible. You will need the latest GitHub clone of Panda3D, as well as these thirdparty packages, which include a copy of Python 3.5.3 and 3.6.1:
http://rdb.name/thirdparty-vc14-x64.7z (64-bit)
http://rdb.name/thirdparty-vc14.7z (32-bit)
You will also need to install the Windows 10 SDK.

Use this makepanda command to build it:
Code: Select all
thirdparty\win-python3.5-x64\python.exe makepanda/makepanda.py --everything --msvc-version=14 --windows-sdk=10

(add --threads and --installer options as desired of course.)

The only package missing that's worth mentioning is libRocket. It cannot be built since it does not support Python 3 at this point.

I've created a CMake script that will build all the thirdparty packages from source code. I've put it here:
https://github.com/rdb/panda3d-thirdparty
This can be used to easily rebuild the thirdparty packages for a different compiler, or using a different version. Feel free to contribute to the script to add missing packages.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby rdb » Fri Apr 22, 2016 10:25 am

Updated to include the remainder of the packages.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby rdb » Tue May 03, 2016 12:42 pm

OpenEXR has been added. The Python build now also comes with pip, by user request.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby Asimov » Mon Oct 24, 2016 6:09 pm

Is there any chance that you could give some instructions on how to do this.
I have downloaded the thirdparty zip and the latest github panda, and haven't a clue what to do.

I am using windows 10.
Asimov
 
Posts: 14
Joined: Sat Oct 15, 2016 8:55 pm

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby cbrunner » Tue Oct 25, 2016 2:59 pm

I was able to build most of the dependencies with the cmake script, except for openssl, which gives an error about not being able to find panda3d-thirdparty\openssl-ms.bat. Ring any bells?
-= Chris
cbrunner
 
Posts: 2
Joined: Tue Mar 20, 2012 6:52 pm

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby rdb » Mon Oct 31, 2016 4:18 pm

@Asimov: all you need to do is extract the thirdparty directory into the Panda source directory, open a command prompt, change to the Panda source directory using "cd", and type the command at the top of this thread in order to commence the build.

@cbrunner: Sorry, my bad, I guess I had forgotten to push that file. Fixed now.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby cbrunner » Mon Oct 31, 2016 5:11 pm

Getting further in the build process, but now I'm seeing this:

Code: Select all
(CustomBuild target) ->
  c:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp\contrib\open3dgc\o3dgcTimer.h(38): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory (compiling source file C:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp\code\glTFExporter.cpp) [C:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp-build\code\assimp.vcxproj] [C:\repos\panda3d-thirdparty\build\assimp.vcxproj]
  c:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp\contrib\open3dgc\o3dgcTimer.h(38): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory (compiling source file C:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp\code\glTFImporter.cpp) [C:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp-build\code\assimp.vcxproj] [C:\repos\panda3d-thirdparty\build\assimp.vcxproj]
  c:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp\contrib\open3dgc\o3dgcTimer.h(38): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory (compiling source file C:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp\code\glTFExporter.cpp) [C:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp-build\code\assimp.vcxproj] [C:\repos\panda3d-thirdparty\build\assimp.vcxproj]
  c:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp\contrib\open3dgc\o3dgcTimer.h(38): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory (compiling source file C:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp\code\glTFImporter.cpp) [C:\repos\panda3d-thirdparty\build\assimp-prefix\src\assimp-build\code\assimp.vcxproj] [C:\repos\panda3d-thirdparty\build\assimp.vcxproj]
-= Chris
cbrunner
 
Posts: 2
Joined: Tue Mar 20, 2012 6:52 pm

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby rdb » Tue Nov 01, 2016 7:20 am

Looks to be an issue in the Assimp project. The relevant header expects WIN32 to be defined instead of _WIN32. If you don't need assimp you can comment out the relevant part in the CMake file. I'll talk to the Assimp people about getting this fixed.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby rdb » Wed Nov 02, 2016 2:13 pm

Upstream merged my fix, and it should be good now.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby Eklyth » Thu Nov 24, 2016 2:08 pm

I have downloaded the repository from Github and the third party package is present. However, I want to use the python package I currently have on my computer (python 3.5.2 through Anaconda) on my windows 10 machine.

Due to the fact that I have the package of python I want to use not being located under the thirdparty directory, the script is complaining to me about not finding the python.exe file under the thirdparty directory. I do have the instance of python under the system path for python.

What do I need to change so I can compile and install panda3d as a package to my anaconda instance of python?

it would be great if I could tell it something like this:
Code: Select all
python makepanda/makepanda.py

etc. and not have it look for an instance of python under it's own directory and instead use the one I have.
Eklyth
 
Posts: 4
Joined: Sat Jan 03, 2015 1:29 am

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby rdb » Wed Nov 30, 2016 6:45 am

Rather than running makepanda.bat, you need to run makepanda.py explicitly with the version of Python you would like to use. For example:
Code: Select all
thirdparty\win-python3.5-x64\python.exe makepanda/makepanda.py --everything --msvc-version=14 --windows-sdk=10
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby Eklyth » Wed Nov 30, 2016 9:58 pm

Thanks for responding.
I am pointing to the .py and not the .bat file. The problem seems to be that there is the expectation that the python.exe file is located under the thirdparty folder (which it is not).
I have a version of python installed on my machine that I would like to use, but this is not in the pre-defined path that the script is checking, and subsequently I get this error:
Code: Select all
Could not find thirdparty/win-python3.5-x64/python.exe!
Eklyth
 
Posts: 4
Joined: Sat Jan 03, 2015 1:29 am

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby rdb » Fri Dec 02, 2016 5:56 am

Ah, yes. Makepanda currently expects the copy of Python to be in the thirdparty dir since it wants to bundle it along into the installer.

I suggest that you either copy (or perhaps symlink) the entire Python installation directory to the thirdparty dir. Otherwise, you could try editing makepandacore.py, looking for SdkLocatePython, and set SDK["PYTHON"], SDK["PYTHONVERSION"] and SDK["PYTHONEXEC"] yourself.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby P1trs » Tue Dec 13, 2016 11:39 am

I dont have W10 SDK, Im using W7 + VS2015, I tried it and got this:
Code: Select all
C:\Users\Peter\Desktop\panda3d>thirdparty\win-python3.5-x64\python.exe makepanda/makepanda.py --everything --msvc-version=14 --windows-sdk=8.1 --verbose
Version: 1.10.0
Using Python 3.5 build located at thirdparty/win-python3.5-x64
Using Windows SDK 8.1 located at C:\Program Files (x86)\Windows Kits\8.1\
Using Visual Studio 14.0 located at C:\Program Files (x86)\Microsoft Visual Studio 14.0\
Using compiler: MSVC
Host OS: windows
Host arch: x64
Target OS: windows
Target arch: x64
Using thirdparty directory: thirdparty/win-libs-vc14-x64/
WARNING: Could not locate thirdparty package fftw, excluding from build
WARNING: Could not locate thirdparty package opencv, excluding from build
WARNING: Could not locate thirdparty package awesomium, excluding from build
WARNING: Could not locate thirdparty package rocket, excluding from build
Writing built_x64/pandac/extension_native_helpers.py
Writing built_x64/etc/Config.prc
Writing built_x64/etc/Confauto.prc
mt -inputresource:"thirdparty/win-python3.5-x64\python.exe";#1 -out:"built_x64/tmp/python.manifest" -nologo
Storing dependency cache.
Elapsed Time: 1 sec
Cannot find mt on search path
Build terminated.
P1trs
 
Posts: 47
Joined: Sun Jan 06, 2013 7:39 pm
Location: Czech Republic

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby rdb » Wed Dec 14, 2016 6:26 am

Hmm, odd. I've never tried building with the Windows 8.1 SDK though.

Could you try running the command it's complaining about in the Visual Studio Command Prompt, to see what kind of error message you get?
Code: Select all
mt -inputresource:"thirdparty/win-python3.5-x64\python.exe";#1 -out:"built_x64/tmp/python.manifest" -nologo
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby P1trs » Thu Dec 15, 2016 12:46 am

Good news. There are several command prompts. If I try to compile in: VS2015 x64 Native Tools Command Prompt, it works. :wink:
P1trs
 
Posts: 47
Joined: Sun Jan 06, 2013 7:39 pm
Location: Czech Republic

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby aniki95 » Tue Mar 28, 2017 12:45 am

i cant compile using the thirdparty, it get stuck at 24%, exactly building composite2.obj, any idea what could be wrong? could anyone compile it (i just really need assimp) and upload it for me?
aniki95
 
Posts: 5
Joined: Fri Mar 24, 2017 1:32 pm

Re: Building Panda3D with MSVC 2015 and Python 3.5

Postby rdb » Wed Mar 29, 2017 8:22 am

composite2.obj doesn't tell me anything; that's not the complete file. I suspect it's merely a big file, though, so I would suggest you wait.

You could use --no-eigen in the compilation flags to get a significantly faster build. You should also use --threads 2 (or as many cores as you can spare) to significantly speed up the build.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5/3.6

Postby rdb » Mon Apr 03, 2017 7:30 am

Some updates, a few new and a few old:

* Python 3.6.1 is now included.
* I have posted 32-bit versions of the thirdparty packages.
* The buildbot now uses VS 2015 to produce the Python 3.5 and 3.6 builds.
* Panda now compiles successfully on the Express version of VS 2015.
* Makepanda now also builds assimp on Windows.
* The thirdparty packages have been built against the v140_xp toolset for Windows XP compatibility.
* It is no longer necessary to set makepanda to use the Windows 10 SDK; leaving it on the 7.1 SDK will keep the build compatible with Windows XP. You will still need the Windows 10 SDK installed for the Universal CRT, however.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5/3.6

Postby rdb » Mon May 01, 2017 5:09 pm

Updates:

* Assimp has been updated with a custom bugfix to prevent a crash on library load.
* HarfBuzz is now included.
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Re: Building Panda3D with MSVC 2015 and Python 3.5/3.6

Postby pavr » Sun Jul 23, 2017 5:03 pm

Hi, thanks a lot for the tools to compile with VS2015, although I'm not able to make it run properly.
I get messages complaining about the options --msvc-version and --windows-sdk. It says they're not supported

See the output I get when running from the VS2015 Native Tools Command Prompt console:
Code: Select all
c:\Panda\panda3d-1.9.4>thirdparty\win-python3.5-x64\python.exe makepanda/makepanda.py --everything --msvc-version=14 --windows-sdk=10 --verbose

Error parsing command-line input: option --msvc-version not recognized

Makepanda generates a 'built' subdirectory containing a
compiled copy of Panda3D.  Command-line arguments are:

  --help            (print the help message you're reading now)


If I remove '--msvc-version', then complains about '--windows-sdk', in fact, any of these two options appears when I run the tool just with '--help' to see the available options.

I copied your thirdparty-vc14-x64.7z, and decompress its contents into a the folder 'thirdparty' in the sources of Panda3d-1.9.4. Am I missing anything?.

From the compiler (2015) and SDK (v10) everything seems correctly installed in my computer.

Thanks a lot
pavr
 
Posts: 1
Joined: Sun Jul 23, 2017 4:35 pm

Re: Building Panda3D with MSVC 2015 and Python 3.5/3.6

Postby rdb » Mon Jul 24, 2017 3:49 pm

1.9.4 does not support building with MSVC 2015. You need to check out the latest master version of Panda from GitHub:
https://github.com/panda3d/panda3d
rdb
 
Posts: 11173
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands


Return to Panda Features in Development

Who is online

Users browsing this forum: No registered users and 1 guest