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

[BUILD] Fix VTA build in CI #5165

Merged
merged 1 commit into from
Mar 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion cmake/modules/VTA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ find_program(PYTHON NAMES python python3 python3.6)

# Throw error if VTA_HW_PATH is not set
if(NOT DEFINED ENV{VTA_HW_PATH})
set(ENV{VTA_HW_PATH} vta/vta-hw)
set(ENV{VTA_HW_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/vta/vta-hw)
endif()

if(MSVC)
Expand Down
2 changes: 1 addition & 1 deletion vta/python/vta/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_vta_hw_path():
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
vta_hw_default = os.path.abspath(os.path.join(curr_path, "../../vta-hw"))
VTA_HW_PATH = os.getenv('VTA_HW_PATH', vta_hw_default)
return VTA_HW_PATH
return os.path.abspath(VTA_HW_PATH)

def pkg_config(cfg):
"""Returns PkgConfig pkg config object."""
Expand Down
18 changes: 14 additions & 4 deletions vta/vta-hw/config/vta_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,21 @@ def main():
return

# Path to vta config
config_path = "vta_config.json"
if not os.path.exists(config_path):
raise RuntimeError("Cannot find config in %s" % str(config_path))
cfg = json.load(open(config_path))
curr_path = os.path.dirname(
os.path.abspath(os.path.expanduser(__file__)))

path_list = [
"vta_config.json", os.path.join(curr_path, "vta_config.json")
]

if args.use_cfg:
path_list = [args.use_cfg]

ok_path_list = [p for p in path_list if os.path.exists(p)]
if not ok_path_list:
raise RuntimeError("Cannot find config in %s" % str(path_list))

cfg = json.load(open(ok_path_list[0]))
pkg = pkg_config(cfg)

if args.target:
Expand Down