Ultimaker / libArcus

Communication library between internal components for Ultimaker software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I get SIP on Windows?

sunheat opened this issue · comments

commented

Hi team, I'm only here asking because I got the following error while trying to build Cura using cura-build on native Windows. Stop me right here and point me the right path if there is a way around it (building libArcus, or SIP in turn).

CMake Error at C:/Users/yyshe/git/libArcus/build/ArcusConfig.cmake:35 (include):
  include could not find requested file:

    C:/Users/yyshe/git/libArcus/build/Arcus-targets.cmake
Call Stack (most recent call first):
  projects/CuraEngine.cmake:1 (find_package)
  CMakeLists.txt:106 (include)

So according to the last post on this issue: Ultimaker/CuraEngine#927
I think I am supposed to build libArcus. I did try finding an already built binary copy of libArcus for Windows but couldn't find it anywhere on the internet about 2 months ago. Stop me right here if there is a shortcut.

Anyway, without a shortcut, I tried to build libArcus, and got this error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'sip'
CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find SIP (missing: SIP_EXECUTABLE SIP_INCLUDE_DIRS)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindSIP.cmake:86 (find_package_handle_standard_args)
  CMakeLists.txt:47 (find_package)

I looked everywhere on the internet for a sip.exe but couldn't find any. So I tried to build it. There aren't much documentation around how to do it, so I tried pip, https://riverbankcomputing.com/software/sip/download and somewhere I can download the source file for the latest version (which is supposed to be already installed when I used pip). No success. I tried python configure.py and nmake with the 4.19.25 version, got the following error:

sip.pyd : fatal error LNK1120: 146 unresolved externals
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.EXE"”: Return code “0x460”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"”: Return code “0x2”
Stop.

Help? Please?

Stop me right here and point me the right path if there is a way around it (building libArcus, or SIP in turn).

There is a way around it, but as a result you won't be able to use Cura's front-end. You'd only be able to use CuraEngine as a command-line program, and won't be able to use the profiles that come with Cura. Not recommended.

I did try finding an already built binary copy of libArcus for Windows but couldn't find it anywhere on the internet about 2 months ago. Stop me right here if there is a shortcut.

You could install the mainline Cura releases and pick out the Python package for Arcus from the installation folder (Arcus.pyd in the lib subfolder). However Arcus comes distributed in two parts: One side for Python and the other side for C++. The C++ part is packed into CuraEngine.exe so you can't just copy it there. For a full build of Cura you'll need to build Arcus indeed. And for that you'll need Sip.

Sip is one of the most annoying dependencies since there is hardly any community around it as far as I could find, and documentation by Riverbank is indeed quite sparse.

We have instructions on how to build Sip and Arcus for running Cura from source in the wiki of Cura: https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-Windows#sip
The instructions there seem quite straightforward, and are indeed what you've already done. However note that they depend on having executed the instructions before it. In particular:

  • Use the x64 Native Tools Command Prompt for VS 2019, rather than just any command line program.
  • Make sure you use Python 3.8.

Also note that you'll have to run this a second time for CuraEngine, but using MinGW, as listed here: https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-Windows#curaengine This is because CuraEngine only supports compilation with MinGW, but Python bindings need to be compiled with MSVC.