summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuveer Devulapalli <raghuveer.devulapalli@intel.com>2023-03-12 11:43:45 -0700
committerGitHub <noreply@github.com>2023-03-12 18:43:45 +0000
commit6e34d87c613557a428da13cce5fb8e8738086a78 (patch)
tree5f9ce04da46b8f8c5d0fe14d7432f7eca0c922f0
parent89d64415e349ca75a25250f22b874aa16e5c0973 (diff)
downloadnumpy-6e34d87c613557a428da13cce5fb8e8738086a78.tar.gz
BLD: Check for submodules before build (#23372)
- DOC: update git clone command in doc to initialize submodules - BLD: Check for submodules before building - CI: update meson.build check and Cirrus for new git submodule [skip ci] Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
-rw-r--r--doc/source/dev/index.rst4
-rw-r--r--numpy/core/meson.build3
-rw-r--r--numpy/core/setup.py16
-rw-r--r--tools/ci/cirrus_general.yml4
4 files changed, 18 insertions, 9 deletions
diff --git a/doc/source/dev/index.rst b/doc/source/dev/index.rst
index 55f5ce99a..bd3595741 100644
--- a/doc/source/dev/index.rst
+++ b/doc/source/dev/index.rst
@@ -45,7 +45,7 @@ Here's the short summary, complete TOC links are below:
* Clone the project to your local computer::
- git clone https://github.com/your-username/numpy.git
+ git clone --recurse-submodules https://github.com/your-username/numpy.git
* Change the directory::
@@ -180,7 +180,7 @@ Guidelines
get no response to your pull request within a week.
.. _stylistic-guidelines:
-
+
Stylistic Guidelines
--------------------
diff --git a/numpy/core/meson.build b/numpy/core/meson.build
index 646dc0597..9aaa5ed87 100644
--- a/numpy/core/meson.build
+++ b/numpy/core/meson.build
@@ -83,6 +83,9 @@ if use_svml
error('Missing the `SVML` git submodule! Run `git submodule update --init` to fix this.')
endif
endif
+if not fs.exists('src/npysort/x86-simd-sort/README.md')
+ error('Missing the `x86-simd-sort` git submodule! Run `git submodule update --init` to fix this.')
+endif
# Check sizes of types. Note, some of these landed in config.h before, but were
# unused. So clean that up and only define the NPY_SIZEOF flavors rather than
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 77e1ebf99..52b17bfc8 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -79,11 +79,13 @@ def can_link_svml():
and "linux" in platform
and sys.maxsize > 2**31)
-def check_svml_submodule(svmlpath):
- if not os.path.exists(svmlpath + "/README.md"):
- raise RuntimeError("Missing `SVML` submodule! Run `git submodule "
- "update --init` to fix this.")
- return True
+def check_git_submodules():
+ out = os.popen("git submodule status")
+ modules = out.readlines()
+ for submodule in modules:
+ if (submodule.strip()[0] == "-"):
+ raise RuntimeError("git submodules are not initialized."
+ "Please run `git submodule update --init` to fix this.")
def pythonlib_dir():
"""return path where libpython* is."""
@@ -414,6 +416,8 @@ def configuration(parent_package='',top_path=None):
# actual C API VERSION. Will raise a MismatchCAPIError if so.
check_api_version(C_API_VERSION, codegen_dir)
+ check_git_submodules()
+
generate_umath_py = join(codegen_dir, 'generate_umath.py')
n = dot_join(config.name, 'generate_umath')
generate_umath = exec_mod_from_location('_'.join(n.split('.')),
@@ -1036,7 +1040,7 @@ def configuration(parent_package='',top_path=None):
# after all maintainable code.
svml_filter = (
)
- if can_link_svml() and check_svml_submodule(svml_path):
+ if can_link_svml():
svml_objs = glob.glob(svml_path + '/**/*.s', recursive=True)
svml_objs = [o for o in svml_objs if not o.endswith(svml_filter)]
diff --git a/tools/ci/cirrus_general.yml b/tools/ci/cirrus_general.yml
index 95e42d334..c21bfd615 100644
--- a/tools/ci/cirrus_general.yml
+++ b/tools/ci/cirrus_general.yml
@@ -6,7 +6,6 @@ build_and_store_wheels: &BUILD_AND_STORE_WHEELS
wheels_artifacts:
path: "wheelhouse/*"
-
######################################################################
# Build linux_aarch64 natively
######################################################################
@@ -24,11 +23,14 @@ linux_aarch64_task:
# single task takes longer than 60 mins (the default time limit for a
# cirrus-ci task).
- env:
+ CIRRUS_CLONE_SUBMODULES: true
CIBW_BUILD: cp39-*
EXPECT_CPU_FEATURES: NEON NEON_FP16 NEON_VFPV4 ASIMD ASIMDHP ASIMDDP ASIMDFHM
- env:
+ CIRRUS_CLONE_SUBMODULES: true
CIBW_BUILD: cp310-*
- env:
+ CIRRUS_CLONE_SUBMODULES: true
CIBW_BUILD: cp311-*
build_script: |