Skip to content

Commit

Permalink
Update build instructions for Linux and Windows.
Browse files Browse the repository at this point in the history
Add 'buildVersionInfo.sh' for non-workflows builds.
  • Loading branch information
Misterblue committed Nov 29, 2023
1 parent 9c8efbe commit 9abb120
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 24 deletions.
55 changes: 32 additions & 23 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,21 @@ editing a `.config` file.

# BUILDING

The file `makeBullets.sh` is a script that encompasses these steps.
This "official" build scripts are called from `.github/workflows/build-dotnet6.yml`
which builds all the pieces using the Github action system.

For Linux, the script `makeBullets.sh` has the following build steps captured
in one script.

To build by hand, several scripts that are used in `build.yml`
are available. This builds the latest version of BulletSim with the latest
version of the Bullet physics engine.

1) Fetch the latest version from GitHub: https://github.com/bulletphysics/bullet3.

```
cd trunk/unmanaged/BulletSim
git clone --depth 1 https://github.com/bulletphysics/bullet3.git
git clone --depth 1 --single-branch https://github.com/bulletphysics/bullet3.git
```

2) Apply all the patches for bullet:
Expand All @@ -67,19 +75,16 @@ and patching the 2.86 version of Bullet.

a) Windows:

<b>Windows not done yet</b>
<strike>
The Bullet distribution has an instance of PreMake (https://premake.github.io/)
to build the Visual Studio project files.
The script buildBulletVS.bat will call premake and generate the project files.
As of August 2017, premake version 4 worked but would only generate for VS2010 (v100).
I build the BulletSim libraries with VS2012 (v110) for downward compatibility.
I let VS2012 upgrade the VS2010 project files for VS2012.
Install CMake for Windows.

`buildBulletCMake.ps1` builds the Bullet physics engine. Note that this
is a PowerShell script.

Once the project files have been built, open
"bullet-2/build3/vs2010/0_Bullet3Solution.sln" with VS2012
and do a batch compile for a Release version for 'Win32' and 'x64'.
</strike>
If one can not install `CMake` but has Visual Studio, `buildBulletVS.bat` will
build `bullet3/build3/vs2010/0Bullet3Solution.sln` which can be used by
any modern Visual Studio to build the Bullet physics engine.
Note that after this step, the Bullet physics engine binaries will be in
the `lib` directory and the include files must be copied into `include/`.

b) Linux and IOS:

Expand All @@ -94,21 +99,25 @@ and patching the 2.86 version of Bullet.
4) Build BulletSim

a) Windows:
<b>Windows not done yet</b>
<strike>
Use VS2012 to open "BulletSim.sln". Build Release version for 'Win32'
and 'x64'. The resulting DLLs will be in "Release/BulletSim.dll"
and "x64/Release/BulletSim.dll". These files are copied to
"bin/lib32/BulletSim.dll" and "bin/lib64/BulletSim.dll" in the
OpenSimulator execution tree.
</strike>

Generate version file information:

```
bash buildVersionInfo.sh
```

Build BulletSim:

```
.\buildBulletSim.ps1
```

b) Linux and IOS:

Run BulletSim compile and link script:

```
./makeBulletSim.sh
./buildBulletSim.sh
```

This builds a file with a name like: `libBulletSim-3.25-20230111-x86_64.so`.
Expand Down
1 change: 1 addition & 0 deletions buildBulletVS.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
cd bullet3/build3

.\premake4.exe --no-clsocket --no-demos --no-enet --no-gtest --no-test --noopengl3 --os=windows --targetdir=../lib vs2010

25 changes: 25 additions & 0 deletions buildVersionInfo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#! /bin/bash
# Script for building "BulletSimVersionInfoFile" which contains application and git
# version information.
# Also sets this information into the environment
# This file exists as an alternative to the building of the version info file in
# .github/workflows/build.yml

export BuildDate=$(date +%Y%m%d)

export BulletSimVersion=$(cat VERSION)
export BulletSimGitVersion=$(git rev-parse HEAD)
export BulletSimGitVersionShort=$(git rev-parse --short HEAD)
cd bullet3
export BulletVersion=$(cat VERSION)
export BulletGitVersion=$(git rev-parse HEAD)
export BulletGitVersionShort=$(git rev-parse --short HEAD)

cd ..
echo "BuildDate=$BuildDate" > BulletSimVersionInfo
echo "BulletSimVersion=$BulletSimVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersion=$BulletSimGitVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersionShort=$BulletSimGitVersionShort" >> BulletSimVersionInfo
echo "BulletVersion=$BulletVersion" >> BulletSimVersionInfo
echo "BulletGitVersion=$BulletGitVersion" >> BulletSimVersionInfo
echo "BulletGitVersionShort=$BulletGitVersionShort" >> BulletSimVersionInfo
25 changes: 24 additions & 1 deletion makeBullets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# This also applies the BulletSim patches to the Bullet sources.

# Set these values to 'yes' or 'no' to enable/disable fetching and building
FETCHBULLETSOURCES=${FETCHBULLETSOURCES:-yes}
FETCHBULLETSOURCES=${FETCHBULLETSOURCES:-no}
BUILDBULLET2=${BUILDBULLET2:-no} # usually don't need the old version
BUILDBULLET3=${BUILDBULLET3:-yes}

Expand Down Expand Up @@ -52,6 +52,29 @@ fi

cd "$BASE"

echo "=== Setting environment variables"
export BuildDate=$(date +%Y%m%d)
export BulletSimVersion=$(cat VERSION)
export BulletSimGitVersion=$(git rev-parse HEAD)
export BulletSimGitVersionShort=$(git rev-parse --short HEAD)
cd bullet3
export BulletVersion=$(cat VERSION)
export BulletGitVersion=$(git rev-parse HEAD)
export BulletGitVersionShort=$(git rev-parse --short HEAD)

echo "=== Creating version information file"
cd "$BASE"
rm BulletSimVersionInfo
touch BulletSimVersionInfo
echo "BuildDate=$BuildDate" > BulletSimVersionInfo
echo "BulletSimVersion=$BulletSimVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersion=$BulletSimGitVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersionShort=$BulletSimGitVersionShort" >> BulletSimVersionInfo
echo "BulletVersion=$BulletVersion" >> BulletSimVersionInfo
echo "BulletGitVersion=$BulletGitVersion" >> BulletSimVersionInfo
echo "BulletGitVersionShort=$BulletGitVersionShort" >> BulletSimVersionInfo
cat BulletSimVersionInfo

echo "=== removing libBulletSim-*"
rm libBulletSim-*.so

Expand Down

0 comments on commit 9abb120

Please sign in to comment.