Skip to content

Commit 5c587cc

Browse files
committed
Merged PR 38791: Modifications to suppress warnings and find packages under Azure Linux 3.0
Modifications to suppress warnings and find packages under Azure Linux 3.0 ---- #### AI description (iteration 1) #### PR Classification This pull request updates build configurations and warning suppressions to improve compatibility with Azure Linux 3.0. #### PR Summary The changes enhance library detection for Intel MKL and Tcmalloc while consolidating warning suppressions in both native and third-party headers. - **`cmake/FindMKL.cmake`**: Updated search paths to include the oneapi MKL directory and adjusted library lookup paths accordingly. - **`cmake/FindTcmalloc.cmake`**: Expanded library search directories to reliably detect Tcmalloc on Linux systems. - **`src/common/filesystem.h` and third-party headers in `src/3rd_party/`**: Introduced additional GCC diagnostic directives to suppress deprecation warnings along with existing warning suppressions. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
1 parent 3462f7c commit 5c587cc

File tree

6 files changed

+73
-13
lines changed

6 files changed

+73
-13
lines changed

cmake/FindMKL.cmake

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,30 +60,33 @@ else()
6060
set(INTEL_ROOT_DEFAULT "/opt/intel")
6161
endif()
6262
set(INTEL_ROOT ${INTEL_ROOT_DEFAULT} CACHE PATH "Folder contains intel libs")
63-
find_path(MKL_ROOT include/mkl.h PATHS $ENV{MKLROOT} ${INTEL_ROOT}/mkl
64-
DOC "Folder contains MKL")
63+
find_path(MKL_ROOT include/mkl.h
64+
PATHS $ENV{MKLROOT} ${INTEL_ROOT}/mkl ${INTEL_ROOT}/oneapi/mkl/latest
65+
DOC "Folder contains MKL")
6566

6667
find_path(MKL_INCLUDE_DIR NAMES mkl.h HINTS ${MKL_ROOT}/include /usr/include/mkl)
6768

68-
6969
find_library(MKL_INTERFACE_LIBRARY
7070
NAMES ${INT_LIB}
7171
PATHS ${MKL_ROOT}/lib
7272
${MKL_ROOT}/lib/intel64
7373
${MKL_ROOT}/lib/intel64_win
74-
${INTEL_ROOT}/mkl/lib/intel64)
74+
${INTEL_ROOT}/mkl/lib/intel64
75+
${INTEL_ROOT}/oneapi/mkl/latest/lib)
7576

7677
find_library(MKL_SEQUENTIAL_LAYER_LIBRARY
7778
NAMES ${SEQ_LIB}
7879
PATHS ${MKL_ROOT}/lib
7980
${MKL_ROOT}/lib/intel64
80-
${INTEL_ROOT}/mkl/lib/intel64)
81+
${INTEL_ROOT}/mkl/lib/intel64
82+
${INTEL_ROOT}/oneapi/mkl/latest/lib)
8183

8284
find_library(MKL_CORE_LIBRARY
8385
NAMES ${COR_LIB}
8486
PATHS ${MKL_ROOT}/lib
8587
${MKL_ROOT}/lib/intel64
86-
${INTEL_ROOT}/mkl/lib/intel64)
88+
${INTEL_ROOT}/mkl/lib/intel64
89+
${INTEL_ROOT}/oneapi/mkl/latest/lib)
8790

8891
set(MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIR})
8992
set(MKL_LIBRARIES ${MKL_INTERFACE_LIBRARY} ${MKL_SEQUENTIAL_LAYER_LIBRARY} ${MKL_CORE_LIBRARY})

cmake/FindTcmalloc.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ else ()
1313
set(Tcmalloc_NAMES tcmalloc_minimal tcmalloc)
1414
endif ()
1515

16-
find_library(Tcmalloc_LIBRARY NAMES ${Tcmalloc_NAMES})
16+
find_library(Tcmalloc_LIBRARY
17+
NAMES ${Tcmalloc_NAMES}
18+
PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 /usr/lib/x86_64-linux-gnu
19+
)
1720

1821
if (Tcmalloc_INCLUDE_DIR AND Tcmalloc_LIBRARY)
1922
set(Tcmalloc_FOUND TRUE)

src/3rd_party/pathie-cpp/include/entry_iterator.hpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,20 @@
2929

