Skip to content

Commit bf20470

Browse files
authored
Add alternative URLs for cmake deps (#67)
* Add alternative URLs for cmake deps * add missing files
1 parent 9fdc43d commit bf20470

5 files changed

Lines changed: 56 additions & 11 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ project(kaldifeat)
77
# remember to change the version in
88
# scripts/conda/kaldifeat/meta.yaml
99
# scripts/conda-cpu/kaldifeat/meta.yaml
10-
set(kaldifeat_VERSION "1.22")
10+
set(kaldifeat_VERSION "1.23")
1111

1212
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
1313
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")

cmake/googletest.cmake

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,44 @@ function(download_googltest)
2424

2525
include(FetchContent)
2626

27-
set(googletest_URL "https://github.com/google/googletest/archive/release-1.10.0.tar.gz")
28-
set(googletest_HASH "SHA256=9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb")
27+
set(googletest_URL "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz")
28+
set(googletest_URL2 "https://huggingface.co/csukuangfj/k2-cmake-deps/resolve/main/googletest-1.13.0.tar.gz")
29+
set(googletest_HASH "SHA256=ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363")
30+
31+
# If you don't have access to the Internet,
32+
# please pre-download googletest
33+
set(possible_file_locations
34+
$ENV{HOME}/Downloads/googletest-1.13.0.tar.gz
35+
${PROJECT_SOURCE_DIR}/googletest-1.13.0.tar.gz
36+
${PROJECT_BINARY_DIR}/googletest-1.13.0.tar.gz
37+
/tmp/googletest-1.13.0.tar.gz
38+
/star-fj/fangjun/download/github/googletest-1.13.0.tar.gz
39+
)
40+
41+
foreach(f IN LISTS possible_file_locations)
42+
if(EXISTS ${f})
43+
set(googletest_URL "${f}")
44+
file(TO_CMAKE_PATH "${googletest_URL}" googletest_URL)
45+
set(googletest_URL2)
46+
break()
47+
endif()
48+
endforeach()
2949

3050
set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
3151
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
3252
set(gtest_disable_pthreads ON CACHE BOOL "" FORCE)
3353
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
3454

3555
FetchContent_Declare(googletest
36-
URL ${googletest_URL}
56+
URL
57+
${googletest_URL}
58+
${googletest_URL2}
3759
URL_HASH ${googletest_HASH}
3860
)
3961

4062
FetchContent_GetProperties(googletest)
4163
if(NOT googletest_POPULATED)
42-
message(STATUS "Downloading googletest")
64+
message(STATUS "Downloading googletest from ${googletest_URL}")
4365
FetchContent_Populate(googletest)
4466
endif()
4567
message(STATUS "googletest is downloaded to ${googletest_SOURCE_DIR}")

cmake/pybind11.cmake

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,40 @@ function(download_pybind11)
88

99
include(FetchContent)
1010

11-
set(pybind11_URL "https://github.com/pybind/pybind11/archive/v2.9.2.tar.gz")
12-
set(pybind11_HASH "SHA256=6bd528c4dbe2276635dc787b6b1f2e5316cf6b49ee3e150264e455a0d68d19c1")
11+
# latest commit as of 2022.10.31 that supports python 3.11
12+
set(pybind11_URL "https://github.com/pybind/pybind11/archive/5bc0943ed96836f46489f53961f6c438d2935357.zip")
13+
set(pybind11_URL2 "https://huggingface.co/csukuangfj/k2-cmake-deps/resolve/main/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip")
14+
set(pybind11_HASH "SHA256=ff65a1a8c9e6ceec11e7ed9d296f2e22a63e9ff0c4264b3af29c72b4f18f25a0")
15+
16+
# If you don't have access to the Internet,
17+
# please pre-download pybind11
18+
set(possible_file_locations
19+
$ENV{HOME}/Downloads/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
20+
${PROJECT_SOURCE_DIR}/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
21+
${PROJECT_BINARY_DIR}/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
22+
/tmp/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
23+
/star-fj/fangjun/download/github/pybind11-5bc0943ed96836f46489f53961f6c438d2935357.zip
24+
)
25+
26+
foreach(f IN LISTS possible_file_locations)
27+
if(EXISTS ${f})
28+
set(pybind11_URL "${f}")
29+
file(TO_CMAKE_PATH "${pybind11_URL}" pybind11_URL)
30+
set(pybind11_URL2)
31+
break()
32+
endif()
33+
endforeach()
1334

1435
FetchContent_Declare(pybind11
15-
URL ${pybind11_URL}
36+
URL
37+
${pybind11_URL}
38+
${pybind11_URL2}
1639
URL_HASH ${pybind11_HASH}
1740
)
1841

1942
FetchContent_GetProperties(pybind11)
2043
if(NOT pybind11_POPULATED)
21-
message(STATUS "Downloading pybind11")
44+
message(STATUS "Downloading pybind11 from ${pybind11_URL}")
2245
FetchContent_Populate(pybind11)
2346
endif()
2447
message(STATUS "pybind11 is downloaded to ${pybind11_SOURCE_DIR}")

scripts/conda-cpu/kaldifeat/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: kaldifeat
3-
version: "1.22"
3+
version: "1.23"
44

55
source:
66
path: "{{ environ.get('KALDIFEAT_ROOT_DIR') }}"

scripts/conda/kaldifeat/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: kaldifeat
3-
version: "1.22"
3+
version: "1.23"
44

55
source:
66
path: "{{ environ.get('KALDIFEAT_ROOT_DIR') }}"

0 commit comments

Comments
 (0)