Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Trying to build latest version of ORE on Linux (Ubuntu 22.04)

Open andrealrichardson opened this issue 3 years ago • 10 comments

Build script:

git clone https://github.com/OpenSourceRisk/Engine.git ore cd ore git checkout tags/v1.8.7.0 git clone https://github.com/OpenSourceRisk/QuantLib.git cd QuantLib/ cd .. mkdir build cd build sudo apt install cmake build-essential libboost-all-dev cmake -DBOOST_ROOT=$BOOST -DBOOST_LIBRARYDIR=$BOOST/stage/lib .. make -j100 (I have big box :))

errors in CMakeError.log: Performing C++ SOURCE FILE Test supportsSometimesUninitialized failed with the following output: Change Dir: /home/azureuser/ore/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_f8703/fast && /usr/bin/gmake -f CMakeFiles/cmTC_f8703.dir/build.make CMakeFiles/cmTC_f8703.dir/build gmake[1]: Entering directory '/home/azureuser/ore/build/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_f8703.dir/src.cxx.o /usr/bin/c++ -DsupportsSometimesUninitialized -DBOOST_ENABLE_ASSERT_HANDLER -Wall -Wsometimes-uninitialized -std=c++17 -o CMakeFiles/cmTC_f8703.dir/src.cxx.o -c /home/azureuser/ore/build/CMakeFiles/CMakeTmp/src.cxx c++: error: unrecognized command-line option '-Wsometimes-uninitialized'; did you mean '-Wmaybe-uninitialized'? gmake[1]: *** [CMakeFiles/cmTC_f8703.dir/build.make:78: CMakeFiles/cmTC_f8703.dir/src.cxx.o] Error 1 gmake[1]: Leaving directory '/home/azureuser/ore/build/CMakeFiles/CMakeTmp' gmake: *** [Makefile:127: cmTC_f8703/fast] Error 2

Source file was: int main() { return 0; } Performing C++ SOURCE FILE Test supportsUnusedLambdaCapture failed with the following output: Change Dir: /home/azureuser/ore/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_afe35/fast && /usr/bin/gmake -f CMakeFiles/cmTC_afe35.dir/build.make CMakeFiles/cmTC_afe35.dir/build gmake[1]: Entering directory '/home/azureuser/ore/build/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_afe35.dir/src.cxx.o /usr/bin/c++ -DsupportsUnusedLambdaCapture -DBOOST_ENABLE_ASSERT_HANDLER -Wall -Wmaybe-uninitialized -Werror=non-virtual-dtor -Werror=sign-compare -Werror=float-conversion -Werror=reorder -Werror=unused-variable -Werror=unused-but-set-variable -Werror=uninitialized -Werror=unused-lambda-capture -std=c++17 -o CMakeFiles/cmTC_afe35.dir/src.cxx.o -c /home/azureuser/ore/build/CMakeFiles/CMakeTmp/src.cxx cc1plus: error: '-Werror=unused-lambda-capture': no option '-Wunused-lambda-capture' gmake[1]: *** [CMakeFiles/cmTC_afe35.dir/build.make:78: CMakeFiles/cmTC_afe35.dir/src.cxx.o] Error 1 gmake[1]: Leaving directory '/home/azureuser/ore/build/CMakeFiles/CMakeTmp' gmake: *** [Makefile:127: cmTC_afe35/fast] Error 2

Source file was: int main() { return 0; } Performing C++ SOURCE FILE Test supportsInconsistentMissingOverride failed with the following output: Change Dir: /home/azureuser/ore/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_b6c24/fast && /usr/bin/gmake -f CMakeFiles/cmTC_b6c24.dir/build.make CMakeFiles/cmTC_b6c24.dir/build gmake[1]: Entering directory '/home/azureuser/ore/build/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_b6c24.dir/src.cxx.o /usr/bin/c++ -DsupportsInconsistentMissingOverride -DBOOST_ENABLE_ASSERT_HANDLER -Wall -Wmaybe-uninitialized -Werror=non-virtual-dtor -Werror=sign-compare -Werror=float-conversion -Werror=reorder -Werror=unused-variable -Werror=unused-but-set-variable -Werror=uninitialized -Werror=return-type -Werror=unused-function -Werror=suggest-override -Werror=inconsistent-missing-override -std=c++17 -o CMakeFiles/cmTC_b6c24.dir/src.cxx.o -c /home/azureuser/ore/build/CMakeFiles/CMakeTmp/src.cxx cc1plus: error: '-Werror=inconsistent-missing-override': no option '-Winconsistent-missing-override' gmake[1]: *** [CMakeFiles/cmTC_b6c24.dir/build.make:78: CMakeFiles/cmTC_b6c24.dir/src.cxx.o] Error 1 gmake[1]: Leaving directory '/home/azureuser/ore/build/CMakeFiles/CMakeTmp' gmake: *** [Makefile:127: cmTC_b6c24/fast] Error 2

Source file was: int main() { return 0; } Performing C++ SOURCE FILE Test supportsSystemHeaderPrefixBoost failed with the following output: Change Dir: /home/azureuser/ore/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_40c97/fast && /usr/bin/gmake -f CMakeFiles/cmTC_40c97.dir/build.make CMakeFiles/cmTC_40c97.dir/build gmake[1]: Entering directory '/home/azureuser/ore/build/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_40c97.dir/src.cxx.o /usr/bin/c++ -DsupportsSystemHeaderPrefixBoost -DBOOST_ENABLE_ASSERT_HANDLER -Wall -Wmaybe-uninitialized -Werror=non-virtual-dtor -Werror=sign-compare -Werror=float-conversion -Werror=reorder -Werror=unused-variable -Werror=unused-but-set-variable -Werror=uninitialized -Werror=return-type -Werror=unused-function -Werror=suggest-override -Wno-unknown-pragmas --system-header-prefix=boost/ -std=c++17 -o CMakeFiles/cmTC_40c97.dir/src.cxx.o -c /home/azureuser/ore/build/CMakeFiles/CMakeTmp/src.cxx c++: error: unrecognized command-line option '--system-header-prefix=boost/' gmake[1]: *** [CMakeFiles/cmTC_40c97.dir/build.make:78: CMakeFiles/cmTC_40c97.dir/src.cxx.o] Error 1 gmake[1]: Leaving directory '/home/azureuser/ore/build/CMakeFiles/CMakeTmp' gmake: *** [Makefile:127: cmTC_40c97/fast] Error 2

Source file was: int main() { return 0; }

Any ideas?

andrealrichardson avatar Oct 15 '22 16:10 andrealrichardson

I don't think any of these errors are the problem, they are the normal way cmake checks for available compiler features. What are the actual errors you see in either a) the cmake configure step or b) during the build with make?

pcaspers avatar Oct 15 '22 16:10 pcaspers

Is there any reason why you didn't use the recommended git submodule init git submodule update instead of directly cloning the quantlib patch?

Regards Roland

rkapl123 avatar Oct 15 '22 16:10 rkapl123

Hi.. Didn't expect weekend support :)

On the git question, the submodule update was throwing an SSH error. I just tried it again and the git command worked this time.. The below logs are from using the documented method of git cloning:

On the output of the cmake and make: makeoutput.txt cmakeoutput.txt

andrealrichardson avatar Oct 15 '22 18:10 andrealrichardson

Ah now I see. The problem is this compile error

In file included from /home/localadmin/ore/QuantLib/Examples/CDS/CDS.cpp:31:
/home/localadmin/ore/QuantLib/ql/termstructures/credit/piecewisedefaultcurve.hpp: In instantiation of ‘class QuantLib::PiecewiseDefaultCurve<QuantLib::HazardRate, QuantLib::BackwardFlat>’:
/home/localadmin/ore/QuantLib/Examples/CDS/CDS.cpp:111:50:   required from here
/home/localadmin/ore/QuantLib/ql/termstructures/credit/piecewisedefaultcurve.hpp:298:17: error: ‘QuantLib::Real QuantLib::PiecewiseDefaultCurve<Traits, Interpolator, Bootstrap>::hazardRateImpl(QuantLib::Time) const [with Traits = QuantLib::HazardRate; Interpolator = QuantLib::BackwardFlat; Bootstrap = QuantLib::IterativeBootstrap; QuantLib::Real = double; QuantLib::Time = double]’ can be marked override [-Werror=suggest-override]
  298 |     inline Real PiecewiseDefaultCurve<C,I,B>::hazardRateImpl(Time t) const {
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

I fixed that problem in https://github.com/lballabio/QuantLib/pull/1455 already, but we did not upgrade to QL 1-28 yet. In the meantime you can work around the issue by commenting out

    add_compiler_flag("-Werror=suggest-override" supportsSuggestOverride)

in ore/cmake/commonSettings.make.

pcaspers avatar Oct 16 '22 07:10 pcaspers

Thanks Peter. I tried that, but still struggling to get a build working. I have added the logs below:

cmake_output.txt commonSettings.cmake.txt make_output.txt

I'm running on Ubuntu 20.04 and using the directory /home/localadmin/ORE-1.8.7.0/ to build ORE. commonSettings.cmake is renamed to commonSettings.cmake.txt to allow github to upload :)

andrealrichardson avatar Oct 16 '22 11:10 andrealrichardson

It looks like your compiler version detects more issues than the one we are using on Linux. In any case the new error points to a QL issues as well for which I'll open a PR. In the meantime can you comment out

    add_compiler_flag("-Werror=uninitialized" supportsUninitialized)

as well?

pcaspers avatar Oct 16 '22 12:10 pcaspers

QR PR for this latest problem: https://github.com/lballabio/QuantLib/pull/1497

pcaspers avatar Oct 16 '22 12:10 pcaspers

which gcc version are you using?

pcaspers avatar Oct 16 '22 12:10 pcaspers

Thanks again... all built and testing ok :)

For GCC localadmin@test20:~$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:hsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)

andrealrichardson avatar Oct 16 '22 17:10 andrealrichardson

@andrealrichardson is that issue resolved? Can you (ideally) confirm on the current master branch?

pcaspers avatar Oct 24 '23 12:10 pcaspers