Skip to content

Commit

Permalink
Merge pull request #1472 from fspindle/fix_cdash_ci
Browse files Browse the repository at this point in the history
Fix issues detected on CDash ci
  • Loading branch information
fspindle authored Oct 1, 2024
2 parents 681ea43 + b9095ad commit c08b25e
Show file tree
Hide file tree
Showing 53 changed files with 415 additions and 395 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@
"dense": "cpp",
"stdvector": "cpp",
"numericaldiff": "cpp",
"source_location": "cpp"
"source_location": "cpp",
"stdfloat": "cpp",
"text_encoding": "cpp",
"print": "cpp"
},
"C_Cpp.vcFormat.indent.namespaceContents": false,
"editor.formatOnSave": true,
Expand Down
13 changes: 12 additions & 1 deletion 3rdparty/apriltag/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif()

if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U__STRICT_ANSI__ -fPIC -std=c99")
endif()
endif()

Expand All @@ -35,6 +35,16 @@ if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${APRILTAG_LIBRARY} PROPERTIES FOLDER "3rdparty")
endif()

if(VISP_CXX_STANDARD EQUAL VISP_CXX_STANDARD_98)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED TRUE)
if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U__STRICT_ANSI__")
endif()
endif()
endif()

set_target_properties(${APRILTAG_LIBRARY}
PROPERTIES OUTPUT_NAME ${APRILTAG_LIBRARY}
DEBUG_POSTFIX "${VISP_DEBUG_POSTFIX}"
Expand Down Expand Up @@ -67,6 +77,7 @@ if(MSVC)
vp_set_source_file_compile_flag(tag25h9.c /wd4996)
vp_set_source_file_compile_flag(tag36h10.c /wd4996)
vp_set_source_file_compile_flag(tag36h11.c /wd4996)
vp_set_source_file_compile_flag(tagCircle21h7.c /wd4996)
# disable optimization
foreach(f ${tag_srcs})
vp_set_source_file_compile_flag(${f} /O0)
Expand Down
1 change: 1 addition & 0 deletions cmake/AddExtraCompilationFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ endif()

if((NOT VISP_HAVE_NULLPTR) AND (VISP_CXX_STANDARD EQUAL VISP_CXX_STANDARD_98) AND (NOT MSVC))
add_extra_compiler_option("-Wno-c++11-compat")
add_extra_compiler_option("-Wno-c++0x-compat")
endif()

# Note here ViSPDetectPlatform.cmake should be called before this file to set ARM var
Expand Down
23 changes: 19 additions & 4 deletions cmake/templates/vpConfig.h.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/****************************************************************************
*
/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2023 by Inria. All rights reserved.
*
Expand Down Expand Up @@ -30,8 +29,7 @@
*
* Description:
* ViSP configuration.
*
*****************************************************************************/
*/

#ifndef VP_CONFIG_H
#define VP_CONFIG_H
Expand Down Expand Up @@ -610,6 +608,23 @@ namespace vp = VISP_NAMESPACE_NAME;
#include <visp3/core/vpNullptrEmulated.h>
#endif

#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
// <regex> was implemented and released in GCC 4.9.0. In older version of GCC, it is not implemented.
// See https://stackoverflow.com/questions/12530406/is-gcc-4-8-or-earlier-buggy-about-regular-expressions
// Calling std::regex lead to a segfault on centos 7.2 that has g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
#include <regex>
#if defined(WINRT) || defined(WIN32)
#define VISP_HAVE_WORKING_REGEX
#elif __cplusplus >= 201103L && \
(!defined(__GLIBCXX__) || (__cplusplus >= 201402L) || \
(defined(_GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT) || \
defined(_GLIBCXX_REGEX_STATE_LIMIT) || \
(defined(_GLIBCXX_RELEASE) && \
_GLIBCXX_RELEASE > 4)))
#define VISP_HAVE_WORKING_REGEX
#endif
#endif

// Handle portable symbol export.
// Defining manually which symbol should be exported is required
// under Windows whether MinGW or MSVC is used.
Expand Down
1 change: 1 addition & 0 deletions doc/config-doxygen.in
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,7 @@ PREDEFINED = @DOXYGEN_SHOULD_SKIP_THIS@ \
VISP_HAVE_VIPER850 \
VISP_HAVE_VIPER850_DATA \
VISP_HAVE_VIRTUOSE \
VISP_HAVE_WORKING_REGEX
VISP_HAVE_X11 \
VISP_HAVE_XML2 \
VISP_HAVE_YARP \
Expand Down
12 changes: 6 additions & 6 deletions example/device/framegrabber/readRealSenseData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#endif
#endif

#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
#define GETOPTARGS "ci:e:jbzodh"
#else
#define GETOPTARGS "ci:e:jbodh"
Expand All @@ -94,7 +94,7 @@ void usage(const char *name, const char *badparam)
<< " [-c]"
<< " [-j]"
<< " [-b]"
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
<< " [-z]"
#endif
<< " [-o]"
Expand All @@ -117,7 +117,7 @@ void usage(const char *name, const char *badparam)
<< " -b" << std::endl
<< " Depth and Pointcloud streams are saved in binary format." << std::endl
<< std::endl
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
<< " -z" << std::endl
<< " Pointcloud stream is saved in NPZ format." << std::endl
<< std::endl
Expand Down Expand Up @@ -161,7 +161,7 @@ bool getOptions(int argc, const char *argv[], std::string &input_directory, std:
case 'b':
force_binary_format = true;
break;
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
case 'z':
read_npz = true;
break;
Expand Down Expand Up @@ -252,7 +252,7 @@ bool readData(int cpt, const std::string &input_directory, const std::string &pa
}
}
}
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
else {
visp::cnpy::npz_t npz_data = visp::cnpy::npz_load(filename_depth);

Expand Down Expand Up @@ -312,7 +312,7 @@ bool readData(int cpt, const std::string &input_directory, const std::string &pa
}
}
}
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
else if (read_npz) {
visp::cnpy::npz_t npz_data = visp::cnpy::npz_load(filename_pointcloud);

Expand Down
14 changes: 7 additions & 7 deletions example/device/framegrabber/saveRealSenseData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#define USE_REALSENSE2
#endif

#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
#define GETOPTARGS "se:o:acdpzijCf:bvh"
#else
#define GETOPTARGS "se:o:acdpijCf:bvh"
Expand All @@ -97,7 +97,7 @@ void usage(const char *name, const char *badparam, int fps)
<< " [-d]"
<< " [-p]"
<< " [-b]"
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
<< " [-z]"
#endif
<< " [-i]"
Expand Down Expand Up @@ -133,7 +133,7 @@ void usage(const char *name, const char *badparam, int fps)
<< " -b" << std::endl
<< " Force depth and pointcloud to be saved in (little-endian) binary format." << std::endl
<< std::endl
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
<< " -z" << std::endl
<< " Pointcloud is saved in NPZ format." << std::endl
<< std::endl
Expand Down Expand Up @@ -220,7 +220,7 @@ bool getOptions(int argc, const char *argv[], bool &save, std::string &pattern,
case 'v':
depth_hist_visu = true;
break;
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
case 'z':
save_pcl_npz_format = true;
break;
Expand Down Expand Up @@ -481,7 +481,7 @@ class vpStorageWorker
}
}
}
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
else {
ss << m_directory << "/depth_image_" << m_save_pattern << ".npz";
snprintf(buffer, FILENAME_MAX, ss.str().c_str(), m_cpt);
Expand Down Expand Up @@ -575,7 +575,7 @@ class vpStorageWorker
}
}
else if (m_save_pcl_npz_format) {
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
// Write Npz headers
std::vector<char> vec_filename(filename_point_cloud.begin(), filename_point_cloud.end());
// Null-terminated character is handled at reading
Expand Down Expand Up @@ -708,7 +708,7 @@ int main(int argc, const char *argv[])
std::cout << "save_jpeg: " << save_jpeg << std::endl;
std::cout << "stream_fps: " << stream_fps << std::endl;
std::cout << "depth_hist_visu: " << depth_hist_visu << std::endl;
#ifdef VISP_HAVE_MINIZ
#if defined(VISP_HAVE_MINIZ) && defined(VISP_HAVE_WORKING_REGEX)
std::cout << "save_pcl_npz_format: " << save_pcl_npz_format << std::endl;
#endif
std::cout << "save_force_binary_format: " << save_force_binary_format << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions modules/ar/include/visp3/ar/vpPanda3DCommonFilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class VISP_EXPORT vpPanda3DLuminanceFilter : public vpPanda3DPostProcessFilter
void getRender(vpImage<unsigned char> &I) const;

private:
static const char *FRAGMENT_SHADER;
static const std::string FRAGMENT_SHADER;
};

