Language and Compiling
You can submit your subroutines as any of the following types of files:
■FORTRAN and/or C source files.
■Object file containing one or more user-written subroutines.
■File containing a list of source files, with one name per line.
To find out what type of compiler you need, read the hardware and software specifications that come with your Adams product (you can also see them at
http://support.mscsoftware.com). Also, for further instructions, refer to your compiler documentation and the hardware and software specifications.
Linux
You can either let Adams Toolbar run your compiler by supplying source files, or you can compile and link your subroutines on your own and create object files. We recommend, however, that you let Adams Toolbar run your compiler since there is less chance for errors. It also ensures that the correct compile flags are set so that your files are compiled and linked using the same options that were used for Adams product code. We also recommend that you purchase a debugger.
To view the list of compiler options valid on your platform, use the following command:
adams2024_1 -c cr-user n
Windows
You can input C or FORTRAN source files to create Adams Solver user libraries and only C source files to create Adams View user libraries. You must use the following C and FORTRAN compiler command and options for your user subroutines. The options are explained in the table shown below.
For FORTRAN, the command and options are:
ifort/c /architecture:pn4 /MD /Ob2 /automatic /Z7
Note: | /Z7 should only be used for debug mode. |
For C, the command and options are:
cl /c /Ox /MD /Z7
This variable: | Provides the following: |
|---|
/c | No linking |
/architecture:pn4 | Pentium 4 optimization (FORTRAN compiler) |
/MD | Multi-threaded applications (Adams is a multi-threaded application) |
/Ob2 or /Ox | Automatic inlining |
/automatic | Puts local variables on the run-time stack |
/Z7 | Adds debugging information |
The linking procedure allows you to supply FORTRAN or C files (depending on the Adams product).