Installing OMNET 4.6 on Mac OS X

1,029 views
Skip to first unread message

Mani Amoozadeh

unread,
Jan 29, 2016, 1:37:37 AM1/29/16
to OMNeT++ Users
I am trying to install OMNET++ 4.6 on Mac OS X El Captain. I followed the installation guide carefully and installed everything. Compiling/making the source does not give me any errors and I can open the eclipse IDE. But I can not run any example in the sample folder. Fpr example running dyna gives me this error:

<!> Error in module (cModule) ClientServer (id=1) during network setup: Class "Server" not found -- perhaps its code was not linked in, or the class wasn't registered with Register_Class(), or in the ...

What can be the problem?

Pablo

unread,
Feb 1, 2016, 6:40:59 AM2/1/16
to OMNeT++ Users
Hi Mani,

I am trying to install OMNET++ 4.6 on Mac OS X El Capitan too, but I've a different problem. I cannot help you, but perhaps you (or somebody) can help us. 

I've been using previous versions of OMNET++ in previous versions of OS X. After update the system to OS X El Capitan, running any simulation crashed into an error: Simulation terminated with exit code: 139

Then, I did the following:
1. I reinstalled Xcode 7.2 + Command Line Tools 7.2
2. updated all the necessary packages with both Fink (tcltk, tcltk-dev, blt, blt-dev, doxygen, graphviz) and MacPorts (tcl, tcllib, tk, tklib, blt, libpng, pango, doxygen, graphviz, openmpi)
3. updated the compiler: gcc5 + gdb.
3. solved some problems with the configure.user file in OMNET. For example, TCL/TK wasn't detected, and the problem was that the argument -fwritable-strings in TK_CFLAGS variable was not supported. The paths are different when using Fink (/sw/lib) than when using MacPorts (/opt/local/lib).

Now, I get an error when compiling (make) OMNET, specifically at the "tkenv" module, which I know that has been updated in this 4.6 version. I paste the error message:

./configure CFLAG_ARCH='-arch x86_64'
make TOOLCHAIN_NAME=cc_-arch_x86_64

===== Compiling tkenv ====

make[2]: Entering directory '/Users/xxx/omnetpp-4.6/src/cmdenv'

make[2]: Entering directory '/Users/xxx/omnetpp-4.6/src/tkenv'

...

tkenv.cc

In file included from /usr/include/Availability.h:168:0,

                 from /usr/include/stdlib.h:61,

                 from /usr/include/assert.h:44,

                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:13,

                 from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19,

                 from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,

                 from osxproctype.cc:17:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h:1242:34: error: expected '}' before '__attribute__'

   kLSHandlerOptionsDefault       __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_4, __MAC_10_11, __IPHONE_4_0, __IPHONE_9_0, "Creator codes are deprecated on OS X.") = 0,

                                  ^

In file included from /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h:529:0,

                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:27,

                 from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:39,

                 from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20,

                 from osxproctype.cc:17:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h:1242:163: error: expected unqualified-id before '=' token

   kLSHandlerOptionsDefault       __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_4, __MAC_10_11, __IPHONE_4_0, __IPHONE_9_0, "Creator codes are deprecated on OS X.") = 0,

                                                                                                                                                                   ^

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h:1294:1: error: expected declaration before '}' token

 }

 ^



I'm stuck at this point, at it seems that the problem is in a System library, something DEPRECATED. Any idea?
Thanks in advance

Pablo

Pablo

unread,
Feb 1, 2016, 7:22:49 AM2/1/16
to OMNeT++ Users
Solved! I've tried using CLang instead of gcc and now OMNET++ has compiled properly.
I've changed the following in the configure.user file:

PREFER_CLANG=yes


I've tested the example Dyna and its works properly too. So, my problem has solved, and perhaps, if you follow the steps I did you can solve your problem.

Regards

Rudolf Hornig

unread,
Feb 3, 2016, 6:19:16 AM2/3/16
to OMNeT++ Users
Yes. Tkenv is using Mac system headers from several frameworks and it seems that gcc is unable to compile them. Generally it is advised that you build OMNeT++ with the compiler toolchain Apple provides (i.e. use clang as you have figured out). In fact it was unnecessary to install gcc separately as the default Mac toolchain also contains the 'gcc' command (which is in fact just a symlink to clang). Setting the preferred compiler to clang is also an option as you already figured out...
Reply all
Reply to author
Forward
0 new messages