Compiler required to use Modelica with Activate


When I tried to run one of the tutorials associated with the Modelica set that comes with Activate , I received an error message shown in the attached screenshot file. That message indicates 'Modelica compiler requires Visual C++ compiler version >= 10'. If I download and install the 'Microsoft Visual C++ 2015 Redistributable Update 3 RC', do you expect that will resolve this error?
Answers
-
Hi Jim,
I had the same issue. I think the redistributables are not enough, because they only contain run-time libraries for c++, but no compiler. After installing a full VC++ compiler (e. g. Visual Studio 2015 from here or here [you have to choose 'older versions' at bottom of the page]) Modelica models work fine. With VS 2017 I didn't get it running.
Ronald
0 -
Altair Forum User said:
Hi Jim,
I had the same issue. I think the redistributables are not enough, because they only contain run-time libraries for c++, but no compiler. After installing a full VC++ compiler (e. g. Visual Studio 2015 from here or here [you have to choose 'older versions' at bottom of the page]) Modelica models work fine. With VS 2017 I didn't get it running.
Ronald
Hi Ronald,
After installing a full VC++ compiler (vs 2015 community) the error message still exist.
I use this command 'vssGetCompilerName()' to check compiler, and it shows that there doesn't exist any compiler on my computer.
It seems to Activate does not detect compiler automatically. But I'm sure that vs 2015 community is installed on my computer.
Do you have any idea to fix this problem? Thank you.
Willy
0 -
Hi Willy,
You have to set the compiler in Preferences (Menue File-Preferences):
After adding the compiler you should get Modelica models running.
Best Regards,
Ronald0 -
Hi Ronald,
Thank you for your reply,
I follow your suggestion to set the path in Preferences:
<?xml version="1.0" encoding="UTF-8"?>
When I tried to run Modelica models, the error message still pop up:
Otherwise, If I unselect the 'Modelica Engine powered by Maplesoft' option, another error message will shown as:
It's really weird, did I miss any settings during installation of Activate or VC++?
Best regards,
Willy
0 -
Hi Willy,
In the meantime I got to know that the compiler setting in preferences belongs to the Modelica compiler, not to the C/C++ compiler. Therefore the field can be left empty (in my installation).
Please check if you have installed C/C++ option and SDK option during installation process of VS. This is the important compiler of the package.
Regards,
Ronald0 -
Yes, I have the same issue of this.
And I click on the SDK option. then I solve this issue.
Hope it can help you.
I install 2019, you need make some choice when you starts to install.
0 -
I have Altair Activate Basic 2019 and I have the same issue. On top of that, I do not see the select Compiler option with my version as shown in the screenshot. Could anyone suggest a workaround? I have installed VS 2019 with the SDK option also installed.
Thanks,
Rajath
0 -
Altair Forum User said:
I have Altair Activate Basic 2019 and I have the same issue. On top of that, I do not see the select Compiler option with my version as shown in the screenshot. Could anyone suggest a workaround? I have installed VS 2019 with the SDK option also installed.
Thanks,
Rajath
Dear Rajath,
You don't even need to install Visual Studio Latest version for fixing this compiler issue for Activate Basic 2019 latest edition. Go to this link,
https://code.visualstudio.com/docs/cpp/config-msvc and follow the first three steps in the webpage. Also, while installing the Visual Studio Build Tools, you don't need to check the box for installing the latest Windows SDK version for fixing this issue. Also, using the same installer, you can install it at a later stage too, if you want it. This approach should work just fine as it did for me.
Regards
Aravind
0 -
Hi All,
For anyone encountering this issue in the future, I have created a Tip and Trick (attached). The slides walk you through installing a compiler for Modelica modeling and FMI import/export. Included as well are tips for setting your Activate Paths for communication with MotionSolve and Flux for co-simulation. I hope you find it helpful!
Take care,
Patrick
0 -
Dear All:
For anyone who encounters related problem, and all above solutions couldn't fix your problem, you can try:
1. Rerun the batch file of VC setup- Open Cmd
- Change directory to your VC installation, for example:
cd C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build - run the batch file depends on your OS
vcvars64.bat - Check if cl return visual studio compiler info
2. Check your enviornment variables
Reference to this link: https://schrievkrom.wordpress.com/2011/01/25/error-cannot-determine-the-location-of-the-vs-common-tools-folder/
Check that if C:\Windows\System32\ is not in the system variable "PATH". If not, include it manually.
For my case, after include the path, Activate registers all my compilers successfully.Jacky
0