[odb-users] compiling odb library

Phillip Shelton phillip.shelton at cardno.com.au
Tue Mar 15 17:54:49 EDT 2022

Thank you for your continued help.

Following the instructions in your last reply:
I created a new empty directory
>C:\compilers>md hello
>C:\compilers>cd hello

>From within that directory, I created a new project and tried to set the config.
>C:\compilers\hello>bdep new -t exe hello
>created new executable project hello in C:\compilers\hello\hello\
>C:\compilers\hello>b hello\ config.cxx=g++.exe
>terminate called after throwing an instance of 'butl::invalid_basic_path<char>'
>  what():  invalid filesystem path

It failed with the same error.  So I then ran the check commands.
First it is the version information.
>C:\compilers\hello>g++ -v
>Using built-in specs.
>Target: x86_64-w64-mingw32
>Configured with: ../configure --prefix=/R/winlibs64_stage/inst_gcc-11.2.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath --enable-libstdcxx-pch --enable-libstdcxx-time=yes --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,d,jit --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --with-mpc=/d/Prog/winlibs64_stage/custombuilt --with-mpfr=/d/Prog/winlibs64_stage/custombuilt --with-gmp=/d/Prog/winlibs64_stage/custombuilt --with-isl=/d/Prog/winlibs64_stage/custombuilt --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/R/winlibs64_stage/gcc-11.2.0/build_mingw/mingw-w64 CFLAGS=-I/d/Prog/winlibs64_stage/custombuilt/include/libdl-win32
>Thread model: posix
>Supported LTO compression algorithms: zlib zstd
>gcc version 11.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders)

Then it was print-multiarch, which returned only a newline. (file paths on windows need to contain at least one non-white space character.) 
>C:\compilers\hello>g++ -print-multiarch

Then it was dumpmachine, and this returned the 'Target' from the version data.
>C:\compilers\hello>g++ -dumpmachine

Then I created a test file with an empty comment as its only contents. And tried to compile it as a c++ file, while asking the compiler to only run the pre-processor and write the processed output to the terminal. (I think that is what that set of parameters means) 
>C:\compilers\hello>echo // >dummy
>C:\compilers\hello>g++ -x c++ -E - <dummy
>cc1plus.exe: warning:  is shorter than expected
># 0 "<stdin>"
># 0 "<built-in>"
># 0 "<command-line>"
># 1 "<stdin>"

Should I run the same set of commands using the build2 gcc compiler?  

Phillip Shelton
Senior Transport Modeller

Phone +61 7 3877 6991  
Address Level 11, 515 St Paul's Terrace, Fortitude Valley, 4006 Queensland Australia
Postal Locked Bag 4006, Fortitude Valley 4006
Email phillip.shelton at cardno.com.au  Web www.cardno.com

Cardno operates a quality management system that has been certified to ISO 9001.

This email and its attachments may contain confidential and/or privileged information for the sole use of the intended recipient(s). All electronically supplied data must be checked against an applicable hardcopy version which shall be the only document for which Cardno warrants accuracy. If you are not the intended recipient, any use, distribution or copying of the information contained in this email and its attachments is strictly prohibited. If you have received this email in error, please email the sender by replying to this message and immediately delete and destroy any copies of this email and any attachments. The views or opinions expressed are the author's own and may not reflect the views or opinions of Cardno.

-----Original Message-----
From: Boris Kolpackov <boris at codesynthesis.com> 
Sent: Tuesday, 15 March 2022 8:39 PM
To: Phillip Shelton <phillip.shelton at cardno.com.au>
Cc: odb-users at codesynthesis.com
Subject: Re: [odb-users] compiling odb library

Phillip Shelton <phillip.shelton at cardno.com.au> writes:

> C:\compilers\odb_build>where g++
> c:\compilers\mingw64\bin\g++.exe
> c:\compilers\build2\bin\g++.exe
> C:\compilers\odb_build>bpkg create -d libodb-mingw-release cc 
> config.cxx=g++ config.cc.coptions=-02 
> config.install.root=c:\compilers\odb\release --wipe

This should work.

> terminate called after throwing an instance of 'butl::invalid_basic_path<char>'
>   what():  invalid filesystem path

Hm, I wonder if it's something in the output of your MinGW GCC that trips build2 up. Can you try this in some temporary directory:

> bdep new -t exe hello
> b hello\ config.cxx=g++.exe

If you get the same error, can you send the output of the following command (they are executed by build2 underneath to query various compiler properties):

> g++ -v
> g++ -print-multiarch
> g++ -dumpmachine
> echo // >dummy
> g++ -x c++ -E - <dummy

More information about the odb-users mailing list