Problem:
I have cyrylic symbols in my $UserBaseDirectory. As result temporal directory for CreateExecutableand friends is in my$UserBaseDirectory`. Which produce error.
Code:
Needs["CCompilerDriver`GenericCCompiler`"]
greeter = CreateExecutable[
StringJoin["#include <stdio.h>\n", "int main(){\n",
" printf(\"Hello MinGW-w64 world.\\n\");\n", "}\n"], "hiworld",
"Compiler" -> GenericCCompiler,
"CompilerInstallation" -> "C:/MinGW-64",
"CompilerName" -> "x86_64-w64-mingw32-gcc.exe"
]
produce error
CreateExecutable::cmperr: Compile error: x86_64-w64-mingw32-gcc.exe: error: C:\Users\¦Ð¦\[Not]¦¦¦¦TÁ¦-¦-¦+TÀ\AppData\Roaming\Mathematica\SystemFiles\LibraryResources\Windows-x86-64\Working-pc6807-6420-5640-3\hiworld.c: No such file or directory >>
but
Needs["CCompilerDriver`GenericCCompiler`"]
greeter = CreateExecutable[
StringJoin["#include <stdio.h>\n", "int main(){\n",
" printf(\"Hello MinGW-w64 world.\\n\");\n", "}\n"], "hiworld",
"Compiler" -> GenericCCompiler,
"CompilerInstallation" -> "C:/MinGW-64",
"CompilerName" -> "x86_64-w64-mingw32-gcc.exe",
"WorkingDirectory"\[Rule]"c:\\1\\",
"TargetDirectory"\[Rule]"c:\\2\\"
]
work fine.
Is there way to setup default value for "WorkingDirectory" and "TargetDirectory" for function like CreateExecutable?
SetOptionsforCreateExecutableas for other functions. Have you tried that?:SetOptions[CreateExecutable, "WorkingDirectory" -> "c:\\1\\", "TargetDirectory" -> "c:\\2\\"]– Mr.Wizard Sep 18 '14 at 08:18Needs["CCompilerDriver`GenericCCompiler`"]? – Mr.Wizard Sep 18 '14 at 08:22