You probably won’t need MinGW as there is Terminal on the Mac. If you have an english system it should be in /Applications/Utilities/Terminal so I would try to replace "C:\\MinGW with “/Applications/Utilities/Terminal” and “gcc.exe” with “gcc”.
Hi Adrian, can you specify the error in detail? Do you have gcc installed? Open the Terminal application and enter gcc and hit return, do you get an error? If yes, you need to install gcc first (e.g. with brew https://brew.sh)
kind regards, Peter
Hi Peter
the error :
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
CreateLibrary::instl: The compiler installation directive “CompilerInstallation” → /Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler. >>
Compile::nogen: A library could not be generated from the compiled function. >>
Then,
I changed the compiler installation directory to
/usr/bin
it does not show error
but the compilation still does not work.
Hi Adrien, can you test in terminal if you have gcc installed (see my previous post). One of the messages indicates that you have not…
/Applications/Utilities/Terminal does not indicate a usable installation of Generic C Compiler
kind regards, Peter
Hi peter
im not sure if you mean to check it this way.
I checked in terminal
Adrian-MM:~ user$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Adrian-MM:~ user$
Hi Adrian, hmm it seems that you have gcc installed, I just have the idea, that you might need a C compiler instead of gcc so try “clang” instead of “gcc”.
kind regards, Peter
There is no MinGW for macOS. You need to install Xcode from the Mac App Store instead. Once it’s installed start it, and allow it to install the command line tools. Finally, test that clang (the compiler on macOS) works in a terminal.
After this, it will work with Mathematica without any special setup (i.e. do not create a special configuration).
Just try the examples for the CCompilerDriver package.
I know, I actually tried to use it once for cross-compiling … but it seemed more helpful to say that there isn’t, since OP doesn’t want to cross-compile.
Is there any reason why you insist on setting up gcc instead of using the native compiler on macOS, i.e. clang, which comes with Xcode and requires zero configuration to get it working in Mathematica?
im trying to run a model written by my friend to simulate some experimental data i measured. he told me that i need to run the compiler first in gcc. he wrote it in windows which needs MinGW package.
Alternatively, I would like to know how to do it with clang in mac using the same file as im using mac, i don’t want to boot camp my laptop. it sounds like a better method. i looked around but i don’t understand how the native compiler in macOS works. I installed Xcode but i don’t know how one can run native compiler on a mathematica nb without opening it and evaluate cell containing the compiler in terminal.
I really appreciate it if there’s instructions how to do it.