Build Options¶
Configure.user Options¶
The configure.user file contains several options that can be used to fine-tune the simulation libraries.
You always need to re-run the configure script in the installation root after changing the configure.user file.
$ ./configure
After this step, you have to remove all previous libraries and recompile OMNeT++:
$ make cleanall
$ make
Options:
PREFER_CLANG=noIf both
gccandclangare installed on your system, setting this variable tonowill force the configure script to usegccas C++ compiler.
<COMPONENTNAME>_CFLAGS,<COMPONENTNAME>_LIBSThe
configure.userfile contains variables for defining the compile and link options needed by various external libraries. By default, theconfigurecommand detects these automatically, but you may override the auto detection by specifying the values by hand. (e.g.<COMP>_CFLAGS=-I/path/to/comp/includedirand<COMP>_LIBS=-L/path/to/comp/libdir -lnameoflib.)WITH_PARSIM=noUse this variable to explicitly disable parallel simulation support in OMNeT++.
WITH_NETBUILDER=noThis option allows you to leave out the NED language parser and the network builder. (This is needed only if you are building your network with C++ API calls and you do not use the built-in NED language parser at all.)
WITH_QTENV=noThis will prevent the build system to link with the Qt libraries. Use this option if your platform does not have a suitable Qt package or you will run the simulation only in command line mode. (i.e. You want to run OMNeT++ in a remote terminal session.)
WITH_OSG=noThis will prevent the build system to use OpenScreenGraph which is used for 3D visualization in Qtenv.
WITH_OSGEARTH=noThis will prevent the build system to use osgEarth which is used for 2D/3D mapping and visualization in Qtenv.
CFLAGS_[RELEASE/DEBUG]To change the compiler command line options the build process is using, you should specify them in the
CFLAGS_RELEASEandCFLAGS_DEBUGvariables. By default, the flags required for debugging or optimization are detected automatically by theconfigurescript. If you set them manually, you should specify all options you need. It is recommended to check what options are detected automatically (check theMakefile.incafter runningconfigureand look for theCFLAGS_[RELEASE/DEBUG]variables.) and add/modify those options manually in theconfigure.userfile.LDFLAGSLinker command line options can be explicitly set using this variable. It is recommended to check what options are detected automatically (check the
Makefile.incafter runningconfigureand look for theLDFLAGSvariable.) and add/modify those options manually in theconfigure.userfile.SHARED_LIBSThis variable controls whether the OMNeT++ build process will create static or dynamic libraries. By default, the OMNeT++ runtime is built as a set of shared libraries. If you want to build a single executable from your simulation, specify
SHARED_LIBS=noinconfigure.userto create static OMNeT++ libraries and then reconfigure (./configure) and recompile OMNeT++ (make cleanall; make). Once the OMNeT++ static libraries are correctly built, your own project have to be rebuilt, too. You will get a single, statically linked executable, which requires only the NED and INI files to run.
Warning
It is important to completely delete the OMNeT++ libraries (make cleanall) and then rebuild them, otherwise it
cannot be guaranteed that the created simulations are linked against the correct libraries.
Note
The USE_DOUBLE_SIMTIME and WITHOUT_CPACKET options are no longer supported. They were introduced in OMNeT++
4.0 to help porting model code from OMNeT++ 3.x, and having fulfilled their role, they were removed in OMNeT++
5.0. If you still have old model code to port, use OMNeT++ 4.x.
Moving the Installation¶
When you build OMNeT++ on your machine, several directory names are compiled into the binaries. This makes it easier to set up OMNeT++ in the first place, but if you rename the installation directory or move it to another location in the file system, the built-in paths become invalid and the correct paths have to be supplied via environment variables.
The following environment variables are affected (in addition to PATH, which also needs to be adjusted):
OMNETPP_IMAGE_PATHThis variable contains the list of directories where Qtenv looks for icons. Set it to point to the
images/subdirectory of your OMNeT++ installation.LD_LIBRARY_PATHThis variable contains the list of additional directories where shared libraries are looked for. Initially,
LD_LIBRARY_PATHis not needed because shared libraries are located via the rpath mechanism. When you move the installation, you need to add thelib/subdirectory of your OMNeT++ installation toLD_LIBRARY_PATH.
Note
On macOS, DYLD_LIBRARY_PATH is used instead of LD_LIBRARY_PATH. On Windows, the PATH variable must
contain the directory where shared libraries (DLLs) are present.
Using Different Compilers¶
By default, the configure script detects the following compilers automatically in the path:
Clang (clang, clang++)
GNU C/C++ (gcc, g++)
If you want to use compilers other than the above ones, you should specify the compiler name in the CC and CXX
variables, and re-run the configuration script.
Note
Different compilers may have different command line options. If you use a compiler other than the default gcc,
you may have to revise the CFLAGS_[RELEASE/DEBUG] and LDFLAGS variables.