AcuSolve comes with utilities to compile User Defined Functions (UDF) on both Windows and Linux. The following instructions provide instructions on how to use these utilities to compile a UDF.
Linux:
UDFs are compiled on Linux using the acuMakeLib script. This script uses the gcc compiler by default. If gcc is installed, acuMakeLib will use the gcc command to compile and link the udf. The following example will compile a UDF named usrInflow.c using an optimization level of 3:
acuMakeLib -src usrInflow.c -opt O3
Windows:
Microsoft Visual Studio Express 2012 provides a free compiler that can be used on Windows 7 and newer macines for both 32 bit and 64 bit applications. The compiler can be downloaded from the following link:
http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-for-windows-desktop
Be sure to select 'Visual Studio 2012 Express for Windows Desktop' when downloading.
Once the package is downloaded and installed, you will need to configure your environment such that the compiler shows up in your path. This can be accomplished through manipulation of the PATH environment variable, but is more easily accomplished using the following procedure:
1.) Launch the command prompt for the compiler (assuming a 64 bit Windows machine). The proper start menu link is as follows: Start-->All Programs-->Microsoft Visual Studio 2012-->Visual Studio Tools-->VS2012 x64 Cross Tools Command Prompt
<?xml version="1.0" encoding="UTF-8"?>
2.) Execute the 'acusim.bat' file from within the Visual Studio command prompt. This will set up the AcuSolve environment. An easy way to accomplish this is by copying the 'Target' of the AcuSovle Cmd Prompt desktop icon and pasting it into the VS command prompt.
<?xml version="1.0" encoding="UTF-8"?>
3.) The UDF can then be compiled from the Visual Studio command prompt using the acuMakeDll script. Keep in mind that the message passing type you intend to use for the simulation must be compiled into the DLL on Windows. The following example will compile a UDF named usrInflow.c that is suitable for running using the Intel MPI message passing interface:
acuMakeDll -src usrInflow.c -mpi impi
More infomration on acuMakeDll and acuMakeLib are available in the AcuSolve Programs Reference Manual.