OpenSourceRisk / ORE-SWIG

Other
49 stars 46 forks source link

Build error: no viable overloaded '=' #19

Open MattNguyen opened 2 years ago

MattNguyen commented 2 years ago

I'm building the project on macOS using cmake.

Environment Details:

Build step with cmake:

[15:25:26] ~/code/oreswig/build (master ✔) ❱ cmake -DORE=~/code/ore -DBOOST_ROOT=/opt/homebrew/Cellar/boost/1.80.0 -DBOOST_LIBRARYDIR=/opt/homebrew/Cellar/boost/1.80.0/lib -DPYTHON_LIBRARY=/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib -DPYTHON_INCLUDE_DIR=/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 ..
-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- 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
-- Performing Test supports_D_QL_USE_STD_UNIQUE_PTR
-- Performing Test supports_D_QL_USE_STD_UNIQUE_PTR - Success
-- Performing Test enableAssertionHandler
-- Performing Test enableAssertionHandler - Success
-- Performing Test supportsWall
-- Performing Test supportsWall - Success
-- Performing Test supportsSometimesUninitialized
-- Performing Test supportsSometimesUninitialized - Success
-- Performing Test supportsMaybeUninitialized
-- Performing Test supportsMaybeUninitialized - Failed
-- Performing Test supportsNonVirtualDtor
-- Performing Test supportsNonVirtualDtor - Success
-- Performing Test supportsSignCompare
-- Performing Test supportsSignCompare - Success
-- Performing Test supportsWfloatConversion
-- Performing Test supportsWfloatConversion - Success
-- Performing Test supportsReorderCtor
-- Performing Test supportsReorderCtor - Success
-- Performing Test supportsUnusedButSetVariable
-- Performing Test supportsUnusedButSetVariable - Success
-- Performing Test supportsUninitialized
-- Performing Test supportsUninitialized - Success
-- Performing Test supportsUnusedLambdaCapture
-- Performing Test supportsUnusedLambdaCapture - Success
-- Performing Test supportsReturnType
-- Performing Test supportsReturnType - Success
-- Performing Test supportsUnusedFunction
-- Performing Test supportsUnusedFunction - Success
-- Performing Test supportsNoUnknownPragmas
-- Performing Test supportsNoUnknownPragmas - Success
-- OREAnalytics library name: OREAnalytics[]
-- OREData library name: OREData[]
-- QuantExt library name: QuantExt[]
-- QuantLib library name: QuantLib[]
-- Found Boost: /opt/homebrew/Cellar/boost/1.80.0/lib/cmake/Boost-1.80.0/BoostConfig.cmake (found version "1.80.0") found components: serialization date_time regex filesystem system timer thread
-- Found SWIG: /opt/homebrew/bin/swig (found version "4.0.2")
-- Found PythonLibs: /opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib (found version "3.10.7")
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.24.1/share/cmake/Modules/UseSWIG.cmake:775 (message):
  Policy CMP0078 is not set: UseSWIG generates standard target names.  Run
  "cmake --help-policy CMP0078" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

Call Stack (most recent call first):
  OREAnalytics-SWIG/Python/CMakeLists.txt:61 (swig_add_library)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.24.1/share/cmake/Modules/UseSWIG.cmake:617 (message):
  Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
  flag.  Run "cmake --help-policy CMP0086" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.24.1/share/cmake/Modules/UseSWIG.cmake:888 (SWIG_ADD_SOURCE_TO_MODULE)
  OREAnalytics-SWIG/Python/CMakeLists.txt:61 (swig_add_library)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BOOST_LIBRARYDIR

-- Build files have been written to: /Users/matt/code/oreswig/build

Running make:

