Skip to content

[B2 Build System] B2 4.6.0 was released 2 days ago, supporting OpenBSD now!

B2 4.6.0 Release

About B2 4.6.0 release, please read this discussion:

https://github.com/bfgroup/b2/discussions/36

B2 Build System

Get b2 information from b2 home:

https://www.bfgroup.xyz/b2

The excellent B2 User Manual:

https://www.bfgroup.xyz/b2/manual/release/index.html

Build B2 on OpenBSD

cd b2-4.6.0/
./bootstrap.sh
./b2 install

Use B2 on OpenBSD

// hello.cpp

#include <iostream>
#include <future>
#include <chrono>

std::mutex mutex;

template <class T>
void fn() {
        for (int i=0; i<9; ++i) {
                std::this_thread::sleep_for(
                        std::chrono::milliseconds(100));
                std::unique_lock guard{mutex};
                std::cout << T('A'+i) << ' ' << std::flush;
        }
}

void t() {
        // std::future<void>
        auto f1 = std::async(
                fn<int>
        );
        auto f2 = std::async(
                fn<char>
        );
}

int main() {
        t();
        std::cout << std::endl;
}
// Jamroot
exe hello : hello.cpp : <cxxflags>"-std=c++20 -stdlib=libc++" ;
Build:
openbsd-bhyve$ ls
Jamroot   hello.cpp
openbsd-bhyve$ b2 toolset=clang
...found 10 targets...
...updating 5 targets...
clang-linux.compile.c++.without-pch bin/clang-linux-10/debug/hello.o
clang-linux.link bin/clang-linux-10/debug/hello
...updated 5 targets...
openbsd-bhyve$ ./bin/clang-linux-10/debug/hello                                
65 A 66 B 67 C 68 D 69 E 70 F 71 G 72 H 73 I 

OpenBSD

https://www.openbsd.org

 

 

 

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options

Submitted comments will be subject to moderation before being displayed.

@cppfx.xyz