diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2a4b10e..0e9c16d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,6 @@ jobs: fail-fast: false max-parallel: 20 matrix: - branch: [v1.4.6] target: # Unit tests - os: linux @@ -35,7 +34,7 @@ jobs: - target: os: windows builder: windows-2019 - name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (${{ matrix.branch }})' + name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}' runs-on: ${{ matrix.builder }} steps: - name: Checkout nim-dagger @@ -93,6 +92,25 @@ jobs: EOF chmod 755 external/bin/gcc external/bin/g++ echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH + NIMFLAGS="-d:LeopardCmakeFlags='-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32'" + quote () { + local quoted=${1//\'/\'\\\'\'}; + printf "'%s'" "$quoted" + } + echo "NIMFLAGS=$(quote "${NIMFLAGS}")" >> $GITHUB_ENV + + - name: Install build dependencies (macOS) + if: runner.os == 'macOS' + run: | + brew install libomp + echo "$(brew --prefix)/opt/llvm/bin" >> $GITHUB_PATH + echo "LDFLAGS=-L$(brew --prefix)/opt/libomp/lib -L$(brew --prefix)/opt/llvm/lib -Wl,-rpath,$(brew --prefix)/opt/llvm/lib" >> $GITHUB_ENV + NIMFLAGS="-d:LeopardCmakeFlags='-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$(brew --prefix)/opt/llvm/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix)/opt/llvm/bin/clang++' -d:LeopardExtraCompilerlags='-fopenmp' -d:LeopardExtraLinkerFlags='-fopenmp -L$(brew --prefix)/opt/libomp/lib'" + quote () { + local quoted=${1//\'/\'\\\'\'}; + printf "'%s'" "$quoted" + } + echo "NIMFLAGS=$(quote "${NIMFLAGS}")" >> $GITHUB_ENV - name: Restore MinGW-W64 (Windows) from cache if: runner.os == 'Windows' @@ -186,3 +204,12 @@ jobs: working-directory: nim-dagger run: | make testAll + if [[ ${{ runner.os }} = macOS ]]; then + echo + echo otool -L build/testDagger + otool -L build/testDagger + else + echo + echo ldd build/testDagger + ldd build/testDagger + fi diff --git a/.gitmodules b/.gitmodules index 8f312a04..a4d16568 100644 --- a/.gitmodules +++ b/.gitmodules @@ -175,3 +175,6 @@ url = https://github.com/status-im/nim-taskpools.git ignore = untracked branch = master +[submodule "vendor/nim-leopard"] + path = vendor/nim-leopard + url = https://github.com/status-im/nim-leopard.git diff --git a/config.nims b/config.nims index dfcb1f7a..d7ce9358 100644 --- a/config.nims +++ b/config.nims @@ -1,7 +1,9 @@ +import std/os + if defined(release): - switch("nimcache", "nimcache/release/$projectName") + switch("nimcache", joinPath(currentSourcePath.parentDir, "nimcache/release/$projectName")) else: - switch("nimcache", "nimcache/debug/$projectName") + switch("nimcache", joinPath(currentSourcePath.parentDir, "nimcache/debug/$projectName")) if defined(windows): # disable timestamps in Windows PE headers - https://wiki.debian.org/ReproducibleBuilds/TimestampsInPEBinaries diff --git a/vendor/nim-leopard b/vendor/nim-leopard new file mode 160000 index 00000000..41cd86df --- /dev/null +++ b/vendor/nim-leopard @@ -0,0 +1 @@ +Subproject commit 41cd86df5bfa67afe7d3660e8ab0878133c8600e