Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Windows with MinGW-w64 needs a separate configuration #383

Open
SilviaHyde opened this issue Jun 23, 2020 · 0 comments
Open
Labels
weed Something isn't working

Comments

@SilviaHyde
Copy link

The problem

On WIndows with MinGW-w64 compiler, the build.wls script doesn't work out of the box.

When running the script from CMD, I got the following error message:

CreateLibrary::instl: The compiler installation directive "CompilerInstallation" -> $Failed does not indicate a usable installation of MinGW (executable: g++.exe).

Expected behavior

Expecting the package be built successfully.

Version

gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Windows 10 (Version 1909)

Additional context

It seems, in scripts/buildInit.wl, some options in CreateLibrary needs special treatment:

"CompileOptions" -> Switch[$OperatingSystem,
"Windows",
{"/std:c++17", "/EHsc"},
"MacOSX",
Join[{"-std=c++17"}, $warningsFlags, {"-mmacosx-version-min=10.12"}], (* for std::shared_mutex support *)
"Unix",
Join[{"-std=c++17"}, $warningsFlags]],
"Compiler" -> ToExpression @ tryEnvironment["COMPILER", Automatic],
"CompilerInstallation" -> tryEnvironment["COMPILER_INSTALLATION", Automatic],

I can make the compilation successful with manually specifying the compiler:

Needs["CCompilerDriver`MinGWCompiler`"];
$CCompiler = {"Name" -> "MinGW", "Compiler" -> MinGWCompiler, "CompilerInstallation" -> "C:\\mingw-w64\\x86_64-8.1.0-posix-seh\\mingw64\\bin", "CompilerName" -> "g++.exe"};

and replacing the above referenced options with just a

  "CompileOptions" -> Join[{"-std=c++17"}, $warningsFlags]
@SilviaHyde SilviaHyde added the weed Something isn't working label Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
weed Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant