mithun218 / GiNaCDE

GiNaC Differential Equation Solver
MIT License
9 stars 1 forks source link

build error on desolve.cpp #46

Open CharlesJQuarra opened 2 months ago

CharlesJQuarra commented 2 months ago

I am getting the following build error:

/usr/bin/clang++ -DGiNaCDE_EXPORTS -I/Users/cjq/Projects/GiNaCDE/build -I/Users/cjq/Projects/GiNaCDE/src -isystem /usr/local/Cellar/ginac/1.8.7/include -isystem /usr/local/Cellar/cln/1.3.7/include -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /opt/anaconda3/include -std=gnu++11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -fPIC -MD -MT CMakeFiles/GiNaCDE.dir/src/desolve.cpp.o -MF CMakeFiles/GiNaCDE.dir/src/desolve.cpp.o.d -o CMakeFiles/GiNaCDE.dir/src/desolve.cpp.o -c /Users/cjq/Projects/GiNaCDE/src/desolve.cpp
/Users/cjq/Projects/GiNaCDE/src/desolve.cpp:1945:19: error: no viable overloaded '='
        beginTime = chrono::high_resolution_clock::now();
        ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/chrono:834:28: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' to 'const time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' for 1st argument
class _LIBCPP_TEMPLATE_VIS time_point
                           ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/chrono:834:28: note: candidate function (the implicit move assignment operator) not viable: no known conversion from 'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' to 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' for 1st argument
/Users/cjq/Projects/GiNaCDE/src/desolve.cpp:1979:66: error: no viable conversion from 'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' to 'const time_point<std::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>'
        const std::chrono::time_point<std::chrono::system_clock> endTime = chrono::high_resolution_clock::now();
                                                                 ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/chrono:834:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'std::__1::chrono::steady_clock::time_point' (aka 'time_point<std::__1::chrono::steady_clock, duration<long long, ratio<1LL, 1000000000LL> > >') to 'const std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000> > > &' for 1st argument
class _LIBCPP_TEMPLATE_VIS time_point
                           ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/chrono:834:28: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'std::__1::chrono::steady_clock::time_point' (aka 'time_point<std::__1::chrono::steady_clock, duration<long long, ratio<1LL, 1000000000LL> > >') to 'std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000> > > &&' for 1st argument
/Library/Developer/CommandLineTools/usr/include/c++/v1/chrono:853:5: note: candidate template ignored: could not match 'std::__1::chrono::system_clock' against 'std::__1::chrono::steady_clock'
    time_point(const time_point<clock, _Duration2>& t,
    ^
/Users/cjq/Projects/GiNaCDE/src/desolve.cpp:2127:19: error: no viable overloaded '='
        beginTime = chrono::high_resolution_clock::now();
        ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/chrono:834:28: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' to 'const time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' for 1st argument
class _LIBCPP_TEMPLATE_VIS time_point
                           ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/chrono:834:28: note: candidate function (the implicit move assignment operator) not viable: no known conversion from 'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' to 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' for 1st argument
/Users/cjq/Projects/GiNaCDE/src/desolve.cpp:2135:19: error: no viable overloaded '='
        beginTime = chrono::high_resolution_clock::now();
        ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/chrono:834:28: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' to 'const time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' for 1st argument
class _LIBCPP_TEMPLATE_VIS time_point
                           ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/chrono:834:28: note: candidate function (the implicit move assignment operator) not viable: no known conversion from 'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' to 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' for 1st argument
4 errors generated.

the CMake command I am running is as follows:

cmake -DGINACDE_GUI_BUILD=off -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES="/usr/local/Cellar/ginac/1.8.7/include;/usr/local/Cellar/cln/1.3.7/include" -D CMAKE_CXX_COMPILER=/usr/bin/clang++ ..

mithun218 commented 2 months ago

I have tested the library with the C++ compiler from the GNU compiler collection, GCC >= 4.9, and it works fine. I suggest to use the C++ compiler from the GNU compiler collection, GCC >= 4.9.