Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a GitHub Actions workflow to build sibernetic and run a test simulation #183

Open
wants to merge 35 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
37a32b3
Initial CI script
pgleeson Mar 15, 2022
cc8370c
More CI script
pgleeson Mar 15, 2022
4eb76b2
Specify python version
pgleeson Mar 15, 2022
03b1b43
Use ubuntu-18.04
pgleeson Mar 15, 2022
96637b6
Test build...
pgleeson Mar 15, 2022
49e2623
install python-dev
pgleeson Mar 15, 2022
85edb19
Install python3-dev
pgleeson Mar 15, 2022
04a6eac
3.7
pgleeson Mar 15, 2022
3aa50f8
Install freeglut3-dev libglu1-mesa-dev
pgleeson Mar 15, 2022
0af5104
Run quick Sibernetic test
pgleeson Mar 15, 2022
e493de2
Print out version info at end of test
pgleeson May 16, 2022
5a66ec4
Test ubuntu 20.04
pgleeson Jun 20, 2022
bf66e59
Minor fix to os.environ.get('XAUTHORITY')
pgleeson Jun 23, 2022
a3bbf79
Test detect python version
pgleeson Jun 23, 2022
36d99fc
Use native system python
pgleeson Jun 24, 2022
7b0f444
Tweak
pgleeson Jun 24, 2022
5da4179
Test on 22.04
pgleeson Jun 24, 2022
e5762fe
Just ubuntu-20.04
pgleeson Jun 24, 2022
d473164
Improved printing from python helper scripts
pgleeson Jun 28, 2022
0cbbf12
Merge pull request #29 from openworm/ow-githubactions
pgleeson Jul 1, 2022
610bf12
Update ci-build.yml
pgleeson Jul 1, 2022
c6503a4
Use libc-bin=2.27-3ubuntu1.5
pgleeson Jul 4, 2022
a93bb0c
Use libc-bin=2.27-3ubuntu1.5
pgleeson Jul 4, 2022
fda2dc6
Merge branch 'ow-githubactions' into ow-githubactions
pgleeson Jul 4, 2022
0db5dd3
Just 18.04
pgleeson Jul 4, 2022
0c5e6d8
Merge branch 'ow-githubactions2' into ow-githubactions
pgleeson Jul 4, 2022
5ac7f27
Merge pull request #30 from openworm/ow-githubactions
pgleeson Jul 4, 2022
f234b7f
Merge pull request #31 from openworm/ow-githubactions
pgleeson Jul 4, 2022
a49f111
L - Merge branch 'ow-githubactions' into ow-githubactions2
pgleeson Jul 4, 2022
27af21c
Typo
pgleeson Jul 4, 2022
be2cd1f
Merge pull request #184 from pgleeson/ow-githubactions2
pgleeson Jul 5, 2022
77a4639
Test on ubuntu-latest
pgleeson Jul 8, 2022
1989074
Update ci-build.yml
pgleeson Jul 8, 2022
ba1ac49
Update tests on gha branch
pgleeson Jan 26, 2024
4ef0e1c
Update versions of gh actions
pgleeson May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci-build-intel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build using Intel drivers

on:
push:
branches: [ master, dev*, ow* ]
pull_request:
branches: [ master, dev, ow* ]

jobs:

build:

runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ ubuntu-latest, ubuntu-20.04 ]

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- uses: actions/checkout@v4

- name: Install Intel OpenCL libraries needed for Sibernetic
run: |

lscpu

echo "Installing OpenCL Drivers"

# Based on: https://github.com/openworm/OpenWorm/blob/master/Dockerfile

mkdir intel-opencl-tmp
cd intel-opencl-tmp
mkdir intel-opencl
wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip
unzip SRB5.0_linux64.zip
tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz
tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz
tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz
sudo cp -R intel-opencl/* /
sudo ldconfig
cd ..
sudo rm -r intel-opencl-tmp

sudo cp -R /opt/intel/opencl/include/CL /usr/include/
sudo apt install -y ocl-icd-opencl-dev vim

echo "OpenCL Driver Installation Complete"


- name: Build Sibernetic
run: |

sudo apt install -y python3-dev freeglut3-dev libglu1-mesa-dev
#sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for some reason...
python -V
ls -alt /usr/bin/python*
ls -alt
make clean
make

- name: Print Sibernetic help
run: |
./Release/Sibernetic -h

- name: Print info on executable
run: |
ldd ./Release/Sibernetic

echo "NOTE: not running Sibernetic on GitHub actions test with Intel drivers. Seg faults."
###./Release/Sibernetic -no_g timelimit=0.001

- name: Final version info
run: |

python -V
pip list
92 changes: 92 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build using AMD drivers

on:
push:
branches: [ master, dev*, ow* ]
pull_request:
branches: [ master, dev, ow* ]

jobs:

build:

runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ ubuntu-latest, ubuntu-20.04 ]

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- uses: actions/checkout@v4

- name: Install AMD OpenCL libraries needed for Sibernetic
run: |

lscpu

echo "Installing OpenCL Drivers"

# Legacy install of Intel's OpenCL Drivers:
# Based on: https://github.com/openworm/OpenWorm/blob/master/Dockerfile
# mkdir intel-opencl-tmp
# cd intel-opencl-tmp
# mkdir intel-opencl
# wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip
# unzip SRB5.0_linux64.zip
# tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz
# tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz
# tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz
# sudo cp -R intel-opencl/* /
# sudo ldconfig
# cd ..
# sudo rm -r intel-opencl-tmp

# sudo cp -R /opt/intel/opencl/include/CL /usr/include/
# sudo apt install -y ocl-icd-opencl-dev vim

# Install AMD's OpenCL Drivers (AMD-APP-SDK 3.0):
wget https://master.dl.sourceforge.net/project/nicehashsgminerv5viptools/APP%20SDK%20A%20Complete%20Development%20Platform/AMD%20APP%20SDK%203.0%20for%2064-bit%20Linux/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
tar -xf AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
printf 'Y\n\n' | sudo ./AMD-APP-SDK-v3.0.130.136-GA-linux64.sh

sudo ln -s /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so.1 /usr/lib/libOpenCL.so.1
sudo ln -s /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so /usr/lib/libamdocl64.so

sudo apt install -y ocl-icd-opencl-dev

echo "OpenCL Driver Installation Complete"

echo "CLINFO:"
clinfo

- name: Build Sibernetic
run: |

sudo apt install -y python3-dev freeglut3-dev libglu1-mesa-dev
#sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for some reason...
python -V
ls -alt /usr/bin/python*
ls -alt
make clean
make

- name: Print Sibernetic help
run: |
./Release/Sibernetic -h

- name: Run quick Sibernetic test
run: |
ldd ./Release/Sibernetic

./Release/Sibernetic -no_g timelimit=0.001

- name: Final version info
run: |

python -V
pip list
16 changes: 10 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ BINARYDIR = $(BUILDDIR)/obj
SOURCES = $(wildcard $(SRCDIR)/*.$(SRCEXT))
BINARYTESTDIR = $(BINARYDIR)/test
OBJECTS := $(patsubst $(SRCDIR)/%,$(BINARYDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
OBJECTS += $(BINARYTESTDIR)/owPhysicTest.o
PYTHON_CONFIG ?= /usr/bin/python3.7-config
OBJECTS += $(BINARYTESTDIR)/owPhysicTest.o
PYTHON_VER_MAIN = $(shell python3 -c 'import sys; vv=sys.version_info[:];print(str(vv[0])+str(1.0)[1]+str(vv[1]))')
#PYTHON_VER_MAIN = 3.8 # Hardcode if necessary
PYTHON_CONFIG ?= /usr/bin/python$(PYTHON_VER_MAIN)-config

CPP_DEPS = $(OBJECTS:.o=.d)

Expand All @@ -35,7 +37,7 @@ CXXFLAGS += $(shell $(PYTHON_CONFIG) --embed --cflags)
endif

CXXFLAGS += -fPIE
EXTRA_LIBS := -L/usr/lib64/OpenCL/vendors/amd/ -L/opt/AMDAPP/lib/x86_64/ -L/usr/lib/x86_64-linux-gnu/
EXTRA_LIBS := -L/usr/lib64/OpenCL/vendors/amd/ -L/opt/AMDAPP/lib/x86_64/ -L/usr/lib/x86_64-linux-gnu/

all: CXXFLAGS += -O3
all : $(TARGET)
Expand All @@ -45,12 +47,13 @@ debug: $(TARGET)

$(TARGET):$(OBJECTS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
@echo 'Invoking: GCC C++ Linker'
$(CC) $(CXXFLAGS) $(EXTRA_LIBS) -o $(BUILDDIR)/$(TARGET) $(OBJECTS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '

$(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
$(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
@echo 'Assuming Python: $(PYTHON_VER_MAIN)'
@mkdir -p $(BINARYDIR)
@mkdir -p $(BINARYTESTDIR)
@echo 'Building file: $<'
Expand All @@ -59,7 +62,8 @@ $(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
@echo 'Finished building: $<'
@echo ' '

clean :
clean :
@echo 'Assuming Python: $(PYTHON_VER_MAIN)'
-$(RM) $(OBJECTS)$(CPP_DEPS) $(BUILDDIR)/$(TARGET)
-@echo ' '

Expand Down
Loading