A small command-line utility, similar to pkg-config that help supply build information for a given architecture
RTI Connext DDS Config version 1.0.4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Usage:
connext-config -h|--help Show this help
connext-config -V|--version Prints version number
connext-config --list-all List all platform architectures supported
connext-config --list-installed List the installed architectures
connext-config --dump-all Dump all platforms and all settings (testing only)
connext-config [modifiers] <what> [targetArch]
Where [modifiers] are:
--static use static linking against RTI Connext DDS
--debug use debug version of the RTI Connext DDS libraries
--sh use shell-like variable expansion (vs. make-like variables)
--noexpand do not expand environment variables in output
--libmsg include libraries for building request/reply apps
Required argument <what> is one of:
C API:
--ccomp output the C compiler to use
--cflags output all pre-processor and compiler flags
--clink output the C linker to use
--ldflags output the linker flags
--ldlibs output the required libraries
Traditional C++ API:
--cxxcomp output the C++ compiler to use
--cxxflags output all pre-processor and compiler flags
--cxxlink output the C++ linker to use
--ldxxflags output the linker flags
--ldxxlibs output the required libraries
Modern C++ API (C++-03):
--cxx03comp output the C++ compiler to use
--cxx03flags output all pre-processor and compiler flags
--cxx03link output the C++ linker to use
--ldxx03flags output the linker flags
--ldxx03libs output the required libraries
Modern C++ API (C++-11):
--cxx11comp output the C++ compiler to use
--cxx11flags output all pre-processor and compiler flags
--cxx11link output the C++ linker to use
--ldxx11flags output the linker flags
--ldxx11libs output the required libraries
Miscellaneous:
--os output the OS (i.e. UNIX, ANDROID, IOS, ...)
--platform output the Platform (i.e. i86, x64, armv7a, ...)
Optional argument [targetArch] is one of the supported target architectures.
If not specified, uses environment variable NDDSARCH.
Use `--list-all` or `--list-installed` to print a list of architectures
The tool can be invoked in two ways:
- To list all the supported targets (including targets NOT installed):
connext-config --list-all - List all the installed targets:
connext-config --list-installed - To obtain the right tool name, flags and libraries for a given architecture.
In general, when determining the tools required to build a RTI Connext DDS application, you may need to use this tool few times. For example, to build a C program:
- Use the
--ccompto determine the correct compiler to use for the specified API (api=c/cxx/cxx03/cxx11) - Use the
--cflagsto determine the right flags for the C compiler - Use the
--clinkto determine the correct linker to use - Use the
--ldflagsand--ldlibsto get the flags and libraries for the linker. Place the output of the--ldflagsat the beginning of the argument list, and the output of--ldlibsat the end.
NOTE: there is also an additional way you can invoke the tool that is accessible only when you build the tool from the source code, and you use the --enable-debug flag with the ./configure script. This enables the following use:connext-config --dump-all to dump all the platforms and settings available. This mode is only meant to debugging and troubleshooting.
If a target does not support a specific language, the tool will print an error. E.g.:
$ connext-config --cxx11flags i86Linux2.6gcc4.4.5
Error: target 'i86Linux2.6gcc4.4.5' does not support C++11
Show all the supported Linux 64-bit targets:
$ ./connext-config --list-all | grep x64Linux
x64Linux2.6gcc3.4.5
x64Linux2.6gcc4.1.1
x64Linux2.6gcc4.1.2
...
Show all the installed targets:
$ connext-config --list-installed
armv6vfphLinux3.xgcc4.7.2
x64Linux4gcc7.3.0
x64Darwin17clang9.0
Show the C compiler to use for the target architecture ppc4xxFPLinux2.6gcc4.5.1:
$ ./connext-config --ccomp ppc4xxFPLinux2.6gcc4.5.1
powerpc-ngc-linux-gcc
Shows the libraries to use when statically linking (--static) C applications on x64Linux2.6gcc4.5.1 with debugging information (--debug):
$ ./connext-config --debug --static --ldlibs x64Linux2.6gcc4.5.1
-L/Users/fabrizio/working/rti_connext_dds-6.0.0/lib/x64Linux2.6gcc4.5.1 -lnddsczd -lnddscorezd -ldl -lnsl -lm -lpthread -lrt
Inside the examples directory you can find some projects that uses this tool to automatically configure the build system.
examples/autoconf-hello: this is the samehello_builtinexample located in the RTI workspace area (typically~/rti_workspace) under theexamples/connext_dds/c/hello_builtindirectory. This example uses the popular autotools (autoconf, automake) to invokeconnext-configto determine the correct build settings. Refer to the README.md file for additional information on this example.example/autoconf-hello-idl-cpp: this is the samehello_idlexample located in the RTI workspace area, under theexamples/connext_dds/c++/hello_idldirectory. Similar to the previous example, this project uses autotools (autoconf, automake) to automatically invokertiddsgento generate type support code from the included IDL file, andconnext-configto obtain build settings for a given platform.examples/cmake-requestreply: this is the samehello_world_request_replyexample located in the RTI workspace area under theexamples/connext_dds/c/hello_world_request_replydirectory. This example uses cmake to invokeconnext-configand generate the appropriate build files. Refer to the README.md file for additional information on this example
-
The tool operates by looking up the requested information from the platform file used by
rtiddsgen. This file is located under:$NDDSHOME/resource/app/app_support/rtiddsgen/templates/projectfiles/platforms.vm.where
$NDDSHOMEis the directory where RTI Connext DDS is installed. Because of this dependency,connext-configneeds to be able to locate this directory. -
connext-configwill first use the environment variable$NDDSHOMEto locate the platform file above. If$NDDSHOMEis not defined, it will attempt to determine the location of the platform file from the location of theconnext-configapplication (assumes this tool is invoked from the$NDDSHOME/bindirectory). If it cannot locate theplatforms.vmfile, it will report an error. -
Starting from version 1.0.1,
connext-configthe target architecture can be omitted from the command line and specified in the environment variableNDDSARCH. For example: the following two lines are equivalent:
$ ./connext-config --cflags x64Linux4gcc7.3.0
$ NDDSARCH=x64Linux4gcc7.3.0 ./connext-config --cflags
-
All the error messages are printed to
stderr, while the normal results are printed tostdout(help is printed tostdout). -
The
--debugoption affects only the name of the required libraries and NOT the C or C++ compiler flags (for example, it does not include-gor disable any optimization, nor define any debug-related macros). -
Many platforms are not supported: Windows, iOS, Integrity, and in general all the platform where a project is normally not built through Makefile. All the unix-based architectures are supported.
-
To build
connext-configfrom the the git source tree, just run:$ autoreconf -ivf $ ./configure $ makeYou need to have the traditional autoconf, automake, make, buildtools installed in your system.
-
To build
connext-configfrom a source release, you don't need to invokeautoreconfas the .tar.gz already include the./configurescript. -
To install this application on your existing RTI Connext DDS installation:
- Copy the script:
bin/connext-configunder$NDDSHOME/bin - Copy the compiled version of connext-config under:
$NDDSHOME/resource/app/bin/<hostPlatform>(where is the name of the directory containing platform-specific binaries).
Alternatively just un-tar one of the pre-built binaries (see the Release page)
- Copy the script: