Windows

User Libraries on Windows

On Windows, you can create user libraries for the following:

Custom Adams View Libraries

You can add your own C routines to create a user Adams View library. Sample C functions are in the file vc_init_usr.c in the directory /install_dir/aview/usersubs/, where install_dir is the directory in which you installed Adams software.
 
Note:  
You can also use a list file (.lst) to enter the names of several object files at once. You must place an @ sign before the name of the list file (for example, @names.lst).

To create an Adams View library:

1. From the Start menu, point to Programs, point to Adams x (where x is the release number), and then select Command Prompt.
2. Enter aview.
3. Enter cr-user.
4. At the debug prompt, enter one of the following options:
To run in debug mode, enter y.
To run in standard mode, enter n or press Enter.
5. Enter the name of the first object, source, or list file containing your subroutines.
You can enter an object file (for example, mysubs.obj), a source file (.f or .c), or a .lst file (for example, @sub_list.lst). If entering a source file, be sure the .f or .c extension is lowercase.
6. Repeat Step 2 as many times as necessary by either:
Entering an object file containing one or more user-written subroutines.
Pressing Enter to end the list of subroutines linked to Adams View.
7. Enter a name for the Adams View user library that you want to create.
You've now created a user library that Adams View can run.

Custom Template-Based Product Libraries

For Adams Car, and Adams Driveline, you can create user interface or Adams Solver libraries.
You can create the libraries in your private (home) directory where only you can access them or place them in the site location for all users to access. Learn about the Directory Structure for Template-Based Products.
For information on running the libraries, see Running Template-Based Products. For more information on customizing these products, see their online help.

Creating Libraries for Template-Based Products

The following steps explain how to create interface or Adams Solver user libraries that run with Adams Car, Adams Driveline.
You can choose to place any of the libraries in your private or site location. If you are creating a library in your site location, be sure to set up the directory, as explained in Directory Structure for Template-Based Products.

To create an interface user library:

1. From the Start menu, point to Programs, point to Adams x (where x is the release number), and then select Command Prompt.
2. Enter acar, or adriveline.
3. Enter the code to create a private or site library (for example, cr-acarprivate or cr-acarsite).
4. At the debug prompt, enter one of the following options:
To run in debug mode, enter y.
To run in standard mode, enter n or press Enter.
5. Enter the name of the first object, source, or list file containing your subroutines.
You can enter an object file (for example, mysubs.obj), a source file (.f or .c), or a .lst file (for example, @sub_list.lst). If entering a source file, be sure the .f or .c extension is lowercase.
6. Repeat Step 4 as many times as necessary by either:
Entering an object file containing one or more user-written subroutines.
Pressing Enter to end the list of subroutines linked to Adams View.

To create an Adams Solver library:

1. From the Start menu, point to Programs, point to Adams x (where x is the release number), and then select Command Prompt.
2. Enter acar, or adriveline.
3. Enter the code to create a private or site library (for example, enter cr-solverprivate or cr-solversite).
4. At the debug prompt, enter one of the following options:
To run in debug mode, enter y.
To run in standard mode, enter n or press Enter.
5. Enter the name of the first object, source, or list file containing your subroutines.
You can enter an object file (for example, mysubs.obj), a source file (.f or .c), or a .lst file (for example, @sub_list.lst). If entering a source file, be sure the .f or .c extension is lowercase.
6. Repeat Step 4 as many times as necessary, by either:
Entering an object file containing one or more user-written subroutines.
Pressing Enter to end the list of subroutines.

User Libraries for Analysis Products

You can create user libraries for the Adams analysis products, which include Adams Solver, Adams Controls, and Adams Tire. You can also run the user libraries from within Adams View when running Adams View with an integrated Adams Solver.
Sample user FORTRAN subroutines are in the tire.f file in the directory c:/install_dir/solver/samples/, where install_dir is the directory in which you installed Adams software.
 
Note:  
You can also use a list file (.lst) to enter the names of several object files at once. You must place an @ sign before the name of the list file (for example, @names.lst).

To create a user library:

1. From the Start menu, point to Programs, point to Adams x (where x is the release number), and then select Command Prompt.
2. Enter cr-user.
3. At the debug prompt, enter one of the following options:
To run in debug mode, enter y.
To run in standard mode, enter n or press Enter.
4. Enter the name of the first object, source, or list file containing your subroutines.
You can enter an object file (for example, mysubs.obj), a source file (.f or .c), or a .lst file (for example, @sub_list.lst). If entering a source file, be sure the .f or .c extension is lowercase.
5. Repeat Step 2 as many times as necessary, by either:
Entering an object file containing one or more user-written subroutines.
Pressing Enter to end the list of subroutines linked to Adams Solver.
6. Enter a name for the Adams Solver library you want to create and press Enter to begin the linking process.

NO_FORTRAN

Adams Solver supports user subroutines that are written in C. When all of your user subroutines are written in C then NO_FORTRAN compiler is required to compile them. However, on windows when Adams builds user libraries that are to be run with the Solver, Adams assumes FORTRAN is installed on and includes the FORTRAN libraries to its link command. To communicate to the linking scripts that NO_FORTRAN libraries are required, set the environment variable NO_FORTRAN to 1.
For example:
C:\temp>set NO_FORTRAN=1
C:\temp>adams2024_1 cr-u n myfile.c -n mylib.dll

Linking Custom Libraries

If you need to include one or more custom libraries when you create your user library, you can set an environment variable to instruct the linker which libraries to include.
 
For the library type:
Use the environment variable:
Interface
MSC_CUSTOM_LINK_LIBS
Adams Solver
MYSLIBS
For example, if you are creating an interface library, and your custom libraries are named my_custom_library1_imp.lib and my_custom_library2_imp.lib, set the environment variable as follows:
C:\temp>set MSC_CUSTOM_LINK_LIBS="my_custom_library1_imp.lib my_custom_library2_imp.lib"
If you are creating a Solver library, and your custom libraries are named my_solver_lib1_imp.lib and my_solver_lib2_imp.lib, set the environment variable as follows:
C:\temp>set MYSLIBS="my_solver_lib1_imp.lib my_solver_lib2_imp.lib"
Once the user library has been created, the environment variable is no longer needed.