From 5d857bd3cf7496addeff23af23084320b74a6e47 Mon Sep 17 00:00:00 2001 From: Lalit Sharma Date: Mon, 29 Mar 2021 00:39:53 -0700 Subject: [PATCH] Updating script to fix CI issue --- .github/workflows/build.yml | 4 ++-- CMakeLists.txt | 23 ++++++----------------- openfpga.sh | 4 ++++ 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bafc9e1c..fc388e3d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -134,11 +134,11 @@ jobs: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE - name: Build - working-directory: build + #working-directory: build shell: bash # Execute the build. You can specify a specific target with "--target " run: | - source ../openfpga.sh && cmake --build . --config $BUILD_TYPE + source openfpga.sh && cmake --build build --config $BUILD_TYPE # Check the cache size and see if it is over the limit - name: Check ccache size diff --git a/CMakeLists.txt b/CMakeLists.txt index b27539343..bfb7ca6a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,33 +231,22 @@ include(CheckCXXCompilerFlag) # run makefile provided, we pass-on the options to the local make file add_custom_target( yosys ALL - COMMAND rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/yosys/install + COMMAND rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/yosys/install COMMAND $(MAKE) config-gcc COMMAND $(MAKE) install PREFIX=${CMAKE_CURRENT_SOURCE_DIR}/yosys/install WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/yosys - COMMENT "Compile Yosys with given Makefile: ${CMAKE_CURRENT_SOURCE_DIR}/yosys/install" + COMMENT "Compile Yosys with given Makefile" ) # yosys compilation ends # yosys-plugins compilation starts -add_custom_target( - YosysVariables ALL ${CMAKE_COMMAND} - -D YOSYS_INSTALL=${CMAKE_CURRENT_SOURCE_DIR}/yosys/install - -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/YosysVars.cmake - COMMENT "Getting Yosys variables to use in yosys-plugins build: ${YS_CXX}" -) -add_dependencies(YosysVariables yosys) - -# run makefile provided, we pass-on the options to the local make file add_custom_target( yosys-plugins ALL - COMMAND $(MAKE) CXX=${YS_CXX} CXXFLAGS=${YS_CXXFLAGS} LDFLAGS=${YS_LDFLAGS} - LDLIBS=${YS_LDLIBS} PLUGINS_DIR=${YS_DATA_DIR}/plugins DATA_DIR=${YS_DATA_DIR} - COMMAND $(MAKE) install CXX=${YS_CXX} CXXFLAGS=${YS_CXXFLAGS} LDFLAGS=${YS_LDFLAGS} - LDLIBS=${YS_LDLIBS} PLUGINS_DIR=${YS_DATA_DIR}/plugins DATA_DIR=${YS_DATA_DIR} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/yosys-plugins - COMMENT "Compile Yosys-plugins with given Makefile: ${YS_CXX}" + COMMAND $(MAKE) + COMMAND $(MAKE) install + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/yosys-plugins + COMMENT "Compile Yosys-plugins with given Makefile" ) #add_dependencies(yosys-plugins yosys ) #YosysVariables) diff --git a/openfpga.sh b/openfpga.sh index f0ab701ee..f0180cdcc 100755 --- a/openfpga.sh +++ b/openfpga.sh @@ -16,6 +16,10 @@ export OPENFPGA_SCRIPT_PATH="${OPENFPGA_PATH}/openfpga_flow/scripts" export OPENFPGA_TASK_PATH="${OPENFPGA_PATH}/openfpga_flow/tasks" if [ -z $PYTHON_EXEC ]; then export PYTHON_EXEC="python3"; fi +# Add yosys bin folder in PATH, this is required by yosys-plugins +# to install plugins in yosys folder +export PATH="${OPENFPGA_PATH}/yosys/install/bin:${PATH}" + # This function checks the path and # raises warning if the command is not executing # inside current OpendFPGA folder