How do I build Boost from github? - boost

I git clone boost latest source code on master branch from Github. I tried to build it but failed,
$ ./bootstrap.sh
./bootstrap.sh: line 188: ./tools/build/src/engine/build.sh: No such file or directory
-n Building Boost.Build engine with toolset ...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details
The content of bootstrap.log
1 ./bootstrap.sh: line 218: cd: ./tools/build/src/engine: No such file or directory
Question:
I understand there is no ./tools/build/src/engine, how do I solve this? I also noted that
-n Building Boost.Build engine with toolset ...
however, bootstrap.sh doesn't have -n option.
My develop environment:
MacOS X10.9 Xcode5.1

The current documentation for building directly from the Git repo is at Getting Started. Basically there are some additional steps to create the include directory tree and to run the build itself. NOTE, please also make sure you use the b2 command from the cloned repo. Not whatever you might have prebuilt in your system.

To checkout latest version of Boost libraries from GitHub do the following:
Checkout Boost super-project (only minimum required): git clone --single-branch --branch master --depth=1 https://github.com/boostorg/boost.git.
cd boost/
Checkout all the submodules (only minimum required): git submodule update --init --recursive --remote --no-fetch --depth=1.
If an error like following occured:
Cloning into 'libs/predef'...
remote: Counting objects: 243, done.
remote: Compressing objects: 100% (163/163), done.
remote: Total 243 (delta 128), reused 126 (delta 70), pack-reused 0
Receiving objects: 100% (243/243), 142.82 KiB | 209.00 KiB/s, done.
Resolving deltas: 100% (128/128), done.
Checking connectivity... done.
fatal: Needed a single revision
Unable to find current origin/master revision in submodule path 'libs/predef'
then use script (reget.bash):
#! /usr/bin/env bash -vex
rm -rf $3/$1 .git/modules/$1
git clone --depth=1 --branch=$2 --single-branch --separate-git-dir .git/modules/$1 https://github.com/boostorg/$1 $3/$1
where $1 is predef, $2 is master, $3 is libs, i.e. run bash reget.bash predef master libs.
An error can occur many times for different submodules, just use above script to clean up unrecoverable git error and to checkout latest commit for failed submodule. Then reuse git submodule update --init --recursive --remote --no-fetch --depth=1.
After complete checking out of all the submodules, build b2 executable. For clang it looks like:
export CC=clang
export CFLAGS="-march=native -Ofast"
export CXX=clang++
export CXXFLAGS="-march=native -Ofast"
bash bootstrap.sh --with-toolset=clang
You have obtained b2 executable. Use it to build whole Boost:
sudo ./b2 -j`nproc` toolset=clang --build-dir=/tmp/build-boost --without-mpi install
ADDITIONAL:
If you want to clone only HEAD of boost itself and HEADS of all the its submodules, then you may use following Lua script (tested on https://github.com/boostorg/boost.git repository):
-- mkdir boost ; cd boost ; lua ../git-submodules-clone-HEAD.lua https://github.com/boostorg/boost.git .
local module_url = arg[1] or 'https://github.com/boostorg/boost.git'
local module = arg[2] or module_url:match('.+/([_%d%a]+)%.git')
local branch = arg[3] or 'master'
function execute(command)
print('# ' .. command)
return os.execute(command)
end
-- execute('rm -rf ' .. module)
if not execute('git clone --single-branch --branch master --depth=1 ' .. module_url .. ' ' .. module) then
io.stderr:write('can\'t clone repository from ' .. module_url .. ' to ' .. module .. '\n')
return 1
end
-- cd $module ; git submodule update --init --recursive --remote --no-fetch --depth=1
execute('mkdir -p ' .. module .. '/.git/modules')
assert(io.input(module .. '/.gitmodules'))
local lines = {}
for line in io.lines() do
table.insert(lines, line)
end
local submodule
local path
local submodule_url
for _, line in ipairs(lines) do
local submodule_ = line:match('^%[submodule %"([_%d%a]-)%"%]$')
if submodule_ then
submodule = submodule_
path = nil
submodule_url = nil
else
local path_ = line:match('^%s*path = (.+)$')
if path_ then
path = path_
else
submodule_url = line:match('^%s*url = (.+)$')
end
if submodule and path and submodule_url then
-- execute('rm -rf ' .. path)
local git_dir = module .. '/.git/modules/' .. path:match('^.-/(.+)$')
-- execute('rm -rf ' .. git_dir)
execute('mkdir -p $(dirname "' .. git_dir .. '")')
if not execute('git clone --depth=1 --single-branch --branch=' .. branch .. ' --separate-git-dir ' .. git_dir .. ' ' .. module_url .. '/' .. submodule_url .. ' ' .. module .. '/' .. path) then
io.stderr:write('can\'t clone submodule ' .. submodule)
return 1
end
path = nil
submodule_url = nil
end
end
end

I really missed some important part of the documentation: .\b2 headers. So here follows all I've done to build thread, chrono and date-time, both release and debug, both static and shared, from version 1.60.0, cloning from the GitHub repo (in a Windows machine):
git clone --recursive https://github.com/boostorg/boost.git
cd boost
git checkout boost-1.60.0
git submodule update
bootstrap.bat
.\b2.exe headers
.\b2.exe variant=release,debug link=static,shared address-model=32 architecture=x86 --with-thread --with-chrono --with-date_time --stagedir=stage\win32 stage
.\b2.exe variant=release,debug link=static,shared address-model=64 architecture=x86 --with-thread --with-chrono --with-date_time --stagedir=stage\x64 stage
Don't forget the:
.\b2.exe headers

I had exactly the same problem. The shortest answer is that, tools/build.git is missing. https://github.com/boostorg/build.git. Simply do a git submodule update --recursive --remote on the directory. This will download the missing tools/build and other depending directories.
Note, many more submodules would be correspondingly downloaded apart from the build submodule.

Related

Failure in verification of Move Module for SUI

So I was following the documentation for beginners on SUI, I faced an issue with my Move.toml as I was building my file with sui move build. And I got the following error
Failed to verify the Move module, reason: "Sui framework version mismatch detected.
Make sure that you are using a GitHub dep in your Move.toml:[dependencies]
Sui = { git = \"https://github.com/MystenLabs/sui.git\", subdir = \"crates/sui-framework\", rev = \"devnet\" }\n`
If that does not fix the issue, your `sui` binary is likely out of date--try
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch devnet sui".
I get that my SUI binary is likely out of date and I tried
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch devnet sui
However that didn't fix the error and I got another error which was
error: could not find `sui` in https://github.com/MystenLabs/sui.git?branch=devnet with version `*`
I have also tried running the command
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch "devnet" sui sui-gateway
From the docs but i am facing this error
Updating git repository `https://github.com/MystenLabs/sui.git`
error: could not find `sui` in https://github.com/MystenLabs/sui.git?branch=devnet with version `*`
Updating git repository `https://github.com/MystenLabs/sui.git`
error: could not find `sui-gateway` in https://github.com/MystenLabs/sui.git?branch=devnet with version `*`
Summary Failed to install sui, sui-gateway (see error(s) above).
error: some crates failed to install
I am wondering how I can fix the issue and update my sui binary?
Context:
MacOs
SUI before 0.11 devnet release
I had the same errors when trying to install the SUI binaries. The following hint in the installation instructions solved my issue.
"Trouble shooting: If the previous command fails, make sure you have the latest version of Rust installed:"
rustup update stable
source "$HOME/.cargo/env"
Try to use the Sui module from Github instead of the local. In your Move.toml file
Replace this row
[dependencies]
Sui = { local = "../../../crates/sui-framework" }
with this
[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework", rev = "devnet" }

pack has bad object at offset 152904485

I'm trying to clone a repository on Gitlab with the command:
git clone git#gitlab.com:company/folder/project.git
And every time I get this output:
remote: Enumerating objects: 3860, done.
remote: Counting objects: 100% (482/482), done.
remote: Compressing objects: 100% (360/360), done.
fatal: pack has bad object at offset 152904485: inflate returned 1
fatal: fetch-pack: invalid index-pack output
The thing is, it happens only on my machine, I tested the exact same command accessing a linux machine remotely through ssh and it works just fine. Also, it's relevant to mention that I'm using git on Windows 11. How can I solve this?
As in this thread, start checking the protocol used:
git -c protocol.version=1 git#gitlab.com:company/folder/project.git
As bit as in this gist, you could try an incremental clone, using a shallow clone (--depth)
REPO=$1
DIR=$2
git clone --recurse-submodules $REPO $DIR --depth=1
cd $DIR
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch --depth=10
git fetch --depth=100
...
Another approach, clone up to the problematic commit: (--shallow-exclude=<revision>)
git clone --shallow-exclude=anOlCommit
There is a patch in progress around index-pack (June 2022), about unpacking large object in a stream.
The OP Otávio Augusto Silva confirms in the comments:
It didn't worked on Windows 11 cmd but it worked on WSL2 (Ubuntu)
And since Git can be installed on Windows AND on WSL, that could be a valid workaround.

Error while cloning GitHub COSMOS Repository. (GO)

i want to clone and install a GitHub repository but get an error.
git clone https://github.com/bandprotocol/chain
cd chain && git checkout v2.3.0
make install
Result:
..\go\pkg\mod\github.com\rcrowley\go-metrics#v0.0.0-20200313005456-10cdbea86bc0\runtime.go:5:2: found packages pprof (elf.go) and proto (proto.go) in C:\Users\user\go\GO Language\src\runtime\pprof
make: *** [Makefile:24: install] Error 1
If i delete for example one file he takes the next two out of this folder.
Thanks for help and answers

Singularity v3.9.4 Installation - mconfig not inside a git repository and no VERSION file found

I'm trying to install Singularity after installing Go. I've confirmed that Go has been installed successfully:
$ go version
go version go1.17.6 linux/amd64
After that, I run the following commands:
$ export VERSION=3.9.4
$ wget https://github.com/sylabs/singularity/archive/refs/tags/v${VERSION}.tar.gz
$ tar -xzf v${VERSION}.tar.gz
$ cd singularity-${VERSION}
$ ./mconfig # This is where it fails
E: Not inside a git repository and no VERSION file found. Abort.
The tarball you are downloading is the one generated automatically for a tag, not the release tarball. From the release page:
Source Code
Please use the singularity-ce-3.9.4.tar.gz download below to obtain and install SingularityCE 3.9.4. The GitHub auto-generated 'Source Code' downloads do not include required dependencies etc.
Working snippet using the correct url:
export VERSION=3.9.4
wget https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-ce-${VERSION}.tar.gz && \
tar xf singularity-ce-${VERSION}.tar.gz && \
cd singularity-ce-${VERSION} && \
./mconfig

git flow installer fails to install shFlags on the Mac OS X 10.8.3

Tried this several times including nuking the previous download and manually getting the submodule. Does anyone have a workaround?
SilverFir-2:SRC mike$ sudo ./git-flow-installer
### gitflow no-make installer ###
Installing git-flow to /usr/local/bin
Cloning repo from GitHub to gitflow
Cloning into 'gitflow'...
remote: Counting objects: 1407, done.
remote: Compressing objects: 100% (602/602), done.
remote: Total 1407 (delta 893), reused 1285 (delta 790)
Receiving objects: 100% (1407/1407), 358.18 KiB | 121 KiB/s, done.
Resolving deltas: 100% (893/893), done.
Updating submodules
Submodule 'shFlags' (git://github.com/nvie/shFlags.git) registered for path 'shFlags'
Cloning into 'shFlags'...
fatal: unable to connect to github.com:
github.com[0: 204.232.175.90]: errno=Operation timed out
Clone of 'git://github.com/nvie/shFlags.git' into submodule path 'shFlags' failed
install: gitflow/git-flow -> /usr/local/bin/git-flow
install: gitflow/git-flow-init -> /usr/local/bin/git-flow-init
install: gitflow/git-flow-feature -> /usr/local/bin/git-flow-feature
install: gitflow/git-flow-hotfix -> /usr/local/bin/git-flow-hotfix
install: gitflow/git-flow-release -> /usr/local/bin/git-flow-release
install: gitflow/git-flow-support -> /usr/local/bin/git-flow-support
install: gitflow/git-flow-version -> /usr/local/bin/git-flow-version
install: gitflow/gitflow-common -> /usr/local/bin/gitflow-common
install: gitflow/gitflow-shFlags: No such file or directory
SilverFir-2:SRC mike$
It looks like it may just be a temporary connection issue (though it's unusual that you were able to manually get the submodule but the script couldn't do it). The make-less installer appeared to work fine on my Mac OS 10.8.3 system. The make-less installer isn't doing much, you can run the steps yourself to install it-
git clone https://github.com/nvie/gitflow.git
cd gitflow
git submodule init
git submodule update
sudo make install

Resources