3030
#ifndef PATHIE_ENTRY_ITERATOR_HPP
3131
#define PATHIE_ENTRY_ITERATOR_HPP
32+
3233
#include <iterator>
3334

35+
#ifdef __GNUC__
36+
#pragma GCC diagnostic push
37+
#if defined(__has_warning)
38+
#if __has_warning("-Wdeprecated-declarations")
39+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
40+
#endif
41+
#else
42+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
43+
#endif
44+
#endif
45+
3446
namespace Pathie {
3547

3648
class Path;
@@ -112,8 +124,13 @@ namespace Pathie {
112124

113125
const Path* mp_directory; ///< Path requested to read from.
114126
void* mp_cur; ///< Native handle to the opened directory.
115-
Path* mp_cur_path; ///< Path instance of the path pointed to by mp_cur (only a pointer to allow forward-declaration of Path).
127+
Path* mp_cur_path; ///< Path instance of the path pointed to by mp_cur.
116128
};
129+
117130
}
118131

132+
#ifdef __GNUC__
133+
#pragma GCC diagnostic pop
134+
#endif
135+
119136
#endif /* PATHIE_ENTRY_ITERATOR_HPP */

src/3rd_party/yaml-cpp/node/detail/iterator.h

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#if defined(_MSC_VER) || \
55
(defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
6-
(__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
6+
(__GNUC__ >= 4))
77
#pragma once
88
#endif
99

@@ -13,8 +13,20 @@
1313
#include <cstddef>
1414
#include <iterator>
1515

16+
#ifdef __GNUC__
17+
#pragma GCC diagnostic push
18+
#if defined(__has_warning)
19+
#if __has_warning("-Wdeprecated-declarations")
20+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
21+
#endif
22+
#else
23+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
24+
#endif
25+
#endif
26+
1627
namespace YAML {
1728
namespace detail {
29+
1830
struct iterator_value;
1931

2032
template <typename V>
@@ -85,7 +97,12 @@ class iterator_base : public std::iterator<std::forward_iterator_tag, V,
8597
base_type m_iterator;
8698
shared_memory_holder m_pMemory;
8799
};
88-
}
89-
}
100+
101+
#ifdef __GNUC__
102+
#pragma GCC diagnostic pop
103+
#endif
104+
105+
} // namespace detail
106+
} // namespace YAML
90107

91108
#endif // VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66

src/3rd_party/yaml-cpp/node/detail/node_iterator.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,20 @@
1616
#include <utility>
1717
#include <vector>
1818

19+
#ifdef __GNUC__
20+
# pragma GCC diagnostic push
21+
# if defined(__has_warning)
22+
# if __has_warning("-Wdeprecated-declarations")
23+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
24+
# endif
25+
# else
26+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
27+
# endif
28+
#endif
29+
1930
namespace YAML {
2031
namespace detail {
32+
2133
struct iterator_type {
2234
enum value { None, Sequence, Map };
2335
};
@@ -172,6 +184,10 @@ class node_iterator_base
172184
MapIter m_mapIt, m_mapEnd;
173185
};
174186

187+
#ifdef __GNUC__
188+
# pragma GCC diagnostic pop
189+
#endif
190+
175191
typedef node_iterator_base<node> node_iterator;
176192
typedef node_iterator_base<const node> const_node_iterator;
177193
}

src/common/filesystem.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@
99

1010
// Even when compiling with clang, __GNUC__ may be defined, so
1111
// we need to add some extra checks to avoid compile errors with
12-
// respect to -Wsuggest-override.
12+
// respect to -Wsuggest-override and deprecation warnings.
1313
#ifdef __GNUC__
1414
# pragma GCC diagnostic push
15-
# pragma GCC diagnostic ignored "-Wunused-value"
1615
# if defined(__has_warning)
16+
# if __has_warning("-Wdeprecated-declarations")
17+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
18+
# endif
1719
# if __has_warning("-Wsuggest-override")
1820
# pragma GCC diagnostic ignored "-Wsuggest-override"
1921
# endif
2022
# else
23+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2124
# pragma GCC diagnostic ignored "-Wsuggest-override"
2225
# endif
26+
# pragma GCC diagnostic ignored "-Wunused-value"
2327
#endif
2428

2529
#include "3rd_party/pathie-cpp/include/path.hpp" // @TODO: update to latest Pathie

0 commit comments

Comments
 (0)