This article describes shortly how to set up your machine to be able to use the Microsoft Visual C++ 2019 compiler in Simcenter Amesim.
Have you ever encountered the following error message when trying to compile your Simcenter Amesim model with the Microsoft Visual C++ 2019 compiler, referring to "'nmake' is not recognized as an internal or external command, operable program or batch file."?
Then this article can help you to resolve your issue.
The important prerequisite is that you have the Microsoft Visual C++ 2019 compiler installed on your machine. In this article, an installation of Microsoft Visual Studio 2019 Professional is used to provide the needed Visual C++ 2019 compiler. Please contact your IT department to install the according compiler.
Generally, there are two possibilities to set up your machine, so that Simcenter Amesim is able to use the Microsoft Visual C++ 2019 compiler. These will be outlined in the next two subsections.
In the simplest case, after installing Microsoft Visual Studio 2019 Professional, you need to define an environment variable 'VS160COMNTOOLS' pointing to the 'Tools' subfolder in the 'Common' folder of your Microsoft Visual Studio 2019 Professional installation folder, e.g.:
This step is important, since Simcenter Amesim (up to version 2404) is using this environment variable (or better the according path) in the "vcvars64_vc140.bat" file (located in the Simcenter Amesim installation folder) to call the "vcvarsall.bat" file (located in another subfolder dedicated to the Visual C++ compiler in the Microsoft Visual Studio 2019 installation folder) with the 64-bit option to initiate the compilation with the Microsoft Visual C++ 2019 compiler (64-bit):
If you do not want to define the environment variable 'VS160COMNTOOLS', you can directly set the path to call the needed "vcvarsall.bat" file in the "vcvars64_vc140.bat" file located in your Simcenter Amesim installation folder. For this purpose, please open the "vcvars64_vc140.bat" with a text editor and change the according lines referring to the "Visual Studio 2019 compiler" as follows:
You can see in line 10 starting with the command 'call' that directly the according "vcvarsall.bat" with the option "x64" is called to initiate a compilation with the Microsoft Visual C++ 2019 (64-bit) compiler. Probably, you need to provide another path if your Microsoft Visual Studio 2019 Professional installation folder location differs from the one in the example. You can also adapt line 11 so that a success message is drawn in the Simcenter Amesim compilation window, when the compilation is done.
Following one of the above instructions, you can select and use the Microsoft Visual C++ 2019 (64-bit) compiler as the active compiler set in the "Compilation" tab of the Preferences window accessible via "Tools -> Preferences" in the Simcenter Amesim GUI:
Remarks
If the "vcvars64_vc140.bat" is not present in your Simcenter Amesim installation folder, you can find a template file called "vcvars64_vc140_template.bat" in the 'misc' subfolder of your Simcenter Amesim installation folder:
Please copy this file into your Simcenter Amesim installation folder, rename it into "vcvars64_vc140.bat" and adapt it if needed.
If you need to set up the Intel oneAPI C++ compiler in Simcenter Amesim, please have a look into the article "How can I use the Intel oneAPI DPC++/C++ Compiler in Simcenter Amesim?".