Skip to content
Permalink
Browse files

* Adding an option for warnings=1 in the build system so we can toggl…

…e whether we want -w (no warnings) or -Wall (warnings). Currently, the GAMS build is spitting out over 3k warnings due to Eigen and an interaction with some macro. Since this is out of our hands, we're allowing for suppressing warnings by default and only enabling with the warnings feature on base_build.sh

* Changed logging with OscPlatform.cpp to be LOG_MAJOR for creating a new agent in the UnrealGAMS sim
  • Loading branch information...
jredmondson committed Feb 26, 2019
1 parent c3bbc64 commit 8960420b6bc815b2026f3f37e200428da90fa694
Showing with 42 additions and 18 deletions.
  1. +4 −0 default.features
  2. +1 −1 gams.mpc
  3. +5 −0 no_warnings.mpb
  4. +16 −12 scripts/linux/base_build.sh
  5. +8 −2 src/gams/platforms/osc/OscPlatform.cpp
  6. +1 −1 using_gams.mpb
  7. +1 −2 using_madara.mpb
  8. +6 −0 using_warnings.mpb
@@ -76,3 +76,7 @@ simtime = 0
/// @feature airlib
/// This is required to build GAMS with AirLib. AirLib is a requirement to interface the GAMS algorithms with the Unreal engine and to see things working in an Unreal simulation. 'prereqs unreal' is used to actually pull in and download Unreal. The airlib command is used to build the GAMS library with an airlib integration, which is actually separate.
airlib = 0

