-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QNX Compatibility #1968
base: develop
Are you sure you want to change the base?
QNX Compatibility #1968
Changes from 12 commits
ba522a8
45adc0c
4eff178
b78a296
e33e05a
8d17fb3
93f463d
9d35582
26b301d
8489ebc
77c5c57
20d72d0
074f889
d35ff2e
903e7de
26f1ba0
5a02a22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,9 +197,11 @@ macro(gtsamAddTestsGlob_impl groupName globPatterns excludedFiles linkLibraries) | |
|
||
# Add TOPSRCDIR | ||
set_property(SOURCE ${script_src} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${GTSAM_SOURCE_DIR}\"") | ||
|
||
# Exclude from 'make all' and 'make install' | ||
set_target_properties(${script_name} PROPERTIES EXCLUDE_FROM_ALL ON) | ||
if(NOT QNX OR NOT DEFINED ENV{QNX_BUILD_TESTS}) | ||
set_target_properties(${script_name} PROPERTIES EXCLUDE_FROM_ALL ON) | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Allows tests to be built when compiling for QNX with option QNX_BUILD_TESTS There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there something specific to QNX that you need to use an environment variable? We normally do "make check" to run the tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can now be controlled by setting GTSAM_BUILD_TESTS to OFF, so no need for a QNX version. Removed env variable. |
||
|
||
# Configure target folder (for MSVC and Xcode) | ||
set_property(TARGET ${script_name} PROPERTY FOLDER "Unit tests/${groupName}") | ||
|
@@ -240,8 +242,10 @@ macro(gtsamAddTestsGlob_impl groupName globPatterns excludedFiles linkLibraries) | |
set_property(SOURCE ${script_srcs} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${GTSAM_SOURCE_DIR}\"") | ||
|
||
# Exclude from 'make all' and 'make install' | ||
set_target_properties(${target_name} PROPERTIES EXCLUDE_FROM_ALL ON) | ||
|
||
if(NOT QNX OR NOT DEFINED ENV{QNX_BUILD_TESTS}) | ||
set_target_properties(${target_name} PROPERTIES EXCLUDE_FROM_ALL ON) | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Allows tests to be built when compiling for QNX with option QNX_BUILD_TESTS |
||
|
||
# Configure target folder (for MSVC and Xcode) | ||
set_property(TARGET ${script_name} PROPERTY FOLDER "Unit tests") | ||
endif() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
file(GLOB ceres_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h") | ||
install(FILES ${ceres_headers} DESTINATION include/gtsam/3rdparty/ceres) | ||
if(NOT QNX) | ||
install(FILES ${ceres_headers} DESTINATION include/gtsam/3rdparty/ceres) | ||
else() | ||
#Install in the install include directory rather than at the install prefix. | ||
install(FILES ${ceres_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/3rdparty/ceres) | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a number of changes identical to this one, which handle the correct include directory for installation in qnx. Note that CMAKE_INSTALL_INCLUDEDIR should point to include/ by default, so in the future the QNX line could just replace the default one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is
JaiXJM-BB marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
install(FILES metis.h DESTINATION include/gtsam/3rdparty/metis) | ||
if(NOT QNX) | ||
install(FILES metis.h DESTINATION include/gtsam/3rdparty/metis) | ||
else() | ||
#Install in the install include directory rather than at the install prefix. | ||
install(FILES metis.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/3rdparty/metis) | ||
JaiXJM-BB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,10 @@ IF(MSVC) | |
ENDIF(MSVC) | ||
|
||
# Generate and install config and dllexport files | ||
#For config.in searches | ||
if(QNX) | ||
set(QNX_TARGET_DATASET_DIR "$ENV{QNX_TARGET_DATASET_DIR}") | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dataset directory is not examples/Data when running tests out of the source tree, so this is required to properly set the path. |
||
configure_file(config.h.in config.h) | ||
set(library_name GTSAM) # For substitution in dllexport.h.in | ||
configure_file("${GTSAM_SOURCE_DIR}/cmake/dllexport.h.in" "dllexport.h") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
# Install headers | ||
# Header groups | ||
file(GLOB base_headers "*.h") | ||
install(FILES ${base_headers} DESTINATION include/gtsam/base) | ||
|
||
file(GLOB base_headers_tree "treeTraversal/*.h") | ||
install(FILES ${base_headers_tree} DESTINATION include/gtsam/base/treeTraversal) | ||
|
||
JaiXJM-BB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Installation | ||
if(NOT QNX) | ||
install(FILES ${base_headers} DESTINATION include/gtsam/base) | ||
install(FILES ${base_headers_tree} DESTINATION include/gtsam/base/treeTraversal) | ||
else() | ||
# For QNX, Install in the Installation's Include Directory | ||
install(FILES ${base_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base) | ||
install(FILES ${base_headers_tree} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base/treeTraversal) | ||
endif() | ||
|
||
# Build tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,10 @@ namespace boost { namespace serialization { struct U; } } | |
namespace std { template<> struct is_trivially_default_constructible<boost::serialization::U> : std::false_type {}; } | ||
namespace std { template<> struct is_trivially_copy_constructible<boost::serialization::U> : std::false_type {}; } | ||
namespace std { template<> struct is_trivially_move_constructible<boost::serialization::U> : std::false_type {}; } | ||
// QCC (The QNX GCC-based Compiler) also has this issue, but it also extends to trivial destructor. | ||
#if defined(__QNX__) | ||
namespace std { template<> struct is_trivially_destructible<boost::serialization::U> : std::false_type {}; } | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84075 issue extendes to QNX, but also affects |
||
#endif | ||
#endif | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB basis_headers "*.h") | ||
install(FILES ${basis_headers} DESTINATION include/gtsam/basis) | ||
if(NOT QNX) | ||
install(FILES ${basis_headers} DESTINATION include/gtsam/basis) | ||
else() | ||
install(FILES ${basis_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/basis) | ||
endif() | ||
|
||
# Build tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,12 @@ | |
|
||
// Paths to example datasets distributed with GTSAM | ||
#define GTSAM_SOURCE_TREE_DATASET_DIR "@GTSAM_SOURCE_DIR@/examples/Data" | ||
#if !defined(__QNX__) | ||
#define GTSAM_INSTALLED_DATASET_DIR "@GTSAM_TOOLBOX_INSTALL_PATH@/gtsam_examples/Data" | ||
#else | ||
//Set toolbox path to the path on the target. | ||
#define GTSAM_INSTALLED_DATASET_DIR "@QNX_TARGET_DATASET_DIR@/gtsam_examples/Data" | ||
#endif | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Data path changed when testing outside of the source tree on QNX. |
||
// Whether GTSAM is compiled to use quaternions for Rot3 (otherwise uses rotation matrices) | ||
#cmakedefine GTSAM_USE_QUATERNIONS | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
# Install headers | ||
set(subdir discrete) | ||
file(GLOB discrete_headers "*.h") | ||
install(FILES ${discrete_headers} DESTINATION include/gtsam/discrete) | ||
# FIXME: exclude headers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This FIXME was not added by me; so I assume it may have been changed in the 430 or so commits I needed to merge into this one to get up to develop. This should be double checked before merging. |
||
if(QNX) | ||
install(FILES ${discrete_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/discrete) | ||
else() | ||
install(FILES ${discrete_headers} DESTINATION include/gtsam/discrete) | ||
endif() | ||
|
||
# Add all tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB geometry_headers "*.h") | ||
install(FILES ${geometry_headers} DESTINATION include/gtsam/geometry) | ||
if(QNX) | ||
install(FILES ${geometry_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/geometry) | ||
else() | ||
install(FILES ${geometry_headers} DESTINATION include/gtsam/geometry) | ||
endif() | ||
|
||
# Build tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB inference_headers "*.h") | ||
install(FILES ${inference_headers} DESTINATION include/gtsam/inference) | ||
if(QNX) | ||
install(FILES ${inference_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/inference) | ||
else() | ||
install(FILES ${inference_headers} DESTINATION include/gtsam/inference) | ||
endif() | ||
|
||
# Build tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -303,7 +303,7 @@ TEST(Ordering, MetisLoop) { | |
symbolicGraph.push_factor(0, 5); | ||
|
||
// METIS | ||
#if defined(__APPLE__) | ||
#if defined(__APPLE__) || defined(__QNX__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Follows apple ordering in test output. |
||
{ | ||
Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph); | ||
// - P( 1 0 3) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB linear_headers "*.h") | ||
install(FILES ${linear_headers} DESTINATION include/gtsam/linear) | ||
if(QNX) | ||
install(FILES ${linear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/linear) | ||
else() | ||
install(FILES ${linear_headers} DESTINATION include/gtsam/linear) | ||
endif() | ||
|
||
# Build tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB navigation_headers "*.h") | ||
install(FILES ${navigation_headers} DESTINATION include/gtsam/navigation) | ||
if(QNX) | ||
install(FILES ${navigation_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/navigation) | ||
else() | ||
install(FILES ${navigation_headers} DESTINATION include/gtsam/navigation) | ||
endif() | ||
|
||
# Add all tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
# Install headers | ||
file(GLOB nonlinear_headers "*.h") | ||
install(FILES ${nonlinear_headers} DESTINATION "include/gtsam/nonlinear") | ||
if(QNX) | ||
install(FILES ${nonlinear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/nonlinear) | ||
else() | ||
install(FILES ${nonlinear_headers} DESTINATION include/gtsam/nonlinear) | ||
endif() | ||
|
||
file(GLOB nonlinear_headers_internal "internal/*.h") | ||
install(FILES ${nonlinear_headers_internal} DESTINATION "include/gtsam/nonlinear/internal") | ||
|
||
if(QNX) | ||
install(FILES ${nonlinear_headers_internal} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/nonlinear/internal) | ||
else() | ||
install(FILES ${nonlinear_headers_internal} DESTINATION include/gtsam/nonlinear/internal) | ||
endif() | ||
# Build tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,9 +153,15 @@ TEST(Serialization, NoiseModelFactor1_backwards_compatibility) { | |
|
||
// Deserialize XML | ||
PriorFactor<Pose3> factor_deserialized_xml = PriorFactor<Pose3>(); | ||
#if !defined(__QNX__) | ||
deserializeFromXMLFile(GTSAM_SOURCE_TREE_DATASET_DIR | ||
"/../../gtsam/nonlinear/tests/priorFactor.xml", | ||
factor_deserialized_xml); | ||
#else | ||
bool c = deserializeFromXMLFile( | ||
"priorFactor.xml", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, a filepath search error on QNX. Changed to look in the same directory now, as outside of source tree. |
||
factor_deserialized_xml); | ||
#endif | ||
EXPECT(assert_equal(factor, factor_deserialized_xml)); | ||
#endif | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB sam_headers "*.h") | ||
install(FILES ${sam_headers} DESTINATION include/gtsam/sam) | ||
if(QNX) | ||
install(FILES ${sam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/sam) | ||
else() | ||
install(FILES ${sam_headers} DESTINATION include/gtsam/sam) | ||
endif() | ||
|
||
# Build tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB sfm_headers "*.h") | ||
install(FILES ${sfm_headers} DESTINATION include/gtsam/sfm) | ||
if(QNX) | ||
install(FILES ${sfm_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/sfm) | ||
else() | ||
install(FILES ${sfm_headers} DESTINATION include/gtsam/sfm) | ||
endif() | ||
|
||
# Build tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB symbolic_headers "*.h") | ||
install(FILES ${symbolic_headers} DESTINATION include/gtsam/symbolic) | ||
if(QNX) | ||
install(FILES ${symbolic_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/symbolic) | ||
else() | ||
install(FILES ${symbolic_headers} DESTINATION include/gtsam/symbolic) | ||
endif() | ||
|
||
# Build tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -687,7 +687,7 @@ TEST(SymbolicBayesTree, COLAMDvsMETIS) { | |
{ | ||
Ordering ordering = Ordering::Create(Ordering::METIS, sfg); | ||
// Linux and Mac split differently when using Metis | ||
#if defined(__APPLE__) | ||
#if defined(__APPLE__) || defined(__QNX__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, ordering results on QNX seem to follow the APPLE results from Metis. |
||
EXPECT(assert_equal(Ordering{5, 4, 2, 1, 0, 3}, ordering)); | ||
#elif defined(_WIN32) | ||
EXPECT(assert_equal(Ordering{4, 3, 1, 0, 5, 2}, ordering)); | ||
|
@@ -700,7 +700,7 @@ TEST(SymbolicBayesTree, COLAMDvsMETIS) { | |
// | | - P( 5 | 0 4) | ||
// | - P( 2 | 1 3) | ||
SymbolicBayesTree expected; | ||
#if defined(__APPLE__) | ||
#if defined(__APPLE__) || defined(__QNX__) | ||
expected.insertRoot( | ||
NodeClique(Keys(1)(0)(3), 3, | ||
Children( // | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB base_headers "*.h") | ||
install(FILES ${base_headers} DESTINATION include/gtsam_unstable/base) | ||
if(QNX) | ||
install(FILES ${base_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/base) | ||
else() | ||
install(FILES ${base_headers} DESTINATION include/gtsam_unstable/base) | ||
endif() | ||
|
||
# Add all tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,11 @@ TEST(schedulingExample, test) { | |
|
||
/* ************************************************************************* */ | ||
TEST(schedulingExample, smallFromFile) { | ||
#if !defined(__QNX__) | ||
string path(TOPSRCDIR "/gtsam_unstable/discrete/examples/"); | ||
#else | ||
string path(""); //Same Directory | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another path change when testing out of the source tree. |
||
#endif | ||
Scheduler s(2, path + "small.csv"); | ||
|
||
// add areas | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB dynamics_headers "*.h") | ||
install(FILES ${dynamics_headers} DESTINATION include/gtsam_unstable/dynamics) | ||
if(QNX) | ||
install(FILES ${dynamics_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/dynamics) | ||
else() | ||
install(FILES ${dynamics_headers} DESTINATION include/gtsam_unstable/dynamics) | ||
endif() | ||
|
||
# Add all tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB geometry_headers "*.h") | ||
install(FILES ${geometry_headers} DESTINATION include/gtsam_unstable/geometry) | ||
if(QNX) | ||
install(FILES ${geometry_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/geometry) | ||
else() | ||
install(FILES ${geometry_headers} DESTINATION include/gtsam_unstable/geometry) | ||
endif() | ||
|
||
# Add all tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB linear_headers "*.h") | ||
install(FILES ${linear_headers} DESTINATION include/gtsam_unstable/linear) | ||
if(QNX) | ||
install(FILES ${linear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/linear) | ||
else() | ||
install(FILES ${linear_headers} DESTINATION include/gtsam_unstable/linear) | ||
endif() | ||
|
||
# Add all tests | ||
add_subdirectory(tests) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Install headers | ||
file(GLOB nonlinear_headers "*.h") | ||
install(FILES ${nonlinear_headers} DESTINATION include/gtsam_unstable/nonlinear) | ||
if(QNX) | ||
install(FILES ${nonlinear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/nonlinear) | ||
else() | ||
install(FILES ${nonlinear_headers} DESTINATION include/gtsam_unstable/nonlinear) | ||
endif() | ||
|
||
# Add all tests | ||
add_subdirectory(tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this might be a merging error - is line 211 meant to be here?