# Compiling SystemC with GCC 4 (and Mac OS X)

### 12 Feb 2007

I’m having to use SystemC for a project involving simulation of Network-On-Chip applications. Turned out that it didn’t quite compile cleanly on my GNU/Linux machine:

My friend pointed me to a patch for this, which I later modified slightly. Turns out that GCC4 is a bit more stricter about friend functions than its old counterpart.

That problem solved, I went on to compiling SystemC on the Mac. My Macbook Pro has an Intel processor so it shouldn’t have been much trouble. Needless to say, configure couldn’t even detect the build type:

And after specifying one explicitely:

Not a problem. After adding a case…esac block to configure.in (setting the CXXFLAGS etc. to the the same as the case for linux), we were up and running!

In summary, here’s what you have to do after grabbing the SystemC sources (requires registration and acceptance of license):

Those of you trying to compile SystemC on GNU/Linux with GCC4 do the same; but leave out the build argument to the configure statement.