Jump to content

Recommended Posts

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.
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
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: 
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
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.
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.

Share this post

Link to post
Share on other sites


I have encountered some problems in learning acusolve acu-4002, and I have been unable to run gravity.c file. My compiler software has been installed (VS2013), and the environment configuration has been completed according to the relevant information (Figure 1). However, the following problem was encountered in operation (Figure 2). The gravity. obj file cannot be found, nor can the. Dll file be generated.

I also tried to run gravity. C program separately in VS2013, but I also found many errors. (Fig. 3)

1. error LNK2019: Unparsable external symbol _udfCheckNumUsrVals, which is referenced in function _usrGravity

2. error LNK1120: Three unresolved external commands

3. IntelliSense: Undefined identifier "Integer"

4. IntelliSense: Undefined identifier "String"

5. IntelliSense: Undefined identifier "Void"

6. IntelliSense: Undefined identifier "Real"

I hope you can help me. Thank you very much.






Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...