diff --git a/.cloud-v/Makefile b/.cloud-v/Makefile new file mode 100644 index 000000000..70a6b4a52 --- /dev/null +++ b/.cloud-v/Makefile @@ -0,0 +1,41 @@ +# Makefile + +# Define the directory to search for executables +DIR := ../build/test + +# Define a shell command to find all executable files, excluding C/C++ files and directories +EXEC_FILES := $(shell find $(DIR) -type f -executable ! -name '*.c' ! -name '*.cpp' ! -name '*.h') + +# Log file +LOG_FILE := test.mak.log + +# Default target +all: run + +# Target to run all executable files and log the output +run: + @echo "Running executables in $(DIR)..." > $(LOG_FILE)aaaa + count=0; \ + pass_count=0; \ + fail_count=0; \ + for file in $(EXEC_FILES); do \ + echo "Executing $$file" | tee -a $(LOG_FILE); \ + $$file >> $(LOG_FILE) 2>&1; \ + case "$$?" in \ + 0) echo "PASSED" | tee -a $(LOG_FILE); \ + pass_count=$$((pass_count + 1)) ;; \ + *) echo "FAILED" | tee -a $(LOG_FILE); \ + fail_count=$$((fail_count + 1)) ;; \ + esac; \ + echo ""; \ + echo "" >> $(LOG_FILE); \ + count=$$((count + 1)); \ + done; \ + echo "Total executables run: $$count" | tee -a $(LOG_FILE); \ + echo "Total passed: $$pass_count" | tee -a $(LOG_FILE); \ + echo "Total failed: $$fail_count" | tee -a $(LOG_FILE) + echo "Complete log is saved in test.mak.log" + +# Clean target (example, not strictly necessary for this task) +clean: + @echo "Nothing to clean" \ No newline at end of file diff --git a/.cloud-v/cloud-v-pipeline b/.cloud-v/cloud-v-pipeline new file mode 100644 index 000000000..5ab4b8e6d --- /dev/null +++ b/.cloud-v/cloud-v-pipeline @@ -0,0 +1,58 @@ +// All CI build results of this pipeline are available at: https://dash.cloud-v.co/blue/organizations/jenkins/simde/activity +node('J-TESTVM-1') { + stage('Clean Workspace') { + cleanWs() + } + stage('Clone') { + checkout scm + } + stage('Run system_info') { + sh '''#!/bin/bash + cat /proc/cpuinfo + ''' + } + stage('Run configure') { + sh '''#!/bin/bash -l + module load riscv64-gnu-glibc/14.1.1 + riscv64-unknown-linux-gnu-gcc --version + meson setup build --cross-file=./docker/cross-files/riscv64-gcc-13-unknown.cross -Db_lundef=false + ''' + } + stage('Run cross compile') { + sh '''#!/bin/bash -l + set -e + module load riscv64-gnu-glibc/14.1.1 + meson compile -C build -v + if [ $? -ne 0 ]; then + echo "Meson compile failed" + exit 1 + fi + echo "export SIMDE_PATH=$(pwd)" > testvm_pwd.sh + ''' + stash includes: 'testvm_pwd.sh', name: 'testvm_pwd.sh' + } +} +node('J-K230-1') { + stage('Clean Workspace') { + cleanWs() + } + stage('Get Cross-compiled binaries') { + unstash 'testvm_pwd.sh' + withCredentials([sshUserPrivateKey(credentialsId: 'TESTVM_SSH_CREDENTIALS', keyFileVariable: 'SSH_KEY')]) { + sh '''#!/bin/bash -v + source testvm_pwd.sh + echo "$SIMDE_PATH" + ssh -i $SSH_KEY jenkins_user@machine.cloud-v.co -p 30013 "cd $SIMDE_PATH && tar cvf - ." | tar xvf - -C ./ + ''' + } + } + stage('Run test') { + sh'''#!/bin/bash + cd .cloud-v + make + ''' + } + stage('Archive Artifacts'){ + archiveArtifacts artifacts: '.cloud-v/test.mak.log', fingerprint: true + } +} diff --git a/docker/cross-files/riscv64-gcc-13-unknown.cross b/docker/cross-files/riscv64-gcc-13-unknown.cross new file mode 100644 index 000000000..ea9afad67 --- /dev/null +++ b/docker/cross-files/riscv64-gcc-13-unknown.cross @@ -0,0 +1,11 @@ +[binaries] +c = ['riscv64-unknown-linux-gnu-gcc', '-march=rv64gcv_zvl256b', '-mrvv-vector-bits=zvl', '-mabi=lp64d'] +cpp = ['riscv64-unknown-linux-gnu-g++', '-march=rv64gcv_zvl256b', '-mrvv-vector-bits=zvl', '-mabi=lp64d'] +ar = 'riscv64-unknown-linux-gnu-ar' +strip = 'riscv64-unknown-linux-gnu-strip' + +[host_machine] +system = 'linux' +cpu_family = 'riscv64' +cpu = 'riscv64' +endian = 'little' \ No newline at end of file