[15:25:26] ~/code/oreswig/build (master ✔) ❱ make
Scanning dependencies of target OREAnalytics_swig_compilation
[ 33%] Swig compile /Users/matt/code/oreswig/OREAnalytics-SWIG/Python/../SWIG/oreanalytics.i for python
/Users/matt/code/oreswig/OREAnalytics-SWIG/Python/../../QuantExt-SWIG/SWIG/qle_termstructures.i:235: Warning 325: Nested struct not currently supported (RefData ignored)
/Users/matt/code/oreswig/OREAnalytics-SWIG/Python/../../QuantExt-SWIG/SWIG/qle_averageois.i:81: Warning 314: 'None' is a python keyword, renaming to '_None'
/Users/matt/code/oreswig/OREAnalytics-SWIG/Python/../../QuantExt-SWIG/SWIG/qle_termstructures.i:218: Warning 401: Nothing known about base class 'Observer'. Ignored.
/Users/matt/code/oreswig/OREAnalytics-SWIG/Python/../../QuantLib-SWIG/SWIG/swap.i:53: Warning 509: Overloaded method Swap::Swap(std::vector< Leg,std::allocator< Leg > > const &,std::vector< bool,std::allocator< bool > > const &) effectively ignored,
/Users/matt/code/oreswig/OREAnalytics-SWIG/Python/../../QuantLib-SWIG/SWIG/swap.i:51: Warning 509: as it is shadowed by Swap::Swap(std::vector< ext::shared_ptr< CashFlow >,std::allocator< ext::shared_ptr< CashFlow > > > const &,std::vector< ext::shared_ptr< CashFlow >,std::allocator< ext::shared_ptr< CashFlow > > > const &).
[ 33%] Built target OREAnalytics_swig_compilation
[ 66%] Building CXX object OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx.o
In file included from /Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:5303:
In file included from /Users/matt/code/ore/QuantLib/ql/quantlib.hpp:46:
In file included from /Users/matt/code/ore/QuantLib/ql/experimental/all.hpp:13:
In file included from /Users/matt/code/ore/QuantLib/ql/experimental/credit/all.hpp:4:
In file included from /Users/matt/code/ore/QuantLib/ql/experimental/credit/basecorrelationlossmodel.hpp:32:
In file included from /Users/matt/code/ore/QuantLib/ql/experimental/credit/binomiallossmodel.hpp:24:
In file included from /Users/matt/code/ore/QuantLib/ql/experimental/credit/constantlosslatentmodel.hpp:24:
In file included from /Users/matt/code/ore/QuantLib/ql/experimental/credit/defaultprobabilitylatentmodel.hpp:24:
In file included from /Users/matt/code/ore/QuantLib/ql/experimental/math/latentmodel.hpp:29:
In file included from /Users/matt/code/ore/QuantLib/ql/experimental/math/tcopulapolicy.hpp:26:
In file included from /opt/homebrew/Cellar/boost/1.80.0/include/boost/math/distributions/students_t.hpp:16:
In file included from /opt/homebrew/Cellar/boost/1.80.0/include/boost/math/special_functions/beta.hpp:13:
In file included from /opt/homebrew/Cellar/boost/1.80.0/include/boost/math/special_functions/math_fwd.hpp:29:
In file included from /opt/homebrew/Cellar/boost/1.80.0/include/boost/math/special_functions/detail/round_fwd.hpp:11:
/opt/homebrew/Cellar/boost/1.80.0/include/boost/math/tools/config.hpp:23:6: warning: "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" [-W#warnings]
#    warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)"
     ^
/Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:16654:19: warning: unused variable 'pyResult' [-Wunused-variable]
        PyObject* pyResult
                  ^
/Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:708315:14: error: no viable overloaded '='
      result = ((MarketImpl const *)arg1)->baseCorrelation((std::string const &)*arg2,(std::string const &)*arg3);
      ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:28:21: note: candidate function not viable: no known conversion from 'Handle<QuantExt::BaseCorrelationTermStructure>' to 'const SwigValueWrapper<QuantLib::Handle<QuantLib::BaseCorrelationTermStructure<QuantLib::BilinearInterpolation>>>' for 1st argument
  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
                    ^
/Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:32:21: note: candidate function not viable: no known conversion from 'Handle<QuantExt::BaseCorrelationTermStructure>' to 'const Handle<QuantLib::BaseCorrelationTermStructure<QuantLib::BilinearInterpolation>>' for 1st argument
  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
                    ^
/Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:708375:14: error: no viable overloaded '='
      result = ((MarketImpl const *)arg1)->baseCorrelation((std::string const &)*arg2);
      ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:28:21: note: candidate function not viable: no known conversion from 'Handle<QuantExt::BaseCorrelationTermStructure>' to 'const SwigValueWrapper<QuantLib::Handle<QuantLib::BaseCorrelationTermStructure<QuantLib::BilinearInterpolation>>>' for 1st argument
  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
                    ^
/Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:32:21: note: candidate function not viable: no known conversion from 'Handle<QuantExt::BaseCorrelationTermStructure>' to 'const Handle<QuantLib::BaseCorrelationTermStructure<QuantLib::BilinearInterpolation>>' for 1st argument
  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
                    ^
2 warnings and 2 errors generated.
make[2]: *** [OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx.o] Error 1
make[1]: *** [OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/all] Error 2
make: *** [all] Error 2

These are the errors:

/Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:708315:14: error: no viable overloaded '='
      result = ((MarketImpl const *)arg1)->baseCorrelation((std::string const &)*arg2,(std::string const &)*arg3);
      ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And

/Users/matt/code/oreswig/build/OREAnalytics-SWIG/Python/CMakeFiles/_OREAnalytics.dir/oreanalyticsPYTHON_wrap.cxx:708375:14: error: no viable overloaded '='
      result = ((MarketImpl const *)arg1)->baseCorrelation((std::string const &)*arg2);
      ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm not familiar with c++, so any help to progress past this step would be greatly appreciated.