I am trying to compile a code in a Linux-based cluster with open PBS scheduler using the following command
/home/debamalya/cpp/cpp_libraries/open_mpi/bin/mpicxx -I/home/debamalya/cpp/cpp_libraries/boost_1_81_0/ -I/home/debamalya/cpp/cpp_libraries/eigen-3.4.0/ -I /home/debamalya/cpp/cpp_libraries/gsl/include/ -c test.cpp
But it is creating a long error list, and I am just adding last part of it
/home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/policies/error_handling.hpp:231:10: note: ‘boost::math::policies::detail::raise_domain_error’ inline T raise_domain_error( ^ In file included from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/gamma.hpp:28:0, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/factorials.hpp:14, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/binomial.hpp:14, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp:31, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint.hpp:45, from test.cpp:7: /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/powm1.hpp:47:60: error: expected primary-expression before ‘>’ token return boost::math::policies::raise_domain_error(function, "For non-integral exponent, expected base > 0 but got %1%", x, pol); ^ In file included from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/gamma.hpp:30:0, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/factorials.hpp:14, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/binomial.hpp:14, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp:31, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint.hpp:45, from test.cpp:7: /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/lanczos.hpp: At global scope: /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/lanczos.hpp:91:48: error: expected template-name before ‘<’ token struct lanczos6 : public std::integral_constant<int, 35> ^ /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/lanczos.hpp:91:48: error: expected ‘{’ before ‘<’ token /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/lanczos.hpp:91:48: error: expected unqualified-id before ‘<’ token In file included from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint/algebra/multi_array_algebra.hpp:22:0, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint.hpp:63, from test.cpp:7: /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/multi_array.hpp:25:30: error: expected ‘}’ before end of line # pragma GCC diagnostic push ^ /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/multi_array.hpp:25:30: error: expected ‘}’ before end of line /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/multi_array.hpp:25:30: error: expected ‘}’ before end of line /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/multi_array.hpp:25:30: error: expected declaration before end of line
What I have understood is that the error is due to the boost library.
On the other hand, I have compiled the same code in my local machine using the following command
/home/debamalya/cpp_libraries/open_mpi/bin/mpicxx -I/home/debamalya/cpp_libraries/boost_1_81_0/ -I/home/debamalya/cpp_libraries/eigen-3.4.0/ -I/home/debamalya/cpp_libraries/gsl/include/ -c test.cpp
and it compiles fine.
To resolve compatibility issue, I am using same version of boost library and open mpi in both machines. I have also compiled other cpp codes using the following command in the cluster
/home/debamalya/cpp/cpp_libraries/gcc-11.3.0/bin/g++ -I/home/debamalya/cpp/cpp_libraries/boost_1_81_0/ -I/home/debamalya/cpp/cpp_libraries/eigen-3.4.0/ -I/home/debamalya/cpp/cpp_libraries/gsl/include/ -c test.cpp
but that creates no problem.
I am very confused. Please help me to understand the problem and resolve the issue.
I am also attaching first few line of the error message
In file included from /usr/include/c++/4.8.2/type_traits:35:0, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/math_fwd.hpp:28, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/binomial.hpp:13, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp:31, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint.hpp:45, from test.cpp:7: /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support for the \ ^ In file included from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/detail/round_fwd.hpp:11:0, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/math_fwd.hpp:29, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/binomial.hpp:13, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp:31, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint.hpp:45, from test.cpp:7: /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/config.hpp:23:6: warning: #warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" [-Wcpp] #
warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" ^ In file included from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/constants/constants.hpp:11:0, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/gamma.hpp:24, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/factorials.hpp:14, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/binomial.hpp:14, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp:31, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint.hpp:45, from test.cpp:7: /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/cxx03_warn.hpp:92:2: error: #error Support for C++03 has been removed. The minimum requirement for this library is fully compliant C++11. #error Support for C++03 has been removed. The minimum requirement for this library is fully compliant C++11. ^ In file included from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/detail/round_fwd.hpp:11:0, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/math_fwd.hpp:29, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/binomial.hpp:13, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp:31, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint.hpp:45, from test.cpp:7: /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/config.hpp:368:32: error: expected initializer before ‘noexcept’ #define BOOST_MATH_NOEXCEPT(T) noexcept(std::is_floating_point::value) ^ /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/config.hpp:470:62: note: in expansion of macro ‘BOOST_MATH_NOEXCEPT’ inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c) BOOST_MATH_NOEXCEPT(T) ^ /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/config.hpp:368:32: error: expected initializer before ‘noexcept’ #define BOOST_MATH_NOEXCEPT(T) noexcept(std::is_floating_point::value) ^ /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/config.hpp:476:67: note: in expansion of macro ‘BOOST_MATH_NOEXCEPT’ inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d) BOOST_MATH_NOEXCEPT(T) ^ /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/config.hpp:368:32: error: expected initializer before ‘noexcept’ #define BOOST_MATH_NOEXCEPT(T) noexcept(std::is_floating_point::value) ^ /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/config.hpp:484:49: note: in expansion of macro ‘BOOST_MATH_NOEXCEPT’ void suppress_unused_variable_warning(const T&) BOOST_MATH_NOEXCEPT(T) ^ /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/config.hpp:493:11: error: ‘constexpr’ does not name a type static constexpr bool value = std::is_integral::value || (std::numeric_limits::is_specialized && std::numeric_limits::is_integer); ^ /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/config.hpp:493:11: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11 In file included from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/detail/round_fwd.hpp:12:0, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/math_fwd.hpp:29, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/special_functions/binomial.hpp:13, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp:31, from /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/numeric/odeint.hpp:45, from test.cpp:7: /home/debamalya/cpp/cpp_libraries/boost_1_81_0/boost/math/tools/promotion.hpp:57:15: error: expected nested-name-specifier before ‘type’ using type = typename std::conditionalstd::is_integral<T::value, double, T>::type;