new version under progress
This commit is contained in:
@@ -49,3 +49,18 @@ See the Wiki for more instructions. https://github.com/uzh-rpg/rpg_svo/wiki and
|
||||
You can edit the algorithm parameters in the follwoing file, please look at the config file to underestand the meaning of the parameters (CPU_version/svo/include/svo/config.h)
|
||||
|
||||
CPU_version/vio_svo/param/vo_fast.yaml
|
||||
|
||||
# the GPU_version
|
||||
|
||||
Dose not have dependency with GTSAM, the dependencies are:
|
||||
1. OpenCV 3
|
||||
2. Eigen
|
||||
3. Sophus https://github.com/strasdat/Sophus.git
|
||||
4. Boost
|
||||
5. OpenCL
|
||||
|
||||
if make fails in the build of Sophus with the error lvalue required as left operand of assignment in so2.cpp, see this issue: https://github.com/uzh-rpg/rpg_svo/issues/237
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
Generated
-1
@@ -1 +0,0 @@
|
||||
gpu_svo
|
||||
Generated
-4
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/svo.iml" filepath="$PROJECT_DIR$/.idea/svo.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-7
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,99 +0,0 @@
|
||||
SET(PROJECT_NAME gpu_svo)
|
||||
PROJECT(${PROJECT_NAME})
|
||||
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.3)
|
||||
|
||||
SET(CMAKE_BUILD_TYPE Release) # Release, RelWithDebInfo
|
||||
SET(CMAKE_VERBOSE_MAKEFILE OFF)
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/CMakeModules/")
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
# Set definitions
|
||||
ADD_DEFINITIONS(-DSVO_TRACE)
|
||||
ADD_DEFINITIONS(-DSVO_USE_ROS)
|
||||
|
||||
|
||||
# Set build flags, set ARM_ARCHITECTURE environment variable on Odroid
|
||||
# Set build flags. Set IS_ARM on odroid board as environment variable
|
||||
SET(CMAKE_CXX_FLAGS "-Wall -D_LINUX -D_REENTRANT -march=native -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas")
|
||||
IF(DEFINED ENV{ARM_ARCHITECTURE})
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
|
||||
ELSE()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse -msse2 -msse3 -mssse3")
|
||||
ENDIF()
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -fsee -fomit-frame-pointer -fno-signed-zeros -fno-math-errno -funroll-loops")
|
||||
|
||||
# Add plain cmake packages
|
||||
FIND_PACKAGE(OpenCV REQUIRED)
|
||||
FIND_PACKAGE(Eigen REQUIRED)
|
||||
FIND_PACKAGE(Sophus REQUIRED)
|
||||
FIND_PACKAGE(Boost REQUIRED COMPONENTS thread system)
|
||||
FIND_PACKAGE(GTSAM REQUIRED)
|
||||
FIND_PACKAGE(OpenCL REQUIRED)
|
||||
FIND_PACKAGE(vikit_common REQUIRED)
|
||||
|
||||
set(GTSAM_INCLUDE_DIRS "${GTSAM_INCLUDE_DIR}")
|
||||
FIND_PACKAGE(catkin REQUIRED COMPONENTS roscpp roslib cmake_modules vikit_common vikit_ros)
|
||||
catkin_package(
|
||||
DEPENDS Eigen OpenCV Sophus Boost fast GTSAM
|
||||
CATKIN_DEPENDS roscpp roslib vikit_common vikit_ros
|
||||
INCLUDE_DIRS include
|
||||
LIBRARIES ${PROJECT_NAME}
|
||||
)
|
||||
|
||||
|
||||
# Include dirs
|
||||
INCLUDE_DIRECTORIES(
|
||||
include
|
||||
kernel
|
||||
${Eigen_INCLUDE_DIRS}
|
||||
${OpenCV_INCLUDE_DIRS}
|
||||
${Sophus_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${OpenCL_INCLUDE_DIRS}
|
||||
${GTSAM_INCLUDE_DIR}
|
||||
${catkin_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Set link libraries
|
||||
LIST(APPEND LINK_LIBS
|
||||
gtsam
|
||||
${OpenCV_LIBS}
|
||||
${Sophus_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${OpenCL_LIBRARIES}
|
||||
${catkin_LIBRARIES}
|
||||
)
|
||||
|
||||
|
||||
# Set sourcefiles
|
||||
LIST(APPEND SOURCEFILES
|
||||
src/frame_handler_mono.cpp
|
||||
src/frame_handler_base.cpp
|
||||
src/frame.cpp
|
||||
src/point.cpp
|
||||
src/map.cpp
|
||||
src/pose_optimizer.cpp
|
||||
src/initialization.cpp
|
||||
src/matcher.cpp
|
||||
src/reprojector.cpp
|
||||
src/feature_alignment.cpp
|
||||
src/feature_detection.cpp
|
||||
src/depth_filter.cpp
|
||||
src/config.cpp
|
||||
src/sparse_img_align.cpp
|
||||
src/imu_integration.cpp
|
||||
src/cl_class.cpp
|
||||
src/atan_camera.cpp
|
||||
src/math_utils.cpp
|
||||
src/robust_cost.cpp
|
||||
src/vision.cpp
|
||||
src/homography.cpp)
|
||||
|
||||
# Create svo library
|
||||
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SOURCEFILES})
|
||||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LINK_LIBS} )
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_range_for)
|
||||
ADD_DEFINITIONS(-DKERNEL_DIR=\"${PROJECT_SOURCE_DIR}/kernel\")
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<package>
|
||||
<name>gpu_svo</name>
|
||||
<version>0.1.0</version>
|
||||
<description>
|
||||
Monocular Visual Odometry
|
||||
</description>
|
||||
<author>Christian Forster</author>
|
||||
<maintainer email="[email protected]">Christian Forster</maintainer>
|
||||
<license>GPLv3</license>
|
||||
|
||||
<!-- Dependencies which this package needs to build itself. -->
|
||||
<buildtool_depend>catkin</buildtool_depend>
|
||||
|
||||
<!-- Dependencies needed to compile this package. -->
|
||||
<build_depend>cmake_modules</build_depend> <!-- for FindEigen.cmake -->
|
||||
<build_depend>roscpp</build_depend>
|
||||
<build_depend>roslib</build_depend>
|
||||
<build_depend>vikit_common</build_depend>
|
||||
<build_depend>vikit_ros</build_depend>
|
||||
|
||||
<!-- Dependencies needed after this package is compiled. -->
|
||||
<run_depend>roscpp</run_depend>
|
||||
<run_depend>roslib</run_depend>
|
||||
<run_depend>vikit_common</run_depend>
|
||||
<run_depend>vikit_ros</run_depend>
|
||||
</package>
|
||||
@@ -1,435 +0,0 @@
|
||||
// This file is part of SVO - Semi-direct Visual Odometry.
|
||||
//
|
||||
// Copyright (C) 2014 Christian Forster <forster at ifi dot uzh dot ch>
|
||||
// (Robotics and Perception Group, University of Zurich, Switzerland).
|
||||
//
|
||||
// SVO is free software: you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the Free Software
|
||||
// Foundation, either version 3 of the License, or any later version.
|
||||
//
|
||||
// SVO is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include <gpu_svo/math_utils.h>
|
||||
#include <boost/thread.hpp>
|
||||
#include <g2o/core/sparse_optimizer.h>
|
||||
#include <g2o/core/block_solver.h>
|
||||
#include <g2o/core/solver.h>
|
||||
#include <g2o/core/robust_kernel_impl.h>
|
||||
#include <g2o/core/optimization_algorithm_levenberg.h>
|
||||
#include <g2o/solvers/cholmod/linear_solver_cholmod.h>
|
||||
#include <g2o/solvers/csparse/linear_solver_csparse.h>
|
||||
#include <g2o/solvers/dense/linear_solver_dense.h>
|
||||
#include <g2o/types/sba/types_six_dof_expmap.h>
|
||||
#include <g2o/solvers/structure_only/structure_only_solver.h>
|
||||
#include <gpu_svo/bundle_adjustment.h>
|
||||
#include <gpu_svo/frame.h>
|
||||
#include <gpu_svo/feature.h>
|
||||
#include <gpu_svo/point.h>
|
||||
#include <gpu_svo/config.h>
|
||||
#include <gpu_svo/map.h>
|
||||
|
||||
#define SCHUR_TRICK 1
|
||||
|
||||
namespace svo {
|
||||
namespace ba {
|
||||
|
||||
void twoViewBA(
|
||||
Frame* frame1,
|
||||
Frame* frame2,
|
||||
double reproj_thresh,
|
||||
Map* map)
|
||||
{
|
||||
// scale reprojection threshold in pixels to unit plane
|
||||
reproj_thresh /= frame1->cam_->errorMultiplier2();
|
||||
|
||||
// init g2o
|
||||
g2o::SparseOptimizer optimizer;
|
||||
setupG2o(&optimizer);
|
||||
|
||||
list<EdgeContainerSE3> edges;
|
||||
size_t v_id = 0;
|
||||
|
||||
// New Keyframe Vertex 1: This Keyframe is set to fixed!
|
||||
g2oFrameSE3* v_frame1 = createG2oFrameSE3(frame1, v_id++, true);
|
||||
optimizer.addVertex(v_frame1);
|
||||
|
||||
// New Keyframe Vertex 2
|
||||
g2oFrameSE3* v_frame2 = createG2oFrameSE3(frame2, v_id++, false);
|
||||
optimizer.addVertex(v_frame2);
|
||||
|
||||
// Create Point Vertices
|
||||
for(Features::iterator it_ftr=frame1->fts_.begin(); it_ftr!=frame1->fts_.end(); ++it_ftr)
|
||||
{
|
||||
Point* pt = (*it_ftr)->point;
|
||||
if(pt == NULL)
|
||||
continue;
|
||||
g2oPoint* v_pt = createG2oPoint(pt->pos_, v_id++, false);
|
||||
optimizer.addVertex(v_pt);
|
||||
pt->v_pt_ = v_pt;
|
||||
g2oEdgeSE3* e = createG2oEdgeSE3(v_frame1, v_pt, vk::project2d((*it_ftr)->f), true, reproj_thresh*Config::lobaRobustHuberWidth());
|
||||
optimizer.addEdge(e);
|
||||
edges.push_back(EdgeContainerSE3(e, frame1, *it_ftr)); // TODO feature now links to frame, so we can simplify edge container!
|
||||
|
||||
// find at which index the second frame observes the point
|
||||
Feature* ftr_frame2 = pt->findFrameRef(frame2);
|
||||
e = createG2oEdgeSE3(v_frame2, v_pt, vk::project2d(ftr_frame2->f), true, reproj_thresh*Config::lobaRobustHuberWidth());
|
||||
optimizer.addEdge(e);
|
||||
edges.push_back(EdgeContainerSE3(e, frame2, ftr_frame2));
|
||||
}
|
||||
|
||||
// Optimization
|
||||
double init_error, final_error;
|
||||
runSparseBAOptimizer(&optimizer, Config::lobaNumIter(), init_error, final_error);
|
||||
printf("2-View BA: Error before/after = %f / %f\n", init_error, final_error);
|
||||
|
||||
// Update Keyframe Positions
|
||||
frame1->T_f_w_.rotation_matrix() = v_frame1->estimate().rotation().toRotationMatrix();
|
||||
frame1->T_f_w_.translation() = v_frame1->estimate().translation();
|
||||
frame2->T_f_w_.rotation_matrix() = v_frame2->estimate().rotation().toRotationMatrix();
|
||||
frame2->T_f_w_.translation() = v_frame2->estimate().translation();
|
||||
|
||||
// Update Mappoint Positions
|
||||
for(Features::iterator it=frame1->fts_.begin(); it!=frame1->fts_.end(); ++it)
|
||||
{
|
||||
if((*it)->point == NULL)
|
||||
continue;
|
||||
(*it)->point->pos_ = (*it)->point->v_pt_->estimate();
|
||||
(*it)->point->v_pt_ = NULL;
|
||||
}
|
||||
|
||||
// Find Mappoints with too large reprojection error
|
||||
const double reproj_thresh_squared = reproj_thresh*reproj_thresh;
|
||||
size_t n_incorrect_edges = 0;
|
||||
for(list<EdgeContainerSE3>::iterator it_e = edges.begin(); it_e != edges.end(); ++it_e)
|
||||
if(it_e->edge->chi2() > reproj_thresh_squared)
|
||||
{
|
||||
if(it_e->feature->point != NULL)
|
||||
{
|
||||
map->safeDeletePoint(it_e->feature->point);
|
||||
it_e->feature->point = NULL;
|
||||
}
|
||||
++n_incorrect_edges;
|
||||
}
|
||||
|
||||
printf("2-View BA: Wrong edges = %zu\n", n_incorrect_edges);
|
||||
}
|
||||
|
||||
void localBA(
|
||||
Frame* center_kf,
|
||||
set<FramePtr>* core_kfs,
|
||||
Map* map,
|
||||
size_t& n_incorrect_edges_1,
|
||||
size_t& n_incorrect_edges_2,
|
||||
double& init_error,
|
||||
double& final_error)
|
||||
{
|
||||
|
||||
// init g2o
|
||||
g2o::SparseOptimizer optimizer;
|
||||
setupG2o(&optimizer);
|
||||
|
||||
list<EdgeContainerSE3> edges;
|
||||
set<Point*> mps;
|
||||
list<Frame*> neib_kfs;
|
||||
size_t v_id = 0;
|
||||
size_t n_mps = 0;
|
||||
size_t n_fix_kfs = 0;
|
||||
size_t n_var_kfs = 1;
|
||||
size_t n_edges = 0;
|
||||
n_incorrect_edges_1 = 0;
|
||||
n_incorrect_edges_2 = 0;
|
||||
|
||||
// Add all core keyframes
|
||||
for(set<FramePtr>::iterator it_kf = core_kfs->begin(); it_kf != core_kfs->end(); ++it_kf)
|
||||
{
|
||||
g2oFrameSE3* v_kf = createG2oFrameSE3(it_kf->get(), v_id++, false);
|
||||
(*it_kf)->v_kf_ = v_kf;
|
||||
++n_var_kfs;
|
||||
assert(optimizer.addVertex(v_kf));
|
||||
|
||||
// all points that the core keyframes observe are also optimized:
|
||||
for(Features::iterator it_pt=(*it_kf)->fts_.begin(); it_pt!=(*it_kf)->fts_.end(); ++it_pt)
|
||||
if((*it_pt)->point != NULL)
|
||||
mps.insert((*it_pt)->point);
|
||||
}
|
||||
|
||||
// Now go throug all the points and add a measurement. Add a fixed neighbour
|
||||
// Keyframe if it is not in the set of core kfs
|
||||
double reproj_thresh_2 = Config::lobaThresh() / center_kf->cam_->errorMultiplier2();
|
||||
double reproj_thresh_1 = Config::poseOptimThresh() / center_kf->cam_->errorMultiplier2();
|
||||
double reproj_thresh_1_squared = reproj_thresh_1*reproj_thresh_1;
|
||||
for(set<Point*>::iterator it_pt = mps.begin(); it_pt!=mps.end(); ++it_pt)
|
||||
{
|
||||
// Create point vertex
|
||||
g2oPoint* v_pt = createG2oPoint((*it_pt)->pos_, v_id++, false);
|
||||
(*it_pt)->v_pt_ = v_pt;
|
||||
assert(optimizer.addVertex(v_pt));
|
||||
++n_mps;
|
||||
|
||||
// Add edges
|
||||
list<Feature*>::iterator it_obs=(*it_pt)->obs_.begin();
|
||||
while(it_obs!=(*it_pt)->obs_.end())
|
||||
{
|
||||
Vector2d error = vk::project2d((*it_obs)->f) - vk::project2d((*it_obs)->frame->w2f((*it_pt)->pos_));
|
||||
|
||||
if((*it_obs)->frame->v_kf_ == NULL)
|
||||
{
|
||||
// frame does not have a vertex yet -> it belongs to the neib kfs and
|
||||
// is fixed. create one:
|
||||
g2oFrameSE3* v_kf = createG2oFrameSE3((*it_obs)->frame, v_id++, true);
|
||||
(*it_obs)->frame->v_kf_ = v_kf;
|
||||
++n_fix_kfs;
|
||||
assert(optimizer.addVertex(v_kf));
|
||||
neib_kfs.push_back((*it_obs)->frame);
|
||||
}
|
||||
|
||||
// create edge
|
||||
g2oEdgeSE3* e = createG2oEdgeSE3((*it_obs)->frame->v_kf_, v_pt,
|
||||
vk::project2d((*it_obs)->f),
|
||||
true,
|
||||
reproj_thresh_2*Config::lobaRobustHuberWidth(),
|
||||
1.0 / (1<<(*it_obs)->level));
|
||||
assert(optimizer.addEdge(e));
|
||||
edges.push_back(EdgeContainerSE3(e, (*it_obs)->frame, *it_obs));
|
||||
++n_edges;
|
||||
++it_obs;
|
||||
}
|
||||
}
|
||||
|
||||
// structure only
|
||||
g2o::StructureOnlySolver<3> structure_only_ba;
|
||||
g2o::OptimizableGraph::VertexContainer points;
|
||||
for (g2o::OptimizableGraph::VertexIDMap::const_iterator it = optimizer.vertices().begin(); it != optimizer.vertices().end(); ++it)
|
||||
{
|
||||
g2o::OptimizableGraph::Vertex* v = static_cast<g2o::OptimizableGraph::Vertex*>(it->second);
|
||||
if (v->dimension() == 3 && v->edges().size() >= 2)
|
||||
points.push_back(v);
|
||||
}
|
||||
structure_only_ba.calc(points, 10);
|
||||
|
||||
// Optimization
|
||||
if(Config::lobaNumIter() > 0)
|
||||
runSparseBAOptimizer(&optimizer, Config::lobaNumIter(), init_error, final_error);
|
||||
|
||||
// Update Keyframes
|
||||
for(set<FramePtr>::iterator it = core_kfs->begin(); it != core_kfs->end(); ++it)
|
||||
{
|
||||
(*it)->T_f_w_ = SE3( (*it)->v_kf_->estimate().rotation(),
|
||||
(*it)->v_kf_->estimate().translation());
|
||||
(*it)->v_kf_ = NULL;
|
||||
}
|
||||
|
||||
for(list<Frame*>::iterator it = neib_kfs.begin(); it != neib_kfs.end(); ++it)
|
||||
(*it)->v_kf_ = NULL;
|
||||
|
||||
// Update Mappoints
|
||||
for(set<Point*>::iterator it = mps.begin(); it != mps.end(); ++it)
|
||||
{
|
||||
(*it)->pos_ = (*it)->v_pt_->estimate();
|
||||
(*it)->v_pt_ = NULL;
|
||||
}
|
||||
|
||||
// Remove Measurements with too large reprojection error
|
||||
double reproj_thresh_2_squared = reproj_thresh_2*reproj_thresh_2;
|
||||
for(list<EdgeContainerSE3>::iterator it = edges.begin(); it != edges.end(); ++it)
|
||||
{
|
||||
if(it->edge->chi2() > reproj_thresh_2_squared) //*(1<<it->feature_->level))
|
||||
{
|
||||
map->removePtFrameRef(it->frame, it->feature);
|
||||
++n_incorrect_edges_2;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: delete points and edges!
|
||||
init_error = sqrt(init_error)*center_kf->cam_->errorMultiplier2();
|
||||
final_error = sqrt(final_error)*center_kf->cam_->errorMultiplier2();
|
||||
}
|
||||
|
||||
void globalBA(Map* map)
|
||||
{
|
||||
// init g2o
|
||||
g2o::SparseOptimizer optimizer;
|
||||
setupG2o(&optimizer);
|
||||
|
||||
list<EdgeContainerSE3> edges;
|
||||
list< pair<FramePtr,Feature*> > incorrect_edges;
|
||||
|
||||
// Go through all Keyframes
|
||||
size_t v_id = 0;
|
||||
double reproj_thresh_2 = Config::lobaThresh() / map->lastKeyframe()->cam_->errorMultiplier2();
|
||||
double reproj_thresh_1_squared = Config::poseOptimThresh() / map->lastKeyframe()->cam_->errorMultiplier2();
|
||||
reproj_thresh_1_squared *= reproj_thresh_1_squared;
|
||||
for(list<FramePtr>::iterator it_kf = map->keyframes_.begin();
|
||||
it_kf != map->keyframes_.end(); ++it_kf)
|
||||
{
|
||||
// New Keyframe Vertex
|
||||
g2oFrameSE3* v_kf = createG2oFrameSE3(it_kf->get(), v_id++, false);
|
||||
(*it_kf)->v_kf_ = v_kf;
|
||||
optimizer.addVertex(v_kf);
|
||||
for(Features::iterator it_ftr=(*it_kf)->fts_.begin(); it_ftr!=(*it_kf)->fts_.end(); ++it_ftr)
|
||||
{
|
||||
// for each keyframe add edges to all observed mapoints
|
||||
Point* mp = (*it_ftr)->point;
|
||||
if(mp == NULL)
|
||||
continue;
|
||||
g2oPoint* v_mp = mp->v_pt_;
|
||||
if(v_mp == NULL)
|
||||
{
|
||||
// mappoint-vertex doesn't exist yet. create a new one:
|
||||
v_mp = createG2oPoint(mp->pos_, v_id++, false);
|
||||
mp->v_pt_ = v_mp;
|
||||
optimizer.addVertex(v_mp);
|
||||
}
|
||||
|
||||
// Due to merging of mappoints it is possible that references in kfs suddenly
|
||||
// have a very large reprojection error which may result in distorted results.
|
||||
Vector2d error = vk::project2d((*it_ftr)->f) - vk::project2d((*it_kf)->w2f(mp->pos_));
|
||||
if(error.squaredNorm() > reproj_thresh_1_squared)
|
||||
incorrect_edges.push_back(pair<FramePtr,Feature*>(*it_kf, *it_ftr));
|
||||
else
|
||||
{
|
||||
g2oEdgeSE3* e = createG2oEdgeSE3(v_kf, v_mp, vk::project2d((*it_ftr)->f),
|
||||
true,
|
||||
reproj_thresh_2*Config::lobaRobustHuberWidth());
|
||||
|
||||
edges.push_back(EdgeContainerSE3(e, it_kf->get(), *it_ftr));
|
||||
optimizer.addEdge(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Optimization
|
||||
double init_error=0.0, final_error=0.0;
|
||||
if(Config::lobaNumIter() > 0)
|
||||
runSparseBAOptimizer(&optimizer, Config::lobaNumIter(), init_error, final_error);
|
||||
|
||||
// Update Keyframe and MapPoint Positions
|
||||
for(list<FramePtr>::iterator it_kf = map->keyframes_.begin();
|
||||
it_kf != map->keyframes_.end(); ++it_kf)
|
||||
{
|
||||
(*it_kf)->T_f_w_ = SE3( (*it_kf)->v_kf_->estimate().rotation(),
|
||||
(*it_kf)->v_kf_->estimate().translation());
|
||||
(*it_kf)->v_kf_ = NULL;
|
||||
for(Features::iterator it_ftr=(*it_kf)->fts_.begin(); it_ftr!=(*it_kf)->fts_.end(); ++it_ftr)
|
||||
{
|
||||
Point* mp = (*it_ftr)->point;
|
||||
if(mp == NULL)
|
||||
continue;
|
||||
if(mp->v_pt_ == NULL)
|
||||
continue; // mp was updated before
|
||||
mp->pos_ = mp->v_pt_->estimate();
|
||||
mp->v_pt_ = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove Measurements with too large reprojection error
|
||||
for(list< pair<FramePtr,Feature*> >::iterator it=incorrect_edges.begin();
|
||||
it!=incorrect_edges.end(); ++it)
|
||||
map->removePtFrameRef(it->first.get(), it->second);
|
||||
|
||||
double reproj_thresh_2_squared = reproj_thresh_2*reproj_thresh_2;
|
||||
for(list<EdgeContainerSE3>::iterator it = edges.begin(); it != edges.end(); ++it)
|
||||
{
|
||||
if(it->edge->chi2() > reproj_thresh_2_squared)
|
||||
{
|
||||
map->removePtFrameRef(it->frame, it->feature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setupG2o(g2o::SparseOptimizer * optimizer)
|
||||
{
|
||||
// TODO: What's happening with all this HEAP stuff? Memory Leak?
|
||||
optimizer->setVerbose(false);
|
||||
|
||||
#if SCHUR_TRICK
|
||||
// solver
|
||||
g2o::BlockSolver_6_3::LinearSolverType* linearSolver;
|
||||
linearSolver = new g2o::LinearSolverCholmod<g2o::BlockSolver_6_3::PoseMatrixType>();
|
||||
//linearSolver = new g2o::LinearSolverCSparse<g2o::BlockSolver_6_3::PoseMatrixType>();
|
||||
|
||||
g2o::BlockSolver_6_3 * solver_ptr = new g2o::BlockSolver_6_3(linearSolver);
|
||||
g2o::OptimizationAlgorithmLevenberg * solver = new g2o::OptimizationAlgorithmLevenberg(solver_ptr);
|
||||
#else
|
||||
g2o::BlockSolverX::LinearSolverType * linearSolver;
|
||||
linearSolver = new g2o::LinearSolverCholmod<g2o::BlockSolverX::PoseMatrixType>();
|
||||
//linearSolver = new g2o::LinearSolverCSparse<g2o::BlockSolverX::PoseMatrixType>();
|
||||
g2o::BlockSolverX * solver_ptr = new g2o::BlockSolverX(linearSolver);
|
||||
g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg(solver_ptr);
|
||||
#endif
|
||||
|
||||
solver->setMaxTrialsAfterFailure(5);
|
||||
optimizer->setAlgorithm(solver);
|
||||
|
||||
// setup camera
|
||||
g2o::CameraParameters * cam_params = new g2o::CameraParameters(1.0, Vector2d(0.,0.), 0.);
|
||||
cam_params->setId(0);
|
||||
if (!optimizer->addParameter(cam_params)) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
runSparseBAOptimizer(g2o::SparseOptimizer* optimizer,
|
||||
unsigned int num_iter,
|
||||
double& init_error, double& final_error)
|
||||
{
|
||||
optimizer->initializeOptimization();
|
||||
optimizer->computeActiveErrors();
|
||||
init_error = optimizer->activeChi2();
|
||||
optimizer->optimize(num_iter);
|
||||
final_error = optimizer->activeChi2();
|
||||
}
|
||||
|
||||
g2oFrameSE3*
|
||||
createG2oFrameSE3(Frame* frame, size_t id, bool fixed)
|
||||
{
|
||||
g2oFrameSE3* v = new g2oFrameSE3();
|
||||
v->setId(id);
|
||||
v->setFixed(fixed);
|
||||
v->setEstimate(g2o::SE3Quat(frame->T_f_w_.unit_quaternion(), frame->T_f_w_.translation()));
|
||||
return v;
|
||||
}
|
||||
|
||||
g2oPoint*
|
||||
createG2oPoint(Vector3d pos,
|
||||
size_t id,
|
||||
bool fixed)
|
||||
{
|
||||
g2oPoint* v = new g2oPoint();
|
||||
v->setId(id);
|
||||
#if SCHUR_TRICK
|
||||
v->setMarginalized(true);
|
||||
#endif
|
||||
v->setFixed(fixed);
|
||||
v->setEstimate(pos);
|
||||
return v;
|
||||
}
|
||||
|
||||
g2oEdgeSE3*
|
||||
createG2oEdgeSE3( g2oFrameSE3* v_frame,
|
||||
g2oPoint* v_point,
|
||||
const Vector2d& f_up,
|
||||
bool robust_kernel,
|
||||
double huber_width,
|
||||
double weight)
|
||||
{
|
||||
g2oEdgeSE3* e = new g2oEdgeSE3();
|
||||
e->setVertex(0, dynamic_cast<g2o::OptimizableGraph::Vertex*>(v_point));
|
||||
e->setVertex(1, dynamic_cast<g2o::OptimizableGraph::Vertex*>(v_frame));
|
||||
e->setMeasurement(f_up);
|
||||
e->information() = weight * Eigen::Matrix2d::Identity(2,2);
|
||||
g2o::RobustKernelHuber* rk = new g2o::RobustKernelHuber(); // TODO: memory leak
|
||||
rk->setDelta(huber_width);
|
||||
e->setRobustKernel(rk);
|
||||
e->setParameterId(0, 0); //old: e->setId(v_point->id());
|
||||
return e;
|
||||
}
|
||||
|
||||
} // namespace ba
|
||||
} // namespace svo
|
||||
Generated
+1
-1
@@ -1 +1 @@
|
||||
vio_gpu
|
||||
vio
|
||||
Generated
+1
-1
@@ -2,7 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/svo_ros.iml" filepath="$PROJECT_DIR$/.idea/svo_ros.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/svo.iml" filepath="$PROJECT_DIR$/.idea/svo.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-2
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
Regular → Executable
+33
-49
@@ -1,92 +1,76 @@
|
||||
SET(PROJECT_NAME vio_gpu)
|
||||
SET(PROJECT_NAME vio)
|
||||
PROJECT(${PROJECT_NAME})
|
||||
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.3)
|
||||
|
||||
SET(CMAKE_BUILD_TYPE Release) # Release, RelWithDebInfo
|
||||
SET(CMAKE_VERBOSE_MAKEFILE OFF)
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/CMakeModules/")
|
||||
set(CMAKE_C_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
# Set definitions
|
||||
ADD_DEFINITIONS(-DSVO_TRACE)
|
||||
ADD_DEFINITIONS(-DSVO_USE_ROS)
|
||||
|
||||
|
||||
# Set build flags, set ARM_ARCHITECTURE environment variable on Odroid
|
||||
# Set build flags. Set IS_ARM on odroid board as environment variable
|
||||
SET(CMAKE_CXX_FLAGS "-Wall -D_LINUX -D_REENTRANT -march=native -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas")
|
||||
IF(DEFINED ENV{ARM_ARCHITECTURE})
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
|
||||
ELSE()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse -msse2 -msse3 -mssse3")
|
||||
ENDIF()
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
ELSE()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
ENDIF()
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -fsee -fomit-frame-pointer -fno-signed-zeros -fno-math-errno -funroll-loops")
|
||||
|
||||
# Add catkin and required ROS packages
|
||||
FIND_PACKAGE(catkin REQUIRED COMPONENTS
|
||||
geometry_msgs
|
||||
roscpp
|
||||
cmake_modules
|
||||
nav_msgs
|
||||
std_msgs
|
||||
visualization_msgs
|
||||
sensor_msgs
|
||||
image_transport
|
||||
cv_bridge
|
||||
tf
|
||||
gpu_svo
|
||||
vikit_common
|
||||
vikit_ros
|
||||
)
|
||||
|
||||
# Add plain cmake packages
|
||||
FIND_PACKAGE(OpenCV REQUIRED)
|
||||
FIND_PACKAGE(OpenCV 3 REQUIRED)
|
||||
FIND_PACKAGE(Eigen REQUIRED)
|
||||
FIND_PACKAGE(Sophus REQUIRED)
|
||||
FIND_PACKAGE(Boost REQUIRED COMPONENTS thread)
|
||||
FIND_PACKAGE(GTSAM REQUIRED)
|
||||
FIND_PACKAGE(Boost REQUIRED COMPONENTS thread system)
|
||||
FIND_PACKAGE(OpenCL REQUIRED)
|
||||
|
||||
# notify catkin to look at the previously found msg files
|
||||
add_message_files(
|
||||
FILES
|
||||
Info.msg
|
||||
)
|
||||
|
||||
# build the header files from the msg files, and notify catkin about the dependencies
|
||||
generate_messages(
|
||||
DEPENDENCIES
|
||||
geometry_msgs
|
||||
sensor_msgs
|
||||
)
|
||||
# Describe catkin Project
|
||||
set(GTSAM_INCLUDE_DIRS "${GTSAM_INCLUDE_DIR}")
|
||||
FIND_PACKAGE(catkin REQUIRED COMPONENTS roscpp roslib cmake_modules image_transport cv_bridge tf geometry_msgs)
|
||||
catkin_package(
|
||||
DEPENDS Eigen OpenCV Sophus Boost
|
||||
CATKIN_DEPENDS roscpp nav_msgs std_msgs visualization_msgs sensor_msgs image_transport cv_bridge tf gpu_svo vikit_common vikit_ros geometry_msgs
|
||||
CATKIN_DEPENDS roscpp roslib image_transport cv_bridge tf geometry_msgs
|
||||
INCLUDE_DIRS include
|
||||
LIBRARIES ${PROJECT_NAME}_visualizer
|
||||
)
|
||||
|
||||
|
||||
# Include dirs
|
||||
INCLUDE_DIRECTORIES(
|
||||
include
|
||||
kernel
|
||||
${Eigen_INCLUDE_DIRS}
|
||||
${OpenCV_INCLUDE_DIRS}
|
||||
${Sophus_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${OpenCL_INCLUDE_DIRS}
|
||||
${catkin_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Set link libraries
|
||||
LIST(APPEND LINK_LIBS
|
||||
#gtsam
|
||||
${OpenCV_LIBS}
|
||||
${Sophus_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${catkin_LIBRARIES}
|
||||
${OpenCL_LIBRARIES}
|
||||
${catkin_LIBRARIES}
|
||||
)
|
||||
|
||||
# Create visualizer library
|
||||
ADD_LIBRARY(${PROJECT_NAME}_visualizer src/visualizer.cpp)
|
||||
TARGET_LINK_LIBRARIES(${PROJECT_NAME}_visualizer ${LINK_LIBS} gtsam)
|
||||
file(GLOB SRC CONFIGURE_DEPENDS "src/*.cpp")
|
||||
|
||||
|
||||
|
||||
# Create svo library
|
||||
ADD_EXECUTABLE(${PROJECT_NAME} ${SRC})
|
||||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LINK_LIBS})
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_range_for)
|
||||
ADD_DEFINITIONS(-DKERNEL_DIR=\"${PROJECT_SOURCE_DIR}/kernel\")
|
||||
|
||||
|
||||
# Create Executables
|
||||
ADD_EXECUTABLE(${PROJECT_NAME} src/vo_node.cpp)
|
||||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PROJECT_NAME}_visualizer ${LINK_LIBS})
|
||||
|
||||
Regular → Executable
File diff suppressed because one or more lines are too long
@@ -0,0 +1,76 @@
|
||||
set(CMAKE_C_COMPILER "/usr/bin/cc")
|
||||
set(CMAKE_C_COMPILER_ARG1 "")
|
||||
set(CMAKE_C_COMPILER_ID "GNU")
|
||||
set(CMAKE_C_COMPILER_VERSION "7.5.0")
|
||||
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
|
||||
set(CMAKE_C_COMPILER_WRAPPER "")
|
||||
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
|
||||
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
|
||||
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
|
||||
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
|
||||
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
|
||||
|
||||
set(CMAKE_C_PLATFORM_ID "Linux")
|
||||
set(CMAKE_C_SIMULATE_ID "")
|
||||
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "")
|
||||
set(CMAKE_C_SIMULATE_VERSION "")
|
||||
|
||||
|
||||
|
||||
set(CMAKE_AR "/usr/bin/ar")
|
||||
set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-7")
|
||||
set(CMAKE_RANLIB "/usr/bin/ranlib")
|
||||
set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-7")
|
||||
set(CMAKE_LINKER "/usr/bin/ld")
|
||||
set(CMAKE_MT "")
|
||||
set(CMAKE_COMPILER_IS_GNUCC 1)
|
||||
set(CMAKE_C_COMPILER_LOADED 1)
|
||||
set(CMAKE_C_COMPILER_WORKS TRUE)
|
||||
set(CMAKE_C_ABI_COMPILED TRUE)
|
||||
set(CMAKE_COMPILER_IS_MINGW )
|
||||
set(CMAKE_COMPILER_IS_CYGWIN )
|
||||
if(CMAKE_COMPILER_IS_CYGWIN)
|
||||
set(CYGWIN 1)
|
||||
set(UNIX 1)
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_COMPILER_ENV_VAR "CC")
|
||||
|
||||
if(CMAKE_COMPILER_IS_MINGW)
|
||||
set(MINGW 1)
|
||||
endif()
|
||||
set(CMAKE_C_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
|
||||
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
set(CMAKE_C_LINKER_PREFERENCE 10)
|
||||
|
||||
# Save compiler ABI information.
|
||||
set(CMAKE_C_SIZEOF_DATA_PTR "8")
|
||||
set(CMAKE_C_COMPILER_ABI "ELF")
|
||||
set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
|
||||
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR)
|
||||
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ABI)
|
||||
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_LIBRARY_ARCHITECTURE)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
|
||||
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
|
||||
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include")
|
||||
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s")
|
||||
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
|
||||
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
|
||||
@@ -0,0 +1,88 @@
|
||||
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
|
||||
set(CMAKE_CXX_COMPILER_ARG1 "")
|
||||
set(CMAKE_CXX_COMPILER_ID "GNU")
|
||||
set(CMAKE_CXX_COMPILER_VERSION "7.5.0")
|
||||
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
|
||||
set(CMAKE_CXX_COMPILER_WRAPPER "")
|
||||
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14")
|
||||
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17")
|
||||
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
|
||||
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
|
||||
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
|
||||
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
|
||||
set(CMAKE_CXX20_COMPILE_FEATURES "")
|
||||
|
||||
set(CMAKE_CXX_PLATFORM_ID "Linux")
|
||||
set(CMAKE_CXX_SIMULATE_ID "")
|
||||
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "")
|
||||
set(CMAKE_CXX_SIMULATE_VERSION "")
|
||||
|
||||
|
||||
|
||||
set(CMAKE_AR "/usr/bin/ar")
|
||||
set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-7")
|
||||
set(CMAKE_RANLIB "/usr/bin/ranlib")
|
||||
set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-7")
|
||||
set(CMAKE_LINKER "/usr/bin/ld")
|
||||
set(CMAKE_MT "")
|
||||
set(CMAKE_COMPILER_IS_GNUCXX 1)
|
||||
set(CMAKE_CXX_COMPILER_LOADED 1)
|
||||
set(CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||
set(CMAKE_CXX_ABI_COMPILED TRUE)
|
||||
set(CMAKE_COMPILER_IS_MINGW )
|
||||
set(CMAKE_COMPILER_IS_CYGWIN )
|
||||
if(CMAKE_COMPILER_IS_CYGWIN)
|
||||
set(CYGWIN 1)
|
||||
set(UNIX 1)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
|
||||
|
||||
if(CMAKE_COMPILER_IS_MINGW)
|
||||
set(MINGW 1)
|
||||
endif()
|
||||
set(CMAKE_CXX_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
|
||||
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
|
||||
foreach (lang C OBJC OBJCXX)
|
||||
if (CMAKE_${lang}_COMPILER_ID_RUN)
|
||||
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
|
||||
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(CMAKE_CXX_LINKER_PREFERENCE 30)
|
||||
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
|
||||
|
||||
# Save compiler ABI information.
|
||||
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
|
||||
set(CMAKE_CXX_COMPILER_ABI "ELF")
|
||||
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
|
||||
|
||||
if(CMAKE_CXX_SIZEOF_DATA_PTR)
|
||||
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ABI)
|
||||
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
|
||||
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
|
||||
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/7;/usr/include/x86_64-linux-gnu/c++/7;/usr/include/c++/7/backward;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include")
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc")
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
set(CMAKE_HOST_SYSTEM "Linux-5.8.0-48-generic")
|
||||
set(CMAKE_HOST_SYSTEM_NAME "Linux")
|
||||
set(CMAKE_HOST_SYSTEM_VERSION "5.8.0-48-generic")
|
||||
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
|
||||
|
||||
|
||||
|
||||
set(CMAKE_SYSTEM "Linux-5.8.0-48-generic")
|
||||
set(CMAKE_SYSTEM_NAME "Linux")
|
||||
set(CMAKE_SYSTEM_VERSION "5.8.0-48-generic")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
|
||||
|
||||
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||
|
||||
set(CMAKE_SYSTEM_LOADED 1)
|
||||
@@ -0,0 +1,671 @@
|
||||
#ifdef __cplusplus
|
||||
# error "A C++ compiler has been selected for C."
|
||||
#endif
|
||||
|
||||
#if defined(__18CXX)
|
||||
# define ID_VOID_MAIN
|
||||
#endif
|
||||
#if defined(__CLASSIC_C__)
|
||||
/* cv-qualifiers did not exist in K&R C */
|
||||
# define const
|
||||
# define volatile
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number components: V=Version, R=Revision, P=Patch
|
||||
Version date components: YYYY=Year, MM=Month, DD=Day */
|
||||
|
||||
#if defined(__INTEL_COMPILER) || defined(__ICC)
|
||||
# define COMPILER_ID "Intel"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# endif
|
||||
/* __INTEL_COMPILER = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||
# if defined(__INTEL_COMPILER_UPDATE)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||
# else
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||
# endif
|
||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||
# endif
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__PATHCC__)
|
||||
# define COMPILER_ID "PathScale"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||
# if defined(__PATHCC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
||||
# define COMPILER_ID "Embarcadero"
|
||||
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define COMPILER_ID "Borland"
|
||||
/* __BORLANDC__ = 0xVRR */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||
|
||||
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define COMPILER_ID "OpenWatcom"
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SUNPRO_C)
|
||||
# define COMPILER_ID "SunPro"
|
||||
# if __SUNPRO_C >= 0x5100
|
||||
/* __SUNPRO_C = 0xVRRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# else
|
||||
/* __SUNPRO_CC = 0xVRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# endif
|
||||
|
||||
#elif defined(__HP_cc)
|
||||
# define COMPILER_ID "HP"
|
||||
/* __HP_cc = VVRRPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
|
||||
|
||||
#elif defined(__DECC)
|
||||
# define COMPILER_ID "Compaq"
|
||||
/* __DECC_VER = VVRRTPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
|
||||
|
||||
#elif defined(__IBMC__) && defined(__COMPILER_VER__)
|
||||
# define COMPILER_ID "zOS"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__ibmxl__) && defined(__clang__)
|
||||
# define COMPILER_ID "XLClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
|
||||
# define COMPILER_ID "XL"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
|
||||
# define COMPILER_ID "VisualAge"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__PGI)
|
||||
# define COMPILER_ID "PGI"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||
# if defined(__PGIC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_CRAYC)
|
||||
# define COMPILER_ID "Cray"
|
||||
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# define COMPILER_ID "TI"
|
||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
||||
|
||||
#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
|
||||
# define COMPILER_ID "Fujitsu"
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# define COMPILER_ID "GHS"
|
||||
/* __GHS_VERSION_NUMBER = VVVVRP */
|
||||
# ifdef __GHS_VERSION_NUMBER
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__TINYC__)
|
||||
# define COMPILER_ID "TinyCC"
|
||||
|
||||
#elif defined(__BCC__)
|
||||
# define COMPILER_ID "Bruce"
|
||||
|
||||
#elif defined(__SCO_VERSION__)
|
||||
# define COMPILER_ID "SCO"
|
||||
|
||||
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
|
||||
# define COMPILER_ID "ARMCC"
|
||||
#if __ARMCC_VERSION >= 1000000
|
||||
/* __ARMCC_VERSION = VRRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#else
|
||||
/* __ARMCC_VERSION = VRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(__clang__) && defined(__apple_build_version__)
|
||||
# define COMPILER_ID "AppleClang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
||||
|
||||
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
|
||||
# define COMPILER_ID "ARMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
|
||||
|
||||
#elif defined(__clang__)
|
||||
# define COMPILER_ID "Clang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# define COMPILER_ID "GNU"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define COMPILER_ID "MSVC"
|
||||
/* _MSC_VER = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# if defined(_MSC_FULL_VER)
|
||||
# if _MSC_VER >= 1400
|
||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||
# else
|
||||
/* _MSC_FULL_VER = VVRRPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_MSC_BUILD)
|
||||
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||
# endif
|
||||
|
||||
#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
|
||||
# define COMPILER_ID "ADSP"
|
||||
#if defined(__VISUALDSPVERSION__)
|
||||
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
|
||||
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
|
||||
#endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# define COMPILER_ID "IAR"
|
||||
# if defined(__VER__) && defined(__ICCARM__)
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
|
||||
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# endif
|
||||
|
||||
#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
|
||||
# define COMPILER_ID "SDCC"
|
||||
# if defined(__SDCC_VERSION_MAJOR)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
|
||||
# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
|
||||
# else
|
||||
/* SDCC = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
|
||||
# endif
|
||||
|
||||
|
||||
/* These compilers are either not known or too old to define an
|
||||
identification macro. Try to identify the platform and guess that
|
||||
it is the native compiler. */
|
||||
#elif defined(__hpux) || defined(__hpua)
|
||||
# define COMPILER_ID "HP"
|
||||
|
||||
#else /* unknown compiler */
|
||||
# define COMPILER_ID ""
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||
#ifdef SIMULATE_ID
|
||||
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||
#endif
|
||||
|
||||
#ifdef __QNXNTO__
|
||||
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||
#endif
|
||||
|
||||
#if defined(__CRAYXE) || defined(__CRAYXC)
|
||||
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
#endif
|
||||
|
||||
#define STRINGIFY_HELPER(X) #X
|
||||
#define STRINGIFY(X) STRINGIFY_HELPER(X)
|
||||
|
||||
/* Identify known platforms by name. */
|
||||
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
#elif defined(__CYGWIN__)
|
||||
# define PLATFORM_ID "Cygwin"
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define PLATFORM_ID "MinGW"
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
# define PLATFORM_ID "Darwin"
|
||||
|
||||
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||
# define PLATFORM_ID "Windows"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
||||
# define PLATFORM_ID "FreeBSD"
|
||||
|
||||
#elif defined(__NetBSD__) || defined(__NetBSD)
|
||||
# define PLATFORM_ID "NetBSD"
|
||||
|
||||
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
||||
# define PLATFORM_ID "OpenBSD"
|
||||
|
||||
#elif defined(__sun) || defined(sun)
|
||||
# define PLATFORM_ID "SunOS"
|
||||
|
||||
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
||||
# define PLATFORM_ID "AIX"
|
||||
|
||||
#elif defined(__hpux) || defined(__hpux__)
|
||||
# define PLATFORM_ID "HP-UX"
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
# define PLATFORM_ID "Haiku"
|
||||
|
||||
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
||||
# define PLATFORM_ID "BeOS"
|
||||
|
||||
#elif defined(__QNX__) || defined(__QNXNTO__)
|
||||
# define PLATFORM_ID "QNX"
|
||||
|
||||
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
||||
# define PLATFORM_ID "Tru64"
|
||||
|
||||
#elif defined(__riscos) || defined(__riscos__)
|
||||
# define PLATFORM_ID "RISCos"
|
||||
|
||||
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
||||
# define PLATFORM_ID "SINIX"
|
||||
|
||||
#elif defined(__UNIX_SV__)
|
||||
# define PLATFORM_ID "UNIX_SV"
|
||||
|
||||
#elif defined(__bsdos__)
|
||||
# define PLATFORM_ID "BSDOS"
|
||||
|
||||
#elif defined(_MPRAS) || defined(MPRAS)
|
||||
# define PLATFORM_ID "MP-RAS"
|
||||
|
||||
#elif defined(__osf) || defined(__osf__)
|
||||
# define PLATFORM_ID "OSF1"
|
||||
|
||||
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
||||
# define PLATFORM_ID "SCO_SV"
|
||||
|
||||
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
||||
# define PLATFORM_ID "ULTRIX"
|
||||
|
||||
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||
# define PLATFORM_ID "Xenix"
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__LINUX__)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
# elif defined(__DOS__)
|
||||
# define PLATFORM_ID "DOS"
|
||||
|
||||
# elif defined(__OS2__)
|
||||
# define PLATFORM_ID "OS2"
|
||||
|
||||
# elif defined(__WINDOWS__)
|
||||
# define PLATFORM_ID "Windows3x"
|
||||
|
||||
# else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
# endif
|
||||
|
||||
#elif defined(__INTEGRITY)
|
||||
# if defined(INT_178B)
|
||||
# define PLATFORM_ID "Integrity178"
|
||||
|
||||
# else /* regular Integrity */
|
||||
# define PLATFORM_ID "Integrity"
|
||||
# endif
|
||||
|
||||
#else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
|
||||
#endif
|
||||
|
||||
/* For windows compilers MSVC and Intel we can determine
|
||||
the architecture of the compiler being used. This is because
|
||||
the compilers do not have flags that can change the architecture,
|
||||
but rather depend on which compiler is being used
|
||||
*/
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if defined(_M_IA64)
|
||||
# define ARCHITECTURE_ID "IA64"
|
||||
|
||||
# elif defined(_M_X64) || defined(_M_AMD64)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# elif defined(_M_ARM64)
|
||||
# define ARCHITECTURE_ID "ARM64"
|
||||
|
||||
# elif defined(_M_ARM)
|
||||
# if _M_ARM == 4
|
||||
# define ARCHITECTURE_ID "ARMV4I"
|
||||
# elif _M_ARM == 5
|
||||
# define ARCHITECTURE_ID "ARMV5I"
|
||||
# else
|
||||
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
|
||||
# endif
|
||||
|
||||
# elif defined(_M_MIPS)
|
||||
# define ARCHITECTURE_ID "MIPS"
|
||||
|
||||
# elif defined(_M_SH)
|
||||
# define ARCHITECTURE_ID "SHx"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(_M_I86)
|
||||
# define ARCHITECTURE_ID "I86"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# if defined(__ICCARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__ICCRX__)
|
||||
# define ARCHITECTURE_ID "RX"
|
||||
|
||||
# elif defined(__ICCRH850__)
|
||||
# define ARCHITECTURE_ID "RH850"
|
||||
|
||||
# elif defined(__ICCRL78__)
|
||||
# define ARCHITECTURE_ID "RL78"
|
||||
|
||||
# elif defined(__ICCRISCV__)
|
||||
# define ARCHITECTURE_ID "RISCV"
|
||||
|
||||
# elif defined(__ICCAVR__)
|
||||
# define ARCHITECTURE_ID "AVR"
|
||||
|
||||
# elif defined(__ICC430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__ICCV850__)
|
||||
# define ARCHITECTURE_ID "V850"
|
||||
|
||||
# elif defined(__ICC8051__)
|
||||
# define ARCHITECTURE_ID "8051"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# if defined(__PPC64__)
|
||||
# define ARCHITECTURE_ID "PPC64"
|
||||
|
||||
# elif defined(__ppc__)
|
||||
# define ARCHITECTURE_ID "PPC"
|
||||
|
||||
# elif defined(__ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__x86_64__)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(__i386__)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
#else
|
||||
# define ARCHITECTURE_ID
|
||||
#endif
|
||||
|
||||
/* Convert integer to decimal digit literals. */
|
||||
#define DEC(n) \
|
||||
('0' + (((n) / 10000000)%10)), \
|
||||
('0' + (((n) / 1000000)%10)), \
|
||||
('0' + (((n) / 100000)%10)), \
|
||||
('0' + (((n) / 10000)%10)), \
|
||||
('0' + (((n) / 1000)%10)), \
|
||||
('0' + (((n) / 100)%10)), \
|
||||
('0' + (((n) / 10)%10)), \
|
||||
('0' + ((n) % 10))
|
||||
|
||||
/* Convert integer to hex digit literals. */
|
||||
#define HEX(n) \
|
||||
('0' + ((n)>>28 & 0xF)), \
|
||||
('0' + ((n)>>24 & 0xF)), \
|
||||
('0' + ((n)>>20 & 0xF)), \
|
||||
('0' + ((n)>>16 & 0xF)), \
|
||||
('0' + ((n)>>12 & 0xF)), \
|
||||
('0' + ((n)>>8 & 0xF)), \
|
||||
('0' + ((n)>>4 & 0xF)), \
|
||||
('0' + ((n) & 0xF))
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
char const info_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
|
||||
COMPILER_VERSION_MAJOR,
|
||||
# ifdef COMPILER_VERSION_MINOR
|
||||
'.', COMPILER_VERSION_MINOR,
|
||||
# ifdef COMPILER_VERSION_PATCH
|
||||
'.', COMPILER_VERSION_PATCH,
|
||||
# ifdef COMPILER_VERSION_TWEAK
|
||||
'.', COMPILER_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the internal version number. */
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
char const info_version_internal[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||
'i','n','t','e','r','n','a','l','[',
|
||||
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
char const info_simulate_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
|
||||
SIMULATE_VERSION_MAJOR,
|
||||
# ifdef SIMULATE_VERSION_MINOR
|
||||
'.', SIMULATE_VERSION_MINOR,
|
||||
# ifdef SIMULATE_VERSION_PATCH
|
||||
'.', SIMULATE_VERSION_PATCH,
|
||||
# ifdef SIMULATE_VERSION_TWEAK
|
||||
'.', SIMULATE_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
|
||||
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
|
||||
|
||||
|
||||
|
||||
|
||||
#if !defined(__STDC__)
|
||||
# if (defined(_MSC_VER) && !defined(__clang__)) \
|
||||
|| (defined(__ibmxl__) || defined(__IBMC__))
|
||||
# define C_DIALECT "90"
|
||||
# else
|
||||
# define C_DIALECT
|
||||
# endif
|
||||
#elif __STDC_VERSION__ >= 201000L
|
||||
# define C_DIALECT "11"
|
||||
#elif __STDC_VERSION__ >= 199901L
|
||||
# define C_DIALECT "99"
|
||||
#else
|
||||
# define C_DIALECT "90"
|
||||
#endif
|
||||
const char* info_language_dialect_default =
|
||||
"INFO" ":" "dialect_default[" C_DIALECT "]";
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef ID_VOID_MAIN
|
||||
void main() {}
|
||||
#else
|
||||
# if defined(__CLASSIC_C__)
|
||||
int main(argc, argv) int argc; char *argv[];
|
||||
# else
|
||||
int main(int argc, char* argv[])
|
||||
# endif
|
||||
{
|
||||
int require = 0;
|
||||
require += info_compiler[argc];
|
||||
require += info_platform[argc];
|
||||
require += info_arch[argc];
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
require += info_version[argc];
|
||||
#endif
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
require += info_version_internal[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_ID
|
||||
require += info_simulate[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
require += info_simulate_version[argc];
|
||||
#endif
|
||||
#if defined(__CRAYXE) || defined(__CRAYXC)
|
||||
require += info_cray[argc];
|
||||
#endif
|
||||
require += info_language_dialect_default[argc];
|
||||
(void)argv;
|
||||
return require;
|
||||
}
|
||||
#endif
|
||||
Binary file not shown.
+660
@@ -0,0 +1,660 @@
|
||||
/* This source file must have a .cpp extension so that all C++ compilers
|
||||
recognize the extension without flags. Borland does not know .cxx for
|
||||
example. */
|
||||
#ifndef __cplusplus
|
||||
# error "A C compiler has been selected for C++."
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number components: V=Version, R=Revision, P=Patch
|
||||
Version date components: YYYY=Year, MM=Month, DD=Day */
|
||||
|
||||
#if defined(__COMO__)
|
||||
# define COMPILER_ID "Comeau"
|
||||
/* __COMO_VERSION__ = VRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
|
||||
|
||||
#elif defined(__INTEL_COMPILER) || defined(__ICC)
|
||||
# define COMPILER_ID "Intel"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# endif
|
||||
/* __INTEL_COMPILER = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||
# if defined(__INTEL_COMPILER_UPDATE)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||
# else
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||
# endif
|
||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||
# endif
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__PATHCC__)
|
||||
# define COMPILER_ID "PathScale"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||
# if defined(__PATHCC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
||||
# define COMPILER_ID "Embarcadero"
|
||||
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define COMPILER_ID "Borland"
|
||||
/* __BORLANDC__ = 0xVRR */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||
|
||||
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define COMPILER_ID "OpenWatcom"
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SUNPRO_CC)
|
||||
# define COMPILER_ID "SunPro"
|
||||
# if __SUNPRO_CC >= 0x5100
|
||||
/* __SUNPRO_CC = 0xVRRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||
# else
|
||||
/* __SUNPRO_CC = 0xVRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||
# endif
|
||||
|
||||
#elif defined(__HP_aCC)
|
||||
# define COMPILER_ID "HP"
|
||||
/* __HP_aCC = VVRRPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
|
||||
|
||||
#elif defined(__DECCXX)
|
||||
# define COMPILER_ID "Compaq"
|
||||
/* __DECCXX_VER = VVRRTPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
|
||||
|
||||
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
|
||||
# define COMPILER_ID "zOS"
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||
|
||||
#elif defined(__ibmxl__) && defined(__clang__)
|
||||
# define COMPILER_ID "XLClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
|
||||
# define COMPILER_ID "XL"
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||
|
||||
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
|
||||
# define COMPILER_ID "VisualAge"
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||
|
||||
#elif defined(__PGI)
|
||||
# define COMPILER_ID "PGI"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||
# if defined(__PGIC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_CRAYC)
|
||||
# define COMPILER_ID "Cray"
|
||||
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# define COMPILER_ID "TI"
|
||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
||||
|
||||
#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
|
||||
# define COMPILER_ID "Fujitsu"
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# define COMPILER_ID "GHS"
|
||||
/* __GHS_VERSION_NUMBER = VVVVRP */
|
||||
# ifdef __GHS_VERSION_NUMBER
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SCO_VERSION__)
|
||||
# define COMPILER_ID "SCO"
|
||||
|
||||
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
|
||||
# define COMPILER_ID "ARMCC"
|
||||
#if __ARMCC_VERSION >= 1000000
|
||||
/* __ARMCC_VERSION = VRRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#else
|
||||
/* __ARMCC_VERSION = VRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(__clang__) && defined(__apple_build_version__)
|
||||
# define COMPILER_ID "AppleClang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
||||
|
||||
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
|
||||
# define COMPILER_ID "ARMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
|
||||
|
||||
#elif defined(__clang__)
|
||||
# define COMPILER_ID "Clang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
|
||||
#elif defined(__GNUC__) || defined(__GNUG__)
|
||||
# define COMPILER_ID "GNU"
|
||||
# if defined(__GNUC__)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||
# else
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define COMPILER_ID "MSVC"
|
||||
/* _MSC_VER = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# if defined(_MSC_FULL_VER)
|
||||
# if _MSC_VER >= 1400
|
||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||
# else
|
||||
/* _MSC_FULL_VER = VVRRPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_MSC_BUILD)
|
||||
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||
# endif
|
||||
|
||||
#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
|
||||
# define COMPILER_ID "ADSP"
|
||||
#if defined(__VISUALDSPVERSION__)
|
||||
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
|
||||
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
|
||||
#endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# define COMPILER_ID "IAR"
|
||||
# if defined(__VER__) && defined(__ICCARM__)
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
|
||||
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# endif
|
||||
|
||||
|
||||
/* These compilers are either not known or too old to define an
|
||||
identification macro. Try to identify the platform and guess that
|
||||
it is the native compiler. */
|
||||
#elif defined(__hpux) || defined(__hpua)
|
||||
# define COMPILER_ID "HP"
|
||||
|
||||
#else /* unknown compiler */
|
||||
# define COMPILER_ID ""
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||
#ifdef SIMULATE_ID
|
||||
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||
#endif
|
||||
|
||||
#ifdef __QNXNTO__
|
||||
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||
#endif
|
||||
|
||||
#if defined(__CRAYXE) || defined(__CRAYXC)
|
||||
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
#endif
|
||||
|
||||
#define STRINGIFY_HELPER(X) #X
|
||||
#define STRINGIFY(X) STRINGIFY_HELPER(X)
|
||||
|
||||
/* Identify known platforms by name. */
|
||||
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
#elif defined(__CYGWIN__)
|
||||
# define PLATFORM_ID "Cygwin"
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define PLATFORM_ID "MinGW"
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
# define PLATFORM_ID "Darwin"
|
||||
|
||||
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||
# define PLATFORM_ID "Windows"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
||||
# define PLATFORM_ID "FreeBSD"
|
||||
|
||||
#elif defined(__NetBSD__) || defined(__NetBSD)
|
||||
# define PLATFORM_ID "NetBSD"
|
||||
|
||||
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
||||
# define PLATFORM_ID "OpenBSD"
|
||||
|
||||
#elif defined(__sun) || defined(sun)
|
||||
# define PLATFORM_ID "SunOS"
|
||||
|
||||
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
||||
# define PLATFORM_ID "AIX"
|
||||
|
||||
#elif defined(__hpux) || defined(__hpux__)
|
||||
# define PLATFORM_ID "HP-UX"
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
# define PLATFORM_ID "Haiku"
|
||||
|
||||
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
||||
# define PLATFORM_ID "BeOS"
|
||||
|
||||
#elif defined(__QNX__) || defined(__QNXNTO__)
|
||||
# define PLATFORM_ID "QNX"
|
||||
|
||||
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
||||
# define PLATFORM_ID "Tru64"
|
||||
|
||||
#elif defined(__riscos) || defined(__riscos__)
|
||||
# define PLATFORM_ID "RISCos"
|
||||
|
||||
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
||||
# define PLATFORM_ID "SINIX"
|
||||
|
||||
#elif defined(__UNIX_SV__)
|
||||
# define PLATFORM_ID "UNIX_SV"
|
||||
|
||||
#elif defined(__bsdos__)
|
||||
# define PLATFORM_ID "BSDOS"
|
||||
|
||||
#elif defined(_MPRAS) || defined(MPRAS)
|
||||
# define PLATFORM_ID "MP-RAS"
|
||||
|
||||
#elif defined(__osf) || defined(__osf__)
|
||||
# define PLATFORM_ID "OSF1"
|
||||
|
||||
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
||||
# define PLATFORM_ID "SCO_SV"
|
||||
|
||||
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
||||
# define PLATFORM_ID "ULTRIX"
|
||||
|
||||
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||
# define PLATFORM_ID "Xenix"
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__LINUX__)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
# elif defined(__DOS__)
|
||||
# define PLATFORM_ID "DOS"
|
||||
|
||||
# elif defined(__OS2__)
|
||||
# define PLATFORM_ID "OS2"
|
||||
|
||||
# elif defined(__WINDOWS__)
|
||||
# define PLATFORM_ID "Windows3x"
|
||||
|
||||
# else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
# endif
|
||||
|
||||
#elif defined(__INTEGRITY)
|
||||
# if defined(INT_178B)
|
||||
# define PLATFORM_ID "Integrity178"
|
||||
|
||||
# else /* regular Integrity */
|
||||
# define PLATFORM_ID "Integrity"
|
||||
# endif
|
||||
|
||||
#else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
|
||||
#endif
|
||||
|
||||
/* For windows compilers MSVC and Intel we can determine
|
||||
the architecture of the compiler being used. This is because
|
||||
the compilers do not have flags that can change the architecture,
|
||||
but rather depend on which compiler is being used
|
||||
*/
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if defined(_M_IA64)
|
||||
# define ARCHITECTURE_ID "IA64"
|
||||
|
||||
# elif defined(_M_X64) || defined(_M_AMD64)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# elif defined(_M_ARM64)
|
||||
# define ARCHITECTURE_ID "ARM64"
|
||||
|
||||
# elif defined(_M_ARM)
|
||||
# if _M_ARM == 4
|
||||
# define ARCHITECTURE_ID "ARMV4I"
|
||||
# elif _M_ARM == 5
|
||||
# define ARCHITECTURE_ID "ARMV5I"
|
||||
# else
|
||||
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
|
||||
# endif
|
||||
|
||||
# elif defined(_M_MIPS)
|
||||
# define ARCHITECTURE_ID "MIPS"
|
||||
|
||||
# elif defined(_M_SH)
|
||||
# define ARCHITECTURE_ID "SHx"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(_M_I86)
|
||||
# define ARCHITECTURE_ID "I86"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# if defined(__ICCARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__ICCRX__)
|
||||
# define ARCHITECTURE_ID "RX"
|
||||
|
||||
# elif defined(__ICCRH850__)
|
||||
# define ARCHITECTURE_ID "RH850"
|
||||
|
||||
# elif defined(__ICCRL78__)
|
||||
# define ARCHITECTURE_ID "RL78"
|
||||
|
||||
# elif defined(__ICCRISCV__)
|
||||
# define ARCHITECTURE_ID "RISCV"
|
||||
|
||||
# elif defined(__ICCAVR__)
|
||||
# define ARCHITECTURE_ID "AVR"
|
||||
|
||||
# elif defined(__ICC430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__ICCV850__)
|
||||
# define ARCHITECTURE_ID "V850"
|
||||
|
||||
# elif defined(__ICC8051__)
|
||||
# define ARCHITECTURE_ID "8051"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# if defined(__PPC64__)
|
||||
# define ARCHITECTURE_ID "PPC64"
|
||||
|
||||
# elif defined(__ppc__)
|
||||
# define ARCHITECTURE_ID "PPC"
|
||||
|
||||
# elif defined(__ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__x86_64__)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(__i386__)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
#else
|
||||
# define ARCHITECTURE_ID
|
||||
#endif
|
||||
|
||||
/* Convert integer to decimal digit literals. */
|
||||
#define DEC(n) \
|
||||
('0' + (((n) / 10000000)%10)), \
|
||||
('0' + (((n) / 1000000)%10)), \
|
||||
('0' + (((n) / 100000)%10)), \
|
||||
('0' + (((n) / 10000)%10)), \
|
||||
('0' + (((n) / 1000)%10)), \
|
||||
('0' + (((n) / 100)%10)), \
|
||||
('0' + (((n) / 10)%10)), \
|
||||
('0' + ((n) % 10))
|
||||
|
||||
/* Convert integer to hex digit literals. */
|
||||
#define HEX(n) \
|
||||
('0' + ((n)>>28 & 0xF)), \
|
||||
('0' + ((n)>>24 & 0xF)), \
|
||||
('0' + ((n)>>20 & 0xF)), \
|
||||
('0' + ((n)>>16 & 0xF)), \
|
||||
('0' + ((n)>>12 & 0xF)), \
|
||||
('0' + ((n)>>8 & 0xF)), \
|
||||
('0' + ((n)>>4 & 0xF)), \
|
||||
('0' + ((n) & 0xF))
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
char const info_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
|
||||
COMPILER_VERSION_MAJOR,
|
||||
# ifdef COMPILER_VERSION_MINOR
|
||||
'.', COMPILER_VERSION_MINOR,
|
||||
# ifdef COMPILER_VERSION_PATCH
|
||||
'.', COMPILER_VERSION_PATCH,
|
||||
# ifdef COMPILER_VERSION_TWEAK
|
||||
'.', COMPILER_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the internal version number. */
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
char const info_version_internal[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||
'i','n','t','e','r','n','a','l','[',
|
||||
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
char const info_simulate_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
|
||||
SIMULATE_VERSION_MAJOR,
|
||||
# ifdef SIMULATE_VERSION_MINOR
|
||||
'.', SIMULATE_VERSION_MINOR,
|
||||
# ifdef SIMULATE_VERSION_PATCH
|
||||
'.', SIMULATE_VERSION_PATCH,
|
||||
# ifdef SIMULATE_VERSION_TWEAK
|
||||
'.', SIMULATE_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
|
||||
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
|
||||
# if defined(__INTEL_CXX11_MODE__)
|
||||
# if defined(__cpp_aggregate_nsdmi)
|
||||
# define CXX_STD 201402L
|
||||
# else
|
||||
# define CXX_STD 201103L
|
||||
# endif
|
||||
# else
|
||||
# define CXX_STD 199711L
|
||||
# endif
|
||||
#elif defined(_MSC_VER) && defined(_MSVC_LANG)
|
||||
# define CXX_STD _MSVC_LANG
|
||||
#else
|
||||
# define CXX_STD __cplusplus
|
||||
#endif
|
||||
|
||||
const char* info_language_dialect_default = "INFO" ":" "dialect_default["
|
||||
#if CXX_STD > 201703L
|
||||
"20"
|
||||
#elif CXX_STD >= 201703L
|
||||
"17"
|
||||
#elif CXX_STD >= 201402L
|
||||
"14"
|
||||
#elif CXX_STD >= 201103L
|
||||
"11"
|
||||
#else
|
||||
"98"
|
||||
#endif
|
||||
"]";
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int require = 0;
|
||||
require += info_compiler[argc];
|
||||
require += info_platform[argc];
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
require += info_version[argc];
|
||||
#endif
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
require += info_version_internal[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_ID
|
||||
require += info_simulate[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
require += info_simulate_version[argc];
|
||||
#endif
|
||||
#if defined(__CRAYXE) || defined(__CRAYXC)
|
||||
require += info_cray[argc];
|
||||
#endif
|
||||
require += info_language_dialect_default[argc];
|
||||
(void)argv;
|
||||
return require;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,65 @@
|
||||
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
|
||||
Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_6ff0d/fast && /usr/bin/make -f CMakeFiles/cmTC_6ff0d.dir/build.make CMakeFiles/cmTC_6ff0d.dir/build
|
||||
make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Building C object CMakeFiles/cmTC_6ff0d.dir/src.c.o
|
||||
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_6ff0d.dir/src.c.o -c /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp/src.c
|
||||
Linking C executable cmTC_6ff0d
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6ff0d.dir/link.txt --verbose=1
|
||||
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_6ff0d.dir/src.c.o -o cmTC_6ff0d
|
||||
CMakeFiles/cmTC_6ff0d.dir/src.c.o: In function `main':
|
||||
src.c:(.text+0x3e): undefined reference to `pthread_create'
|
||||
src.c:(.text+0x4a): undefined reference to `pthread_detach'
|
||||
src.c:(.text+0x56): undefined reference to `pthread_cancel'
|
||||
src.c:(.text+0x67): undefined reference to `pthread_join'
|
||||
src.c:(.text+0x7b): undefined reference to `pthread_atfork'
|
||||
collect2: error: ld returned 1 exit status
|
||||
CMakeFiles/cmTC_6ff0d.dir/build.make:106: recipe for target 'cmTC_6ff0d' failed
|
||||
make[1]: *** [cmTC_6ff0d] Error 1
|
||||
make[1]: Leaving directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Makefile:141: recipe for target 'cmTC_6ff0d/fast' failed
|
||||
make: *** [cmTC_6ff0d/fast] Error 2
|
||||
|
||||
|
||||
Source file was:
|
||||
#include <pthread.h>
|
||||
|
||||
void* test_func(void* data)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, NULL, test_func, NULL);
|
||||
pthread_detach(thread);
|
||||
pthread_cancel(thread);
|
||||
pthread_join(thread, NULL);
|
||||
pthread_atfork(NULL, NULL, NULL);
|
||||
pthread_exit(NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Determining if the function pthread_create exists in the pthreads failed with the following output:
|
||||
Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_ce6d0/fast && /usr/bin/make -f CMakeFiles/cmTC_ce6d0.dir/build.make CMakeFiles/cmTC_ce6d0.dir/build
|
||||
make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Building C object CMakeFiles/cmTC_ce6d0.dir/CheckFunctionExists.c.o
|
||||
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_ce6d0.dir/CheckFunctionExists.c.o -c /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CheckFunctionExists.c
|
||||
Linking C executable cmTC_ce6d0
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ce6d0.dir/link.txt --verbose=1
|
||||
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_ce6d0.dir/CheckFunctionExists.c.o -o cmTC_ce6d0 -lpthreads
|
||||
/usr/bin/ld: cannot find -lpthreads
|
||||
collect2: error: ld returned 1 exit status
|
||||
CMakeFiles/cmTC_ce6d0.dir/build.make:106: recipe for target 'cmTC_ce6d0' failed
|
||||
make[1]: *** [cmTC_ce6d0] Error 1
|
||||
make[1]: Leaving directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Makefile:141: recipe for target 'cmTC_ce6d0/fast' failed
|
||||
make: *** [cmTC_ce6d0/fast] Error 2
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,522 @@
|
||||
The system is: Linux - 5.8.0-48-generic - x86_64
|
||||
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
|
||||
Compiler: /usr/bin/cc
|
||||
Build flags:
|
||||
Id flags:
|
||||
|
||||
The output was:
|
||||
0
|
||||
|
||||
|
||||
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
|
||||
|
||||
The C compiler identification is GNU, found in "/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdC/a.out"
|
||||
|
||||
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
|
||||
Compiler: /usr/bin/c++
|
||||
Build flags:
|
||||
Id flags:
|
||||
|
||||
The output was:
|
||||
0
|
||||
|
||||
|
||||
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
|
||||
|
||||
The CXX compiler identification is GNU, found in "/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/3.17.5/CompilerIdCXX/a.out"
|
||||
|
||||
Determining if the C compiler works passed with the following output:
|
||||
Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_06aef/fast && /usr/bin/make -f CMakeFiles/cmTC_06aef.dir/build.make CMakeFiles/cmTC_06aef.dir/build
|
||||
make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Building C object CMakeFiles/cmTC_06aef.dir/testCCompiler.c.o
|
||||
/usr/bin/cc -o CMakeFiles/cmTC_06aef.dir/testCCompiler.c.o -c /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
|
||||
Linking C executable cmTC_06aef
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_06aef.dir/link.txt --verbose=1
|
||||
/usr/bin/cc -rdynamic CMakeFiles/cmTC_06aef.dir/testCCompiler.c.o -o cmTC_06aef
|
||||
make[1]: Leaving directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Detecting C compiler ABI info compiled with the following output:
|
||||
Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_4d3e9/fast && /usr/bin/make -f CMakeFiles/cmTC_4d3e9.dir/build.make CMakeFiles/cmTC_4d3e9.dir/build
|
||||
make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Building C object CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o
|
||||
/usr/bin/cc -v -o CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o -c /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCCompilerABI.c
|
||||
Using built-in specs.
|
||||
COLLECT_GCC=/usr/bin/cc
|
||||
OFFLOAD_TARGET_NAMES=nvptx-none
|
||||
OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-linux-gnu
|
||||
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
|
||||
Thread model: posix
|
||||
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/cc1 -quiet -v -imultiarch x86_64-linux-gnu /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccW0mWjy.s
|
||||
GNU C11 (Ubuntu 7.5.0-3ubuntu1~18.04) version 7.5.0 (x86_64-linux-gnu)
|
||||
compiled by GNU C version 7.5.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
|
||||
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"
|
||||
#include "..." search starts here:
|
||||
#include <...> search starts here:
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/include
|
||||
/usr/local/include
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
|
||||
/usr/include/x86_64-linux-gnu
|
||||
/usr/include
|
||||
End of search list.
|
||||
GNU C11 (Ubuntu 7.5.0-3ubuntu1~18.04) version 7.5.0 (x86_64-linux-gnu)
|
||||
compiled by GNU C version 7.5.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
Compiler executable checksum: b62ed4a2880cd4159476ea8293b72fa8
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
|
||||
as -v --64 -o CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o /tmp/ccW0mWjy.s
|
||||
GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30
|
||||
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
|
||||
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
|
||||
Linking C executable cmTC_4d3e9
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4d3e9.dir/link.txt --verbose=1
|
||||
/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o -o cmTC_4d3e9
|
||||
Using built-in specs.
|
||||
COLLECT_GCC=/usr/bin/cc
|
||||
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
|
||||
OFFLOAD_TARGET_NAMES=nvptx-none
|
||||
OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-linux-gnu
|
||||
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
|
||||
Thread model: posix
|
||||
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
|
||||
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
|
||||
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
|
||||
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_4d3e9' '-mtune=generic' '-march=x86-64'
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/cckCIR5B.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_4d3e9 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o
|
||||
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_4d3e9' '-mtune=generic' '-march=x86-64'
|
||||
make[1]: Leaving directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Parsed C implicit include dir info from above output: rv=done
|
||||
found start of include info
|
||||
found start of implicit include info
|
||||
add: [/usr/lib/gcc/x86_64-linux-gnu/7/include]
|
||||
add: [/usr/local/include]
|
||||
add: [/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed]
|
||||
add: [/usr/include/x86_64-linux-gnu]
|
||||
add: [/usr/include]
|
||||
end of search list found
|
||||
collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/7/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/7/include]
|
||||
collapse include dir [/usr/local/include] ==> [/usr/local/include]
|
||||
collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed] ==> [/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed]
|
||||
collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu]
|
||||
collapse include dir [/usr/include] ==> [/usr/include]
|
||||
implicit include dirs: [/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include]
|
||||
|
||||
|
||||
Parsed C implicit link information from above output:
|
||||
link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
|
||||
ignore line: [Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp]
|
||||
ignore line: []
|
||||
ignore line: [Run Build Command(s):/usr/bin/make cmTC_4d3e9/fast && /usr/bin/make -f CMakeFiles/cmTC_4d3e9.dir/build.make CMakeFiles/cmTC_4d3e9.dir/build]
|
||||
ignore line: [make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp']
|
||||
ignore line: [Building C object CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o]
|
||||
ignore line: [/usr/bin/cc -v -o CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o -c /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCCompilerABI.c]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=/usr/bin/cc]
|
||||
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
|
||||
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
|
||||
ignore line: [Target: x86_64-linux-gnu]
|
||||
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) ]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/7/cc1 -quiet -v -imultiarch x86_64-linux-gnu /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccW0mWjy.s]
|
||||
ignore line: [GNU C11 (Ubuntu 7.5.0-3ubuntu1~18.04) version 7.5.0 (x86_64-linux-gnu)]
|
||||
ignore line: [ compiled by GNU C version 7.5.0 GMP version 6.1.2 MPFR version 4.0.1 MPC version 1.1.0 isl version isl-0.19-GMP]
|
||||
ignore line: []
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"]
|
||||
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"]
|
||||
ignore line: [#include "..." search starts here:]
|
||||
ignore line: [#include <...> search starts here:]
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/7/include]
|
||||
ignore line: [ /usr/local/include]
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed]
|
||||
ignore line: [ /usr/include/x86_64-linux-gnu]
|
||||
ignore line: [ /usr/include]
|
||||
ignore line: [End of search list.]
|
||||
ignore line: [GNU C11 (Ubuntu 7.5.0-3ubuntu1~18.04) version 7.5.0 (x86_64-linux-gnu)]
|
||||
ignore line: [ compiled by GNU C version 7.5.0 GMP version 6.1.2 MPFR version 4.0.1 MPC version 1.1.0 isl version isl-0.19-GMP]
|
||||
ignore line: []
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [Compiler executable checksum: b62ed4a2880cd4159476ea8293b72fa8]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [ as -v --64 -o CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o /tmp/ccW0mWjy.s]
|
||||
ignore line: [GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30]
|
||||
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/]
|
||||
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [Linking C executable cmTC_4d3e9]
|
||||
ignore line: [/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4d3e9.dir/link.txt --verbose=1]
|
||||
ignore line: [/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o -o cmTC_4d3e9 ]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=/usr/bin/cc]
|
||||
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper]
|
||||
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
|
||||
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
|
||||
ignore line: [Target: x86_64-linux-gnu]
|
||||
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) ]
|
||||
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/]
|
||||
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_4d3e9' '-mtune=generic' '-march=x86-64']
|
||||
link line: [ /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/cckCIR5B.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_4d3e9 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o]
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/collect2] ==> ignore
|
||||
arg [-plugin] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so] ==> ignore
|
||||
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper] ==> ignore
|
||||
arg [-plugin-opt=-fresolution=/tmp/cckCIR5B.res] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
|
||||
arg [--build-id] ==> ignore
|
||||
arg [--eh-frame-hdr] ==> ignore
|
||||
arg [-m] ==> ignore
|
||||
arg [elf_x86_64] ==> ignore
|
||||
arg [--hash-style=gnu] ==> ignore
|
||||
arg [--as-needed] ==> ignore
|
||||
arg [-export-dynamic] ==> ignore
|
||||
arg [-dynamic-linker] ==> ignore
|
||||
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
|
||||
arg [-pie] ==> ignore
|
||||
arg [-znow] ==> ignore
|
||||
arg [-zrelro] ==> ignore
|
||||
arg [-o] ==> ignore
|
||||
arg [cmTC_4d3e9] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o] ==> ignore
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/7] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/7]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib]
|
||||
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
|
||||
arg [-L/lib/../lib] ==> dir [/lib/../lib]
|
||||
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
|
||||
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/7/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../..]
|
||||
arg [CMakeFiles/cmTC_4d3e9.dir/CMakeCCompilerABI.c.o] ==> ignore
|
||||
arg [-lgcc] ==> lib [gcc]
|
||||
arg [--push-state] ==> ignore
|
||||
arg [--as-needed] ==> ignore
|
||||
arg [-lgcc_s] ==> lib [gcc_s]
|
||||
arg [--pop-state] ==> ignore
|
||||
arg [-lc] ==> lib [c]
|
||||
arg [-lgcc] ==> lib [gcc]
|
||||
arg [--push-state] ==> ignore
|
||||
arg [--as-needed] ==> ignore
|
||||
arg [-lgcc_s] ==> lib [gcc_s]
|
||||
arg [--pop-state] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o] ==> ignore
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/7] ==> [/usr/lib/gcc/x86_64-linux-gnu/7]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib] ==> [/usr/lib]
|
||||
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/lib/../lib] ==> [/lib]
|
||||
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../..] ==> [/usr/lib]
|
||||
implicit libs: [gcc;gcc_s;c;gcc;gcc_s]
|
||||
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
|
||||
implicit fwks: []
|
||||
|
||||
|
||||
Determining if the CXX compiler works passed with the following output:
|
||||
Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_36240/fast && /usr/bin/make -f CMakeFiles/cmTC_36240.dir/build.make CMakeFiles/cmTC_36240.dir/build
|
||||
make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Building CXX object CMakeFiles/cmTC_36240.dir/testCXXCompiler.cxx.o
|
||||
/usr/bin/c++ -o CMakeFiles/cmTC_36240.dir/testCXXCompiler.cxx.o -c /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
|
||||
Linking CXX executable cmTC_36240
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_36240.dir/link.txt --verbose=1
|
||||
/usr/bin/c++ -rdynamic CMakeFiles/cmTC_36240.dir/testCXXCompiler.cxx.o -o cmTC_36240
|
||||
make[1]: Leaving directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Detecting CXX compiler ABI info compiled with the following output:
|
||||
Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_bddc5/fast && /usr/bin/make -f CMakeFiles/cmTC_bddc5.dir/build.make CMakeFiles/cmTC_bddc5.dir/build
|
||||
make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Building CXX object CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o
|
||||
/usr/bin/c++ -v -o CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o -c /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCXXCompilerABI.cpp
|
||||
Using built-in specs.
|
||||
COLLECT_GCC=/usr/bin/c++
|
||||
OFFLOAD_TARGET_NAMES=nvptx-none
|
||||
OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-linux-gnu
|
||||
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
|
||||
Thread model: posix
|
||||
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccEVgspL.s
|
||||
GNU C++14 (Ubuntu 7.5.0-3ubuntu1~18.04) version 7.5.0 (x86_64-linux-gnu)
|
||||
compiled by GNU C version 7.5.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/7"
|
||||
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
|
||||
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"
|
||||
#include "..." search starts here:
|
||||
#include <...> search starts here:
|
||||
/usr/include/c++/7
|
||||
/usr/include/x86_64-linux-gnu/c++/7
|
||||
/usr/include/c++/7/backward
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/include
|
||||
/usr/local/include
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
|
||||
/usr/include/x86_64-linux-gnu
|
||||
/usr/include
|
||||
End of search list.
|
||||
GNU C++14 (Ubuntu 7.5.0-3ubuntu1~18.04) version 7.5.0 (x86_64-linux-gnu)
|
||||
compiled by GNU C version 7.5.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
Compiler executable checksum: 3eb3dc290cd5714c3e1c3ae751116f07
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
as -v --64 -o CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccEVgspL.s
|
||||
GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30
|
||||
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
|
||||
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
Linking CXX executable cmTC_bddc5
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bddc5.dir/link.txt --verbose=1
|
||||
/usr/bin/c++ -v -rdynamic CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_bddc5
|
||||
Using built-in specs.
|
||||
COLLECT_GCC=/usr/bin/c++
|
||||
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
|
||||
OFFLOAD_TARGET_NAMES=nvptx-none
|
||||
OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-linux-gnu
|
||||
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
|
||||
Thread model: posix
|
||||
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
|
||||
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
|
||||
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
|
||||
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_bddc5' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/cckr006M.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_bddc5 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o
|
||||
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_bddc5' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
make[1]: Leaving directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Parsed CXX implicit include dir info from above output: rv=done
|
||||
found start of include info
|
||||
found start of implicit include info
|
||||
add: [/usr/include/c++/7]
|
||||
add: [/usr/include/x86_64-linux-gnu/c++/7]
|
||||
add: [/usr/include/c++/7/backward]
|
||||
add: [/usr/lib/gcc/x86_64-linux-gnu/7/include]
|
||||
add: [/usr/local/include]
|
||||
add: [/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed]
|
||||
add: [/usr/include/x86_64-linux-gnu]
|
||||
add: [/usr/include]
|
||||
end of search list found
|
||||
collapse include dir [/usr/include/c++/7] ==> [/usr/include/c++/7]
|
||||
collapse include dir [/usr/include/x86_64-linux-gnu/c++/7] ==> [/usr/include/x86_64-linux-gnu/c++/7]
|
||||
collapse include dir [/usr/include/c++/7/backward] ==> [/usr/include/c++/7/backward]
|
||||
collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/7/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/7/include]
|
||||
collapse include dir [/usr/local/include] ==> [/usr/local/include]
|
||||
collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed] ==> [/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed]
|
||||
collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu]
|
||||
collapse include dir [/usr/include] ==> [/usr/include]
|
||||
implicit include dirs: [/usr/include/c++/7;/usr/include/x86_64-linux-gnu/c++/7;/usr/include/c++/7/backward;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include]
|
||||
|
||||
|
||||
Parsed CXX implicit link information from above output:
|
||||
link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
|
||||
ignore line: [Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp]
|
||||
ignore line: []
|
||||
ignore line: [Run Build Command(s):/usr/bin/make cmTC_bddc5/fast && /usr/bin/make -f CMakeFiles/cmTC_bddc5.dir/build.make CMakeFiles/cmTC_bddc5.dir/build]
|
||||
ignore line: [make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp']
|
||||
ignore line: [Building CXX object CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o]
|
||||
ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o -c /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCXXCompilerABI.cpp]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=/usr/bin/c++]
|
||||
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
|
||||
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
|
||||
ignore line: [Target: x86_64-linux-gnu]
|
||||
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) ]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/7/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccEVgspL.s]
|
||||
ignore line: [GNU C++14 (Ubuntu 7.5.0-3ubuntu1~18.04) version 7.5.0 (x86_64-linux-gnu)]
|
||||
ignore line: [ compiled by GNU C version 7.5.0 GMP version 6.1.2 MPFR version 4.0.1 MPC version 1.1.0 isl version isl-0.19-GMP]
|
||||
ignore line: []
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/7"]
|
||||
ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"]
|
||||
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"]
|
||||
ignore line: [#include "..." search starts here:]
|
||||
ignore line: [#include <...> search starts here:]
|
||||
ignore line: [ /usr/include/c++/7]
|
||||
ignore line: [ /usr/include/x86_64-linux-gnu/c++/7]
|
||||
ignore line: [ /usr/include/c++/7/backward]
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/7/include]
|
||||
ignore line: [ /usr/local/include]
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed]
|
||||
ignore line: [ /usr/include/x86_64-linux-gnu]
|
||||
ignore line: [ /usr/include]
|
||||
ignore line: [End of search list.]
|
||||
ignore line: [GNU C++14 (Ubuntu 7.5.0-3ubuntu1~18.04) version 7.5.0 (x86_64-linux-gnu)]
|
||||
ignore line: [ compiled by GNU C version 7.5.0 GMP version 6.1.2 MPFR version 4.0.1 MPC version 1.1.0 isl version isl-0.19-GMP]
|
||||
ignore line: []
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [Compiler executable checksum: 3eb3dc290cd5714c3e1c3ae751116f07]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [ as -v --64 -o CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccEVgspL.s]
|
||||
ignore line: [GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30]
|
||||
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/]
|
||||
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [Linking CXX executable cmTC_bddc5]
|
||||
ignore line: [/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bddc5.dir/link.txt --verbose=1]
|
||||
ignore line: [/usr/bin/c++ -v -rdynamic CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_bddc5 ]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=/usr/bin/c++]
|
||||
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper]
|
||||
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
|
||||
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
|
||||
ignore line: [Target: x86_64-linux-gnu]
|
||||
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) ]
|
||||
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/]
|
||||
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_bddc5' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
|
||||
link line: [ /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/cckr006M.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_bddc5 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o]
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/collect2] ==> ignore
|
||||
arg [-plugin] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so] ==> ignore
|
||||
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper] ==> ignore
|
||||
arg [-plugin-opt=-fresolution=/tmp/cckr006M.res] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
|
||||
arg [--build-id] ==> ignore
|
||||
arg [--eh-frame-hdr] ==> ignore
|
||||
arg [-m] ==> ignore
|
||||
arg [elf_x86_64] ==> ignore
|
||||
arg [--hash-style=gnu] ==> ignore
|
||||
arg [--as-needed] ==> ignore
|
||||
arg [-export-dynamic] ==> ignore
|
||||
arg [-dynamic-linker] ==> ignore
|
||||
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
|
||||
arg [-pie] ==> ignore
|
||||
arg [-znow] ==> ignore
|
||||
arg [-zrelro] ==> ignore
|
||||
arg [-o] ==> ignore
|
||||
arg [cmTC_bddc5] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o] ==> ignore
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/7] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/7]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib]
|
||||
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
|
||||
arg [-L/lib/../lib] ==> dir [/lib/../lib]
|
||||
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
|
||||
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/7/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../..]
|
||||
arg [CMakeFiles/cmTC_bddc5.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
|
||||
arg [-lstdc++] ==> lib [stdc++]
|
||||
arg [-lm] ==> lib [m]
|
||||
arg [-lgcc_s] ==> lib [gcc_s]
|
||||
arg [-lgcc] ==> lib [gcc]
|
||||
arg [-lc] ==> lib [c]
|
||||
arg [-lgcc_s] ==> lib [gcc_s]
|
||||
arg [-lgcc] ==> lib [gcc]
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o] ==> ignore
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/7] ==> [/usr/lib/gcc/x86_64-linux-gnu/7]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib] ==> [/usr/lib]
|
||||
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/lib/../lib] ==> [/lib]
|
||||
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/7/../../..] ==> [/usr/lib]
|
||||
implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc]
|
||||
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
|
||||
implicit fwks: []
|
||||
|
||||
|
||||
Determining if the include file pthread.h exists passed with the following output:
|
||||
Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_7a980/fast && /usr/bin/make -f CMakeFiles/cmTC_7a980.dir/build.make CMakeFiles/cmTC_7a980.dir/build
|
||||
make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Building C object CMakeFiles/cmTC_7a980.dir/CheckIncludeFile.c.o
|
||||
/usr/bin/cc -o CMakeFiles/cmTC_7a980.dir/CheckIncludeFile.c.o -c /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp/CheckIncludeFile.c
|
||||
Linking C executable cmTC_7a980
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7a980.dir/link.txt --verbose=1
|
||||
/usr/bin/cc -rdynamic CMakeFiles/cmTC_7a980.dir/CheckIncludeFile.c.o -o cmTC_7a980
|
||||
make[1]: Leaving directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Determining if the function pthread_create exists in the pthread passed with the following output:
|
||||
Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_1a96d/fast && /usr/bin/make -f CMakeFiles/cmTC_1a96d.dir/build.make CMakeFiles/cmTC_1a96d.dir/build
|
||||
make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Building C object CMakeFiles/cmTC_1a96d.dir/CheckFunctionExists.c.o
|
||||
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_1a96d.dir/CheckFunctionExists.c.o -c /opt/clion-2020.3.2/bin/cmake/linux/share/cmake-3.17/Modules/CheckFunctionExists.c
|
||||
Linking C executable cmTC_1a96d
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1a96d.dir/link.txt --verbose=1
|
||||
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_1a96d.dir/CheckFunctionExists.c.o -o cmTC_1a96d -lpthread
|
||||
make[1]: Leaving directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Determining if the CL_VERSION_2_2 exist passed with the following output:
|
||||
Change Dir: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_fdf34/fast && /usr/bin/make -f CMakeFiles/cmTC_fdf34.dir/build.make CMakeFiles/cmTC_fdf34.dir/build
|
||||
make[1]: Entering directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
Building C object CMakeFiles/cmTC_fdf34.dir/CheckSymbolExists.c.o
|
||||
/usr/bin/cc -o CMakeFiles/cmTC_fdf34.dir/CheckSymbolExists.c.o -c /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c
|
||||
Linking C executable cmTC_fdf34
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_fdf34.dir/link.txt --verbose=1
|
||||
/usr/bin/cc -rdynamic CMakeFiles/cmTC_fdf34.dir/CheckSymbolExists.c.o -o cmTC_fdf34
|
||||
make[1]: Leaving directory '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
File /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
|
||||
/* */
|
||||
#include </usr/include/CL/cl.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
(void)argv;
|
||||
#ifndef CL_VERSION_2_2
|
||||
return ((int*)(&CL_VERSION_2_2))[argc];
|
||||
#else
|
||||
(void)argc;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
ToolSet: 1.0 (local)Options:
|
||||
|
||||
Options:
|
||||
@@ -0,0 +1,70 @@
|
||||
/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /root/Project/ROS/src/vio_svo/GPU_version/svo
|
||||
-- The C compiler identification is GNU 7.5.0
|
||||
-- The CXX compiler identification is GNU 7.5.0
|
||||
-- Check for working C compiler: /usr/bin/cc
|
||||
-- Check for working C compiler: /usr/bin/cc - works
|
||||
-- Detecting C compiler ABI info
|
||||
-- Detecting C compiler ABI info - done
|
||||
-- Detecting C compile features
|
||||
-- Detecting C compile features - done
|
||||
-- Check for working CXX compiler: /usr/bin/c++
|
||||
-- Check for working CXX compiler: /usr/bin/c++ - works
|
||||
-- Detecting CXX compiler ABI info
|
||||
-- Detecting CXX compiler ABI info - done
|
||||
-- Detecting CXX compile features
|
||||
-- Detecting CXX compile features - done
|
||||
-- Found OpenCV: /usr (found suitable version "3.2.0", minimum required is "3")
|
||||
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
|
||||
-- Checking for module 'eigen3'
|
||||
-- Found eigen3, version 3.3.4
|
||||
-- Found Eigen: /usr/include/eigen3
|
||||
-- Eigen found (include: /usr/include/eigen3)
|
||||
-- Looking for pthread.h
|
||||
-- Looking for pthread.h - found
|
||||
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
|
||||
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
|
||||
-- Looking for pthread_create in pthreads
|
||||
-- Looking for pthread_create in pthreads - not found
|
||||
-- Looking for pthread_create in pthread
|
||||
-- Looking for pthread_create in pthread - found
|
||||
-- Found Threads: TRUE
|
||||
-- Found Boost: /usr/include (found version "1.65.1") found components: thread system chrono date_time atomic
|
||||
-- Looking for CL_VERSION_2_2
|
||||
-- Looking for CL_VERSION_2_2 - found
|
||||
-- Found OpenCL: /usr/lib/x86_64-linux-gnu/libOpenCL.so (found version "2.2")
|
||||
-- Using CATKIN_DEVEL_PREFIX: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel
|
||||
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
|
||||
-- This workspace overlays: /opt/ros/melodic
|
||||
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")
|
||||
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
|
||||
-- Using Debian Python package layout
|
||||
-- Using empy: /usr/bin/empy
|
||||
-- Using CATKIN_ENABLE_TESTING: ON
|
||||
-- Call enable_testing()
|
||||
-- Using CATKIN_TEST_RESULTS_DIR: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/test_results
|
||||
-- Found gtest sources under '/usr/src/googletest': gtests will be built
|
||||
-- Found gmock sources under '/usr/src/googletest': gmock will be built
|
||||
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17")
|
||||
-- Using Python nosetests: /usr/bin/nosetests-2.7
|
||||
-- catkin 0.7.28
|
||||
-- BUILD_SHARED_LIBS is on
|
||||
-- Could NOT find robot_localization (missing: robot_localization_DIR)
|
||||
-- Could not find the required component 'robot_localization'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
|
||||
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
|
||||
Could not find a package configuration file provided by
|
||||
"robot_localization" with any of the following names:
|
||||
|
||||
robot_localizationConfig.cmake
|
||||
robot_localization-config.cmake
|
||||
|
||||
Add the installation prefix of "robot_localization" to CMAKE_PREFIX_PATH or
|
||||
set "robot_localization_DIR" to a directory containing one of the above
|
||||
files. If "robot_localization" provides a separate development package or
|
||||
SDK, be sure it has been installed.
|
||||
Call Stack (most recent call first):
|
||||
CMakeLists.txt:34 (FIND_PACKAGE)
|
||||
|
||||
|
||||
-- Configuring incomplete, errors occurred!
|
||||
See also "/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeOutput.log".
|
||||
See also "/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/CMakeFiles/CMakeError.log".
|
||||
@@ -0,0 +1 @@
|
||||
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
|
||||
@@ -0,0 +1,107 @@
|
||||
# This file is configured by CMake automatically as DartConfiguration.tcl
|
||||
# If you choose not to use CMake, this file may be hand configured, by
|
||||
# filling in the required variables.
|
||||
|
||||
|
||||
# Configuration directories and files
|
||||
SourceDirectory: /root/Project/ROS/src/vio_svo/GPU_version/svo
|
||||
BuildDirectory: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug
|
||||
|
||||
# Where to place the cost data store
|
||||
CostDataFile:
|
||||
|
||||
# Site is something like machine.domain, i.e. pragmatic.crd
|
||||
Site: gfuse
|
||||
|
||||
# Build name is osname-revision-compiler, i.e. Linux-2.4.2-2smp-c++
|
||||
BuildName:
|
||||
|
||||
# Subprojects
|
||||
LabelsForSubprojects:
|
||||
|
||||
# Submission information
|
||||
SubmitURL:
|
||||
|
||||
# Dashboard start time
|
||||
NightlyStartTime:
|
||||
|
||||
# Commands for the build/test/submit cycle
|
||||
ConfigureCommand: "/opt/clion-2020.3.2/bin/cmake/linux/bin/cmake" "/root/Project/ROS/src/vio_svo/GPU_version/svo"
|
||||
MakeCommand:
|
||||
DefaultCTestConfigurationType:
|
||||
|
||||
# version control
|
||||
UpdateVersionOnly:
|
||||
|
||||
# CVS options
|
||||
# Default is "-d -P -A"
|
||||
CVSCommand:
|
||||
CVSUpdateOptions:
|
||||
|
||||
# Subversion options
|
||||
SVNCommand:
|
||||
SVNOptions:
|
||||
SVNUpdateOptions:
|
||||
|
||||
# Git options
|
||||
GITCommand:
|
||||
GITInitSubmodules:
|
||||
GITUpdateOptions:
|
||||
GITUpdateCustom:
|
||||
|
||||
# Perforce options
|
||||
P4Command:
|
||||
P4Client:
|
||||
P4Options:
|
||||
P4UpdateOptions:
|
||||
P4UpdateCustom:
|
||||
|
||||
# Generic update command
|
||||
UpdateCommand:
|
||||
UpdateOptions:
|
||||
UpdateType:
|
||||
|
||||
# Compiler info
|
||||
Compiler: /usr/bin/c++
|
||||
CompilerVersion: 7.5.0
|
||||
|
||||
# Dynamic analysis (MemCheck)
|
||||
PurifyCommand:
|
||||
ValgrindCommand:
|
||||
ValgrindCommandOptions:
|
||||
DrMemoryCommand:
|
||||
DrMemoryCommandOptions:
|
||||
MemoryCheckType:
|
||||
MemoryCheckSanitizerOptions:
|
||||
MemoryCheckCommand:
|
||||
MemoryCheckCommandOptions:
|
||||
MemoryCheckSuppressionFile:
|
||||
|
||||
# Coverage
|
||||
CoverageCommand:
|
||||
CoverageExtraFlags:
|
||||
|
||||
# Cluster commands
|
||||
SlurmBatchCommand:
|
||||
SlurmRunCommand:
|
||||
|
||||
# Testing options
|
||||
# TimeOut is the amount of time in seconds to wait for processes
|
||||
# to complete during testing. After TimeOut seconds, the
|
||||
# process will be summarily terminated.
|
||||
# Currently set to 25 minutes
|
||||
TimeOut:
|
||||
|
||||
# During parallel testing CTest will not start a new test if doing
|
||||
# so would cause the system load to exceed this value.
|
||||
TestLoad:
|
||||
|
||||
UseLaunchers:
|
||||
CurlOptions:
|
||||
# warning, if you add new options here that have to do with submit,
|
||||
# you have to update cmCTestSubmitCommand.cxx
|
||||
|
||||
# For CTest submissions that timeout, these options
|
||||
# specify behavior for retrying the submission
|
||||
CTestSubmitRetryDelay:
|
||||
CTestSubmitRetryCount:
|
||||
@@ -0,0 +1,2 @@
|
||||
set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 0)
|
||||
set(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 0)
|
||||
@@ -0,0 +1,2 @@
|
||||
- setup-file:
|
||||
local-name: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel/setup.sh
|
||||
@@ -0,0 +1,304 @@
|
||||
#!/usr/bin/python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2012, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
"""This file generates shell code for the setup.SHELL scripts to set environment variables."""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
import errno
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
CATKIN_MARKER_FILE = '.catkin'
|
||||
|
||||
system = platform.system()
|
||||
IS_DARWIN = (system == 'Darwin')
|
||||
IS_WINDOWS = (system == 'Windows')
|
||||
|
||||
PATH_TO_ADD_SUFFIX = ['bin']
|
||||
if IS_WINDOWS:
|
||||
# while catkin recommends putting dll's into bin, 3rd party packages often put dll's into lib
|
||||
# since Windows finds dll's via the PATH variable, prepend it with path to lib
|
||||
PATH_TO_ADD_SUFFIX.extend([['lib', os.path.join('lib', 'x86_64-linux-gnu')]])
|
||||
|
||||
# subfolder of workspace prepended to CMAKE_PREFIX_PATH
|
||||
ENV_VAR_SUBFOLDERS = {
|
||||
'CMAKE_PREFIX_PATH': '',
|
||||
'LD_LIBRARY_PATH' if not IS_DARWIN else 'DYLD_LIBRARY_PATH': ['lib', os.path.join('lib', 'x86_64-linux-gnu')],
|
||||
'PATH': PATH_TO_ADD_SUFFIX,
|
||||
'PKG_CONFIG_PATH': [os.path.join('lib', 'pkgconfig'), os.path.join('lib', 'x86_64-linux-gnu', 'pkgconfig')],
|
||||
'PYTHONPATH': 'lib/python2.7/dist-packages',
|
||||
}
|
||||
|
||||
|
||||
def rollback_env_variables(environ, env_var_subfolders):
|
||||
"""
|
||||
Generate shell code to reset environment variables.
|
||||
|
||||
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
|
||||
This does not cover modifications performed by environment hooks.
|
||||
"""
|
||||
lines = []
|
||||
unmodified_environ = copy.copy(environ)
|
||||
for key in sorted(env_var_subfolders.keys()):
|
||||
subfolders = env_var_subfolders[key]
|
||||
if not isinstance(subfolders, list):
|
||||
subfolders = [subfolders]
|
||||
value = _rollback_env_variable(unmodified_environ, key, subfolders)
|
||||
if value is not None:
|
||||
environ[key] = value
|
||||
lines.append(assignment(key, value))
|
||||
if lines:
|
||||
lines.insert(0, comment('reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH'))
|
||||
return lines
|
||||
|
||||
|
||||
def _rollback_env_variable(environ, name, subfolders):
|
||||
"""
|
||||
For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder.
|
||||
|
||||
:param subfolders: list of str '' or subfoldername that may start with '/'
|
||||
:returns: the updated value of the environment variable.
|
||||
"""
|
||||
value = environ[name] if name in environ else ''
|
||||
env_paths = [path for path in value.split(os.pathsep) if path]
|
||||
value_modified = False
|
||||
for subfolder in subfolders:
|
||||
if subfolder:
|
||||
if subfolder.startswith(os.path.sep) or (os.path.altsep and subfolder.startswith(os.path.altsep)):
|
||||
subfolder = subfolder[1:]
|
||||
if subfolder.endswith(os.path.sep) or (os.path.altsep and subfolder.endswith(os.path.altsep)):
|
||||
subfolder = subfolder[:-1]
|
||||
for ws_path in _get_workspaces(environ, include_fuerte=True, include_non_existing=True):
|
||||
path_to_find = os.path.join(ws_path, subfolder) if subfolder else ws_path
|
||||
path_to_remove = None
|
||||
for env_path in env_paths:
|
||||
env_path_clean = env_path[:-1] if env_path and env_path[-1] in [os.path.sep, os.path.altsep] else env_path
|
||||
if env_path_clean == path_to_find:
|
||||
path_to_remove = env_path
|
||||
break
|
||||
if path_to_remove:
|
||||
env_paths.remove(path_to_remove)
|
||||
value_modified = True
|
||||
new_value = os.pathsep.join(env_paths)
|
||||
return new_value if value_modified else None
|
||||
|
||||
|
||||
def _get_workspaces(environ, include_fuerte=False, include_non_existing=False):
|
||||
"""
|
||||
Based on CMAKE_PREFIX_PATH return all catkin workspaces.
|
||||
|
||||
:param include_fuerte: The flag if paths starting with '/opt/ros/fuerte' should be considered workspaces, ``bool``
|
||||
"""
|
||||
# get all cmake prefix paths
|
||||
env_name = 'CMAKE_PREFIX_PATH'
|
||||
value = environ[env_name] if env_name in environ else ''
|
||||
paths = [path for path in value.split(os.pathsep) if path]
|
||||
# remove non-workspace paths
|
||||
workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE)) or (include_fuerte and path.startswith('/opt/ros/fuerte')) or (include_non_existing and not os.path.exists(path))]
|
||||
return workspaces
|
||||
|
||||
|
||||
def prepend_env_variables(environ, env_var_subfolders, workspaces):
|
||||
"""Generate shell code to prepend environment variables for the all workspaces."""
|
||||
lines = []
|
||||
lines.append(comment('prepend folders of workspaces to environment variables'))
|
||||
|
||||
paths = [path for path in workspaces.split(os.pathsep) if path]
|
||||
|
||||
prefix = _prefix_env_variable(environ, 'CMAKE_PREFIX_PATH', paths, '')
|
||||
lines.append(prepend(environ, 'CMAKE_PREFIX_PATH', prefix))
|
||||
|
||||
for key in sorted(key for key in env_var_subfolders.keys() if key != 'CMAKE_PREFIX_PATH'):
|
||||
subfolder = env_var_subfolders[key]
|
||||
prefix = _prefix_env_variable(environ, key, paths, subfolder)
|
||||
lines.append(prepend(environ, key, prefix))
|
||||
return lines
|
||||
|
||||
|
||||
def _prefix_env_variable(environ, name, paths, subfolders):
|
||||
"""
|
||||
Return the prefix to prepend to the environment variable NAME.
|
||||
|
||||
Adding any path in NEW_PATHS_STR without creating duplicate or empty items.
|
||||
"""
|
||||
value = environ[name] if name in environ else ''
|
||||
environ_paths = [path for path in value.split(os.pathsep) if path]
|
||||
checked_paths = []
|
||||
for path in paths:
|
||||
if not isinstance(subfolders, list):
|
||||
subfolders = [subfolders]
|
||||
for subfolder in subfolders:
|
||||
path_tmp = path
|
||||
if subfolder:
|
||||
path_tmp = os.path.join(path_tmp, subfolder)
|
||||
# skip nonexistent paths
|
||||
if not os.path.exists(path_tmp):
|
||||
continue
|
||||
# exclude any path already in env and any path we already added
|
||||
if path_tmp not in environ_paths and path_tmp not in checked_paths:
|
||||
checked_paths.append(path_tmp)
|
||||
prefix_str = os.pathsep.join(checked_paths)
|
||||
if prefix_str != '' and environ_paths:
|
||||
prefix_str += os.pathsep
|
||||
return prefix_str
|
||||
|
||||
|
||||
def assignment(key, value):
|
||||
if not IS_WINDOWS:
|
||||
return 'export %s="%s"' % (key, value)
|
||||
else:
|
||||
return 'set %s=%s' % (key, value)
|
||||
|
||||
|
||||
def comment(msg):
|
||||
if not IS_WINDOWS:
|
||||
return '# %s' % msg
|
||||
else:
|
||||
return 'REM %s' % msg
|
||||
|
||||
|
||||
def prepend(environ, key, prefix):
|
||||
if key not in environ or not environ[key]:
|
||||
return assignment(key, prefix)
|
||||
if not IS_WINDOWS:
|
||||
return 'export %s="%s$%s"' % (key, prefix, key)
|
||||
else:
|
||||
return 'set %s=%s%%%s%%' % (key, prefix, key)
|
||||
|
||||
|
||||
def find_env_hooks(environ, cmake_prefix_path):
|
||||
"""Generate shell code with found environment hooks for the all workspaces."""
|
||||
lines = []
|
||||
lines.append(comment('found environment hooks in workspaces'))
|
||||
|
||||
generic_env_hooks = []
|
||||
generic_env_hooks_workspace = []
|
||||
specific_env_hooks = []
|
||||
specific_env_hooks_workspace = []
|
||||
generic_env_hooks_by_filename = {}
|
||||
specific_env_hooks_by_filename = {}
|
||||
generic_env_hook_ext = 'bat' if IS_WINDOWS else 'sh'
|
||||
specific_env_hook_ext = environ['CATKIN_SHELL'] if not IS_WINDOWS and 'CATKIN_SHELL' in environ and environ['CATKIN_SHELL'] else None
|
||||
# remove non-workspace paths
|
||||
workspaces = [path for path in cmake_prefix_path.split(os.pathsep) if path and os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))]
|
||||
for workspace in reversed(workspaces):
|
||||
env_hook_dir = os.path.join(workspace, 'etc', 'catkin', 'profile.d')
|
||||
if os.path.isdir(env_hook_dir):
|
||||
for filename in sorted(os.listdir(env_hook_dir)):
|
||||
if filename.endswith('.%s' % generic_env_hook_ext):
|
||||
# remove previous env hook with same name if present
|
||||
if filename in generic_env_hooks_by_filename:
|
||||
i = generic_env_hooks.index(generic_env_hooks_by_filename[filename])
|
||||
generic_env_hooks.pop(i)
|
||||
generic_env_hooks_workspace.pop(i)
|
||||
# append env hook
|
||||
generic_env_hooks.append(os.path.join(env_hook_dir, filename))
|
||||
generic_env_hooks_workspace.append(workspace)
|
||||
generic_env_hooks_by_filename[filename] = generic_env_hooks[-1]
|
||||
elif specific_env_hook_ext is not None and filename.endswith('.%s' % specific_env_hook_ext):
|
||||
# remove previous env hook with same name if present
|
||||
if filename in specific_env_hooks_by_filename:
|
||||
i = specific_env_hooks.index(specific_env_hooks_by_filename[filename])
|
||||
specific_env_hooks.pop(i)
|
||||
specific_env_hooks_workspace.pop(i)
|
||||
# append env hook
|
||||
specific_env_hooks.append(os.path.join(env_hook_dir, filename))
|
||||
specific_env_hooks_workspace.append(workspace)
|
||||
specific_env_hooks_by_filename[filename] = specific_env_hooks[-1]
|
||||
env_hooks = generic_env_hooks + specific_env_hooks
|
||||
env_hooks_workspace = generic_env_hooks_workspace + specific_env_hooks_workspace
|
||||
count = len(env_hooks)
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_COUNT', count))
|
||||
for i in range(count):
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d' % i, env_hooks[i]))
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d_WORKSPACE' % i, env_hooks_workspace[i]))
|
||||
return lines
|
||||
|
||||
|
||||
def _parse_arguments(args=None):
|
||||
parser = argparse.ArgumentParser(description='Generates code blocks for the setup.SHELL script.')
|
||||
parser.add_argument('--extend', action='store_true', help='Skip unsetting previous environment variables to extend context')
|
||||
parser.add_argument('--local', action='store_true', help='Only consider this prefix path and ignore other prefix path in the environment')
|
||||
return parser.parse_known_args(args=args)[0]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
try:
|
||||
args = _parse_arguments()
|
||||
except Exception as e:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if not args.local:
|
||||
# environment at generation time
|
||||
CMAKE_PREFIX_PATH = '/opt/ros/melodic'.split(';')
|
||||
else:
|
||||
# don't consider any other prefix path than this one
|
||||
CMAKE_PREFIX_PATH = []
|
||||
# prepend current workspace if not already part of CPP
|
||||
base_path = os.path.dirname(__file__)
|
||||
# CMAKE_PREFIX_PATH uses forward slash on all platforms, but __file__ is platform dependent
|
||||
# base_path on Windows contains backward slashes, need to be converted to forward slashes before comparison
|
||||
if os.path.sep != '/':
|
||||
base_path = base_path.replace(os.path.sep, '/')
|
||||
|
||||
if base_path not in CMAKE_PREFIX_PATH:
|
||||
CMAKE_PREFIX_PATH.insert(0, base_path)
|
||||
CMAKE_PREFIX_PATH = os.pathsep.join(CMAKE_PREFIX_PATH)
|
||||
|
||||
environ = dict(os.environ)
|
||||
lines = []
|
||||
if not args.extend:
|
||||
lines += rollback_env_variables(environ, ENV_VAR_SUBFOLDERS)
|
||||
lines += prepend_env_variables(environ, ENV_VAR_SUBFOLDERS, CMAKE_PREFIX_PATH)
|
||||
lines += find_env_hooks(environ, CMAKE_PREFIX_PATH)
|
||||
print('\n'.join(lines))
|
||||
|
||||
# need to explicitly flush the output
|
||||
sys.stdout.flush()
|
||||
except IOError as e:
|
||||
# and catch potential "broken pipe" if stdout is not writable
|
||||
# which can happen when piping the output to a file but the disk is full
|
||||
if e.errno == errno.EPIPE:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(2)
|
||||
raise
|
||||
|
||||
sys.exit(0)
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/templates/env.sh.in
|
||||
|
||||
if [ $# -eq 0 ] ; then
|
||||
/bin/echo "Usage: env.sh COMMANDS"
|
||||
/bin/echo "Calling env.sh without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ensure to not use different shell type which was set before
|
||||
CATKIN_SHELL=sh
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(cd "`dirname "$0"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh"
|
||||
exec "$@"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# generated from catkin/cmake/templates/local_setup.bash.in
|
||||
|
||||
CATKIN_SHELL=bash
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh" --extend --local
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/template/local_setup.sh.in
|
||||
|
||||
# since this file is sourced either use the provided _CATKIN_SETUP_DIR
|
||||
# or fall back to the destination set at configure time
|
||||
: ${_CATKIN_SETUP_DIR:=/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel}
|
||||
CATKIN_SETUP_UTIL_ARGS="--extend --local"
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh"
|
||||
unset CATKIN_SETUP_UTIL_ARGS
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env zsh
|
||||
# generated from catkin/cmake/templates/local_setup.zsh.in
|
||||
|
||||
CATKIN_SHELL=zsh
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd -q "`dirname "$0"`" > /dev/null && pwd)
|
||||
emulate -R zsh -c 'source "$_CATKIN_SETUP_DIR/setup.sh" --extend --local'
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# generated from catkin/cmake/templates/setup.bash.in
|
||||
|
||||
CATKIN_SHELL=bash
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh"
|
||||
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/template/setup.sh.in
|
||||
|
||||
# Sets various environment variables and sources additional environment hooks.
|
||||
# It tries it's best to undo changes from a previously sourced setup file before.
|
||||
# Supported command line options:
|
||||
# --extend: skips the undoing of changes from a previously sourced setup file
|
||||
# --local: only considers this workspace but not the chained ones
|
||||
# In plain sh shell which doesn't support arguments for sourced scripts you can
|
||||
# set the environment variable `CATKIN_SETUP_UTIL_ARGS=--extend/--local` instead.
|
||||
|
||||
# since this file is sourced either use the provided _CATKIN_SETUP_DIR
|
||||
# or fall back to the destination set at configure time
|
||||
: ${_CATKIN_SETUP_DIR:=/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel}
|
||||
_SETUP_UTIL="$_CATKIN_SETUP_DIR/_setup_util.py"
|
||||
unset _CATKIN_SETUP_DIR
|
||||
|
||||
if [ ! -f "$_SETUP_UTIL" ]; then
|
||||
echo "Missing Python script: $_SETUP_UTIL"
|
||||
return 22
|
||||
fi
|
||||
|
||||
# detect if running on Darwin platform
|
||||
_UNAME=`uname -s`
|
||||
_IS_DARWIN=0
|
||||
if [ "$_UNAME" = "Darwin" ]; then
|
||||
_IS_DARWIN=1
|
||||
fi
|
||||
unset _UNAME
|
||||
|
||||
# make sure to export all environment variables
|
||||
export CMAKE_PREFIX_PATH
|
||||
if [ $_IS_DARWIN -eq 0 ]; then
|
||||
export LD_LIBRARY_PATH
|
||||
else
|
||||
export DYLD_LIBRARY_PATH
|
||||
fi
|
||||
unset _IS_DARWIN
|
||||
export PATH
|
||||
export PKG_CONFIG_PATH
|
||||
export PYTHONPATH
|
||||
|
||||
# remember type of shell if not already set
|
||||
if [ -z "$CATKIN_SHELL" ]; then
|
||||
CATKIN_SHELL=sh
|
||||
fi
|
||||
|
||||
# invoke Python script to generate necessary exports of environment variables
|
||||
# use TMPDIR if it exists, otherwise fall back to /tmp
|
||||
if [ -d "${TMPDIR:-}" ]; then
|
||||
_TMPDIR="${TMPDIR}"
|
||||
else
|
||||
_TMPDIR=/tmp
|
||||
fi
|
||||
_SETUP_TMP=`mktemp "${_TMPDIR}/setup.sh.XXXXXXXXXX"`
|
||||
unset _TMPDIR
|
||||
if [ $? -ne 0 -o ! -f "$_SETUP_TMP" ]; then
|
||||
echo "Could not create temporary file: $_SETUP_TMP"
|
||||
return 1
|
||||
fi
|
||||
CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ ${CATKIN_SETUP_UTIL_ARGS:-} >> "$_SETUP_TMP"
|
||||
_RC=$?
|
||||
if [ $_RC -ne 0 ]; then
|
||||
if [ $_RC -eq 2 ]; then
|
||||
echo "Could not write the output of '$_SETUP_UTIL' to temporary file '$_SETUP_TMP': may be the disk if full?"
|
||||
else
|
||||
echo "Failed to run '\"$_SETUP_UTIL\" $@': return code $_RC"
|
||||
fi
|
||||
unset _RC
|
||||
unset _SETUP_UTIL
|
||||
rm -f "$_SETUP_TMP"
|
||||
unset _SETUP_TMP
|
||||
return 1
|
||||
fi
|
||||
unset _RC
|
||||
unset _SETUP_UTIL
|
||||
. "$_SETUP_TMP"
|
||||
rm -f "$_SETUP_TMP"
|
||||
unset _SETUP_TMP
|
||||
|
||||
# source all environment hooks
|
||||
_i=0
|
||||
while [ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]; do
|
||||
eval _envfile=\$_CATKIN_ENVIRONMENT_HOOKS_$_i
|
||||
unset _CATKIN_ENVIRONMENT_HOOKS_$_i
|
||||
eval _envfile_workspace=\$_CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE
|
||||
unset _CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE
|
||||
# set workspace for environment hook
|
||||
CATKIN_ENV_HOOK_WORKSPACE=$_envfile_workspace
|
||||
. "$_envfile"
|
||||
unset CATKIN_ENV_HOOK_WORKSPACE
|
||||
_i=$((_i + 1))
|
||||
done
|
||||
unset _i
|
||||
|
||||
unset _CATKIN_ENVIRONMENT_HOOKS_COUNT
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env zsh
|
||||
# generated from catkin/cmake/templates/setup.zsh.in
|
||||
|
||||
CATKIN_SHELL=zsh
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd -q "`dirname "$0"`" > /dev/null && pwd)
|
||||
emulate -R zsh -c 'source "$_CATKIN_SETUP_DIR/setup.sh"'
|
||||
@@ -0,0 +1,24 @@
|
||||
set(_CATKIN_CURRENT_PACKAGE "catkin")
|
||||
set(catkin_VERSION "0.7.28")
|
||||
set(catkin_MAINTAINER "Dirk Thomas <[email protected]>")
|
||||
set(catkin_PACKAGE_FORMAT "3")
|
||||
set(catkin_BUILD_DEPENDS "python-argparse" "python-catkin-pkg" "python3-catkin-pkg" "python-empy" "python3-empy")
|
||||
set(catkin_BUILD_DEPENDS_python-catkin-pkg_VERSION_GT "0.4.3")
|
||||
set(catkin_BUILD_DEPENDS_python3-catkin-pkg_VERSION_GT "0.4.3")
|
||||
set(catkin_BUILD_EXPORT_DEPENDS "google-mock" "gtest" "python-nose" "python3-nose" "python-argparse" "python-catkin-pkg" "python3-catkin-pkg" "python-empy" "python3-empy")
|
||||
set(catkin_BUILD_EXPORT_DEPENDS_python-catkin-pkg_VERSION_GT "0.4.3")
|
||||
set(catkin_BUILD_EXPORT_DEPENDS_python3-catkin-pkg_VERSION_GT "0.4.3")
|
||||
set(catkin_BUILDTOOL_DEPENDS "cmake" "python-setuptools" "python3-setuptools")
|
||||
set(catkin_BUILDTOOL_EXPORT_DEPENDS "cmake" "python3-setuptools")
|
||||
set(catkin_EXEC_DEPENDS "python-argparse" "python-catkin-pkg" "python3-catkin-pkg" "python-empy" "python3-empy")
|
||||
set(catkin_EXEC_DEPENDS_python-catkin-pkg_VERSION_GT "0.4.3")
|
||||
set(catkin_EXEC_DEPENDS_python3-catkin-pkg_VERSION_GT "0.4.3")
|
||||
set(catkin_RUN_DEPENDS "python-argparse" "python-catkin-pkg" "python3-catkin-pkg" "python-empy" "python3-empy" "google-mock" "gtest" "python-nose" "python3-nose")
|
||||
set(catkin_RUN_DEPENDS_python-catkin-pkg_VERSION_GT "0.4.3")
|
||||
set(catkin_RUN_DEPENDS_python3-catkin-pkg_VERSION_GT "0.4.3")
|
||||
set(catkin_TEST_DEPENDS "python-mock" "python3-mock" "python-nose" "python3-nose")
|
||||
set(catkin_DOC_DEPENDS )
|
||||
set(catkin_URL_WEBSITE "http://wiki.ros.org/catkin")
|
||||
set(catkin_URL_BUGTRACKER "https://github.com/ros/catkin/issues")
|
||||
set(catkin_URL_REPOSITORY "https://github.com/ros/catkin")
|
||||
set(catkin_DEPRECATED "")
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/templates/env.sh.in
|
||||
|
||||
if [ $# -eq 0 ] ; then
|
||||
/bin/echo "Usage: env.sh COMMANDS"
|
||||
/bin/echo "Calling env.sh without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ensure to not use different shell type which was set before
|
||||
CATKIN_SHELL=sh
|
||||
|
||||
# source setup_cached.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(cd "`dirname "$0"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup_cached.sh"
|
||||
exec "$@"
|
||||
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import stat
|
||||
import sys
|
||||
|
||||
# find the import for catkin's python package - either from source space or from an installed underlay
|
||||
if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
|
||||
sys.path.insert(0, os.path.join('/opt/ros/melodic/share/catkin/cmake', '..', 'python'))
|
||||
try:
|
||||
from catkin.environment_cache import generate_environment_script
|
||||
except ImportError:
|
||||
# search for catkin package in all workspaces and prepend to path
|
||||
for workspace in '/opt/ros/melodic'.split(';'):
|
||||
python_path = os.path.join(workspace, 'lib/python2.7/dist-packages')
|
||||
if os.path.isdir(os.path.join(python_path, 'catkin')):
|
||||
sys.path.insert(0, python_path)
|
||||
break
|
||||
from catkin.environment_cache import generate_environment_script
|
||||
|
||||
code = generate_environment_script('/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel/env.sh')
|
||||
|
||||
output_filename = '/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/catkin_generated/setup_cached.sh'
|
||||
with open(output_filename, 'w') as f:
|
||||
# print('Generate script for cached setup "%s"' % output_filename)
|
||||
f.write('\n'.join(code))
|
||||
|
||||
mode = os.stat(output_filename).st_mode
|
||||
os.chmod(output_filename, mode | stat.S_IXUSR)
|
||||
@@ -0,0 +1,2 @@
|
||||
- setup-file:
|
||||
local-name: /usr/local/setup.sh
|
||||
+304
@@ -0,0 +1,304 @@
|
||||
#!/usr/bin/python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2012, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
"""This file generates shell code for the setup.SHELL scripts to set environment variables."""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
import errno
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
CATKIN_MARKER_FILE = '.catkin'
|
||||
|
||||
system = platform.system()
|
||||
IS_DARWIN = (system == 'Darwin')
|
||||
IS_WINDOWS = (system == 'Windows')
|
||||
|
||||
PATH_TO_ADD_SUFFIX = ['bin']
|
||||
if IS_WINDOWS:
|
||||
# while catkin recommends putting dll's into bin, 3rd party packages often put dll's into lib
|
||||
# since Windows finds dll's via the PATH variable, prepend it with path to lib
|
||||
PATH_TO_ADD_SUFFIX.extend([['lib', os.path.join('lib', 'x86_64-linux-gnu')]])
|
||||
|
||||
# subfolder of workspace prepended to CMAKE_PREFIX_PATH
|
||||
ENV_VAR_SUBFOLDERS = {
|
||||
'CMAKE_PREFIX_PATH': '',
|
||||
'LD_LIBRARY_PATH' if not IS_DARWIN else 'DYLD_LIBRARY_PATH': ['lib', os.path.join('lib', 'x86_64-linux-gnu')],
|
||||
'PATH': PATH_TO_ADD_SUFFIX,
|
||||
'PKG_CONFIG_PATH': [os.path.join('lib', 'pkgconfig'), os.path.join('lib', 'x86_64-linux-gnu', 'pkgconfig')],
|
||||
'PYTHONPATH': 'lib/python2.7/dist-packages',
|
||||
}
|
||||
|
||||
|
||||
def rollback_env_variables(environ, env_var_subfolders):
|
||||
"""
|
||||
Generate shell code to reset environment variables.
|
||||
|
||||
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
|
||||
This does not cover modifications performed by environment hooks.
|
||||
"""
|
||||
lines = []
|
||||
unmodified_environ = copy.copy(environ)
|
||||
for key in sorted(env_var_subfolders.keys()):
|
||||
subfolders = env_var_subfolders[key]
|
||||
if not isinstance(subfolders, list):
|
||||
subfolders = [subfolders]
|
||||
value = _rollback_env_variable(unmodified_environ, key, subfolders)
|
||||
if value is not None:
|
||||
environ[key] = value
|
||||
lines.append(assignment(key, value))
|
||||
if lines:
|
||||
lines.insert(0, comment('reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH'))
|
||||
return lines
|
||||
|
||||
|
||||
def _rollback_env_variable(environ, name, subfolders):
|
||||
"""
|
||||
For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder.
|
||||
|
||||
:param subfolders: list of str '' or subfoldername that may start with '/'
|
||||
:returns: the updated value of the environment variable.
|
||||
"""
|
||||
value = environ[name] if name in environ else ''
|
||||
env_paths = [path for path in value.split(os.pathsep) if path]
|
||||
value_modified = False
|
||||
for subfolder in subfolders:
|
||||
if subfolder:
|
||||
if subfolder.startswith(os.path.sep) or (os.path.altsep and subfolder.startswith(os.path.altsep)):
|
||||
subfolder = subfolder[1:]
|
||||
if subfolder.endswith(os.path.sep) or (os.path.altsep and subfolder.endswith(os.path.altsep)):
|
||||
subfolder = subfolder[:-1]
|
||||
for ws_path in _get_workspaces(environ, include_fuerte=True, include_non_existing=True):
|
||||
path_to_find = os.path.join(ws_path, subfolder) if subfolder else ws_path
|
||||
path_to_remove = None
|
||||
for env_path in env_paths:
|
||||
env_path_clean = env_path[:-1] if env_path and env_path[-1] in [os.path.sep, os.path.altsep] else env_path
|
||||
if env_path_clean == path_to_find:
|
||||
path_to_remove = env_path
|
||||
break
|
||||
if path_to_remove:
|
||||
env_paths.remove(path_to_remove)
|
||||
value_modified = True
|
||||
new_value = os.pathsep.join(env_paths)
|
||||
return new_value if value_modified else None
|
||||
|
||||
|
||||
def _get_workspaces(environ, include_fuerte=False, include_non_existing=False):
|
||||
"""
|
||||
Based on CMAKE_PREFIX_PATH return all catkin workspaces.
|
||||
|
||||
:param include_fuerte: The flag if paths starting with '/opt/ros/fuerte' should be considered workspaces, ``bool``
|
||||
"""
|
||||
# get all cmake prefix paths
|
||||
env_name = 'CMAKE_PREFIX_PATH'
|
||||
value = environ[env_name] if env_name in environ else ''
|
||||
paths = [path for path in value.split(os.pathsep) if path]
|
||||
# remove non-workspace paths
|
||||
workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE)) or (include_fuerte and path.startswith('/opt/ros/fuerte')) or (include_non_existing and not os.path.exists(path))]
|
||||
return workspaces
|
||||
|
||||
|
||||
def prepend_env_variables(environ, env_var_subfolders, workspaces):
|
||||
"""Generate shell code to prepend environment variables for the all workspaces."""
|
||||
lines = []
|
||||
lines.append(comment('prepend folders of workspaces to environment variables'))
|
||||
|
||||
paths = [path for path in workspaces.split(os.pathsep) if path]
|
||||
|
||||
prefix = _prefix_env_variable(environ, 'CMAKE_PREFIX_PATH', paths, '')
|
||||
lines.append(prepend(environ, 'CMAKE_PREFIX_PATH', prefix))
|
||||
|
||||
for key in sorted(key for key in env_var_subfolders.keys() if key != 'CMAKE_PREFIX_PATH'):
|
||||
subfolder = env_var_subfolders[key]
|
||||
prefix = _prefix_env_variable(environ, key, paths, subfolder)
|
||||
lines.append(prepend(environ, key, prefix))
|
||||
return lines
|
||||
|
||||
|
||||
def _prefix_env_variable(environ, name, paths, subfolders):
|
||||
"""
|
||||
Return the prefix to prepend to the environment variable NAME.
|
||||
|
||||
Adding any path in NEW_PATHS_STR without creating duplicate or empty items.
|
||||
"""
|
||||
value = environ[name] if name in environ else ''
|
||||
environ_paths = [path for path in value.split(os.pathsep) if path]
|
||||
checked_paths = []
|
||||
for path in paths:
|
||||
if not isinstance(subfolders, list):
|
||||
subfolders = [subfolders]
|
||||
for subfolder in subfolders:
|
||||
path_tmp = path
|
||||
if subfolder:
|
||||
path_tmp = os.path.join(path_tmp, subfolder)
|
||||
# skip nonexistent paths
|
||||
if not os.path.exists(path_tmp):
|
||||
continue
|
||||
# exclude any path already in env and any path we already added
|
||||
if path_tmp not in environ_paths and path_tmp not in checked_paths:
|
||||
checked_paths.append(path_tmp)
|
||||
prefix_str = os.pathsep.join(checked_paths)
|
||||
if prefix_str != '' and environ_paths:
|
||||
prefix_str += os.pathsep
|
||||
return prefix_str
|
||||
|
||||
|
||||
def assignment(key, value):
|
||||
if not IS_WINDOWS:
|
||||
return 'export %s="%s"' % (key, value)
|
||||
else:
|
||||
return 'set %s=%s' % (key, value)
|
||||
|
||||
|
||||
def comment(msg):
|
||||
if not IS_WINDOWS:
|
||||
return '# %s' % msg
|
||||
else:
|
||||
return 'REM %s' % msg
|
||||
|
||||
|
||||
def prepend(environ, key, prefix):
|
||||
if key not in environ or not environ[key]:
|
||||
return assignment(key, prefix)
|
||||
if not IS_WINDOWS:
|
||||
return 'export %s="%s$%s"' % (key, prefix, key)
|
||||
else:
|
||||
return 'set %s=%s%%%s%%' % (key, prefix, key)
|
||||
|
||||
|
||||
def find_env_hooks(environ, cmake_prefix_path):
|
||||
"""Generate shell code with found environment hooks for the all workspaces."""
|
||||
lines = []
|
||||
lines.append(comment('found environment hooks in workspaces'))
|
||||
|
||||
generic_env_hooks = []
|
||||
generic_env_hooks_workspace = []
|
||||
specific_env_hooks = []
|
||||
specific_env_hooks_workspace = []
|
||||
generic_env_hooks_by_filename = {}
|
||||
specific_env_hooks_by_filename = {}
|
||||
generic_env_hook_ext = 'bat' if IS_WINDOWS else 'sh'
|
||||
specific_env_hook_ext = environ['CATKIN_SHELL'] if not IS_WINDOWS and 'CATKIN_SHELL' in environ and environ['CATKIN_SHELL'] else None
|
||||
# remove non-workspace paths
|
||||
workspaces = [path for path in cmake_prefix_path.split(os.pathsep) if path and os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))]
|
||||
for workspace in reversed(workspaces):
|
||||
env_hook_dir = os.path.join(workspace, 'etc', 'catkin', 'profile.d')
|
||||
if os.path.isdir(env_hook_dir):
|
||||
for filename in sorted(os.listdir(env_hook_dir)):
|
||||
if filename.endswith('.%s' % generic_env_hook_ext):
|
||||
# remove previous env hook with same name if present
|
||||
if filename in generic_env_hooks_by_filename:
|
||||
i = generic_env_hooks.index(generic_env_hooks_by_filename[filename])
|
||||
generic_env_hooks.pop(i)
|
||||
generic_env_hooks_workspace.pop(i)
|
||||
# append env hook
|
||||
generic_env_hooks.append(os.path.join(env_hook_dir, filename))
|
||||
generic_env_hooks_workspace.append(workspace)
|
||||
generic_env_hooks_by_filename[filename] = generic_env_hooks[-1]
|
||||
elif specific_env_hook_ext is not None and filename.endswith('.%s' % specific_env_hook_ext):
|
||||
# remove previous env hook with same name if present
|
||||
if filename in specific_env_hooks_by_filename:
|
||||
i = specific_env_hooks.index(specific_env_hooks_by_filename[filename])
|
||||
specific_env_hooks.pop(i)
|
||||
specific_env_hooks_workspace.pop(i)
|
||||
# append env hook
|
||||
specific_env_hooks.append(os.path.join(env_hook_dir, filename))
|
||||
specific_env_hooks_workspace.append(workspace)
|
||||
specific_env_hooks_by_filename[filename] = specific_env_hooks[-1]
|
||||
env_hooks = generic_env_hooks + specific_env_hooks
|
||||
env_hooks_workspace = generic_env_hooks_workspace + specific_env_hooks_workspace
|
||||
count = len(env_hooks)
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_COUNT', count))
|
||||
for i in range(count):
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d' % i, env_hooks[i]))
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d_WORKSPACE' % i, env_hooks_workspace[i]))
|
||||
return lines
|
||||
|
||||
|
||||
def _parse_arguments(args=None):
|
||||
parser = argparse.ArgumentParser(description='Generates code blocks for the setup.SHELL script.')
|
||||
parser.add_argument('--extend', action='store_true', help='Skip unsetting previous environment variables to extend context')
|
||||
parser.add_argument('--local', action='store_true', help='Only consider this prefix path and ignore other prefix path in the environment')
|
||||
return parser.parse_known_args(args=args)[0]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
try:
|
||||
args = _parse_arguments()
|
||||
except Exception as e:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if not args.local:
|
||||
# environment at generation time
|
||||
CMAKE_PREFIX_PATH = '/opt/ros/melodic'.split(';')
|
||||
else:
|
||||
# don't consider any other prefix path than this one
|
||||
CMAKE_PREFIX_PATH = []
|
||||
# prepend current workspace if not already part of CPP
|
||||
base_path = os.path.dirname(__file__)
|
||||
# CMAKE_PREFIX_PATH uses forward slash on all platforms, but __file__ is platform dependent
|
||||
# base_path on Windows contains backward slashes, need to be converted to forward slashes before comparison
|
||||
if os.path.sep != '/':
|
||||
base_path = base_path.replace(os.path.sep, '/')
|
||||
|
||||
if base_path not in CMAKE_PREFIX_PATH:
|
||||
CMAKE_PREFIX_PATH.insert(0, base_path)
|
||||
CMAKE_PREFIX_PATH = os.pathsep.join(CMAKE_PREFIX_PATH)
|
||||
|
||||
environ = dict(os.environ)
|
||||
lines = []
|
||||
if not args.extend:
|
||||
lines += rollback_env_variables(environ, ENV_VAR_SUBFOLDERS)
|
||||
lines += prepend_env_variables(environ, ENV_VAR_SUBFOLDERS, CMAKE_PREFIX_PATH)
|
||||
lines += find_env_hooks(environ, CMAKE_PREFIX_PATH)
|
||||
print('\n'.join(lines))
|
||||
|
||||
# need to explicitly flush the output
|
||||
sys.stdout.flush()
|
||||
except IOError as e:
|
||||
# and catch potential "broken pipe" if stdout is not writable
|
||||
# which can happen when piping the output to a file but the disk is full
|
||||
if e.errno == errno.EPIPE:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(2)
|
||||
raise
|
||||
|
||||
sys.exit(0)
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/templates/env.sh.in
|
||||
|
||||
if [ $# -eq 0 ] ; then
|
||||
/bin/echo "Usage: env.sh COMMANDS"
|
||||
/bin/echo "Calling env.sh without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ensure to not use different shell type which was set before
|
||||
CATKIN_SHELL=sh
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(cd "`dirname "$0"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh"
|
||||
exec "$@"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# generated from catkin/cmake/templates/local_setup.bash.in
|
||||
|
||||
CATKIN_SHELL=bash
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh" --extend --local
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/template/local_setup.sh.in
|
||||
|
||||
# since this file is sourced either use the provided _CATKIN_SETUP_DIR
|
||||
# or fall back to the destination set at configure time
|
||||
: ${_CATKIN_SETUP_DIR:=/usr/local}
|
||||
CATKIN_SETUP_UTIL_ARGS="--extend --local"
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh"
|
||||
unset CATKIN_SETUP_UTIL_ARGS
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env zsh
|
||||
# generated from catkin/cmake/templates/local_setup.zsh.in
|
||||
|
||||
CATKIN_SHELL=zsh
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd -q "`dirname "$0"`" > /dev/null && pwd)
|
||||
emulate -R zsh -c 'source "$_CATKIN_SETUP_DIR/setup.sh" --extend --local'
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# generated from catkin/cmake/templates/setup.bash.in
|
||||
|
||||
CATKIN_SHELL=bash
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh"
|
||||
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/template/setup.sh.in
|
||||
|
||||
# Sets various environment variables and sources additional environment hooks.
|
||||
# It tries it's best to undo changes from a previously sourced setup file before.
|
||||
# Supported command line options:
|
||||
# --extend: skips the undoing of changes from a previously sourced setup file
|
||||
# --local: only considers this workspace but not the chained ones
|
||||
# In plain sh shell which doesn't support arguments for sourced scripts you can
|
||||
# set the environment variable `CATKIN_SETUP_UTIL_ARGS=--extend/--local` instead.
|
||||
|
||||
# since this file is sourced either use the provided _CATKIN_SETUP_DIR
|
||||
# or fall back to the destination set at configure time
|
||||
: ${_CATKIN_SETUP_DIR:=/usr/local}
|
||||
_SETUP_UTIL="$_CATKIN_SETUP_DIR/_setup_util.py"
|
||||
unset _CATKIN_SETUP_DIR
|
||||
|
||||
if [ ! -f "$_SETUP_UTIL" ]; then
|
||||
echo "Missing Python script: $_SETUP_UTIL"
|
||||
return 22
|
||||
fi
|
||||
|
||||
# detect if running on Darwin platform
|
||||
_UNAME=`uname -s`
|
||||
_IS_DARWIN=0
|
||||
if [ "$_UNAME" = "Darwin" ]; then
|
||||
_IS_DARWIN=1
|
||||
fi
|
||||
unset _UNAME
|
||||
|
||||
# make sure to export all environment variables
|
||||
export CMAKE_PREFIX_PATH
|
||||
if [ $_IS_DARWIN -eq 0 ]; then
|
||||
export LD_LIBRARY_PATH
|
||||
else
|
||||
export DYLD_LIBRARY_PATH
|
||||
fi
|
||||
unset _IS_DARWIN
|
||||
export PATH
|
||||
export PKG_CONFIG_PATH
|
||||
export PYTHONPATH
|
||||
|
||||
# remember type of shell if not already set
|
||||
if [ -z "$CATKIN_SHELL" ]; then
|
||||
CATKIN_SHELL=sh
|
||||
fi
|
||||
|
||||
# invoke Python script to generate necessary exports of environment variables
|
||||
# use TMPDIR if it exists, otherwise fall back to /tmp
|
||||
if [ -d "${TMPDIR:-}" ]; then
|
||||
_TMPDIR="${TMPDIR}"
|
||||
else
|
||||
_TMPDIR=/tmp
|
||||
fi
|
||||
_SETUP_TMP=`mktemp "${_TMPDIR}/setup.sh.XXXXXXXXXX"`
|
||||
unset _TMPDIR
|
||||
if [ $? -ne 0 -o ! -f "$_SETUP_TMP" ]; then
|
||||
echo "Could not create temporary file: $_SETUP_TMP"
|
||||
return 1
|
||||
fi
|
||||
CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ ${CATKIN_SETUP_UTIL_ARGS:-} >> "$_SETUP_TMP"
|
||||
_RC=$?
|
||||
if [ $_RC -ne 0 ]; then
|
||||
if [ $_RC -eq 2 ]; then
|
||||
echo "Could not write the output of '$_SETUP_UTIL' to temporary file '$_SETUP_TMP': may be the disk if full?"
|
||||
else
|
||||
echo "Failed to run '\"$_SETUP_UTIL\" $@': return code $_RC"
|
||||
fi
|
||||
unset _RC
|
||||
unset _SETUP_UTIL
|
||||
rm -f "$_SETUP_TMP"
|
||||
unset _SETUP_TMP
|
||||
return 1
|
||||
fi
|
||||
unset _RC
|
||||
unset _SETUP_UTIL
|
||||
. "$_SETUP_TMP"
|
||||
rm -f "$_SETUP_TMP"
|
||||
unset _SETUP_TMP
|
||||
|
||||
# source all environment hooks
|
||||
_i=0
|
||||
while [ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]; do
|
||||
eval _envfile=\$_CATKIN_ENVIRONMENT_HOOKS_$_i
|
||||
unset _CATKIN_ENVIRONMENT_HOOKS_$_i
|
||||
eval _envfile_workspace=\$_CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE
|
||||
unset _CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE
|
||||
# set workspace for environment hook
|
||||
CATKIN_ENV_HOOK_WORKSPACE=$_envfile_workspace
|
||||
. "$_envfile"
|
||||
unset CATKIN_ENV_HOOK_WORKSPACE
|
||||
_i=$((_i + 1))
|
||||
done
|
||||
unset _i
|
||||
|
||||
unset _CATKIN_ENVIRONMENT_HOOKS_COUNT
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env zsh
|
||||
# generated from catkin/cmake/templates/setup.zsh.in
|
||||
|
||||
CATKIN_SHELL=zsh
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd -q "`dirname "$0"`" > /dev/null && pwd)
|
||||
emulate -R zsh -c 'source "$_CATKIN_SETUP_DIR/setup.sh"'
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/python/catkin/environment_cache.py
|
||||
|
||||
# based on a snapshot of the environment before and after calling the setup script
|
||||
# it emulates the modifications of the setup script without recurring computations
|
||||
|
||||
# new environment variables
|
||||
|
||||
# modified environment variables
|
||||
export CMAKE_PREFIX_PATH="/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel:$CMAKE_PREFIX_PATH"
|
||||
export PATH='/opt/ros/melodic/bin:/opt/cmake-3.20.0-rc4-linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
|
||||
export ROSLISP_PACKAGE_DIRECTORIES='/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel/share/common-lisp'
|
||||
export ROS_PACKAGE_PATH="/root/Project/ROS/src/vio_svo/GPU_version/svo:$ROS_PACKAGE_PATH"
|
||||
+304
@@ -0,0 +1,304 @@
|
||||
#!/usr/bin/python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2012, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
"""This file generates shell code for the setup.SHELL scripts to set environment variables."""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
import errno
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
CATKIN_MARKER_FILE = '.catkin'
|
||||
|
||||
system = platform.system()
|
||||
IS_DARWIN = (system == 'Darwin')
|
||||
IS_WINDOWS = (system == 'Windows')
|
||||
|
||||
PATH_TO_ADD_SUFFIX = ['bin']
|
||||
if IS_WINDOWS:
|
||||
# while catkin recommends putting dll's into bin, 3rd party packages often put dll's into lib
|
||||
# since Windows finds dll's via the PATH variable, prepend it with path to lib
|
||||
PATH_TO_ADD_SUFFIX.extend([['lib', os.path.join('lib', 'x86_64-linux-gnu')]])
|
||||
|
||||
# subfolder of workspace prepended to CMAKE_PREFIX_PATH
|
||||
ENV_VAR_SUBFOLDERS = {
|
||||
'CMAKE_PREFIX_PATH': '',
|
||||
'LD_LIBRARY_PATH' if not IS_DARWIN else 'DYLD_LIBRARY_PATH': ['lib', os.path.join('lib', 'x86_64-linux-gnu')],
|
||||
'PATH': PATH_TO_ADD_SUFFIX,
|
||||
'PKG_CONFIG_PATH': [os.path.join('lib', 'pkgconfig'), os.path.join('lib', 'x86_64-linux-gnu', 'pkgconfig')],
|
||||
'PYTHONPATH': 'lib/python2.7/dist-packages',
|
||||
}
|
||||
|
||||
|
||||
def rollback_env_variables(environ, env_var_subfolders):
|
||||
"""
|
||||
Generate shell code to reset environment variables.
|
||||
|
||||
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
|
||||
This does not cover modifications performed by environment hooks.
|
||||
"""
|
||||
lines = []
|
||||
unmodified_environ = copy.copy(environ)
|
||||
for key in sorted(env_var_subfolders.keys()):
|
||||
subfolders = env_var_subfolders[key]
|
||||
if not isinstance(subfolders, list):
|
||||
subfolders = [subfolders]
|
||||
value = _rollback_env_variable(unmodified_environ, key, subfolders)
|
||||
if value is not None:
|
||||
environ[key] = value
|
||||
lines.append(assignment(key, value))
|
||||
if lines:
|
||||
lines.insert(0, comment('reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH'))
|
||||
return lines
|
||||
|
||||
|
||||
def _rollback_env_variable(environ, name, subfolders):
|
||||
"""
|
||||
For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder.
|
||||
|
||||
:param subfolders: list of str '' or subfoldername that may start with '/'
|
||||
:returns: the updated value of the environment variable.
|
||||
"""
|
||||
value = environ[name] if name in environ else ''
|
||||
env_paths = [path for path in value.split(os.pathsep) if path]
|
||||
value_modified = False
|
||||
for subfolder in subfolders:
|
||||
if subfolder:
|
||||
if subfolder.startswith(os.path.sep) or (os.path.altsep and subfolder.startswith(os.path.altsep)):
|
||||
subfolder = subfolder[1:]
|
||||
if subfolder.endswith(os.path.sep) or (os.path.altsep and subfolder.endswith(os.path.altsep)):
|
||||
subfolder = subfolder[:-1]
|
||||
for ws_path in _get_workspaces(environ, include_fuerte=True, include_non_existing=True):
|
||||
path_to_find = os.path.join(ws_path, subfolder) if subfolder else ws_path
|
||||
path_to_remove = None
|
||||
for env_path in env_paths:
|
||||
env_path_clean = env_path[:-1] if env_path and env_path[-1] in [os.path.sep, os.path.altsep] else env_path
|
||||
if env_path_clean == path_to_find:
|
||||
path_to_remove = env_path
|
||||
break
|
||||
if path_to_remove:
|
||||
env_paths.remove(path_to_remove)
|
||||
value_modified = True
|
||||
new_value = os.pathsep.join(env_paths)
|
||||
return new_value if value_modified else None
|
||||
|
||||
|
||||
def _get_workspaces(environ, include_fuerte=False, include_non_existing=False):
|
||||
"""
|
||||
Based on CMAKE_PREFIX_PATH return all catkin workspaces.
|
||||
|
||||
:param include_fuerte: The flag if paths starting with '/opt/ros/fuerte' should be considered workspaces, ``bool``
|
||||
"""
|
||||
# get all cmake prefix paths
|
||||
env_name = 'CMAKE_PREFIX_PATH'
|
||||
value = environ[env_name] if env_name in environ else ''
|
||||
paths = [path for path in value.split(os.pathsep) if path]
|
||||
# remove non-workspace paths
|
||||
workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE)) or (include_fuerte and path.startswith('/opt/ros/fuerte')) or (include_non_existing and not os.path.exists(path))]
|
||||
return workspaces
|
||||
|
||||
|
||||
def prepend_env_variables(environ, env_var_subfolders, workspaces):
|
||||
"""Generate shell code to prepend environment variables for the all workspaces."""
|
||||
lines = []
|
||||
lines.append(comment('prepend folders of workspaces to environment variables'))
|
||||
|
||||
paths = [path for path in workspaces.split(os.pathsep) if path]
|
||||
|
||||
prefix = _prefix_env_variable(environ, 'CMAKE_PREFIX_PATH', paths, '')
|
||||
lines.append(prepend(environ, 'CMAKE_PREFIX_PATH', prefix))
|
||||
|
||||
for key in sorted(key for key in env_var_subfolders.keys() if key != 'CMAKE_PREFIX_PATH'):
|
||||
subfolder = env_var_subfolders[key]
|
||||
prefix = _prefix_env_variable(environ, key, paths, subfolder)
|
||||
lines.append(prepend(environ, key, prefix))
|
||||
return lines
|
||||
|
||||
|
||||
def _prefix_env_variable(environ, name, paths, subfolders):
|
||||
"""
|
||||
Return the prefix to prepend to the environment variable NAME.
|
||||
|
||||
Adding any path in NEW_PATHS_STR without creating duplicate or empty items.
|
||||
"""
|
||||
value = environ[name] if name in environ else ''
|
||||
environ_paths = [path for path in value.split(os.pathsep) if path]
|
||||
checked_paths = []
|
||||
for path in paths:
|
||||
if not isinstance(subfolders, list):
|
||||
subfolders = [subfolders]
|
||||
for subfolder in subfolders:
|
||||
path_tmp = path
|
||||
if subfolder:
|
||||
path_tmp = os.path.join(path_tmp, subfolder)
|
||||
# skip nonexistent paths
|
||||
if not os.path.exists(path_tmp):
|
||||
continue
|
||||
# exclude any path already in env and any path we already added
|
||||
if path_tmp not in environ_paths and path_tmp not in checked_paths:
|
||||
checked_paths.append(path_tmp)
|
||||
prefix_str = os.pathsep.join(checked_paths)
|
||||
if prefix_str != '' and environ_paths:
|
||||
prefix_str += os.pathsep
|
||||
return prefix_str
|
||||
|
||||
|
||||
def assignment(key, value):
|
||||
if not IS_WINDOWS:
|
||||
return 'export %s="%s"' % (key, value)
|
||||
else:
|
||||
return 'set %s=%s' % (key, value)
|
||||
|
||||
|
||||
def comment(msg):
|
||||
if not IS_WINDOWS:
|
||||
return '# %s' % msg
|
||||
else:
|
||||
return 'REM %s' % msg
|
||||
|
||||
|
||||
def prepend(environ, key, prefix):
|
||||
if key not in environ or not environ[key]:
|
||||
return assignment(key, prefix)
|
||||
if not IS_WINDOWS:
|
||||
return 'export %s="%s$%s"' % (key, prefix, key)
|
||||
else:
|
||||
return 'set %s=%s%%%s%%' % (key, prefix, key)
|
||||
|
||||
|
||||
def find_env_hooks(environ, cmake_prefix_path):
|
||||
"""Generate shell code with found environment hooks for the all workspaces."""
|
||||
lines = []
|
||||
lines.append(comment('found environment hooks in workspaces'))
|
||||
|
||||
generic_env_hooks = []
|
||||
generic_env_hooks_workspace = []
|
||||
specific_env_hooks = []
|
||||
specific_env_hooks_workspace = []
|
||||
generic_env_hooks_by_filename = {}
|
||||
specific_env_hooks_by_filename = {}
|
||||
generic_env_hook_ext = 'bat' if IS_WINDOWS else 'sh'
|
||||
specific_env_hook_ext = environ['CATKIN_SHELL'] if not IS_WINDOWS and 'CATKIN_SHELL' in environ and environ['CATKIN_SHELL'] else None
|
||||
# remove non-workspace paths
|
||||
workspaces = [path for path in cmake_prefix_path.split(os.pathsep) if path and os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))]
|
||||
for workspace in reversed(workspaces):
|
||||
env_hook_dir = os.path.join(workspace, 'etc', 'catkin', 'profile.d')
|
||||
if os.path.isdir(env_hook_dir):
|
||||
for filename in sorted(os.listdir(env_hook_dir)):
|
||||
if filename.endswith('.%s' % generic_env_hook_ext):
|
||||
# remove previous env hook with same name if present
|
||||
if filename in generic_env_hooks_by_filename:
|
||||
i = generic_env_hooks.index(generic_env_hooks_by_filename[filename])
|
||||
generic_env_hooks.pop(i)
|
||||
generic_env_hooks_workspace.pop(i)
|
||||
# append env hook
|
||||
generic_env_hooks.append(os.path.join(env_hook_dir, filename))
|
||||
generic_env_hooks_workspace.append(workspace)
|
||||
generic_env_hooks_by_filename[filename] = generic_env_hooks[-1]
|
||||
elif specific_env_hook_ext is not None and filename.endswith('.%s' % specific_env_hook_ext):
|
||||
# remove previous env hook with same name if present
|
||||
if filename in specific_env_hooks_by_filename:
|
||||
i = specific_env_hooks.index(specific_env_hooks_by_filename[filename])
|
||||
specific_env_hooks.pop(i)
|
||||
specific_env_hooks_workspace.pop(i)
|
||||
# append env hook
|
||||
specific_env_hooks.append(os.path.join(env_hook_dir, filename))
|
||||
specific_env_hooks_workspace.append(workspace)
|
||||
specific_env_hooks_by_filename[filename] = specific_env_hooks[-1]
|
||||
env_hooks = generic_env_hooks + specific_env_hooks
|
||||
env_hooks_workspace = generic_env_hooks_workspace + specific_env_hooks_workspace
|
||||
count = len(env_hooks)
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_COUNT', count))
|
||||
for i in range(count):
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d' % i, env_hooks[i]))
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d_WORKSPACE' % i, env_hooks_workspace[i]))
|
||||
return lines
|
||||
|
||||
|
||||
def _parse_arguments(args=None):
|
||||
parser = argparse.ArgumentParser(description='Generates code blocks for the setup.SHELL script.')
|
||||
parser.add_argument('--extend', action='store_true', help='Skip unsetting previous environment variables to extend context')
|
||||
parser.add_argument('--local', action='store_true', help='Only consider this prefix path and ignore other prefix path in the environment')
|
||||
return parser.parse_known_args(args=args)[0]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
try:
|
||||
args = _parse_arguments()
|
||||
except Exception as e:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if not args.local:
|
||||
# environment at generation time
|
||||
CMAKE_PREFIX_PATH = '/opt/ros/melodic'.split(';')
|
||||
else:
|
||||
# don't consider any other prefix path than this one
|
||||
CMAKE_PREFIX_PATH = []
|
||||
# prepend current workspace if not already part of CPP
|
||||
base_path = os.path.dirname(__file__)
|
||||
# CMAKE_PREFIX_PATH uses forward slash on all platforms, but __file__ is platform dependent
|
||||
# base_path on Windows contains backward slashes, need to be converted to forward slashes before comparison
|
||||
if os.path.sep != '/':
|
||||
base_path = base_path.replace(os.path.sep, '/')
|
||||
|
||||
if base_path not in CMAKE_PREFIX_PATH:
|
||||
CMAKE_PREFIX_PATH.insert(0, base_path)
|
||||
CMAKE_PREFIX_PATH = os.pathsep.join(CMAKE_PREFIX_PATH)
|
||||
|
||||
environ = dict(os.environ)
|
||||
lines = []
|
||||
if not args.extend:
|
||||
lines += rollback_env_variables(environ, ENV_VAR_SUBFOLDERS)
|
||||
lines += prepend_env_variables(environ, ENV_VAR_SUBFOLDERS, CMAKE_PREFIX_PATH)
|
||||
lines += find_env_hooks(environ, CMAKE_PREFIX_PATH)
|
||||
print('\n'.join(lines))
|
||||
|
||||
# need to explicitly flush the output
|
||||
sys.stdout.flush()
|
||||
except IOError as e:
|
||||
# and catch potential "broken pipe" if stdout is not writable
|
||||
# which can happen when piping the output to a file but the disk is full
|
||||
if e.errno == errno.EPIPE:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(2)
|
||||
raise
|
||||
|
||||
sys.exit(0)
|
||||
+255
@@ -0,0 +1,255 @@
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2012, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import runpy
|
||||
import sys
|
||||
from argparse import ArgumentParser
|
||||
|
||||
setup_modules = []
|
||||
|
||||
try:
|
||||
import distutils.core
|
||||
setup_modules.append(distutils.core)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
import setuptools
|
||||
setup_modules.append(setuptools)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
assert setup_modules, 'Must have distutils or setuptools installed'
|
||||
|
||||
|
||||
def _get_locations(pkgs, package_dir):
|
||||
"""
|
||||
Based on setuptools logic and the package_dir dict, builds a dict of location roots for each pkg in pkgs.
|
||||
|
||||
See http://docs.python.org/distutils/setupscript.html
|
||||
|
||||
:returns: a dict {pkgname: root} for each pkgname in pkgs (and each of their parents)
|
||||
"""
|
||||
# package_dir contains a dict {package_name: relativepath}
|
||||
# Example {'': 'src', 'foo': 'lib', 'bar': 'lib2'}
|
||||
#
|
||||
# '' means where to look for any package unless a parent package
|
||||
# is listed so package bar.pot is expected at lib2/bar/pot,
|
||||
# whereas package sup.dee is expected at src/sup/dee
|
||||
#
|
||||
# if package_dir does not state anything about a package,
|
||||
# setuptool expects the package folder to be in the root of the
|
||||
# project
|
||||
locations = {}
|
||||
allprefix = package_dir.get('', '')
|
||||
for pkg in pkgs:
|
||||
parent_location = None
|
||||
splits = pkg.split('.')
|
||||
# we iterate over compound name from parent to child
|
||||
# so once we found parent, children just append to their parent
|
||||
for key_len in range(len(splits)):
|
||||
key = '.'.join(splits[:key_len + 1])
|
||||
if key not in locations:
|
||||
if key in package_dir:
|
||||
locations[key] = package_dir[key]
|
||||
elif parent_location is not None:
|
||||
locations[key] = os.path.join(parent_location, splits[key_len])
|
||||
else:
|
||||
locations[key] = os.path.join(allprefix, key)
|
||||
parent_location = locations[key]
|
||||
return locations
|
||||
|
||||
|
||||
def generate_cmake_file(package_name, version, scripts, package_dir, pkgs, modules, setup_module=None):
|
||||
"""
|
||||
Generate lines to add to a cmake file which will set variables.
|
||||
|
||||
:param version: str, format 'int.int.int'
|
||||
:param scripts: [list of str]: relative paths to scripts
|
||||
:param package_dir: {modulename: path}
|
||||
:param pkgs: [list of str] python_packages declared in catkin package
|
||||
:param modules: [list of str] python modules
|
||||
:param setup_module: str, setuptools or distutils
|
||||
"""
|
||||
prefix = '%s_SETUP_PY' % package_name
|
||||
result = []
|
||||
if setup_module:
|
||||
result.append(r'set(%s_SETUP_MODULE "%s")' % (prefix, setup_module))
|
||||
result.append(r'set(%s_VERSION "%s")' % (prefix, version))
|
||||
result.append(r'set(%s_SCRIPTS "%s")' % (prefix, ';'.join(scripts)))
|
||||
|
||||
# Remove packages with '.' separators.
|
||||
#
|
||||
# setuptools allows specifying submodules in other folders than
|
||||
# their parent
|
||||
#
|
||||
# The symlink approach of catkin does not work with such submodules.
|
||||
# In the common case, this does not matter as the submodule is
|
||||
# within the containing module. We verify this assumption, and if
|
||||
# it passes, we remove submodule packages.
|
||||
locations = _get_locations(pkgs, package_dir)
|
||||
for pkgname, location in locations.items():
|
||||
if '.' not in pkgname:
|
||||
continue
|
||||
splits = pkgname.split('.')
|
||||
# hack: ignore write-combining setup.py files for msg and srv files
|
||||
if splits[1] in ['msg', 'srv']:
|
||||
continue
|
||||
# check every child has the same root folder as its parent
|
||||
root_name = splits[0]
|
||||
root_location = location
|
||||
for _ in range(len(splits) - 1):
|
||||
root_location = os.path.dirname(root_location)
|
||||
if root_location != locations[root_name]:
|
||||
raise RuntimeError(
|
||||
'catkin_export_python does not support setup.py files that combine across multiple directories: %s in %s, %s in %s' % (pkgname, location, root_name, locations[root_name]))
|
||||
|
||||
# If checks pass, remove all submodules
|
||||
pkgs = [p for p in pkgs if '.' not in p]
|
||||
|
||||
resolved_pkgs = []
|
||||
for pkg in pkgs:
|
||||
resolved_pkgs += [locations[pkg]]
|
||||
|
||||
result.append(r'set(%s_PACKAGES "%s")' % (prefix, ';'.join(pkgs)))
|
||||
result.append(r'set(%s_PACKAGE_DIRS "%s")' % (prefix, ';'.join(resolved_pkgs).replace('\\', '/')))
|
||||
|
||||
# skip modules which collide with package names
|
||||
filtered_modules = []
|
||||
for modname in modules:
|
||||
splits = modname.split('.')
|
||||
# check all parents too
|
||||
equals_package = [('.'.join(splits[:-i]) in locations) for i in range(len(splits))]
|
||||
if any(equals_package):
|
||||
continue
|
||||
filtered_modules.append(modname)
|
||||
module_locations = _get_locations(filtered_modules, package_dir)
|
||||
|
||||
result.append(r'set(%s_MODULES "%s")' % (prefix, ';'.join(['%s.py' % m.replace('.', '/') for m in filtered_modules])))
|
||||
result.append(r'set(%s_MODULE_DIRS "%s")' % (prefix, ';'.join([module_locations[m] for m in filtered_modules]).replace('\\', '/')))
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def _create_mock_setup_function(setup_module, package_name, outfile):
|
||||
"""
|
||||
Create a function to call instead of distutils.core.setup or setuptools.setup.
|
||||
|
||||
It just captures some args and writes them into a file that can be used from cmake.
|
||||
|
||||
:param package_name: name of the package
|
||||
:param outfile: filename that cmake will use afterwards
|
||||
:returns: a function to replace disutils.core.setup and setuptools.setup
|
||||
"""
|
||||
|
||||
def setup(*args, **kwargs):
|
||||
"""Check kwargs and write a scriptfile."""
|
||||
if 'version' not in kwargs:
|
||||
sys.stderr.write("\n*** Unable to find 'version' in setup.py of %s\n" % package_name)
|
||||
raise RuntimeError('version not found in setup.py')
|
||||
version = kwargs['version']
|
||||
package_dir = kwargs.get('package_dir', {})
|
||||
|
||||
pkgs = kwargs.get('packages', [])
|
||||
scripts = kwargs.get('scripts', [])
|
||||
modules = kwargs.get('py_modules', [])
|
||||
|
||||
unsupported_args = [
|
||||
'entry_points',
|
||||
'exclude_package_data',
|
||||
'ext_modules ',
|
||||
'ext_package',
|
||||
'include_package_data',
|
||||
'namespace_packages',
|
||||
'setup_requires',
|
||||
'use_2to3',
|
||||
'zip_safe']
|
||||
used_unsupported_args = [arg for arg in unsupported_args if arg in kwargs]
|
||||
if used_unsupported_args:
|
||||
sys.stderr.write('*** Arguments %s to setup() not supported in catkin devel space in setup.py of %s\n' % (used_unsupported_args, package_name))
|
||||
|
||||
result = generate_cmake_file(package_name=package_name,
|
||||
version=version,
|
||||
scripts=scripts,
|
||||
package_dir=package_dir,
|
||||
pkgs=pkgs,
|
||||
modules=modules,
|
||||
setup_module=setup_module)
|
||||
with open(outfile, 'w') as out:
|
||||
out.write('\n'.join(result))
|
||||
|
||||
return setup
|
||||
|
||||
|
||||
def main():
|
||||
"""Script main, parses arguments and invokes Dummy.setup indirectly."""
|
||||
parser = ArgumentParser(description='Utility to read setup.py values from cmake macros. Creates a file with CMake set commands setting variables.')
|
||||
parser.add_argument('package_name', help='Name of catkin package')
|
||||
parser.add_argument('setupfile_path', help='Full path to setup.py')
|
||||
parser.add_argument('outfile', help='Where to write result to')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# print("%s" % sys.argv)
|
||||
# PACKAGE_NAME = sys.argv[1]
|
||||
# OUTFILE = sys.argv[3]
|
||||
# print("Interrogating setup.py for package %s into %s " % (PACKAGE_NAME, OUTFILE),
|
||||
# file=sys.stderr)
|
||||
|
||||
# print("executing %s" % args.setupfile_path)
|
||||
|
||||
# be sure you're in the directory containing
|
||||
# setup.py so the sys.path manipulation works,
|
||||
# so the import of __version__ works
|
||||
os.chdir(os.path.dirname(os.path.abspath(args.setupfile_path)))
|
||||
|
||||
# patch setup() function of distutils and setuptools for the
|
||||
# context of evaluating setup.py
|
||||
backup_modules = {}
|
||||
try:
|
||||
|
||||
for module in setup_modules:
|
||||
backup_modules[id(module)] = module.setup
|
||||
module.setup = _create_mock_setup_function(
|
||||
setup_module=module.__name__, package_name=args.package_name, outfile=args.outfile)
|
||||
|
||||
runpy.run_path(args.setupfile_path)
|
||||
finally:
|
||||
for module in setup_modules:
|
||||
module.setup = backup_modules[id(module)]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model
|
||||
href="http://download.ros.org/schema/package_format3.xsd"
|
||||
schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>catkin</name>
|
||||
<version>0.7.28</version>
|
||||
<description>Low-level build system macros and infrastructure for ROS.</description>
|
||||
<maintainer email="[email protected]">Dirk Thomas</maintainer>
|
||||
<license>BSD</license>
|
||||
|
||||
<url type="website">http://wiki.ros.org/catkin</url>
|
||||
<url type="bugtracker">https://github.com/ros/catkin/issues</url>
|
||||
<url type="repository">https://github.com/ros/catkin</url>
|
||||
|
||||
<author>Troy Straszheim</author>
|
||||
<author>Morten Kjaergaard</author>
|
||||
<author>Brian Gerkey</author>
|
||||
<author>Dirk Thomas</author>
|
||||
|
||||
<depend condition="$ROS_PYTHON_VERSION == 2">python-argparse</depend>
|
||||
<depend condition="$ROS_PYTHON_VERSION == 2" version_gt="0.4.3">python-catkin-pkg</depend>
|
||||
<depend condition="$ROS_PYTHON_VERSION == 3" version_gt="0.4.3">python3-catkin-pkg</depend>
|
||||
<depend condition="$ROS_PYTHON_VERSION == 2">python-empy</depend>
|
||||
<depend condition="$ROS_PYTHON_VERSION == 3">python3-empy</depend>
|
||||
|
||||
<buildtool_depend>cmake</buildtool_depend>
|
||||
<buildtool_depend condition="$ROS_PYTHON_VERSION == 2">python-setuptools</buildtool_depend>
|
||||
<buildtool_depend condition="$ROS_PYTHON_VERSION == 3">python3-setuptools</buildtool_depend>
|
||||
|
||||
<buildtool_export_depend>cmake</buildtool_export_depend>
|
||||
<buildtool_export_depend condition="$ROS_PYTHON_VERSION == 3">python3-setuptools</buildtool_export_depend>
|
||||
|
||||
<build_export_depend>google-mock</build_export_depend>
|
||||
<build_export_depend>gtest</build_export_depend>
|
||||
<build_export_depend condition="$ROS_PYTHON_VERSION == 2">python-nose</build_export_depend>
|
||||
<build_export_depend condition="$ROS_PYTHON_VERSION == 3">python3-nose</build_export_depend>
|
||||
|
||||
<test_depend condition="$ROS_PYTHON_VERSION == 2">python-mock</test_depend>
|
||||
<test_depend condition="$ROS_PYTHON_VERSION == 3">python3-mock</test_depend>
|
||||
<test_depend condition="$ROS_PYTHON_VERSION == 2">python-nose</test_depend>
|
||||
<test_depend condition="$ROS_PYTHON_VERSION == 3">python3-nose</test_depend>
|
||||
|
||||
<export>
|
||||
<rosdoc config="rosdoc.yaml"/>
|
||||
<architecture_independent/>
|
||||
</export>
|
||||
</package>
|
||||
@@ -0,0 +1 @@
|
||||
/root/Project/ROS/src/vio_svo/GPU_version/svo
|
||||
@@ -0,0 +1,2 @@
|
||||
- setup-file:
|
||||
local-name: /root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel/setup.sh
|
||||
+304
@@ -0,0 +1,304 @@
|
||||
#!/usr/bin/python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Software License Agreement (BSD License)
|
||||
#
|
||||
# Copyright (c) 2012, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of Willow Garage, Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
"""This file generates shell code for the setup.SHELL scripts to set environment variables."""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
import errno
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
CATKIN_MARKER_FILE = '.catkin'
|
||||
|
||||
system = platform.system()
|
||||
IS_DARWIN = (system == 'Darwin')
|
||||
IS_WINDOWS = (system == 'Windows')
|
||||
|
||||
PATH_TO_ADD_SUFFIX = ['bin']
|
||||
if IS_WINDOWS:
|
||||
# while catkin recommends putting dll's into bin, 3rd party packages often put dll's into lib
|
||||
# since Windows finds dll's via the PATH variable, prepend it with path to lib
|
||||
PATH_TO_ADD_SUFFIX.extend([['lib', os.path.join('lib', 'x86_64-linux-gnu')]])
|
||||
|
||||
# subfolder of workspace prepended to CMAKE_PREFIX_PATH
|
||||
ENV_VAR_SUBFOLDERS = {
|
||||
'CMAKE_PREFIX_PATH': '',
|
||||
'LD_LIBRARY_PATH' if not IS_DARWIN else 'DYLD_LIBRARY_PATH': ['lib', os.path.join('lib', 'x86_64-linux-gnu')],
|
||||
'PATH': PATH_TO_ADD_SUFFIX,
|
||||
'PKG_CONFIG_PATH': [os.path.join('lib', 'pkgconfig'), os.path.join('lib', 'x86_64-linux-gnu', 'pkgconfig')],
|
||||
'PYTHONPATH': 'lib/python2.7/dist-packages',
|
||||
}
|
||||
|
||||
|
||||
def rollback_env_variables(environ, env_var_subfolders):
|
||||
"""
|
||||
Generate shell code to reset environment variables.
|
||||
|
||||
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
|
||||
This does not cover modifications performed by environment hooks.
|
||||
"""
|
||||
lines = []
|
||||
unmodified_environ = copy.copy(environ)
|
||||
for key in sorted(env_var_subfolders.keys()):
|
||||
subfolders = env_var_subfolders[key]
|
||||
if not isinstance(subfolders, list):
|
||||
subfolders = [subfolders]
|
||||
value = _rollback_env_variable(unmodified_environ, key, subfolders)
|
||||
if value is not None:
|
||||
environ[key] = value
|
||||
lines.append(assignment(key, value))
|
||||
if lines:
|
||||
lines.insert(0, comment('reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH'))
|
||||
return lines
|
||||
|
||||
|
||||
def _rollback_env_variable(environ, name, subfolders):
|
||||
"""
|
||||
For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder.
|
||||
|
||||
:param subfolders: list of str '' or subfoldername that may start with '/'
|
||||
:returns: the updated value of the environment variable.
|
||||
"""
|
||||
value = environ[name] if name in environ else ''
|
||||
env_paths = [path for path in value.split(os.pathsep) if path]
|
||||
value_modified = False
|
||||
for subfolder in subfolders:
|
||||
if subfolder:
|
||||
if subfolder.startswith(os.path.sep) or (os.path.altsep and subfolder.startswith(os.path.altsep)):
|
||||
subfolder = subfolder[1:]
|
||||
if subfolder.endswith(os.path.sep) or (os.path.altsep and subfolder.endswith(os.path.altsep)):
|
||||
subfolder = subfolder[:-1]
|
||||
for ws_path in _get_workspaces(environ, include_fuerte=True, include_non_existing=True):
|
||||
path_to_find = os.path.join(ws_path, subfolder) if subfolder else ws_path
|
||||
path_to_remove = None
|
||||
for env_path in env_paths:
|
||||
env_path_clean = env_path[:-1] if env_path and env_path[-1] in [os.path.sep, os.path.altsep] else env_path
|
||||
if env_path_clean == path_to_find:
|
||||
path_to_remove = env_path
|
||||
break
|
||||
if path_to_remove:
|
||||
env_paths.remove(path_to_remove)
|
||||
value_modified = True
|
||||
new_value = os.pathsep.join(env_paths)
|
||||
return new_value if value_modified else None
|
||||
|
||||
|
||||
def _get_workspaces(environ, include_fuerte=False, include_non_existing=False):
|
||||
"""
|
||||
Based on CMAKE_PREFIX_PATH return all catkin workspaces.
|
||||
|
||||
:param include_fuerte: The flag if paths starting with '/opt/ros/fuerte' should be considered workspaces, ``bool``
|
||||
"""
|
||||
# get all cmake prefix paths
|
||||
env_name = 'CMAKE_PREFIX_PATH'
|
||||
value = environ[env_name] if env_name in environ else ''
|
||||
paths = [path for path in value.split(os.pathsep) if path]
|
||||
# remove non-workspace paths
|
||||
workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE)) or (include_fuerte and path.startswith('/opt/ros/fuerte')) or (include_non_existing and not os.path.exists(path))]
|
||||
return workspaces
|
||||
|
||||
|
||||
def prepend_env_variables(environ, env_var_subfolders, workspaces):
|
||||
"""Generate shell code to prepend environment variables for the all workspaces."""
|
||||
lines = []
|
||||
lines.append(comment('prepend folders of workspaces to environment variables'))
|
||||
|
||||
paths = [path for path in workspaces.split(os.pathsep) if path]
|
||||
|
||||
prefix = _prefix_env_variable(environ, 'CMAKE_PREFIX_PATH', paths, '')
|
||||
lines.append(prepend(environ, 'CMAKE_PREFIX_PATH', prefix))
|
||||
|
||||
for key in sorted(key for key in env_var_subfolders.keys() if key != 'CMAKE_PREFIX_PATH'):
|
||||
subfolder = env_var_subfolders[key]
|
||||
prefix = _prefix_env_variable(environ, key, paths, subfolder)
|
||||
lines.append(prepend(environ, key, prefix))
|
||||
return lines
|
||||
|
||||
|
||||
def _prefix_env_variable(environ, name, paths, subfolders):
|
||||
"""
|
||||
Return the prefix to prepend to the environment variable NAME.
|
||||
|
||||
Adding any path in NEW_PATHS_STR without creating duplicate or empty items.
|
||||
"""
|
||||
value = environ[name] if name in environ else ''
|
||||
environ_paths = [path for path in value.split(os.pathsep) if path]
|
||||
checked_paths = []
|
||||
for path in paths:
|
||||
if not isinstance(subfolders, list):
|
||||
subfolders = [subfolders]
|
||||
for subfolder in subfolders:
|
||||
path_tmp = path
|
||||
if subfolder:
|
||||
path_tmp = os.path.join(path_tmp, subfolder)
|
||||
# skip nonexistent paths
|
||||
if not os.path.exists(path_tmp):
|
||||
continue
|
||||
# exclude any path already in env and any path we already added
|
||||
if path_tmp not in environ_paths and path_tmp not in checked_paths:
|
||||
checked_paths.append(path_tmp)
|
||||
prefix_str = os.pathsep.join(checked_paths)
|
||||
if prefix_str != '' and environ_paths:
|
||||
prefix_str += os.pathsep
|
||||
return prefix_str
|
||||
|
||||
|
||||
def assignment(key, value):
|
||||
if not IS_WINDOWS:
|
||||
return 'export %s="%s"' % (key, value)
|
||||
else:
|
||||
return 'set %s=%s' % (key, value)
|
||||
|
||||
|
||||
def comment(msg):
|
||||
if not IS_WINDOWS:
|
||||
return '# %s' % msg
|
||||
else:
|
||||
return 'REM %s' % msg
|
||||
|
||||
|
||||
def prepend(environ, key, prefix):
|
||||
if key not in environ or not environ[key]:
|
||||
return assignment(key, prefix)
|
||||
if not IS_WINDOWS:
|
||||
return 'export %s="%s$%s"' % (key, prefix, key)
|
||||
else:
|
||||
return 'set %s=%s%%%s%%' % (key, prefix, key)
|
||||
|
||||
|
||||
def find_env_hooks(environ, cmake_prefix_path):
|
||||
"""Generate shell code with found environment hooks for the all workspaces."""
|
||||
lines = []
|
||||
lines.append(comment('found environment hooks in workspaces'))
|
||||
|
||||
generic_env_hooks = []
|
||||
generic_env_hooks_workspace = []
|
||||
specific_env_hooks = []
|
||||
specific_env_hooks_workspace = []
|
||||
generic_env_hooks_by_filename = {}
|
||||
specific_env_hooks_by_filename = {}
|
||||
generic_env_hook_ext = 'bat' if IS_WINDOWS else 'sh'
|
||||
specific_env_hook_ext = environ['CATKIN_SHELL'] if not IS_WINDOWS and 'CATKIN_SHELL' in environ and environ['CATKIN_SHELL'] else None
|
||||
# remove non-workspace paths
|
||||
workspaces = [path for path in cmake_prefix_path.split(os.pathsep) if path and os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))]
|
||||
for workspace in reversed(workspaces):
|
||||
env_hook_dir = os.path.join(workspace, 'etc', 'catkin', 'profile.d')
|
||||
if os.path.isdir(env_hook_dir):
|
||||
for filename in sorted(os.listdir(env_hook_dir)):
|
||||
if filename.endswith('.%s' % generic_env_hook_ext):
|
||||
# remove previous env hook with same name if present
|
||||
if filename in generic_env_hooks_by_filename:
|
||||
i = generic_env_hooks.index(generic_env_hooks_by_filename[filename])
|
||||
generic_env_hooks.pop(i)
|
||||
generic_env_hooks_workspace.pop(i)
|
||||
# append env hook
|
||||
generic_env_hooks.append(os.path.join(env_hook_dir, filename))
|
||||
generic_env_hooks_workspace.append(workspace)
|
||||
generic_env_hooks_by_filename[filename] = generic_env_hooks[-1]
|
||||
elif specific_env_hook_ext is not None and filename.endswith('.%s' % specific_env_hook_ext):
|
||||
# remove previous env hook with same name if present
|
||||
if filename in specific_env_hooks_by_filename:
|
||||
i = specific_env_hooks.index(specific_env_hooks_by_filename[filename])
|
||||
specific_env_hooks.pop(i)
|
||||
specific_env_hooks_workspace.pop(i)
|
||||
# append env hook
|
||||
specific_env_hooks.append(os.path.join(env_hook_dir, filename))
|
||||
specific_env_hooks_workspace.append(workspace)
|
||||
specific_env_hooks_by_filename[filename] = specific_env_hooks[-1]
|
||||
env_hooks = generic_env_hooks + specific_env_hooks
|
||||
env_hooks_workspace = generic_env_hooks_workspace + specific_env_hooks_workspace
|
||||
count = len(env_hooks)
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_COUNT', count))
|
||||
for i in range(count):
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d' % i, env_hooks[i]))
|
||||
lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d_WORKSPACE' % i, env_hooks_workspace[i]))
|
||||
return lines
|
||||
|
||||
|
||||
def _parse_arguments(args=None):
|
||||
parser = argparse.ArgumentParser(description='Generates code blocks for the setup.SHELL script.')
|
||||
parser.add_argument('--extend', action='store_true', help='Skip unsetting previous environment variables to extend context')
|
||||
parser.add_argument('--local', action='store_true', help='Only consider this prefix path and ignore other prefix path in the environment')
|
||||
return parser.parse_known_args(args=args)[0]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
try:
|
||||
args = _parse_arguments()
|
||||
except Exception as e:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if not args.local:
|
||||
# environment at generation time
|
||||
CMAKE_PREFIX_PATH = '/opt/ros/melodic'.split(';')
|
||||
else:
|
||||
# don't consider any other prefix path than this one
|
||||
CMAKE_PREFIX_PATH = []
|
||||
# prepend current workspace if not already part of CPP
|
||||
base_path = os.path.dirname(__file__)
|
||||
# CMAKE_PREFIX_PATH uses forward slash on all platforms, but __file__ is platform dependent
|
||||
# base_path on Windows contains backward slashes, need to be converted to forward slashes before comparison
|
||||
if os.path.sep != '/':
|
||||
base_path = base_path.replace(os.path.sep, '/')
|
||||
|
||||
if base_path not in CMAKE_PREFIX_PATH:
|
||||
CMAKE_PREFIX_PATH.insert(0, base_path)
|
||||
CMAKE_PREFIX_PATH = os.pathsep.join(CMAKE_PREFIX_PATH)
|
||||
|
||||
environ = dict(os.environ)
|
||||
lines = []
|
||||
if not args.extend:
|
||||
lines += rollback_env_variables(environ, ENV_VAR_SUBFOLDERS)
|
||||
lines += prepend_env_variables(environ, ENV_VAR_SUBFOLDERS, CMAKE_PREFIX_PATH)
|
||||
lines += find_env_hooks(environ, CMAKE_PREFIX_PATH)
|
||||
print('\n'.join(lines))
|
||||
|
||||
# need to explicitly flush the output
|
||||
sys.stdout.flush()
|
||||
except IOError as e:
|
||||
# and catch potential "broken pipe" if stdout is not writable
|
||||
# which can happen when piping the output to a file but the disk is full
|
||||
if e.errno == errno.EPIPE:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(2)
|
||||
raise
|
||||
|
||||
sys.exit(0)
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/templates/env.sh.in
|
||||
|
||||
if [ $# -eq 0 ] ; then
|
||||
/bin/echo "Usage: env.sh COMMANDS"
|
||||
/bin/echo "Calling env.sh without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ensure to not use different shell type which was set before
|
||||
CATKIN_SHELL=sh
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(cd "`dirname "$0"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh"
|
||||
exec "$@"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# generated from catkin/cmake/templates/local_setup.bash.in
|
||||
|
||||
CATKIN_SHELL=bash
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh" --extend --local
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/template/local_setup.sh.in
|
||||
|
||||
# since this file is sourced either use the provided _CATKIN_SETUP_DIR
|
||||
# or fall back to the destination set at configure time
|
||||
: ${_CATKIN_SETUP_DIR:=/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel}
|
||||
CATKIN_SETUP_UTIL_ARGS="--extend --local"
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh"
|
||||
unset CATKIN_SETUP_UTIL_ARGS
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env zsh
|
||||
# generated from catkin/cmake/templates/local_setup.zsh.in
|
||||
|
||||
CATKIN_SHELL=zsh
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd -q "`dirname "$0"`" > /dev/null && pwd)
|
||||
emulate -R zsh -c 'source "$_CATKIN_SETUP_DIR/setup.sh" --extend --local'
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# generated from catkin/cmake/templates/setup.bash.in
|
||||
|
||||
CATKIN_SHELL=bash
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
|
||||
. "$_CATKIN_SETUP_DIR/setup.sh"
|
||||
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env sh
|
||||
# generated from catkin/cmake/template/setup.sh.in
|
||||
|
||||
# Sets various environment variables and sources additional environment hooks.
|
||||
# It tries it's best to undo changes from a previously sourced setup file before.
|
||||
# Supported command line options:
|
||||
# --extend: skips the undoing of changes from a previously sourced setup file
|
||||
# --local: only considers this workspace but not the chained ones
|
||||
# In plain sh shell which doesn't support arguments for sourced scripts you can
|
||||
# set the environment variable `CATKIN_SETUP_UTIL_ARGS=--extend/--local` instead.
|
||||
|
||||
# since this file is sourced either use the provided _CATKIN_SETUP_DIR
|
||||
# or fall back to the destination set at configure time
|
||||
: ${_CATKIN_SETUP_DIR:=/root/Project/ROS/src/vio_svo/GPU_version/svo/cmake-build-debug/devel}
|
||||
_SETUP_UTIL="$_CATKIN_SETUP_DIR/_setup_util.py"
|
||||
unset _CATKIN_SETUP_DIR
|
||||
|
||||
if [ ! -f "$_SETUP_UTIL" ]; then
|
||||
echo "Missing Python script: $_SETUP_UTIL"
|
||||
return 22
|
||||
fi
|
||||
|
||||
# detect if running on Darwin platform
|
||||
_UNAME=`uname -s`
|
||||
_IS_DARWIN=0
|
||||
if [ "$_UNAME" = "Darwin" ]; then
|
||||
_IS_DARWIN=1
|
||||
fi
|
||||
unset _UNAME
|
||||
|
||||
# make sure to export all environment variables
|
||||
export CMAKE_PREFIX_PATH
|
||||
if [ $_IS_DARWIN -eq 0 ]; then
|
||||
export LD_LIBRARY_PATH
|
||||
else
|
||||
export DYLD_LIBRARY_PATH
|
||||
fi
|
||||
unset _IS_DARWIN
|
||||
export PATH
|
||||
export PKG_CONFIG_PATH
|
||||
export PYTHONPATH
|
||||
|
||||
# remember type of shell if not already set
|
||||
if [ -z "$CATKIN_SHELL" ]; then
|
||||
CATKIN_SHELL=sh
|
||||
fi
|
||||
|
||||
# invoke Python script to generate necessary exports of environment variables
|
||||
# use TMPDIR if it exists, otherwise fall back to /tmp
|
||||
if [ -d "${TMPDIR:-}" ]; then
|
||||
_TMPDIR="${TMPDIR}"
|
||||
else
|
||||
_TMPDIR=/tmp
|
||||
fi
|
||||
_SETUP_TMP=`mktemp "${_TMPDIR}/setup.sh.XXXXXXXXXX"`
|
||||
unset _TMPDIR
|
||||
if [ $? -ne 0 -o ! -f "$_SETUP_TMP" ]; then
|
||||
echo "Could not create temporary file: $_SETUP_TMP"
|
||||
return 1
|
||||
fi
|
||||
CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ ${CATKIN_SETUP_UTIL_ARGS:-} >> "$_SETUP_TMP"
|
||||
_RC=$?
|
||||
if [ $_RC -ne 0 ]; then
|
||||
if [ $_RC -eq 2 ]; then
|
||||
echo "Could not write the output of '$_SETUP_UTIL' to temporary file '$_SETUP_TMP': may be the disk if full?"
|
||||
else
|
||||
echo "Failed to run '\"$_SETUP_UTIL\" $@': return code $_RC"
|
||||
fi
|
||||
unset _RC
|
||||
unset _SETUP_UTIL
|
||||
rm -f "$_SETUP_TMP"
|
||||
unset _SETUP_TMP
|
||||
return 1
|
||||
fi
|
||||
unset _RC
|
||||
unset _SETUP_UTIL
|
||||
. "$_SETUP_TMP"
|
||||
rm -f "$_SETUP_TMP"
|
||||
unset _SETUP_TMP
|
||||
|
||||
# source all environment hooks
|
||||
_i=0
|
||||
while [ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]; do
|
||||
eval _envfile=\$_CATKIN_ENVIRONMENT_HOOKS_$_i
|
||||
unset _CATKIN_ENVIRONMENT_HOOKS_$_i
|
||||
eval _envfile_workspace=\$_CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE
|
||||
unset _CATKIN_ENVIRONMENT_HOOKS_${_i}_WORKSPACE
|
||||
# set workspace for environment hook
|
||||
CATKIN_ENV_HOOK_WORKSPACE=$_envfile_workspace
|
||||
. "$_envfile"
|
||||
unset CATKIN_ENV_HOOK_WORKSPACE
|
||||
_i=$((_i + 1))
|
||||
done
|
||||
unset _i
|
||||
|
||||
unset _CATKIN_ENVIRONMENT_HOOKS_COUNT
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env zsh
|
||||
# generated from catkin/cmake/templates/setup.zsh.in
|
||||
|
||||
CATKIN_SHELL=zsh
|
||||
|
||||
# source setup.sh from same directory as this file
|
||||
_CATKIN_SETUP_DIR=$(builtin cd -q "`dirname "$0"`" > /dev/null && pwd)
|
||||
emulate -R zsh -c 'source "$_CATKIN_SETUP_DIR/setup.sh"'
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Regular → Executable
+4
-8
@@ -2,17 +2,15 @@
|
||||
// Created by gfuse on 4/9/21.
|
||||
//
|
||||
//#define NDEBUG
|
||||
#include "gpu_svo/imu_integration.h"
|
||||
#include "imu_integration.h"
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include "gpu_svo/feature.h"
|
||||
#include "gpu_svo/point.h"
|
||||
//#include "gpu_svo/svoVisionFactorSmall.h"
|
||||
#include "gpu_svo/svoVisionFactor.h"
|
||||
//#include "gpu_svo/svoVisionFactorLandMark.h"
|
||||
#include <gtsam/nonlinear/Marginals.h>
|
||||
#include <gtsam/geometry/Pose3.h>
|
||||
#include <vikit/params_helper.h>
|
||||
#include <gpu_svo/params_helper.h>
|
||||
#include <gpu_svo/config.h>
|
||||
#include <gpu_svo/for_it.hpp>
|
||||
#define debug 0
|
||||
@@ -43,14 +41,12 @@ Imu_Integration::~Imu_Integration(){
|
||||
bool Imu_Integration::update(double* imu){
|
||||
if(syn)return false;
|
||||
if(imu_factor_id<1)return false;
|
||||
if(abs(imu[0])<1.0)imu[0]=pow(imu[0],3);//picked up from your code
|
||||
if(abs(imu[1])<1.0)imu[0]=pow(imu[1],3);//picked up from your code
|
||||
auto in=std::chrono::steady_clock::now();
|
||||
if(std::chrono::duration<double>(in-t_1).count()>20.0){
|
||||
t_1=in;
|
||||
preintegratedPtr->integrateMeasurement(Eigen::Vector3d(-1.0*(imu[0]-svo::Config::X_off()),0.0,-1.0*(imu[1]-svo::Config::Y_off())),Eigen::Vector3d(0.0,imu[5]-svo::Config::Teta_off(),0.0),0.0005);
|
||||
preintegratedPtr->integrateMeasurement(Eigen::Vector3d(-1.0*(imu[0]-svo::Config::X_off()),0.0,-1.0*(imu[1]-svo::Config::Y_off())),Eigen::Vector3d(0.0,imu[2]-svo::Config::Teta_off(),0.0),0.0005);
|
||||
}else{
|
||||
preintegratedPtr->integrateMeasurement(Eigen::Vector3d(-1.0*(imu[0]-svo::Config::X_off()),0.0,-1.0*(imu[1]-svo::Config::Y_off())),Eigen::Vector3d(0.0,imu[5]-svo::Config::Teta_off(),0.0),std::chrono::duration<double>(in-t_1).count());
|
||||
preintegratedPtr->integrateMeasurement(Eigen::Vector3d(-1.0*(imu[0]-svo::Config::X_off()),0.0,-1.0*(imu[1]-svo::Config::Y_off())),Eigen::Vector3d(0.0,imu[2]-svo::Config::Teta_off(),0.0),std::chrono::duration<double>(in-t_1).count());
|
||||
t_1=in;
|
||||
++imu_n;
|
||||
}
|
||||
+2
-2
@@ -10,8 +10,8 @@
|
||||
#include <gtsam/base/Matrix.h>
|
||||
#include <gtsam/base/Vector.h>
|
||||
#include <gtsam/geometry/Pose3.h>
|
||||
#include <vikit/robust_cost.h>
|
||||
#include <vikit/math_utils.h>
|
||||
#include <gpu_svo/robust_cost.h>
|
||||
#include <gpu_svo/math_utils.h>
|
||||
#include <gpu_svo/frame.h>
|
||||
|
||||
namespace svo {
|
||||
@@ -134,10 +134,11 @@ public:
|
||||
static double& EBP() { return getInstance().ebp; }
|
||||
/// the noise used for projection
|
||||
static double& NRP() { return getInstance().nrp; }
|
||||
static double& Gravity() { return getInstance().gravity; }
|
||||
static double& Svo_Ekf() { return getInstance().svo_ekf; }
|
||||
static double& X_off() { return getInstance().acc_x_off; }
|
||||
static double& Y_off() { return getInstance().acc_y_off; }
|
||||
static double& Teta_off() { return getInstance().gyr_z_off; }
|
||||
static double& Cmd_Cov() { return getInstance().cmd_cov; }
|
||||
|
||||
|
||||
private:
|
||||
@@ -173,7 +174,7 @@ private:
|
||||
size_t max_fts;
|
||||
size_t quality_min_fts;
|
||||
int quality_max_drop_fts;
|
||||
double nrp,ebp,gbc,abc,iuc,ACC_noise,GYO_noise,gravity,acc_x_off,acc_y_off,gyr_z_off;
|
||||
double nrp,ebp,gbc,abc,iuc,ACC_noise,GYO_noise,svo_ekf,acc_x_off,acc_y_off,gyr_z_off,cmd_cov;
|
||||
};
|
||||
|
||||
} // namespace svo
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
double timestamp_; //!< Timestamp of when the image was recorded.
|
||||
vk::AbstractCamera* cam_; //!< Camera model.
|
||||
SE2_5 T_f_w_; //!< Transform (f)rame from (w)orld.
|
||||
Matrix<double, 6, 6> Cov_; //!< Covariance.
|
||||
Matrix<double, 3, 3> Cov_; //!< Covariance.
|
||||
ImgPyr img_pyr_; //!< Image Pyramid.
|
||||
Features fts_; //!< List of features in the image.
|
||||
vector<Feature*> key_pts_; //!< Five features and associated 3D points which are used to detect if two frames have overlapping field of view.
|
||||
@@ -93,9 +93,11 @@ public:
|
||||
|
||||
/// Transforms point coordinates in world-frame (w) to camera pixel coordinates (c).
|
||||
inline Vector2d w2c(const Vector3d& xyz_w) const {
|
||||
return cam_->world2cam( Vector3d(xyz_w.x()*T_f_w_.cos_theta_+xyz_w.z()*T_f_w_.sin_theta_+T_f_w_.X_,
|
||||
xyz_w.y(),
|
||||
-xyz_w.x()*T_f_w_.sin_theta_+xyz_w.z()*T_f_w_.cos_theta_+T_f_w_.Z_) );
|
||||
Eigen::Matrix<double,3,3> R;
|
||||
R<<T_f_w_.T2_.rotation_matrix()(0,0),1e-19,T_f_w_.T2_.rotation_matrix()(0,1),
|
||||
1e-19,1.0,1e-19,
|
||||
T_f_w_.T2_.rotation_matrix()(1,0),1e-19,T_f_w_.T2_.rotation_matrix()(1,1);
|
||||
return cam_->world2cam( SE3(R,Vector3d(T_f_w_.T2_.translation()(0),1e-19,T_f_w_.T2_.translation()(1)))*xyz_w);
|
||||
}
|
||||
/// Transforms point coordinates in world-frame (w) to camera pixel coordinates (c).
|
||||
inline Vector2d w2px(const Vector3d& xyz_w) const { return cam_->world2cam( xyz_w ); }
|
||||
@@ -108,28 +110,53 @@ public:
|
||||
|
||||
/// Transforms point coordinates in world-frame (w) to camera-frams (f).
|
||||
inline Vector3d w2f(const Vector3d& xyz_w) const {
|
||||
return Vector3d(xyz_w.x()*T_f_w_.cos_theta_+xyz_w.z()*T_f_w_.sin_theta_+T_f_w_.X_,
|
||||
xyz_w.y(),
|
||||
-xyz_w.x()*T_f_w_.sin_theta_+xyz_w.z()*T_f_w_.cos_theta_+T_f_w_.Z_);
|
||||
Eigen::Matrix<double,3,3> R;
|
||||
R<<T_f_w_.T2_.rotation_matrix()(0,0),1e-19,T_f_w_.T2_.rotation_matrix()(0,1),
|
||||
1e-19,1.0,1e-19,
|
||||
T_f_w_.T2_.rotation_matrix()(1,0),1e-19,T_f_w_.T2_.rotation_matrix()(1,1);
|
||||
return Vector3d(SE3(R,Vector3d(T_f_w_.T2_.translation()(0),1e-19,T_f_w_.T2_.translation()(1)))*xyz_w);
|
||||
}
|
||||
|
||||
/// Transforms point from frame unit sphere (f) frame to world coordinate frame (w).
|
||||
inline Vector3d f2w(const Vector3d& f) const {
|
||||
return T_f_w_.T->inverse() * f;
|
||||
Eigen::Matrix<double,3,3> R;
|
||||
R<<T_f_w_.T2_.rotation_matrix()(0,0),1e-19,T_f_w_.T2_.rotation_matrix()(0,1),
|
||||
1e-19,1.0,1e-19,
|
||||
T_f_w_.T2_.rotation_matrix()(1,0),1e-19,T_f_w_.T2_.rotation_matrix()(1,1);
|
||||
return SE3(R,Vector3d(T_f_w_.T2_.translation()(0),1e-19,T_f_w_.T2_.translation()(1))).inverse() * f;
|
||||
}
|
||||
|
||||
/// Projects Point from unit sphere (f) in camera pixels (c).
|
||||
inline Vector2d f2c(const Vector3d& f) const { return cam_->world2cam( f ); }
|
||||
|
||||
/// Return the pose of the frame in the (w)orld coordinate frame.
|
||||
inline Vector3d pos() const { return T_f_w_.T->inverse().translation(); }
|
||||
inline Vector2d pos() const { return T_f_w_.T2_.translation(); }
|
||||
|
||||
inline SE3 se3() const{
|
||||
Eigen::Matrix<double,3,3> R;
|
||||
R<<T_f_w_.getSE2().rotation_matrix()(0,0),1e-19,T_f_w_.getSE2().rotation_matrix()(0,1),
|
||||
1e-19,1.0,1e-19,
|
||||
T_f_w_.getSE2().rotation_matrix()(1,0),1e-19,T_f_w_.getSE2().rotation_matrix()(1,1);
|
||||
SE3 out(R,Vector3d(T_f_w_.getSE2().translation()(0),1e-19,T_f_w_.getSE2().translation()(1)));
|
||||
return out;
|
||||
}
|
||||
|
||||
inline SE3 getSE3Inv() const{
|
||||
Eigen::Matrix<double,3,3> R;
|
||||
R<<T_f_w_.inverse().rotation_matrix()(0,0),1e-19,T_f_w_.inverse().rotation_matrix()(0,1),
|
||||
1e-19,1.0,1e-19,
|
||||
T_f_w_.inverse().rotation_matrix()(1,0),1e-19,T_f_w_.inverse().rotation_matrix()(1,1);
|
||||
SE3 out(R,Vector3d(T_f_w_.inverse().translation()(0),1e-19,T_f_w_.inverse().translation()(1)));
|
||||
return out;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Frame jacobian for projection of 3D point in (f)rame coordinate to
|
||||
/// unit plane coordinates uv (focal length = 1).
|
||||
inline static void jacobian_xyz2uv(
|
||||
const Vector3d& xyz_in_f,
|
||||
Matrix<double,2,6>& J)
|
||||
Matrix<double,2,3>& J)
|
||||
{
|
||||
const double x = xyz_in_f[0];
|
||||
const double y = xyz_in_f[1];
|
||||
@@ -137,18 +164,12 @@ public:
|
||||
const double z_inv_2 = z_inv*z_inv;
|
||||
|
||||
J(0,0) = -z_inv; // -1/z
|
||||
J(0,1) = 0.0; // 0
|
||||
J(0,2) = x*z_inv_2; // x/z^2
|
||||
J(0,3) = y*J(0,2); // x*y/z^2
|
||||
J(0,4) = -(1.0 + x*J(0,2)); // -(1.0 + x^2/z^2)
|
||||
J(0,5) = y*z_inv; // y/z
|
||||
J(0,1) = x*z_inv_2; // x/z^2
|
||||
J(0,2) = -(1.0 + pow(x,2)/z_inv_2); // -(1.0 + x^2/z^2)
|
||||
|
||||
J(1,0) = 0.0; // 0
|
||||
J(1,1) = -z_inv; // -1/z
|
||||
J(1,2) = y*z_inv_2; // y/z^2
|
||||
J(1,3) = 1.0 + y*J(1,2); // 1.0 + y^2/z^2
|
||||
J(1,4) = -J(0,3); // -x*y/z^2
|
||||
J(1,5) = -x*z_inv; // x/z
|
||||
J(1,0) = 1e-19; // 0
|
||||
J(1,1) = y*z_inv_2; // y/z^2
|
||||
J(1,2) = -x*y/z_inv_2; // -x*y/z^2
|
||||
}
|
||||
inline static void jacobian_l2uv(
|
||||
const Matrix<double,3,1>& p,
|
||||
@@ -156,10 +177,10 @@ public:
|
||||
double A = -1.0*sqrt(p.z());
|
||||
double z_inv = -1/p.z();
|
||||
J(0,0) = z_inv;
|
||||
J(0,1) = 0.0;
|
||||
J(0,1) = 1e-19;
|
||||
J(0,2) = p.x()*A;
|
||||
|
||||
J(1,0) = 0.0;
|
||||
J(1,0) = 1e-19;
|
||||
J(1,1) = z_inv;
|
||||
J(1,2) =A*p.y();
|
||||
}
|
||||
+8
-5
@@ -22,7 +22,7 @@
|
||||
#include <gpu_svo/frame_handler_base.h>
|
||||
#include <gpu_svo/reprojector.h>
|
||||
#include <gpu_svo/initialization.h>
|
||||
#include <gpu_svo/imu_integration.h>
|
||||
#include <gpu_svo/ukf.h>
|
||||
#include <gpu_svo/cl_class.h>
|
||||
|
||||
namespace svo {
|
||||
@@ -33,11 +33,11 @@ class FrameHandlerMono : public FrameHandlerBase
|
||||
public:
|
||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
|
||||
|
||||
FrameHandlerMono(vk::AbstractCamera* cam,Sophus::SE3& SE_init);
|
||||
FrameHandlerMono(vk::AbstractCamera* cam,Eigen::Matrix<double,6,1>& init);
|
||||
virtual ~FrameHandlerMono();
|
||||
|
||||
/// Provide an image.
|
||||
void addImage(const cv::Mat& img, double timestamp);
|
||||
void addImage(const cv::Mat& img, double timestamp,const ros::Time& time);
|
||||
|
||||
/// Set the first frame (used for synthetic datasets in benchmark node)
|
||||
void setFirstFrame(const FramePtr& first_frame);
|
||||
@@ -61,7 +61,9 @@ public:
|
||||
const SE3& T_kf_f,
|
||||
const cv::Mat& img,
|
||||
const double timestamp);
|
||||
std::shared_ptr<Imu_Integration> imu_integPtr_; //Integration of IMU
|
||||
//std::shared_ptr<Imu_Integration> imu_integPtr_; //Integration of IMU
|
||||
void UpdateIMU(double* value,const ros::Time& time);
|
||||
void UpdateCmd(double* value,const ros::Time& time);
|
||||
|
||||
protected:
|
||||
vk::AbstractCamera* cam_; //!< Camera model, can be ATAN, Pinhole or Ocam (see vikit).
|
||||
@@ -73,7 +75,8 @@ protected:
|
||||
initialization::KltHomographyInit* klt_homography_init_; //!< Used to estimate pose of the first two keyframes by estimating a homography.
|
||||
DepthFilter* depth_filter_; //!< Depth estimation algorithm runs in a parallel thread and is used to initialize new 3D points.
|
||||
opencl* gpu_fast_;
|
||||
uint image_count_=0;
|
||||
ros::Time time_;
|
||||
UKF ukfPtr_;
|
||||
|
||||
/// Initialize the visual odometry algorithm.
|
||||
virtual void initialize();
|
||||
+45
-18
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <sophus/se2.h>
|
||||
#include <sophus/se3.h>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include<Eigen/StdVector>
|
||||
@@ -49,26 +50,52 @@ namespace svo
|
||||
|
||||
const double EPS = 0.0000000001;
|
||||
const double PI = 3.14159265;
|
||||
class SE2_5{
|
||||
class SE2_5: public SE2{
|
||||
public:
|
||||
double X_,Z_,tetha_,cos_theta_,sin_theta_;
|
||||
SE3* T;
|
||||
SE2_5(double x,double z,double tetha):X_(x),Z_(z),tetha_(tetha){
|
||||
cos_theta_=cos(tetha_);
|
||||
sin_theta_=sin(tetha_);
|
||||
Eigen::Matrix<double, 3,3> R;
|
||||
R<<cos_theta_,0.0,sin_theta_,
|
||||
0.0,1.0,0.0,
|
||||
-sin_theta_,0.0,cos_theta_;
|
||||
T=new SE3(R,Vector3d(X_,0.0,Z_));
|
||||
SE2 T2_;
|
||||
SE2_5(SE2&& se2):T2_(se2){
|
||||
}
|
||||
SE2_5(SE2& se2):T2_(se2){
|
||||
}
|
||||
SE2_5(SE3&& se3){
|
||||
Quaterniond q=se3.unit_quaternion().normalized();
|
||||
double pitch=asin(2.0*(q.w()*q.y()-q.z()*q.x()));
|
||||
if (std::abs(pitch) >= 1)
|
||||
pitch = std::copysign(M_PI / 2.0, pitch); // use 90 degrees if out of range
|
||||
else
|
||||
pitch = std::asin(pitch);
|
||||
Eigen::Matrix<double, 2,2> R;
|
||||
R<<cos(pitch),sin(pitch),
|
||||
-sin(pitch),cos(pitch);
|
||||
T2_ = SE2(R,Vector2d(se3.translation().x(),se3.translation().z()));
|
||||
}
|
||||
SE2_5(SE3& se3){
|
||||
Quaterniond q=se3.unit_quaternion().normalized();
|
||||
double pitch=asin(2.0*(q.w()*q.y()-q.z()*q.x()));
|
||||
if (std::abs(pitch) >= 1)
|
||||
pitch = std::copysign(M_PI / 2.0, pitch); // use 90 degrees if out of range
|
||||
else
|
||||
pitch = std::asin(pitch);
|
||||
Eigen::Matrix<double, 2,2> R;
|
||||
R<<cos(pitch),sin(pitch),
|
||||
-sin(pitch),cos(pitch);
|
||||
T2_=SE2(R,Vector2d(se3.translation().x(),se3.translation().z()));
|
||||
}
|
||||
SE2_5(double x,double z,double pitch){
|
||||
Eigen::Matrix<double, 2,2> R;
|
||||
R<<cos(pitch),sin(pitch),
|
||||
-sin(pitch),cos(pitch);
|
||||
T2_=SE2(R,Vector2d(x,z));
|
||||
};
|
||||
void set(){
|
||||
X_=T->translation().x();
|
||||
Z_=T->translation().z();
|
||||
tetha_=asin(2*(T->unit_quaternion().w()*T->unit_quaternion().y()-
|
||||
T->unit_quaternion().z()*T->unit_quaternion().x()));
|
||||
cos_theta_=cos(tetha_);
|
||||
sin_theta_=sin(tetha_);
|
||||
SE2 getSE2() const{
|
||||
return T2_;
|
||||
}
|
||||
SE2 inverse() const{
|
||||
double yaw=atan(T2_.rotation_matrix()(0,1)/T2_.rotation_matrix()(0,0));
|
||||
return SE2(yaw+PI,T2_.translation());
|
||||
}
|
||||
double pitch()const{
|
||||
return atan(T2_.rotation_matrix()(0,1)/T2_.rotation_matrix()(0,0));
|
||||
}
|
||||
~SE2_5(){}
|
||||
};
|
||||
+4
-4
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <gpu_svo/global.h>
|
||||
#include <gpu_svo/cl_class.h>
|
||||
#include <gpu_svo/imu_integration.h>
|
||||
//#include "../../gtsam/imu_integration.h"
|
||||
|
||||
namespace svo {
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
|
||||
|
||||
FramePtr frame_ref_;
|
||||
KltHomographyInit(opencl* gpu_fast_):gpu_fast_(gpu_fast_) {};
|
||||
KltHomographyInit(opencl* gpu_fast_):gpu_fast_(gpu_fast_),T_cur_from_ref_(0.0,0.0,0.0) {};
|
||||
~KltHomographyInit() {};
|
||||
InitResult addFirstFrame(FramePtr frame_ref);
|
||||
InitResult addSecondFrame(FramePtr frame_ref);
|
||||
@@ -51,7 +51,7 @@ protected:
|
||||
vector<double> disparities_; //!< disparity between first and second frame.
|
||||
vector<int> inliers_; //!< inliers after the geometric check (e.g., Homography).
|
||||
vector<Vector3d> xyz_in_cur_; //!< 3D points computed during the geometric check.
|
||||
SE3 T_cur_from_ref_; //!< computed transformation between the first two frames.
|
||||
SE2_5 T_cur_from_ref_; //!< computed transformation between the first two frames.
|
||||
opencl* gpu_fast_;
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ void computeHomography(
|
||||
double reprojection_threshold,
|
||||
vector<int>& inliers,
|
||||
vector<Vector3d>& xyz_in_cur,
|
||||
SE3& T_cur_from_ref);
|
||||
SE2_5& T_cur_from_ref);
|
||||
|
||||
} // namespace initialization
|
||||
} // namespace svo
|
||||
@@ -103,12 +103,12 @@ public:
|
||||
FramePtr getClosestKeyframe(const FramePtr& frame) const;
|
||||
|
||||
/// Return the keyframe which is furthest apart from pos.
|
||||
FramePtr getFurthestKeyframe(const Vector3d& pos) const;
|
||||
FramePtr getFurthestKeyframe(const Vector2d& pos) const;
|
||||
|
||||
bool getKeyframeById(const int id, FramePtr& frame) const;
|
||||
|
||||
/// Transform the whole map with rotation R, translation t and scale s.
|
||||
void transform(const Matrix3d& R, const Vector3d& t, const double& s);
|
||||
void transform(const Matrix2d& R, const Vector2d& t, const double& s);
|
||||
|
||||
/// Empty trash bin of deleted keyframes and map points. We don't delete the
|
||||
/// points immediately to ensure proper cleanup and to provide the visualizer
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user