screenshot_20170124_095958
3DPrinting, Atelier, KDE, Qt

Crafting AtCore on Windows

After a lot of VM’s and a lot of patience(or not), I was able to Craft AtCore on Windows.

Craft is the evolution of Emerge, a tool that KDE developed to cross compile KDE applications to Windows and Mac. Since the goal of Atelier project is to reach all those environments, we need to use it.

So far on my knowledge, Craft is mostly written in Python. A lot of scripts to manage KDE frameworks, Qt, and other dependencies.

Since Atelier isn’t ready, for now just AtCore was craft.

The first step was to write a Recipe for AtCore inside Craft. The recipe is the script that will manage the repository and dependencies that the project needs to be built.

AtCore dependencies are Extra CMake Files, QtBase, QtSerialPort and Solid.

Extra CMake Files is a KDE module to add more features to CMake. QtBase and QtSerialPort are the Qt part of the project and Solid is to manage to connect/disconnect of serial devices on the host. So this is the code:


import info
from CraftConfig import * 

class subinfo( info.infoclass ):
def setTargets( self ):
self.svnTargets[ 'master' ] = '[git]kde:atcore|master'
self.defaultTarget = 'master'
self.shortDescription = "the KDE core of Atelier Printer Host" 

def setDependencies( self ):
self.buildDependencies["frameworks/extra-cmake-modules"] = "default"
self.dependencies["libs/qtbase"] = "default"
self.dependencies["libs/qtserialport"] = "default"
self.dependencies["frameworks/solid"] = "default" 

from Package.CMakePackageBase import * 

class Package( CMakePackageBase ):
def __init__( self ):
CMakePackageBase.__init__( self )

After that, we need to setup the Windows environment. So I used an Oracle Virtual Box with a Windows 10 iso. I setup like 6 VM’s until I got success. In the beginning, I had an issue related to some libs missing, but that was my mistake, but since I thought that I screwed up things, I did a new VM. But then I started to have some Python issues, that neither me or Hannah(The maintainer of Craft) could discover why. But for some reason after a new VM configured I was able to install Craft. And after that my dummiest mistake. On Craft manual says: “In order to compile the Qt5 qtbase package with MinGW you will also need to install the Microsoft DirectX SDK, make sure to open a new command line window after the installation.” However, for some reason, I just saw that I need it to install DirectX, forgot totally about the SDK part. When I finally was able to read the output of the error, I saw what I was missing. And then, I left my laptop(4G, I5, 2 cores for the VM) burning for like 3 hours to compile everything.

16251985_1222556734486904_6890286130932095368_o
Living dangerously

Those are the steps that I did to be able to Craft AtCore, if you want to test it, please follow the instructions:

  1. Install DirectX SDK;
  2. Install Git;
  3. Install Python(Make sure to add Python to your PATH);
    1. If you don’t want to install Python, Craft can do it for you;
  4. Open a PowerShell instance like Administrator;
  5. Run this command:
     Set-ExecutionPolicy RemoteSigned
  6. Close the PowerShell instance and open again as a normal user;
  7. Run this command:
    iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/KDE/craft/master/setup/install_craft.ps1'))
    1. The above command will fetch craft and do the initial setup of the tool.
    2. Follow the instructions that appear to you on the PowerShell
  8. After the setup is finished run:
    1. craft runtime
      1. It will install the base libs that you will need to your project.
    2. craft atcore
      1. It will compile all the dependencies of AtCore project. That will take a while based on your hardware configuration.
    3. craft atcore run install
      1. This will install AtCore

After that you should be setup. So on R:/bin you should find the AtCoreTest.exe to run.

I only was able to  run the bin with Craft environment active. If you shutdown your PC, when it goes on you need to open the PowerShell again and run:

C:\KDE\craft\kdeenv.ps1

I was able to make my Arduino Mega a shared device in the VBox and it appeared on AtCore, however we discovered a problem with the path used to install the plugins of the Firmwares, and they weren’t found by AtCoreTest, so I wasn’t able to load a plugin, but I can send unitary commands to the Arduino and worked fine. The Atelier team already discover what was causing the problem, so it will be fixed soon.

Note: If you want to test it, it’s on you. =D

Please join our channel on freenode IRC #kde-atelier or our group at Telegram and give us feedback!

Advertisements

3 thoughts on “Crafting AtCore on Windows”

  1. If it helps, I have solved heating problems of my old laptop by spraying some contact cleaner inside the cooler openings. I guess it helps taking dust off the heat sink.

    BTW, great job ! AtCore seems to be shaping up nicely.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s