/**
Expand All @@ -71,7 +71,7 @@ class VISP_EXPORT vpPanda3DGaussianBlur : public vpPanda3DPostProcessFilter
void getRender(vpImage<unsigned char> &I) const;

private:
static const char *FRAGMENT_SHADER;
static const std::string FRAGMENT_SHADER;
};

/**
Expand All @@ -96,7 +96,7 @@ class VISP_EXPORT vpPanda3DCanny : public vpPanda3DPostProcessFilter
void setupScene() VP_OVERRIDE;

private:
static const char *FRAGMENT_SHADER;
static const std::string FRAGMENT_SHADER;
float m_edgeThreshold;
};

Expand Down
5 changes: 0 additions & 5 deletions modules/ar/include/visp3/ar/vpPanda3DGeometryRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ class VISP_EXPORT vpPanda3DGeometryRenderer : public vpPanda3DBaseRenderer
vpRenderType m_renderType;
PointerTo<Texture> m_normalDepthTexture;
PointerTo<GraphicsOutput> m_normalDepthBuffer;

static const char *SHADER_VERT_NORMAL_AND_DEPTH_OBJECT;
static const char *SHADER_VERT_NORMAL_AND_DEPTH_CAMERA;
static const char *SHADER_FRAG_NORMAL_AND_DEPTH;

};
END_VISP_NAMESPACE
#endif //VISP_HAVE_PANDA3D
Expand Down
Loading

0 comments on commit c08b25e

Please sign in to comment.