Skip to content

Build failed on develop branch in M1 Mac Pro + Homebrew environment #2616

Closed
@sanak

Description

@sanak

Problem
From the following PR's comment.
#2607 (comment)

:
[ 60%] Built target bellman_ford
[ 61%] Building CXX object src/cpp_common/CMakeFiles/cpp_common.dir/Dmatrix.cpp.o
[ 61%] Building CXX object src/cpp_common/CMakeFiles/cpp_common.dir/compPaths.cpp.o
[ 62%] Building CXX object src/cpp_common/CMakeFiles/cpp_common.dir/rule.cpp.o
[ 62%] Building CXX object src/cpp_common/CMakeFiles/cpp_common.dir/bpoint.cpp.o
[ 63%] Building CXX object src/cpp_common/CMakeFiles/cpp_common.dir/pgr_messages.cpp.o
[ 63%] Building CXX object src/cpp_common/CMakeFiles/cpp_common.dir/combinations.cpp.o
In file included from /Users/sanak/Projects/pgRouting/git/pgrouting/src/cpp_common/combinations.cpp:27:
In file included from /Users/sanak/Projects/pgRouting/git/pgrouting/include/cpp_common/combinations.hpp:46:
In file included from /Users/sanak/Projects/pgRouting/git/pgrouting/include/cpp_common/basePath_SSEC.hpp:44:
In file included from /opt/homebrew/include/boost/graph/adjacency_list.hpp:20:
In file included from /opt/homebrew/include/boost/unordered_set.hpp:17:
In file included from /opt/homebrew/include/boost/unordered/unordered_set.hpp:17:
In file included from /opt/homebrew/include/boost/unordered/detail/serialize_fca_container.hpp:12:
In file included from /opt/homebrew/include/boost/unordered/detail/serialize_container.hpp:13:
In file included from /opt/homebrew/include/boost/throw_exception.hpp:21:
In file included from /opt/homebrew/include/boost/exception/exception.hpp:9:
/opt/homebrew/include/boost/assert/source_location.hpp:95:9: error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'?
        BOOST_ASSERT_SNPRINTF( buffer, ":%lu", ln );
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/include/boost/assert/source_location.hpp:79:53: note: expanded from macro 'BOOST_ASSERT_SNPRINTF'
# define BOOST_ASSERT_SNPRINTF(buffer, format, arg) std::snprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), format, arg)
                                                    ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/stdio.h:337:6: note: 'snprintf' declared here
int      snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
         ^
In file included from /Users/sanak/Projects/pgRouting/git/pgrouting/src/cpp_common/combinations.cpp:27:
In file included from /Users/sanak/Projects/pgRouting/git/pgrouting/include/cpp_common/combinations.hpp:46:
In file included from /Users/sanak/Projects/pgRouting/git/pgrouting/include/cpp_common/basePath_SSEC.hpp:44:
In file included from /opt/homebrew/include/boost/graph/adjacency_list.hpp:20:
In file included from /opt/homebrew/include/boost/unordered_set.hpp:17:
In file included from /opt/homebrew/include/boost/unordered/unordered_set.hpp:17:
In file included from /opt/homebrew/include/boost/unordered/detail/serialize_fca_container.hpp:12:
In file included from /opt/homebrew/include/boost/unordered/detail/serialize_container.hpp:13:
In file included from /opt/homebrew/include/boost/throw_exception.hpp:21:
In file included from /opt/homebrew/include/boost/exception/exception.hpp:9:
/opt/homebrew/include/boost/assert/source_location.hpp:102:13: error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'?
            BOOST_ASSERT_SNPRINTF( buffer, ":%lu", co );
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/include/boost/assert/source_location.hpp:79:53: note: expanded from macro 'BOOST_ASSERT_SNPRINTF'
# define BOOST_ASSERT_SNPRINTF(buffer, format, arg) std::snprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), format, arg)
                                                    ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/stdio.h:337:6: note: 'snprintf' declared here
int      snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
         ^
2 errors generated.
make[2]: *** [src/cpp_common/CMakeFiles/cpp_common.dir/combinations.cpp.o] Error 1
make[1]: *** [src/cpp_common/CMakeFiles/cpp_common.dir/all] Error 2
make: *** [all] Error 2

To Reproduce

git checkout develop
git pull
mkdir build
cd build
cmake ../
make

Expectation
Build should be passed.

Workaround patch is here.

--- a/src/cpp_common/combinations.cpp
+++ b/src/cpp_common/combinations.cpp
@@ -24,12 +24,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
  ********************************************************************PGR-GNU*/
 
-#include "cpp_common/combinations.hpp"
-
 #include <map>
 #include <set>
 #include <deque>
 #include <vector>
+#include "cpp_common/combinations.hpp"
 #include "cpp_common/pgdata_getters.hpp"
 #include "cpp_common/basePath_SSEC.hpp"

Platform/versions

  • OS: M1 Mac Sonoma 14.3.1
  • Xcode: 15.2
CMake log
-- Setting build type to 'Release' as none was specified.
-- CMAKE_BUILD_TYPE Release
-- The C compiler identification is AppleClang 15.0.0.15000100
-- The CXX compiler identification is AppleClang 15.0.0.15000100
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /opt/homebrew/bin/git (found version "2.43.0") 
-- DOXYGEN_MINIMUM_VERSION=1.7
-- SPHINX_MINIMUM_VERSION=4.0
-- POSTGRESQL_MINIMUM_VERSION=9.2.0
-- BOOST_MINIMUM_VERSION=1.56.0
-- POSTGIS_MINIMUM_VERSION=2.0.0
-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.84.0/BoostConfig.cmake (found suitable version "1.84.0", minimum required is "1.56.0")  
-- Found Perl: /opt/homebrew/bin/perl (found version "5.38.2") 
-- POSTGRESQL_PG_CONFIG is /opt/homebrew/bin/pg_config
-- POSTGRESQL_EXECUTABLE is /opt/homebrew/Cellar/postgresql@14/14.10_1/bin/postgres
-- POSTGRESQL_VERSION_STRING in FindPostgreSQL.cmake is PostgreSQL 14.10 (Homebrew)
-- POSTGRESQL_INCLUDE_DIR: /opt/homebrew/include/postgresql@14/server
-- POSTGRESQL_LIBRARIES: /opt/homebrew/lib/postgresql@14
-- POSTGRESQL_VERSION_STRING=PostgreSQL 14.10 (Homebrew)
-- POSTGRESQL_VERSION=14.10
-- PGSQL_VERSION=1410
-- LIBRARY_INSTALL_PATH /opt/homebrew/lib/postgresql@14
-- Performing Test C_COMPILER_SUPPORTS_FPIC
-- Performing Test C_COMPILER_SUPPORTS_FPIC - Success
-- Performing Test CXX_COMPILER_SUPPORTS_FPIC
-- Performing Test CXX_COMPILER_SUPPORTS_FPIC - Success
-- Configuring done (3.1s)
-- Generating done (0.2s)
-- Build files have been written to: /Users/sanak/Projects/pgRouting/git/pgrouting/build

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions