Compiler required to use Modelica with Activate

Jim_Ryan
Jim_Ryan
Altair Employee
edited March 2023 in Community Q&A

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?

 

<?xml version="1.0" encoding="UTF-8"?>simluation_error_message.JPG

Answers

  • RoKet
    RoKet
    Altair Employee
    edited April 2018

    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

  • Willy Lo
    Willy Lo New Altair Community Member
    edited July 2018

    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

  • RoKet
    RoKet
    Altair Employee
    edited July 2018

    Hi Willy,

     

    You have to set the compiler in Preferences (Menue File-Preferences):

     

    image.png.750e8f09d51deb80a33de6ad9eecee60.png

     

    After adding the compiler you should get Modelica models running.

     

    Best Regards,
    Ronald

  • Willy Lo
    Willy Lo New Altair Community Member
    edited July 2018

    Hi Ronald,

     

    Thank you for your reply, 

    I follow your suggestion to set the path in Preferences:

     

    <?xml version="1.0" encoding="UTF-8"?>02.thumb.JPG.0e67a02f8ec94fb075ce9b5645b8ed46.JPG

     

    When I tried to run Modelica models, the error message still pop up:

     

    00.JPG.66d9f97186ddf8a51ba841a93aa34dfa.JPG

     

    Otherwise, If I unselect the 'Modelica Engine powered by Maplesoft' option, another error message will shown as:

     

    01.JPG.130fe85058e915bb5eb9cbb01ac2e65b.JPG

     

    It's really weird, did I miss any settings during installation of Activate or VC++?

     

    Best regards,

    Willy

  • RoKet
    RoKet
    Altair Employee
    edited July 2018

    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,
    Ronald

  • yugang
    yugang Altair Community Member
    edited July 2019

    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.

  • RajathRao
    RajathRao Altair Community Member
    edited August 2019

    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

    <?xml version="1.0" encoding="UTF-8"?>compiler_issue.PNG

  • Aravind Venugopal
    Aravind Venugopal Altair Community Member
    edited February 2020

    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

  • Patrick Goulding_21563
    Patrick Goulding_21563 New Altair Community Member
    edited December 2020

    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

  • Kuan-Jung Ku
    Kuan-Jung Ku
    Altair Employee
    edited March 2023

    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
      image

    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.
    image
    For my case, after include the path, Activate registers all my compilers successfully.

    image

    Jacky