File tree Expand file tree Collapse file tree 3 files changed +56
-6
lines changed Expand file tree Collapse file tree 3 files changed +56
-6
lines changed Original file line number Diff line number Diff line change @@ -257,3 +257,53 @@ jobs:
257257 - name : Run tests
258258 timeout-minutes : 60
259259 run : cd build && ctest
260+
261+ cross_build :
262+ runs-on : ubuntu-22.04
263+
264+ strategy :
265+ fail-fast : false
266+ matrix :
267+ include :
268+ - target : mips64el
269+ triple : mips64el-linux-gnuabi64
270+ opts : DYNAMIC_ARCH=1
271+ - target : riscv64
272+ triple : riscv64-linux-gnu
273+ opts : TARGET=RISCV64_GENERIC
274+ - target : mipsel
275+ triple : mipsel-linux-gnu
276+ opts : TARGET=MIPS1004K
277+ - target : alpha
278+ triple : alpha-linux-gnu
279+ opts : TARGET=EV4
280+
281+ steps :
282+ - name : Checkout repository
283+ uses : actions/checkout@v3
284+
285+ - name : Install Dependencies
286+ run : |
287+ sudo apt-get install -y ccache gcc-${{ matrix.triple }} gfortran-${{ matrix.triple }} libgomp1-${{ matrix.target }}-cross
288+
289+ - name : Compilation cache
290+ uses : actions/cache@v3
291+ with :
292+ path : ~/.ccache
293+ key : ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
294+ restore-keys : |
295+ ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}
296+ ccache-${{ runner.os }}-${{ matrix.target }}
297+
298+ - name : Configure ccache
299+ run : |
300+ # Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota (5 GB).
301+ test -d ~/.ccache || mkdir -p ~/.ccache
302+ echo "max_size = 300M" > ~/.ccache/ccache.conf
303+ echo "compression = true" >> ~/.ccache/ccache.conf
304+ ccache -s
305+
306+
307+ - name : Build OpenBLAS
308+ run : |
309+ make -j$(nproc) HOSTCC="ccache gcc" CC="ccache ${{ matrix.triple }}-gcc" FC="ccache ${{ matrix.triple }}-gfortran" ARCH=${{ matrix.target }} ${{ matrix.opts }}
Original file line number Diff line number Diff line change @@ -60,9 +60,9 @@ all: getarch_2nd
6060 ./getarch_2nd 1 >> $(TARGET_CONF)
6161
6262$(TARGET_CONF): c_check$(SCRIPTSUFFIX) f_check$(SCRIPTSUFFIX) getarch
63- ./c_check$(SCRIPTSUFFIX) $(TARGET_MAKE) $(TARGET_CONF) $(CC) $(TARGET_FLAGS) $(CFLAGS)
63+ ./c_check$(SCRIPTSUFFIX) $(TARGET_MAKE) $(TARGET_CONF) " $(CC)" " $(TARGET_FLAGS) $(CFLAGS)"
6464ifneq ($(ONLY_CBLAS), 1)
65- ./f_check$(SCRIPTSUFFIX) $(TARGET_MAKE) $(TARGET_CONF) $(FC) $(TARGET_FLAGS)
65+ ./f_check$(SCRIPTSUFFIX) $(TARGET_MAKE) $(TARGET_CONF) " $(FC)" " $(TARGET_FLAGS)"
6666else
6767#When we only build CBLAS, we set NOFORTRAN=2
6868 echo "NOFORTRAN=2" >> $(TARGET_MAKE)
7777
7878
7979getarch : getarch.c cpuid.S dummy $(CPUIDEMU)
80- avx512=$$(./c_check$(SCRIPTSUFFIX) - - $(CC) $(TARGET_FLAGS) $(CFLAGS) | grep NO_AVX512); \
81- rv64gv=$$(./c_check$(SCRIPTSUFFIX) - - $(CC) $(TARGET_FLAGS) $(CFLAGS) | grep NO_RV64GV); \
80+ avx512=$$(./c_check$(SCRIPTSUFFIX) - - " $(CC)" " $(TARGET_FLAGS) $(CFLAGS)" | grep NO_AVX512); \
81+ rv64gv=$$(./c_check$(SCRIPTSUFFIX) - - " $(CC)" " $(TARGET_FLAGS) $(CFLAGS)" | grep NO_RV64GV); \
8282 $(HOSTCC) $(HOST_CFLAGS) $(EXFLAGS) $${avx512:+-D$${avx512}} $${rv64gv:+-D$${rv64gv}} -o $(@F) getarch.c cpuid.S $(CPUIDEMU)
8383
8484getarch_2nd : getarch_2nd.c $(TARGET_CONF) dummy
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ flags="$*"
3131
3232cross_suffix=" "
3333
34- if [ " ` dirname $compiler_name ` " != ' .' ]; then
35- cross_suffix=" $cross_suffix ` dirname $compiler_name ` /"
34+ if [ " ` dirname \" $compiler_name \" ` " != ' .' ]; then
35+ cross_suffix=" $cross_suffix ` dirname \" $compiler_name \" ` /"
3636fi
3737
3838bn=` basename $compiler_name `
You can’t perform that action at this time.
0 commit comments