• Compile or executing problem with ifort on Mac OS X. Hi, I have just installed Intel® Parallel Studio XE Composer Edition for Fortran OS X. (mfcompxe2015.3.187.dmg), and I have just used it to compile my program on Mac OS 10.9.5.
  • Local C compiler C Linux, SPARC, MIPS The LLVM Compiler Infrastructure which is also frequently used for research; Portable C Compiler C Unix-like Open Watcom C, C, and Fortran Windows and OS/2, Linux/FreeBSD WIP TenDRA C/C Unix-like Tiny C Compiler C Linux, Windows Open64, supported by AMD on Linux. XPL PL/I dialect.
  • How to cross compile from Mac OS X to Linux x86? I have an application that I wrote in C/SDL, using FMOD library. The app is portable and compiles without any code change on Mac and on Linux. But one annoyance is that when I want to ship Linux version, I have to run my Linux box, copy the source code over there (over USB drive, because I have.

Linux, Mac: Compile your own, same procedure as normal lc0 compile (required). Note the new name AuxEngineFile, you'll need to update your GUI to use that option instead of the old one. Rename AuxEnginePath to AuxEngineFile (helps chess GUIs know to select a file not a directory). Fix some crashes parsing AuxEngine pv output. Compile Everything. Prepros can compile Sass, Less, Stylus, Pug/Jade, Haml, Slim, CoffeeScript and TypeScript out of the box. You can also add your own tools with just a few clicks.

  • 1Cross compiling for macOS on Linux

Cross compiling for macOS on Linux

Requirements

What you'll need:

  • an Intel Mac running Leopard, Snow Leopard, or Lion
  • Xcode installed on your Mac or the original or retail operating system DVD (for the SDK)
  • a working Linux setup (tested with Debian Squeeze)
  • up to date source for FPC (tested with 2.4.x) and Lazarus (tested with 0.9.30)
  • the Open Darwin cctools (odcctools)

Gcc Compile For Mac On Linux

Warning: These instructions are for i386 Linux; trying this on x64 Linux has failed. Update 2013-12-13: cross compiling from Linux for macOS no longer works at all for 10.8 and above. The compiler works fine but viable linker tools (cctools for linux) are not available for Linux anymore. Please adjust instructions if you find a solution for this. The cctools are available in Arch Linux.

STEP 1: copy the SDK from your Mac

You need to install Xcode from your operating system DVD if you've not already done so and copy the SDK to an appropriate location on your Linux box.

I'd recommend Leopard 10.5.sdk (compatible with Leopard) but it depends on how far back you want to be compatible. The 10.5.sdk is located in /Developer/SDKs on the Mac.I put mine at /opt/Mac/ on my Debian box. Example using ssh from your Linux box to copy over the files:

STEP 2: grab odcctools from SVN

Compile on linux for macs

Odcctools apparantly provide binutils for OSX/Darwin.

On 64 bit Linux environments, fpc mailing list users have problems with this step. Perhaps this StackOverflow question and answer can help: in the configure step, you'd apparently need to setCC='gcc -m32' CXX='g++ -m32' ./configure blah blah blah

and build it as

This installs the tools in /opt/odcctools.I've specified gcc 4.4 but it should be okay with other versions.

STEP 3: rebuild FPC

(my sources are in ~/hg/pascal)

Note that the options (OPT) as shown are vital, especially -gw.

Compile C++ For Mac On Linux

STEP 4: configure fpc.cfg

Add a darwin (cross-compile) clause to /etc/fpc.cfg:

STEP 5: build the Carbon LCL

Be sure to specify the Darwin OS target, i386 CPU target and, most importantly, add the -gw option. Perform a Clean+Build of the LCL and the Package Registration.

You should now be able to use Lazarus in Linux to build for macOS.

Gotcha's

There are two more gotcha's when cross-compiling to macOS:

  • Be sure to specify the -gw in your projects to avoid problems

reported in (the unfixable) FPC bug #12001.

  • Be sure to specify the -XR option pointing to your SDK root (e.g. -XR/opt/Mac/Leopard10.5.sdk), or the Darwin linker will try to link to the wrong startup object (/usr/lib/crt1.o).

Source

Fpc Mailing list 6 August 2011 post by Bruce titled 'Re: Cross Compiling from Linux to Leopard 10.5 or Snow Leopard 10.6 target. How? [SOLVED]'Adapted by BigChimp

Older instructions

This section was taken from the general Cross compiling page and may still be of interest: Cities xl 2012 mac.

  • First you need the binutils for the platform you want to compile to. Download odcctools from this site (use the cvs version) and follow their instructions for installing. http://www.opendarwin.org/projects/odcctools/
  • you need to create a fake root dir like: $HOME/darwinroot copy at least the /System and /Frameworks and /usr directories (you may have to copy more than this) from your Apple or Darwin computer to $HOME/darwinroot
  • now that you have these files make a folder in $HOME/darwinroot called cross. where ever you installed the odcctools you need to make links for the cross tools to be more fpc friendly. there are a bunch of files from odcc tools called powerpc-apple-darwin-* you need to make links (or rename them) so powerpc-apple-darwin-ld becomes powerpc-darwin-ld, do the same for *-ar and *-as.
  • now you are ready to crosscompile fpc. basically you need to have the fpc source and have a terminal open there.

type:

type (iirc):

if that succeded you can install it to whereever you want with:

now copy the file ./compiler/ppccross somewhere you will be able to find it as it's the compiler you'll need to build powerpc programs

  • configure your /etc/fpc.cfg file.

add a section like this:

Run linux programs on mac

whenever you want to crosscompile you have to have ppccross and the symlinks to powerpc-darwin-* in the PATHand you should be able to just do ppccross someprogie.pas and it will create a darwin executable.

I may have missed some things (or most everything) as it's been a while since I did this.

Retrieved from 'https://wiki.freepascal.org/index.php?title=Cross_compiling_OSX_on_Linux&oldid=129917'

Best C Compilers: For most beginners of programming choosing a user-friendly C or C++ compiler is challenging enough. The fact is many programming languages that have evolved through different OS environments are not enabled with the ability to bear current day computing parameters.

Best C Compilers

The programming languages C and C++ are the most crucial for every programmer to master since they are the base-point for many other and recent programming languages and still used in many ways today.

A list of best C, C++ compilers to work with Mac OS X, Linux, Windows 7/8/8.1 OS environment is given here –

Development

Eclipse C Compiler

With Eclipse you get advance functionality for programming in C, C++ on an open-source platform. This IDE is really a simple to use IDE, perfect for anyone new to programming. It comes packed with impressive features including a debugger, auto-code completion, syntax highlighting etc.

It is supported on Linux, Mac OS X, and Windows. For compiling the Java run-time environment needs to be functionally operational on the PC.

Code Blocks Compiler

This is a cross-platform extensible and open source IDE compatible for C++. The IDE can be extended with help of different, available PLUGINS. The IDE is fully configurable and can be downloaded through several ways.

Downloading the setup file for the binary release you can run it on the PC. Alternately download a nightly-build, source code or retrieve source-code from the SVN.

Digital Mars

It’s free and has both GUI and command-line versions. Digital Mars is convenient to use for its quick link time and efficient compile.

C-Free

Though small C-Free has brilliant features and can be considered as an alternative to the traditional Turbo-C compiler for developing C++, C programs and for supporting many other compilers as well.

The compiler comes in a 30-day free trial version but for using it long you have to buy it.

NetBeans

Advance and open-source NetBeans offers features like unit testing, semantic highlighting, code assistance and automatic formatting. With NetBeans, you can easily develop web, mobile and desktop applications in Java, HTML, CSS and JavaScript.

SkyIDE

This IDE is a multi-view, multi-project and multi compiler for C++ that supports multi-profile compiling in a number of languages including JavaScript, PHP, and Java. It supports Mac and Linux.

Functions include autocompleting, line tracking, text manipulation, and syntax coloring.

Dev C++

The Dev C++ is an IDE that supports C language and uses Gcc’s MinGW port as compiler. The IDE offers project manager, print support, auto-code completion and syntax highlight.

MinGW

Comprising of a group of tools for programming to cater to native windows apps MinGW has a GCC port like C, ADA, Fortan and C++ compilers.

CodeLite

Functional for Windows, Mac OS, and Linux OS Codelite is an open source and cross-platform IDE compatible for C++ and C.

This is not a free IDE but the fact that it’s quite a powerful and intuitive editor for source code manipulations works to its favor.

Also Read:

U ++

With a set of different libraries like SQL, GUI, Ultimate++ works well with MinGW, Visual C++, and GCC and is used by C++ programmers for good productivity output. It is cross-platform and a RAD IDE.

Driver

So those were some of the best C Compilers for Mac and Linux PCs.

Best linux for mac

This post was last modified on October 16, 2019 9:19 AM

Related Post