Scilab with Visual Studio 2015

1.6k Views Asked by At

I'm new to Scilab/Xcos and am trying to get it setup for the first time. I notice that some of the Xcos blocks I wanted to try require a C compiler.

I have Visual Studio 2015 Professional installed already, and in Scilab, if I run findmsvccompiler, it returns msvc100pro. If I run configure_msvc, it returns T (true?).

However, when I run haveacompiler, it comes back F (false?).

Is there any way to use VS2015's compiler with Scilab? I know that the supported compilers page only lists up to VS2013, but it looks like that page was last updated before VS2015 was released.

Is there a way to manually setup Scilab to use the VC++ 2015 compiler? Or do I have to go about installing the MinGW compiler?

1

There are 1 best solutions below

0
On

I recently found a workaround for scicos 6.0.0 and VC 2015 express. the problem seems to be the detection a wrong key ( see in dlwIsVc14Express.sci). but creating this key is not enough.

the way I chose is to copy paste these lines in the scilab 6.0.0 console. then xcos compilation of a sample work fine for me.

// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) DIGITEO - 2010 - Allan CORNET
// Copyright (C) Scilab Enterprises - 2014 - Antoine ELIAS
//
// Copyright (C) 2012 - 2016 - Scilab Enterprises
//
// This file is hereby licensed under the terms of the GNU GPL v2.0,
// pursuant to article 5.3.4 of the CeCILL v.2.1.
// This file was originally licensed under the terms of the CeCILL v2.1,
// and continues to be available under such terms.
// For more information, see the COPYING file which you should have received
// along with this program.


// copy paste this modified function in scilab 6.0.0 console , then xcos compile

//=============================================================================
function bOK = dlwIsVc14Express()
    bOK = %f;
    try
        if winqueryreg("key", "HKLM", "Software\Microsoft\DevDiv\vc\Servicing\14.0") <> [] then
            bOK = %t;
        end
    catch
    end
endfunction
//=============================================================================

//=============================================================================
// NDLA : I don't know the righ key to chose for dlwIsVc14Pro : change default function here

/*

function bOK = dlwIsVc14Pro()
    bOK = %f;
    try
        if winqueryreg("HKLM", "Software\Microsoft\DevDiv\vs\Servicing\14.0\devenv", "install") == 1  & ...
            dlwIsVc14Express() == %f then
            bOK = %t;
        end
    catch
    end
endfunction

*/

//=============================================================================


//=============================================================================
function MSCompiler = dlwFindMsVcCompiler()
    MSCompiler = "unknown"; // unknown

    // We use always last version of MS compiler

    val = getenv("SCILAB_PREFERED_MSVC", "");
    if val <> "" then
        funcs = list(dlwIsVc14Express,dlwIsVc14Pro,dlwIsVc14Express,dlwIsVc12Pro,dlwIsVc11Express,dlwIsVc11Pro,dlwIsVc10Express,dlwIsVc10Pro);
        compilers = [ ...
        "msvc140express";
        "msvc140pro";
        "msvc120express";
        "msvc120pro";
        "msvc110express";
        "msvc110pro";
        "msvc100express";
        "msvc100pro";];
        idx = find(val == compilers);
        if idx <> [] then
            func = funcs(idx);
            if func() then
                MSCompiler = val;
                return;
            end
        end
    end


    if dlwIsVc14Express() then
        MSCompiler = "msvc140express";     // Microsoft Visual 2015 Express
        return;
    end

    if dlwIsVc14Pro() then
        MSCompiler = "msvc140pro";       // Microsoft Visual 2015 Professional / Community (or more)
        return;
    end

 endfunction
//=============================================================================