26 April, 2014

SublimeText & clang on Windows

After getting Intel compiler to play nice with SublimeText and SCons on Windows, the next target was getting it to use clang. The LLVM environment on Windows requires the MinGW base package for headers and libs, and I decided to use the MinGW-x64 prebuilt mingw-builds distribution from http://mingw-w64.sourceforge.net/download.php#mingw-builds

However, the headers do not play nice with clang and -Wall, with a bunch of typedef and macro redefinitions. I ended up adding

env.Append( CFLAGS=['-Wno-ignored-attributes', '-Wno-typedef-redefinition', '-Wno-undef',
'-Wno-unknown-pragmas', '-Wno-redundant-decls', '-Wno-shadow'] )

to my SConscript environment setup in order to get it to build, only to be greeted with a bunch of alignmen cast compilation warnings and then multiple definition errors when linking

lib\win64\debug/libfoundation.a(log.o): In function `GetCurrentFiber':
D:\dev\mingw\include/winnt.h:8139: multiple definition of `GetCurrentFiber'
lib\win64\debug/libfoundation.a(main.o):D:\dev\mingw\include/winnt.h:8139: first defined here
lib\win64\debug/libfoundation.a(log.o): In function `GetFiberData':
D:\dev\mingw\include/winnt.h:8140: multiple definition of `GetFiberData'

More to follow

22 April, 2014

Rampant Kittens

My block-drop game Rampant Kittens is now available on Google Play. Give it a shot! https://play.google.com/store/apps/details?id=com.rampantpixels.p1



I'm slowly cleaning up, refactoring and releasing the code for the game as well, available on github. To begin with the platform abstraction foundation: https://github.com/rampantpixels/foundation_lib

13 April, 2014

SCons & SublimeText - Intel compiler

In order to get SCons to play nice with the Intel compiler suite version 14 (or later) on Windows it seems the intelc.py tool definition in SCons needs to be updated a bit. The layout of keys in the registry have changed and the directory layout as well.

The registry keys are now chained, so first it needs to look in
HKLM/Software/Wow6432Node/Intel/Suites/<version>/Defaults/C++/<abi> 
to find the UUID of the instance to use, then look in
HKLM/Software/Wow6432Node/Intel/Suites/<version>/<uuid>/C++/<abi>
for the various values to use for locating compiler binaries. I modified the abi strings used in the SCons intelc.py tools match the EM64T_NATIVE and IA32 strings in the 14.0 compiler release, and rewrote the get_all_compiler_versions and get_intel_registry_value functions to use this chained default -> uuid registry lookup. You can get the final modified intelc.py tool from http://www.rampantpixels.com/pub/intelc.py.

This together with the default and mslib tools (basically passing tools=['default','intelc','mslib'] to the Environment construction) allows my SCons construction environment to compile my foundation library with the Intel compiler suite within SublimeText 3. Great success!

11 April, 2014

SublimeText & SCons - part one

First step in my goal to make a decent development environment on Windows using SublimeText 3, SCons and clang (or failing that, Intel compiler suite) is to make SublimeText able to use SCons as a build system.

As a sandbox I will use my public domain foundation library available at https://github.com/rampantpixels/foundation_lib (you can find the SCons build scripts in there for reference).

To begin with, I create a SublimeText project and add the main source directory as a folder in the project. I save the project in the build subdirectory as I hate cluttering the main directory with project files. I also add a project local build system defintion for scons:
{
 "folders":
 [
  {
   "follow_symlinks": true,
   "path": "..\\foundation"
  }
 ],
 "build_systems":
 [
  {
   "name": "SCons",
   "shell_cmd": "scons",
   "working_dir": "${project_path:${folder:${file_path}}}\\..",
  }
 ]
}
Trying it out by selecting SCons as the build system and starting a build results in
scons: Reading SConscript files ...
Building on win32 (x86_64) for  ()
Building RELEASE configuration
scons: done reading SConscript files.
scons: Building targets ...
cl /Fobuild\scons\release-\tools\bin2hex\main.obj /c tools\bin2hex\main.c /nologo /DBUILD_RELEASE=1 /I. /Itools
scons: *** [build\scons\release-\tools\bin2hex\main.obj] error : (2, 'CreateProcess', 'The system cannot find the file specified.')
So now I need to modify my SCons build scripts to use clang and/or Intel toolchain. I decided to go with Intel since I already had that installed on my system, and adding intelc as tools to the SCons environment creation should do the trick. However, the Intel tool setup and version detection is really outdated in SCons, so next step will be to modify this to support version 14.

10 April, 2014

Abandon Visual Studio

I've got a new pet project - abandon Visual Studio for Windows development and instead setup a decent environment using SublimeText, SCons and clang and/or Intel compiler suite. I will post any progress and useful scripts/configs/tools here.