/// @feature warnings
/// This feature enables compilation warnings to debug GAMS core libraries
warnings = 0
@@ -1,4 +1,4 @@
project (gams) : build_files, using_airlib, airlib_lib, using_madara, using_utm, using_ros, using_simtime, using_vrep, vrep_lib, ros_lib, port/java/using_android, port/java/using_java, port/java/using_openjdk, using_boost, using_nortti, using_nothreadlocal, using_osc {
project (gams) : build_files, using_airlib, airlib_lib, using_madara, using_utm, using_ros, using_simtime, using_vrep, vrep_lib, ros_lib, port/java/using_android, port/java/using_java, port/java/using_openjdk, using_boost, using_nortti, using_nothreadlocal, using_osc, using_warnings, no_warnings {
libout = lib
libout = $(GAMS_ROOT)/lib
sharedname = GAMS
@@ -0,0 +1,5 @@
feature (!warnings) {
verbatim (make, local, true) {
CPPFLAGS := $(CPPFLAGS) -w
}
}
@@ -101,6 +101,7 @@ SSL=0
DMPL=0
LZ4=0
PYTHON=0
WARNINGS=0
CLEAN=1
MADARAPULL=1
GAMSPULL=1
@@ -264,6 +265,8 @@ do
VREP=1
elif [ "$var" = "vrep-config" ]; then
VREP_CONFIG=1
elif [ "$var" = "warnings" ]; then
WARNINGS=1
elif [ "$var" = "zmq" ]; then
ZMQ=1
else
@@ -309,6 +312,7 @@ do
echo " unreal-gams builds UnrealGAMS"
echo " vrep build with vrep support"
echo " vrep-config configure vrep to support up to 20 agents"
echo " warnings build with compile warnings enabled in GAMS/MADARA"
echo " zmq build with ZeroMQ support"
echo ""
echo "The following environment variables are used"
@@ -1170,8 +1174,8 @@ if [ $MADARA -eq 1 ] || [ $MADARA_AS_A_PREREQ -eq 1 ]; then
fi
cd $MADARA_ROOT
echo "GENERATING MADARA PROJECT"
echo "perl $MPC_ROOT/mwc.pl -type make -features android=$ANDROID,python=$PYTHON,java=$JAVA,tests=$TESTS,tutorials=$TUTORIALS,docs=$DOCS,ssl=$SSL,zmq=$ZMQ,simtime=$SIMTIME,nothreadlocal=$NOTHREADLOCAL,clang=$CLANG,debug=$DEBUG MADARA.mwc"
perl $MPC_ROOT/mwc.pl -type make -features lz4=$LZ4,android=$ANDROID,python=$PYTHON,java=$JAVA,tests=$TESTS,tutorials=$TUTORIALS,docs=$DOCS,ssl=$SSL,zmq=$ZMQ,simtime=$SIMTIME,nothreadlocal=$NOTHREADLOCAL,clang=$CLANG,debug=$DEBUG MADARA.mwc
echo "perl $MPC_ROOT/mwc.pl -type make -features android=$ANDROID,python=$PYTHON,java=$JAVA,tests=$TESTS,tutorials=$TUTORIALS,docs=$DOCS,ssl=$SSL,zmq=$ZMQ,simtime=$SIMTIME,nothreadlocal=$NOTHREADLOCAL,clang=$CLANG,debug=$DEBUG,warnings=$WARNINGS MADARA.mwc"
perl $MPC_ROOT/mwc.pl -type make -features lz4=$LZ4,android=$ANDROID,python=$PYTHON,java=$JAVA,tests=$TESTS,tutorials=$TUTORIALS,docs=$DOCS,ssl=$SSL,zmq=$ZMQ,simtime=$SIMTIME,nothreadlocal=$NOTHREADLOCAL,clang=$CLANG,debug=$DEBUG,warnings=$WARNINGS MADARA.mwc

if [ $JAVA -eq 1 ]; then
echo "DELETING MADARA JAVA CLASSES"
@@ -1181,10 +1185,10 @@ if [ $MADARA -eq 1 ] || [ $MADARA_AS_A_PREREQ -eq 1 ]; then
fi

echo "BUILDING MADARA"
echo "make depend android=$ANDROID java=$JAVA tests=$TESTS tutorials=$TUTORIALS docs=$DOCS ssl=$SSL zmq=$ZMQ simtime=$SIMTIME python=$PYTHON -j $CORES"
make depend lz4=$LZ4 android=$ANDROID java=$JAVA tests=$TESTS tutorials=$TUTORIALS docs=$DOCS ssl=$SSL zmq=$ZMQ simtime=$SIMTIME python=$PYTHON -j $CORES
echo "make android=$ANDROID java=$JAVA tests=$TESTS tutorials=$TUTORIALS docs=$DOCS ssl=$SSL zmq=$ZMQ simtime=$SIMTIME python=$PYTHON -j $CORES"
make lz4=$LZ4 android=$ANDROID java=$JAVA tests=$TESTS tutorials=$TUTORIALS docs=$DOCS ssl=$SSL zmq=$ZMQ simtime=$SIMTIME python=$PYTHON -j $CORES
echo "make depend android=$ANDROID java=$JAVA tests=$TESTS tutorials=$TUTORIALS docs=$DOCS ssl=$SSL zmq=$ZMQ simtime=$SIMTIME python=$PYTHON warnings=$WARNINGS -j $CORES"
make depend lz4=$LZ4 android=$ANDROID java=$JAVA tests=$TESTS tutorials=$TUTORIALS docs=$DOCS ssl=$SSL zmq=$ZMQ simtime=$SIMTIME python=$PYTHON warnings=$WARNINGS -j $CORES
echo "make android=$ANDROID java=$JAVA tests=$TESTS tutorials=$TUTORIALS docs=$DOCS ssl=$SSL zmq=$ZMQ simtime=$SIMTIME python=$PYTHON warnings=$WARNINGS -j $CORES"
make lz4=$LZ4 android=$ANDROID java=$JAVA tests=$TESTS tutorials=$TUTORIALS docs=$DOCS ssl=$SSL zmq=$ZMQ simtime=$SIMTIME python=$PYTHON warnings=$WARNINGS -j $CORES
MADARA_BUILD_RESULT=$?
if [ ! -f $MADARA_ROOT/lib/libMADARA.so ]; then
MADARA_BUILD_RESULT=1
@@ -1286,8 +1290,8 @@ if [ $GAMS -eq 1 ] || [ $GAMS_AS_A_PREREQ -eq 1 ]; then
cd $GAMS_ROOT

echo "GENERATING GAMS PROJECT"
echo "perl $MPC_ROOT/mwc.pl -type make -features airlib=$AIRLIB,java=$JAVA,ros=$ROS,types=$TYPES,vrep=$VREP,tests=$TESTS,android=$ANDROID,docs=$DOCS,clang=$CLANG,simtime=$SIMTIME,debug=$DEBUG gams.mwc"
perl $MPC_ROOT/mwc.pl -type make -features airlib=$AIRLIB,java=$JAVA,ros=$ROS,python=$PYTHON,types=$TYPES,vrep=$VREP,tests=$TESTS,android=$ANDROID,docs=$DOCS,clang=$CLANG,simtime=$SIMTIME,debug=$DEBUG gams.mwc
echo "perl $MPC_ROOT/mwc.pl -type make -features airlib=$AIRLIB,java=$JAVA,ros=$ROS,types=$TYPES,vrep=$VREP,tests=$TESTS,android=$ANDROID,docs=$DOCS,clang=$CLANG,simtime=$SIMTIME,debug=$DEBUG,warnings=$WARNINGS gams.mwc"
perl $MPC_ROOT/mwc.pl -type make -features airlib=$AIRLIB,java=$JAVA,ros=$ROS,python=$PYTHON,types=$TYPES,vrep=$VREP,tests=$TESTS,android=$ANDROID,docs=$DOCS,clang=$CLANG,simtime=$SIMTIME,debug=$DEBUG,warnings=$WARNINGS gams.mwc

if [ $TYPES -eq 1 ]; then
# Strip the unnecessary NOTPARALLEL: directives
@@ -1301,10 +1305,10 @@ if [ $GAMS -eq 1 ] || [ $GAMS_AS_A_PREREQ -eq 1 ]; then
fi

echo "BUILDING GAMS"
echo "make depend airlib=$AIRLIB java=$JAVA ros=$ROS types=$TYPES vrep=$VREP tests=$TESTS android=$ANDROID simtime=$SIMTIME docs=$DOCS -j $CORES"
make depend airlib=$AIRLIB java=$JAVA ros=$ROS types=$TYPES vrep=$VREP tests=$TESTS android=$ANDROID simtime=$SIMTIME docs=$DOCS -j $CORES
echo "make airlib=$AIRLIB java=$JAVA ros=$ROS types=$TYPES vrep=$VREP tests=$TESTS android=$ANDROID simtime=$SIMTIME docs=$DOCS -j $CORES"
make airlib=$AIRLIB java=$JAVA ros=$ROS types=$TYPES vrep=$VREP python=$PYTHON tests=$TESTS android=$ANDROID simtime=$SIMTIME docs=$DOCS -j $CORES
echo "make depend airlib=$AIRLIB java=$JAVA ros=$ROS types=$TYPES vrep=$VREP tests=$TESTS android=$ANDROID simtime=$SIMTIME docs=$DOCS warnings=$WARNINGS -j $CORES"
make depend airlib=$AIRLIB java=$JAVA ros=$ROS types=$TYPES vrep=$VREP tests=$TESTS android=$ANDROID simtime=$SIMTIME docs=$DOCS warnings=$WARNINGS -j $CORES
echo "make airlib=$AIRLIB java=$JAVA ros=$ROS types=$TYPES vrep=$VREP tests=$TESTS android=$ANDROID simtime=$SIMTIME docs=$DOCS warnings=$WARNINGS -j $CORES"
make airlib=$AIRLIB java=$JAVA ros=$ROS types=$TYPES vrep=$VREP python=$PYTHON tests=$TESTS android=$ANDROID simtime=$SIMTIME docs=$DOCS warnings=$WARNINGS -j $CORES
GAMS_BUILD_RESULT=$?

if [ ! -f $GAMS_ROOT/lib/libGAMS.so ]; then
@@ -147,13 +147,12 @@ gams::platforms::OscPlatform::OscPlatform(


madara_logger_ptr_log(gams::loggers::global_logger.get(),
gams::loggers::LOG_ALWAYS,
gams::loggers::LOG_MAJOR,
"gams::platforms::OscPlatform::const: creating agent with JSON:" \
" %s:\n%s\n",
self_->agent.prefix.c_str(),
json_creation_.c_str());


osc_.create_socket(settings_);

utility::OscUdp::OscMap values;
@@ -370,6 +369,13 @@ gams::platforms::OscPlatform::sense(void)
// if we've never received a server packet for this agent, recreate
if (!is_created_)
{
madara_logger_ptr_log(gams::loggers::global_logger.get(),
gams::loggers::LOG_MAJOR,
"gams::platforms::OscPlatform::sense: recreating agent with JSON:" \
" %s:\n%s\n",
self_->agent.prefix.c_str(),
json_creation_.c_str());

utility::OscUdp::OscMap values;
values["/spawn/quadcopter"] = KnowledgeRecord(json_creation_);

@@ -1,4 +1,4 @@
project : using_madara, using_osc {
project : using_madara, using_osc, using_warnings, no_warnings {
includes += $(GAMS_ROOT)/src
includes += $(EIGEN_ROOT)

@@ -11,8 +11,7 @@ project : debug_build, using_clang, using_android, using_boost, using_nothreadlo
}

verbatim (make, local, true) {
CPPFLAGS := -std=c++11 -Wall -Wextra -Wnon-virtual-dtor \
-Woverloaded-virtual -O3 $(CPPFLAGS)
CPPFLAGS := -std=c++11 -O3 $(CPPFLAGS)
LDLIBS := $(LDLIBS) -lMADARA
}
}
@@ -0,0 +1,6 @@
feature (warnings) {
verbatim (make, local, true) {
CPPFLAGS := $(CPPFLAGS) -Wall -Wextra -Wnon-virtual-dtor \
-Woverloaded-virtual -pedantic
}
}

0 comments on commit 8960420

Please sign in to comment.
You can’t perform that action at this time.