Skip to content

Commit

Permalink
trying to fix py39
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Jan 19, 2024
1 parent d8deec3 commit 23b9596
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ REM set CC_LD=link
REM See the unix build.sh for more details on the build process below.
set MESON_ARGS=-Dincdir_numpy=%NP_INC% -Dpython_target=%PYTHON% %EXTRA_FLAGS%

python -m build -n -x -w .
%PYTHON% -m build -n -x -w .
REM %PYTHON% -m pip install --prefix "%PREFIX%" --no-deps dist/wisdem-3.9-py3-none-any.whl
REM %PYTHON% setup.py install --single-version-externally-managed --record=record.txt
REM pip install --prefix "%PREFIX%" --no-deps --no-index --find-links dist pyoptsparse
Expand Down
29 changes: 15 additions & 14 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,43 @@

set -eox pipefail

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$PREFIX/lib/pkgconfig:$BUILD_PREFIX/lib/pkgconfig
#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$PREFIX/lib/pkgconfig:$BUILD_PREFIX/lib/pkgconfig

EXTRA_FLAGS=""
NP_INC="${SP_DIR}/numpy/core/include/"
#EXTRA_FLAGS=""
#NP_INC="${SP_DIR}/numpy/core/include/"
echo "PYTHON TARGET=${PYTHON}"

if [ `uname` == Darwin ]; then
export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress"
fi

if [[ $CONDA_BUILD_CROSS_COMPILATION == "1" ]]; then
# Add pkg-config to cross-file binaries since meson will disable it
# See https://github.com/mesonbuild/meson/issues/7276
echo "pkg-config = '$(which pkg-config)'" >> "$BUILD_PREFIX"/meson_cross_file.txt
# Use Meson cross-file flag to enable cross compilation
EXTRA_FLAGS="--cross-file $BUILD_PREFIX/meson_cross_file.txt"
NP_INC=""
# Add pkg-config to cross-file binaries since meson will disable it
# See https://github.com/mesonbuild/meson/issues/7276
#echo "pkg-config = '$(which pkg-config)'" >> "$BUILD_PREFIX"/meson_cross_file.txt
# Use Meson cross-file flag to enable cross compilation
#EXTRA_FLAGS="--cross-file $BUILD_PREFIX/meson_cross_file.txt"
#NP_INC=""
export MESON_ARGS="-Dpython_target=${PYTHON} ${MESON_ARGS}"
fi

# This is done on two lines so that the command will return failure info if it fails
PKG_CONFIG=$(which pkg-config)
export PKG_CONFIG
#PKG_CONFIG=$(which pkg-config)
#export PKG_CONFIG


cd "${SRC_DIR}"
#cd "${SRC_DIR}"

# MESON_ARGS is used within setup.py to pass extra arguments to meson
# We need these so that dependencies on the build machine are not incorrectly used by meson when building for a different target
#export MESON_ARGS="-Dincdir_numpy=${NP_INC} -Dpython_target=${PYTHON} ${MESON_ARGS}"
export MESON_ARGS="-Dpython_target=${PYTHON} ${MESON_ARGS}"
#export MESON_ARGS="-Dpython_target=${PYTHON} ${MESON_ARGS}"

# We use this instead of pip install . because the way meson builds from within a conda-build process puts the build
# artifacts where pip install . can't find them. Here we explicitly build the wheel into the working director, wherever that is
# and then tell pip to install the wheel in the working directory. Also, python -m build is now the recommended way to build
# see https://packaging.python.org/en/latest/tutorials/packaging-projects/
python -m build -n -x -w .
$PYTHON -m build -n -x -w .
$PYTHON -m pip install --prefix "${PREFIX}" --no-deps dist/*.whl
#pip install --prefix "${PREFIX}" --no-deps --no-index --find-links dist pyoptsparse
#bin/rm -rf ${SP_DIR}/meson_build

0 comments on commit 23b9596

Please sign in to comment.