Tuesday, September 2, 2014

Parallel Compilation

Hello everybody!

I want to start the post #1 of this blog explaining a little bit about a tool that Microsoft implemented on MS Dynamics AX 2012 CU7 -- the parallel compilation. The official page of the parallel compilation is here.

Parallel compilation of an AOS was properly implemented on CU7 version of AX 2012 R2. There are some guys over the web that said that the parallel compilation works for older versions, like CU6. Particularly, I don't believe. I worked in a project that a full AOS compilation on CU6 took 12 ~ 13 hours. CU7 came to help us developers and build engineers to not waste time in a simple task!

Below we have a small script that performs the parallel compilation and also compile the IL code. Note: the axbuild.exe calculate the numbers of workers automatically according to the number of cores on server processor, as well as the process loaded on them.

Use this script only in development environments! Carefully!

SET ServiceName=AOS60$01
SET AOSHost=your_aos_name
SET AOSPort=2712
SET ServerPath="C:\Program Files\Microsoft Dynamics AX\60\Server\your_server_path\bin"
SET ClientPath="C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\bin"
SET AppExe="C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\bin\ax32.exe"

net stop %ServiceName%
net start %ServiceName%

cd\

cd %ServerPath%

axbuild.exe xppcompileall /s=01 /v /a=%ClientPath%

cd\

%AppExe% -aos2=%AOSHost%:%AOSPort% -startupcmd=compileil -lazytableloading -lazyclassloading

net stop %ServiceName%

net start %ServiceName%

If you don't want to run the IL compilation, just remove the line %AppExe% -aos2=%AOSHost%:%AOSPort% -startupcmd=compileil -lazytableloading -lazyclassloading.

Save this script as a batch file (extension .bat). With this, you can schedule tasks using Windows Server.

Enjoy DAXers!

Note: during the day, I pretend to improve this post. There are some more interesting details hidden on the command.

1 comment:

  1. This is great! I've seen a few answer about this, but this one is by far the best.

    ReplyDelete