From 2f95976074be699c0c84fd3ff238662d57dfe6d6 Mon Sep 17 00:00:00 2001 From: bahugo Date: Tue, 19 Mar 2024 12:20:10 +0100 Subject: [PATCH 01/40] Added version 9.12.0 --- .github/workflows/stable.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 9d33cb3..66e371a 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: [9.11.0] + version: [9.11.0, 9.12.0] abi: [cp38, cp39, cp310, cp311] steps: - uses: actions/checkout@v3 @@ -37,22 +37,22 @@ jobs: windows: runs-on: windows-latest permissions: - contents: write + contents: write strategy: matrix: include: - abi: cp38 python-version: '3.8' - version: 9.11.0 + version: [9.11.0, 9.12.0] - abi: cp39 python-version: '3.9' - version: 9.11.0 + version: [9.11.0, 9.12.0] - abi: cp310 python-version: '3.10' - version: 9.11.0 + version: [9.11.0, 9.12.0] - abi: cp311 python-version: '3.11' - version: 9.11.0 + version: [9.11.0, 9.12.0] steps: - uses: actions/checkout@v3 From 0007b88f439d9f46bffae8fe46758c8502d166e0 Mon Sep 17 00:00:00 2001 From: bahugo Date: Tue, 19 Mar 2024 13:54:01 +0100 Subject: [PATCH 02/40] Added Requires-Python to METADATA.in --- METADATA.in | 1 + 1 file changed, 1 insertion(+) diff --git a/METADATA.in b/METADATA.in index 83d7a02..cbd18da 100644 --- a/METADATA.in +++ b/METADATA.in @@ -17,6 +17,7 @@ Classifier: Programming Language :: C Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Scientific/Engineering :: Physics Classifier: Intended Audience :: Science/Research +Requires-Python: >=3.8 Requires-Dist: numpy Powerful library to manipulate meshes and fields from SALOME platform From 8540a53ccf5fdde26351264348e2e4fc2fbe0300 Mon Sep 17 00:00:00 2001 From: bahugo Date: Tue, 19 Mar 2024 13:59:23 +0100 Subject: [PATCH 03/40] Fixed matix in github action --- .github/workflows/stable.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 66e371a..ec2aae9 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -40,19 +40,16 @@ jobs: contents: write strategy: matrix: + version: [9.11.0, 9.12.0] include: - abi: cp38 python-version: '3.8' - version: [9.11.0, 9.12.0] - abi: cp39 python-version: '3.9' - version: [9.11.0, 9.12.0] - abi: cp310 python-version: '3.10' - version: [9.11.0, 9.12.0] - abi: cp311 python-version: '3.11' - version: [9.11.0, 9.12.0] steps: - uses: actions/checkout@v3 From 10fe12fa449daa6fe9cefce56e1cadd553aa16ca Mon Sep 17 00:00:00 2001 From: bahugo Date: Thu, 21 Mar 2024 15:35:31 +0100 Subject: [PATCH 04/40] Adds write_distinfo python script --- METADATA.in | 2 +- build-wheels-linux.sh | 15 ++++----- build-wheels-windows.bat | 33 +++++++++++-------- write_distinfo.py | 69 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 23 deletions(-) create mode 100644 write_distinfo.py diff --git a/METADATA.in b/METADATA.in index cbd18da..b1fa78c 100644 --- a/METADATA.in +++ b/METADATA.in @@ -1,5 +1,5 @@ Metadata-Version: 2.0 -Name: medcoupling +Name: @PACKAGE_NAME@ Version: @PACKAGE_VERSION@ Summary: Powerful library to manipulate meshes and fields Home-page: https://www.salome-platform.org/downloads diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 1355406..cd91ce5 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -3,7 +3,7 @@ set -e -x test $# = 2 || exit 1 - +PKGNAME="medcoupling" VERSION="$1" ABI="$2" @@ -45,21 +45,18 @@ cd install/lib/python*/site-packages rm -rf __pycache__ # write metadata -mkdir medcoupling-${VERSION}.dist-info -sed "s|@PACKAGE_VERSION@|${VERSION}|g" ${SCRIPTPATH}/METADATA.in > medcoupling-${VERSION}.dist-info/METADATA -echo -e "Wheel-Version: 1.0" > medcoupling-${VERSION}.dist-info/WHEEL -for f in `find *.py *.so medcoupling-${VERSION}.dist-info -type f`; do echo "$f,," >> medcoupling-${VERSION}.dist-info/RECORD ; done +python ${SCRIPTPATH}/write_distinfo.py ${PKGNAME} ${VERSION} ${TAG} # create archive -zip -r medcoupling-${VERSION}-${TAG}.whl *.py *.so medcoupling-${VERSION}.dist-info +zip -r ${PKGNAME}-${VERSION}-${TAG}.whl *.py *.so ${PKGNAME}-${VERSION}.dist-info -auditwheel show medcoupling-${VERSION}-${TAG}.whl -auditwheel repair medcoupling-${VERSION}-${TAG}.whl -w /io/wheelhouse/ +auditwheel show ${PKGNAME}-${VERSION}-${TAG}.whl +auditwheel repair ${PKGNAME}-${VERSION}-${TAG}.whl -w /io/wheelhouse/ # test cd /tmp pip uninstall -y scipy -pip install medcoupling --pre --no-index -f /io/wheelhouse +pip install ${PKGNAME} --pre --no-index -f /io/wheelhouse python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()" python -c "import medcoupling as mc; print(mc.MEDCouplingHasNumPyBindings())" python -c "import medcoupling as mc; print(mc.MEDCouplingHasSciPyBindings())" diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index a3c913d..3053157 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -1,12 +1,21 @@ @echo on + +set PKGNAME="medcoupling" set VERSION=%1% set ABI=%2% set PY_VER=%ABI:~2,1%.%ABI:~3% +set PLATFORM="win_amd64" +set PYTAG=%ABI% +set TAG="%PYTAG%-%ABI%-%PLATFORM%" echo "ABI=%ABI%" echo "PY_VER=%PY_VER%" +echo "PLATFORM=%PLATFORM%" +echo "PYTAG=%PYTAG%" +echo "TAG=%TAG%" echo "PATH=%PATH%" +set DEST_FOLDER="C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages" set PYTHON_ROOT=%pythonLocation% python --version @@ -101,22 +110,20 @@ cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=C:/Librari cmake --build build_medcoupling --config Release --target install :: build wheel -xcopy /y C:\Libraries\libxml2\bin\*.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages -xcopy /y C:\Libraries\hdf5\bin\hdf5.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages -xcopy /y C:\Libraries\med\lib\medC.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages -xcopy /y C:\Libraries\medcoupling\lib\*.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages -rem xcopy /y C:\Libraries\boost\lib\*.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages +xcopy /y C:\Libraries\libxml2\bin\*.dll %DEST_FOLDER% +xcopy /y C:\Libraries\hdf5\bin\hdf5.dll %DEST_FOLDER% +xcopy /y C:\Libraries\med\lib\medC.dll %DEST_FOLDER% +xcopy /y C:\Libraries\medcoupling\lib\*.dll %DEST_FOLDER% +rem xcopy /y C:\Libraries\boost\lib\*.dll %DEST_FOLDER% curl -LO https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release_.without.peview.exe.zip 7z x Dependencies_x64_Release_.without.peview.exe.zip -Dependencies.exe -modules C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages\_medcoupling.pyd - -pushd C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages -mkdir medcoupling-%VERSION%.dist-info -sed "s|@PACKAGE_VERSION@|%VERSION%|g" %GITHUB_WORKSPACE%\METADATA.in > medcoupling-%VERSION%.dist-info\METADATA -type medcoupling-%VERSION%.dist-info\METADATA -echo Wheel-Version: 1.0 > medcoupling-%VERSION%.dist-info\WHEEL -echo medcoupling-%VERSION%.dist-info\RECORD,, > medcoupling-%VERSION%.dist-info\RECORD +Dependencies.exe -modules %DEST_FOLDER%\_medcoupling.pyd + +pushd %DEST_FOLDER% + +python .\write_distinfo.py %DEST_FOLDER% %PKGNAME% %VERSION% %TAG% + mkdir %GITHUB_WORKSPACE%\wheelhouse 7z a -tzip %GITHUB_WORKSPACE%\wheelhouse\medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl *.py *.pyd *.dll medcoupling-%VERSION%.dist-info pip install %GITHUB_WORKSPACE%\wheelhouse\medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl diff --git a/write_distinfo.py b/write_distinfo.py new file mode 100644 index 0000000..e8294fd --- /dev/null +++ b/write_distinfo.py @@ -0,0 +1,69 @@ +import hashlib +import base64 +import sys +from pathlib import Path + +def main(base_folder: str, package_name: str, version: str, tag: str): + """ +Creates a dist-info directory in the current working directory, +Copies the METADATA.in file in the dist-info directory, +replaces @PACKAGE_VERSION@ by version and @PACKAGE_NAME@ by name +Creates RECORD and WHEEL files + """ + base_folder_path = Path(base_folder) + + if not base_folder_path.exists(): + raise NotADirectoryError(f"base_folder {base_folder} is not a directory") + + dist_info_folder = base_folder_path / f"{package_name}-{version}.dist-info" + if not dist_info_folder.exists(): + dist_info_folder.mkdir() + + metadata_file = Path("METADATA.in") + if not metadata_file.exists(): + raise FileNotFoundError(f"Missing {metadata_file}") + + copy_metadata_file = dist_info_folder / metadata_file + with metadata_file.open("r") as forigin: + with copy_metadata_file.open("w") as ftarget: + for line in forigin: + ftarget.write( + line + .replace("@PACKAGE_VERSION@", version) + .replace("@PACKAGE_NAME@", package_name) + ) + + path = dist_info_folder / "RECORD" + with path.open("w") as record: + for subdir in [base_folder_path, path]: + for fpath in subdir.iterdir(): + if not fpath.is_file(): + continue + + if fpath.name == "RECORD": + record.write(f"{str(fpath)},,\n") + continue + + with fpath.open("rb") as file_tmp: + data = file_tmp.read() + + digest = hashlib.sha256(data).digest() + size = len(data) + + checksum = base64.urlsafe_b64encode(digest).decode() + record.write(f"{fpath},sha256={checksum},{size}\n") + + path = dist_info_folder / "WHEEL" + with path.open("w") as wheel: + wheel.write("Wheel-Version: 1.0\n") + wheel.write("Generator: custom\n") + wheel.write("Root-Is-Purelib: false\n") + wheel.write(f"Tag: {tag}\n") + + +if __name__ == "__main__": + if len(sys.argv) != 5: + raise ValueError("no name/version/tag") + base_folder, name, version, tag = sys.argv[1:] + main(base_folder=base_folder, package_name=name, version=version, tag=tag) + From 582bdfabd1fd88d81aa791b5f7fb134dd2ffc1cb Mon Sep 17 00:00:00 2001 From: bahugo Date: Thu, 18 Apr 2024 15:34:16 +0200 Subject: [PATCH 05/40] Updated med-file download link --- build-wheels-linux.sh | 5 +++-- build-wheels-windows.bat | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index cd91ce5..31f95d3 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -19,8 +19,9 @@ export PATH=/opt/python/${PYTAG}-${ABI}/bin/:$PATH cd /tmp # med -MED_VERSION=4.1.1 -curl -fSsL https://files.salome-platform.org/Salome/other/med-${MED_VERSION}.tar.gz | tar xz +MED_VERSION=5.0.0 +# The download link changed (it's generated after filing a form on salome website) +curl -fSsL https://www.salome-platform.org/?sdm_process_download=1&download_id=2540 | tar xz cmake -S med-${MED_VERSION}_SRC -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 3053157..faaf4b5 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -84,8 +84,9 @@ cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=C:/Libraries/hdf5 -DBUIL cmake --build build_hdf5 --config Release --target install :: med -set "MED_VERSION=4.1.1" -curl -LO https://files.salome-platform.org/Salome/other/med-%MED_VERSION%.tar.gz +set "MED_VERSION=5.0.0" +REM The download link changed (it's generated after filing a form on salome website) +curl -LO https://www.salome-platform.org/?sdm_process_download=1&download_id=2540 7z x med-%MED_VERSION%.tar.gz > nul 7z x med-%MED_VERSION%.tar > nul cmake -LAH -S med-%MED_VERSION%_SRC -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ From 5d56e1e58cb026a8ee740af75acb62a8007877ff Mon Sep 17 00:00:00 2001 From: bahugo Date: Thu, 18 Apr 2024 16:08:05 +0200 Subject: [PATCH 06/40] Corrected salome link --- build-wheels-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 31f95d3..6eeb339 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -21,7 +21,7 @@ cd /tmp # med MED_VERSION=5.0.0 # The download link changed (it's generated after filing a form on salome website) -curl -fSsL https://www.salome-platform.org/?sdm_process_download=1&download_id=2540 | tar xz +curl -fSsL "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" | tar xz cmake -S med-${MED_VERSION}_SRC -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON From b719bafca78c685a738d2f34d61fe3f148924f42 Mon Sep 17 00:00:00 2001 From: bahugo Date: Thu, 18 Apr 2024 19:01:04 +0200 Subject: [PATCH 07/40] Updated med-file download link --- build-wheels-linux.sh | 2 +- build-wheels-windows.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 6eeb339..6c9b9b7 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -21,7 +21,7 @@ cd /tmp # med MED_VERSION=5.0.0 # The download link changed (it's generated after filing a form on salome website) -curl -fSsL "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" | tar xz +curl -fSsL https://www.salome-platform.org/?sdm_downloads=med-$MED_VERSION-tar-bz2 | tar xz cmake -S med-${MED_VERSION}_SRC -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index faaf4b5..508dd7e 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -86,7 +86,7 @@ cmake --build build_hdf5 --config Release --target install :: med set "MED_VERSION=5.0.0" REM The download link changed (it's generated after filing a form on salome website) -curl -LO https://www.salome-platform.org/?sdm_process_download=1&download_id=2540 +curl -LO https://www.salome-platform.org/?sdm_downloads=med-%MED_VERSION%-tar-bz2 7z x med-%MED_VERSION%.tar.gz > nul 7z x med-%MED_VERSION%.tar > nul cmake -LAH -S med-%MED_VERSION%_SRC -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ From b0e6e13916e217e7f204043899e5d5f28c02ae28 Mon Sep 17 00:00:00 2001 From: bahugo Date: Thu, 18 Apr 2024 19:37:05 +0200 Subject: [PATCH 08/40] Updated link --- build-wheels-linux.sh | 2 +- build-wheels-windows.bat | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 6c9b9b7..d9e7fee 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -21,7 +21,7 @@ cd /tmp # med MED_VERSION=5.0.0 # The download link changed (it's generated after filing a form on salome website) -curl -fSsL https://www.salome-platform.org/?sdm_downloads=med-$MED_VERSION-tar-bz2 | tar xz +curl -fSsL "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-$MED_VERSION.tar.bz2 | tar xz cmake -S med-${MED_VERSION}_SRC -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 508dd7e..681952f 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -86,8 +86,8 @@ cmake --build build_hdf5 --config Release --target install :: med set "MED_VERSION=5.0.0" REM The download link changed (it's generated after filing a form on salome website) -curl -LO https://www.salome-platform.org/?sdm_downloads=med-%MED_VERSION%-tar-bz2 -7z x med-%MED_VERSION%.tar.gz > nul +curl -LO "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-%MED_VERSION%.tar.bz2 +7z x med-%MED_VERSION%.tar.bz2 > nul 7z x med-%MED_VERSION%.tar > nul cmake -LAH -S med-%MED_VERSION%_SRC -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF From 1009c2b7c7b78346fe20f3659baec4b546412fad Mon Sep 17 00:00:00 2001 From: bahugo Date: Thu, 18 Apr 2024 19:51:02 +0200 Subject: [PATCH 09/40] updated unzip --- build-wheels-linux.sh | 2 +- build-wheels-windows.bat | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index d9e7fee..7c60c3a 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -21,7 +21,7 @@ cd /tmp # med MED_VERSION=5.0.0 # The download link changed (it's generated after filing a form on salome website) -curl -fSsL "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-$MED_VERSION.tar.bz2 | tar xz +curl -fSsL "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-$MED_VERSION.tar.bz2 | tar -xf cmake -S med-${MED_VERSION}_SRC -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 681952f..457cb20 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -87,6 +87,7 @@ cmake --build build_hdf5 --config Release --target install set "MED_VERSION=5.0.0" REM The download link changed (it's generated after filing a form on salome website) curl -LO "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-%MED_VERSION%.tar.bz2 +dir 7z x med-%MED_VERSION%.tar.bz2 > nul 7z x med-%MED_VERSION%.tar > nul cmake -LAH -S med-%MED_VERSION%_SRC -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ From f02ba559ea5d62b314f7a9b3580268e90e5ddd8c Mon Sep 17 00:00:00 2001 From: bahugo Date: Thu, 18 Apr 2024 20:07:20 +0200 Subject: [PATCH 10/40] Modified extraction on linux --- build-wheels-linux.sh | 3 ++- build-wheels-windows.bat | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 7c60c3a..e1d5e86 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -21,7 +21,8 @@ cd /tmp # med MED_VERSION=5.0.0 # The download link changed (it's generated after filing a form on salome website) -curl -fSsL "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-$MED_VERSION.tar.bz2 | tar -xf +curl -fSsL "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-$MED_VERSION.tar.bz2 +tar -xf med-$MED_VERSION.tar.bz2 cmake -S med-${MED_VERSION}_SRC -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 457cb20..3aaf814 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -86,10 +86,14 @@ cmake --build build_hdf5 --config Release --target install :: med set "MED_VERSION=5.0.0" REM The download link changed (it's generated after filing a form on salome website) +echo "downloading med" curl -LO "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-%MED_VERSION%.tar.bz2 +echo "ended downloading med" dir +echo "extracting med" 7z x med-%MED_VERSION%.tar.bz2 > nul 7z x med-%MED_VERSION%.tar > nul +echo "end extracting med" cmake -LAH -S med-%MED_VERSION%_SRC -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF cmake --build build_med --config Release --target install From b641aad9cd7daf2bbbdbc46804d88e3d3fdbdee8 Mon Sep 17 00:00:00 2001 From: bahugo Date: Thu, 18 Apr 2024 20:32:19 +0200 Subject: [PATCH 11/40] Found direct link for med --- build-wheels-linux.sh | 2 +- build-wheels-windows.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index e1d5e86..17308db 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -21,7 +21,7 @@ cd /tmp # med MED_VERSION=5.0.0 # The download link changed (it's generated after filing a form on salome website) -curl -fSsL "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-$MED_VERSION.tar.bz2 +curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.bz2 tar -xf med-$MED_VERSION.tar.bz2 cmake -S med-${MED_VERSION}_SRC -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 3aaf814..2d44e84 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -87,7 +87,7 @@ cmake --build build_hdf5 --config Release --target install set "MED_VERSION=5.0.0" REM The download link changed (it's generated after filing a form on salome website) echo "downloading med" -curl -LO "https://www.salome-platform.org/?sdm_process_download=1&download_id=2540" --output med-%MED_VERSION%.tar.bz2 +curl -LO https://files.salome-platform.org/Salome/medfile/med-%MED_VERSION%.tar.bz2 echo "ended downloading med" dir echo "extracting med" From 29215071f068f643160ebad442753e18efd60310 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 10:07:04 +0200 Subject: [PATCH 12/40] Modified extraction --- build-wheels-linux.sh | 3 +-- build-wheels-windows.bat | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 17308db..ff3c93e 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -21,8 +21,7 @@ cd /tmp # med MED_VERSION=5.0.0 # The download link changed (it's generated after filing a form on salome website) -curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.bz2 -tar -xf med-$MED_VERSION.tar.bz2 +curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.bz2 | tar -xf cmake -S med-${MED_VERSION}_SRC -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 2d44e84..792f10a 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -94,6 +94,7 @@ echo "extracting med" 7z x med-%MED_VERSION%.tar.bz2 > nul 7z x med-%MED_VERSION%.tar > nul echo "end extracting med" +dir cmake -LAH -S med-%MED_VERSION%_SRC -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF cmake --build build_med --config Release --target install From af736f980b9f38ffd924be5845d3e4b94a86fec1 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 10:48:32 +0200 Subject: [PATCH 13/40] Fixed extraction on linux --- build-wheels-linux.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index ff3c93e..1bac12f 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -6,6 +6,8 @@ test $# = 2 || exit 1 PKGNAME="medcoupling" VERSION="$1" ABI="$2" +# med +MED_VERSION=5.0.0 PLATFORM=manylinux2014_x86_64 PYTAG=${ABI/m/} @@ -18,11 +20,9 @@ export PATH=/opt/python/${PYTAG}-${ABI}/bin/:$PATH cd /tmp -# med -MED_VERSION=5.0.0 # The download link changed (it's generated after filing a form on salome website) -curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.bz2 | tar -xf -cmake -S med-${MED_VERSION}_SRC -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ +curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.bz2 | tar xj +cmake -S med-${MED_VERSION} -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON cmake --build build_med --target install From dcef02d4469b3046dff2238ceec2de89dc39e94e Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 10:50:20 +0200 Subject: [PATCH 14/40] Fixed folder name in .bat compilation --- build-wheels-windows.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 792f10a..d838e39 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -3,6 +3,7 @@ set PKGNAME="medcoupling" set VERSION=%1% set ABI=%2% +set "MED_VERSION=5.0.0" set PY_VER=%ABI:~2,1%.%ABI:~3% set PLATFORM="win_amd64" set PYTAG=%ABI% @@ -84,7 +85,6 @@ cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=C:/Libraries/hdf5 -DBUIL cmake --build build_hdf5 --config Release --target install :: med -set "MED_VERSION=5.0.0" REM The download link changed (it's generated after filing a form on salome website) echo "downloading med" curl -LO https://files.salome-platform.org/Salome/medfile/med-%MED_VERSION%.tar.bz2 @@ -95,7 +95,7 @@ echo "extracting med" 7z x med-%MED_VERSION%.tar > nul echo "end extracting med" dir -cmake -LAH -S med-%MED_VERSION%_SRC -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ +cmake -LAH -S med-%MED_VERSION% -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF cmake --build build_med --config Release --target install From 7617848cbb6894dc83cc3c72628c813d7ef313ee Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 11:37:31 +0200 Subject: [PATCH 15/40] Updated github action version --- .github/workflows/stable.yml | 12 +++++++----- build-wheels-linux.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index ec2aae9..db3a8f3 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -7,10 +7,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: [9.11.0, 9.12.0] + # version: [9.11.0, 9.12.0] + version: [9.12.0] abi: [cp38, cp39, cp310, cp311] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | docker build docker/manylinux -t medcoupling/manylinux @@ -40,7 +41,8 @@ jobs: contents: write strategy: matrix: - version: [9.11.0, 9.12.0] + # version: [9.11.0, 9.12.0] + version: [9.12.0] include: - abi: cp38 python-version: '3.8' @@ -52,8 +54,8 @@ jobs: python-version: '3.11' steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} update-environment: true diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 1bac12f..e284e64 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -20,7 +20,7 @@ export PATH=/opt/python/${PYTAG}-${ABI}/bin/:$PATH cd /tmp -# The download link changed (it's generated after filing a form on salome website) +# The download link changed curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.bz2 | tar xj cmake -S med-${MED_VERSION} -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ From 9642ca76ab5875b107877ae067c230e8fce7d310 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 11:58:21 +0200 Subject: [PATCH 16/40] revert med-file version increment --- build-wheels-linux.sh | 4 ++-- build-wheels-windows.bat | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index e284e64..61c4d74 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -7,7 +7,7 @@ PKGNAME="medcoupling" VERSION="$1" ABI="$2" # med -MED_VERSION=5.0.0 +MED_VERSION=4.1.1 PLATFORM=manylinux2014_x86_64 PYTAG=${ABI/m/} @@ -21,7 +21,7 @@ export PATH=/opt/python/${PYTAG}-${ABI}/bin/:$PATH cd /tmp # The download link changed -curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.bz2 | tar xj +curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.gz | tar xj cmake -S med-${MED_VERSION} -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index d838e39..cd134d8 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -3,7 +3,7 @@ set PKGNAME="medcoupling" set VERSION=%1% set ABI=%2% -set "MED_VERSION=5.0.0" +set "MED_VERSION=4.1.1" set PY_VER=%ABI:~2,1%.%ABI:~3% set PLATFORM="win_amd64" set PYTAG=%ABI% @@ -87,11 +87,11 @@ cmake --build build_hdf5 --config Release --target install :: med REM The download link changed (it's generated after filing a form on salome website) echo "downloading med" -curl -LO https://files.salome-platform.org/Salome/medfile/med-%MED_VERSION%.tar.bz2 +curl -LO https://files.salome-platform.org/Salome/medfile/med-%MED_VERSION%.tar.gz echo "ended downloading med" dir echo "extracting med" -7z x med-%MED_VERSION%.tar.bz2 > nul +7z x med-%MED_VERSION%.tar.gz > nul 7z x med-%MED_VERSION%.tar > nul echo "end extracting med" dir From 4d276f856fb32146bf5e7ea7b51f0006d6b242e6 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 12:11:29 +0200 Subject: [PATCH 17/40] Fixed extraction for 4.1.1 med tar.gz --- build-wheels-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 61c4d74..33593ad 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -21,7 +21,7 @@ export PATH=/opt/python/${PYTAG}-${ABI}/bin/:$PATH cd /tmp # The download link changed -curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.gz | tar xj +curl -fSsL https://files.salome-platform.org/Salome/medfile/med-$MED_VERSION.tar.gz | tar xz cmake -S med-${MED_VERSION} -B build_med -LAH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install \ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DHDF5_DIR=$PWD/install/share/cmake/hdf5 \ -DCMAKE_INSTALL_RPATH="${PWD}/install/lib;/usr/local/lib" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON From d2e302204f365e948e35d3276f7500d7d802bc45 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 13:14:12 +0200 Subject: [PATCH 18/40] Added __version__ --- build-wheels-linux.sh | 3 ++- write_distinfo.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 33593ad..c2c5844 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -46,7 +46,8 @@ cd install/lib/python*/site-packages rm -rf __pycache__ # write metadata -python ${SCRIPTPATH}/write_distinfo.py ${PKGNAME} ${VERSION} ${TAG} +# python ${SCRIPTPATH}/write_distinfo.py ${PKGNAME} ${VERSION} ${TAG} +python ./write_distinfo.py install/lib/python*/site-packages ${PKGNAME} ${VERSION} ${TAG} # create archive zip -r ${PKGNAME}-${VERSION}-${TAG}.whl *.py *.so ${PKGNAME}-${VERSION}.dist-info diff --git a/write_distinfo.py b/write_distinfo.py index e8294fd..2a2b9a2 100644 --- a/write_distinfo.py +++ b/write_distinfo.py @@ -3,6 +3,7 @@ import sys from pathlib import Path + def main(base_folder: str, package_name: str, version: str, tag: str): """ Creates a dist-info directory in the current working directory, @@ -15,6 +16,11 @@ def main(base_folder: str, package_name: str, version: str, tag: str): if not base_folder_path.exists(): raise NotADirectoryError(f"base_folder {base_folder} is not a directory") + version_file = base_folder_path / "__init__.py" + + with version_file.open("a") as f: + f.write(f"__version__=\"{version}\"") + dist_info_folder = base_folder_path / f"{package_name}-{version}.dist-info" if not dist_info_folder.exists(): dist_info_folder.mkdir() From 8cbc0ddafbbe75bafb4bc4b3fcc2a9bf5c62fcf7 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 14:45:23 +0200 Subject: [PATCH 19/40] Fixed write_distinfo.py call --- build-wheels-linux.sh | 5 ++--- build-wheels-windows.bat | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index c2c5844..1d1cde5 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -15,7 +15,7 @@ TAG=${PYTAG}-${ABI}-${PLATFORM} PYVERD=${ABI:2:1}.${ABI:3} SCRIPT=`readlink -f "$0"` -SCRIPTPATH=`dirname "$SCRIPT"` +SCRIPTPATH=$PWD export PATH=/opt/python/${PYTAG}-${ABI}/bin/:$PATH cd /tmp @@ -46,8 +46,7 @@ cd install/lib/python*/site-packages rm -rf __pycache__ # write metadata -# python ${SCRIPTPATH}/write_distinfo.py ${PKGNAME} ${VERSION} ${TAG} -python ./write_distinfo.py install/lib/python*/site-packages ${PKGNAME} ${VERSION} ${TAG} +python ${SCRIPTPATH}/write_distinfo.py ${PWD} ${PKGNAME} ${VERSION} ${TAG} # create archive zip -r ${PKGNAME}-${VERSION}-${TAG}.whl *.py *.so ${PKGNAME}-${VERSION}.dist-info diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index cd134d8..11220b6 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -8,6 +8,7 @@ set PY_VER=%ABI:~2,1%.%ABI:~3% set PLATFORM="win_amd64" set PYTAG=%ABI% set TAG="%PYTAG%-%ABI%-%PLATFORM%" +set SCRIPTPATH="%CD%" echo "ABI=%ABI%" echo "PY_VER=%PY_VER%" @@ -129,7 +130,7 @@ Dependencies.exe -modules %DEST_FOLDER%\_medcoupling.pyd pushd %DEST_FOLDER% -python .\write_distinfo.py %DEST_FOLDER% %PKGNAME% %VERSION% %TAG% +python %SCRIPTPATH%\write_distinfo.py %DEST_FOLDER% %PKGNAME% %VERSION% %TAG% mkdir %GITHUB_WORKSPACE%\wheelhouse 7z a -tzip %GITHUB_WORKSPACE%\wheelhouse\medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl *.py *.pyd *.dll medcoupling-%VERSION%.dist-info From 449bc39b07f8f34b36b980e0c094b4be9b948d1b Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 15:17:47 +0200 Subject: [PATCH 20/40] changed write_distinfo call --- build-wheels-linux.sh | 9 ++++++--- build_locally.sh | 2 +- write_distinfo.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build-wheels-linux.sh b/build-wheels-linux.sh index 1d1cde5..d7144ab 100755 --- a/build-wheels-linux.sh +++ b/build-wheels-linux.sh @@ -13,9 +13,11 @@ PLATFORM=manylinux2014_x86_64 PYTAG=${ABI/m/} TAG=${PYTAG}-${ABI}-${PLATFORM} PYVERD=${ABI:2:1}.${ABI:3} - SCRIPT=`readlink -f "$0"` -SCRIPTPATH=$PWD +SCRIPTDIR=`dirname "$SCRIPT"` + +echo "Script directory = $SCRIPTDIR" + export PATH=/opt/python/${PYTAG}-${ABI}/bin/:$PATH cd /tmp @@ -46,7 +48,7 @@ cd install/lib/python*/site-packages rm -rf __pycache__ # write metadata -python ${SCRIPTPATH}/write_distinfo.py ${PWD} ${PKGNAME} ${VERSION} ${TAG} +python ${SCRIPTDIR}/write_distinfo.py ${PWD} ${PKGNAME} ${VERSION} ${TAG} # create archive zip -r ${PKGNAME}-${VERSION}-${TAG}.whl *.py *.so ${PKGNAME}-${VERSION}.dist-info @@ -61,3 +63,4 @@ pip install ${PKGNAME} --pre --no-index -f /io/wheelhouse python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()" python -c "import medcoupling as mc; print(mc.MEDCouplingHasNumPyBindings())" python -c "import medcoupling as mc; print(mc.MEDCouplingHasSciPyBindings())" + diff --git a/build_locally.sh b/build_locally.sh index 379f3bb..9e25c0e 100755 --- a/build_locally.sh +++ b/build_locally.sh @@ -1,3 +1,3 @@ #!/bin/sh docker build docker/manylinux -t medcoupling/manylinux -docker run --rm -e MAKEFLAGS='-j8' -v `pwd`:/io medcoupling/manylinux /io/build-wheels-linux.sh 9.11.0 cp310 +docker run --rm -e MAKEFLAGS='-j8' -v `pwd`:/io medcoupling/manylinux /io/build-wheels-linux.sh 9.12.0 cp310 diff --git a/write_distinfo.py b/write_distinfo.py index 2a2b9a2..51c35c2 100644 --- a/write_distinfo.py +++ b/write_distinfo.py @@ -18,7 +18,7 @@ def main(base_folder: str, package_name: str, version: str, tag: str): version_file = base_folder_path / "__init__.py" - with version_file.open("a") as f: + with version_file.open("x") as f: f.write(f"__version__=\"{version}\"") dist_info_folder = base_folder_path / f"{package_name}-{version}.dist-info" From 573d9f6aa720f27575227aa719606ff71f4b28f4 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 15:34:39 +0200 Subject: [PATCH 21/40] Fixed METADATA.in path --- write_distinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/write_distinfo.py b/write_distinfo.py index 51c35c2..dac7208 100644 --- a/write_distinfo.py +++ b/write_distinfo.py @@ -25,7 +25,7 @@ def main(base_folder: str, package_name: str, version: str, tag: str): if not dist_info_folder.exists(): dist_info_folder.mkdir() - metadata_file = Path("METADATA.in") + metadata_file = base_folder_path / "METADATA.in" if not metadata_file.exists(): raise FileNotFoundError(f"Missing {metadata_file}") From 62105637b9a8538d1c52d88fd1e3d47b0c150f37 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 16:30:51 +0200 Subject: [PATCH 22/40] Fixed metadata_file path in write_distinfo.py --- write_distinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/write_distinfo.py b/write_distinfo.py index dac7208..6a964d9 100644 --- a/write_distinfo.py +++ b/write_distinfo.py @@ -25,7 +25,7 @@ def main(base_folder: str, package_name: str, version: str, tag: str): if not dist_info_folder.exists(): dist_info_folder.mkdir() - metadata_file = base_folder_path / "METADATA.in" + metadata_file = Path(__file__).parent / "METADATA.in" if not metadata_file.exists(): raise FileNotFoundError(f"Missing {metadata_file}") From ec956f2076941ccc3b27a488dac964a831b0e0b7 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 16:54:51 +0200 Subject: [PATCH 23/40] Added check in write_distinfo --- write_distinfo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/write_distinfo.py b/write_distinfo.py index 6a964d9..a594d98 100644 --- a/write_distinfo.py +++ b/write_distinfo.py @@ -42,6 +42,8 @@ def main(base_folder: str, package_name: str, version: str, tag: str): path = dist_info_folder / "RECORD" with path.open("w") as record: for subdir in [base_folder_path, path]: + if not subdir.is_dir(): + continue for fpath in subdir.iterdir(): if not fpath.is_file(): continue From 4e112076dc8f4311c80f4977391047da509a2041 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 18:26:20 +0200 Subject: [PATCH 24/40] Using pyproject.toml and python build to build wheel (WIP) --- .github/workflows/stable.yml | 2 - build-wheels-windows.bat | 26 +++++------- pyproject.toml | 36 +++++++++++++++++ write_distinfo.py | 77 ------------------------------------ 4 files changed, 46 insertions(+), 95 deletions(-) create mode 100644 pyproject.toml delete mode 100644 write_distinfo.py diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index db3a8f3..bb05b6c 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -41,8 +41,6 @@ jobs: contents: write strategy: matrix: - # version: [9.11.0, 9.12.0] - version: [9.12.0] include: - abi: cp38 python-version: '3.8' diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 11220b6..d69ba37 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -1,7 +1,6 @@ @echo on -set PKGNAME="medcoupling" -set VERSION=%1% +set VERSION="9.12.0" set ABI=%2% set "MED_VERSION=4.1.1" set PY_VER=%ABI:~2,1%.%ABI:~3% @@ -17,7 +16,7 @@ echo "PYTAG=%PYTAG%" echo "TAG=%TAG%" echo "PATH=%PATH%" -set DEST_FOLDER="C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages" +set BUILD_DIR="C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages" set PYTHON_ROOT=%pythonLocation% python --version @@ -118,24 +117,19 @@ cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=C:/Librari cmake --build build_medcoupling --config Release --target install :: build wheel -xcopy /y C:\Libraries\libxml2\bin\*.dll %DEST_FOLDER% -xcopy /y C:\Libraries\hdf5\bin\hdf5.dll %DEST_FOLDER% -xcopy /y C:\Libraries\med\lib\medC.dll %DEST_FOLDER% -xcopy /y C:\Libraries\medcoupling\lib\*.dll %DEST_FOLDER% -rem xcopy /y C:\Libraries\boost\lib\*.dll %DEST_FOLDER% +xcopy /y C:\Libraries\libxml2\bin\*.dll %BUILD_DIR% +xcopy /y C:\Libraries\hdf5\bin\hdf5.dll %BUILD_DIR% +xcopy /y C:\Libraries\med\lib\medC.dll %BUILD_DIR% +xcopy /y C:\Libraries\medcoupling\lib\*.dll %BUILD_DIR% +rem xcopy /y C:\Libraries\boost\lib\*.dll %BUILD_DIR% curl -LO https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release_.without.peview.exe.zip 7z x Dependencies_x64_Release_.without.peview.exe.zip -Dependencies.exe -modules %DEST_FOLDER%\_medcoupling.pyd +Dependencies.exe -modules %BUILD_DIR%\_medcoupling.pyd -pushd %DEST_FOLDER% +cd %SCRIPT_PATH% -python %SCRIPTPATH%\write_distinfo.py %DEST_FOLDER% %PKGNAME% %VERSION% %TAG% - -mkdir %GITHUB_WORKSPACE%\wheelhouse -7z a -tzip %GITHUB_WORKSPACE%\wheelhouse\medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl *.py *.pyd *.dll medcoupling-%VERSION%.dist-info -pip install %GITHUB_WORKSPACE%\wheelhouse\medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl -pushd %GITHUB_WORKSPACE% +python -m build --wheel %BUILD_DIR% python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()" python -c "import medcoupling as mc; print(mc.MEDCouplingHasNumPyBindings())" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..825b4de --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[project] +name = "medcoupling" +version = "9.12.0" +authors = [ + {name = "EDF R&D", email = "eric.fayolle@edf.fr"}, +] +keywords = ["salome", "mesh", "numerical", "simulation"] +license = { text = "LGPL" } +description = "Powerful library to manipulate meshes and fields" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", + "Operating System :: Microsoft :: Windows", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX :: Linux", + "Programming Language :: C", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Physics", + "Intended Audience :: Science/Research", +] +requires-python = ">=3.8" +dependencies = ["numpy"] + +[project.urls] +Homepage = "https://www.salome-platform.org/downloads" +Repository = "https://git.salome-platform.org/gitweb" + +[build-system] +requires = ["setuptools>=60", ] + +[tool.setuptools.packages.find] +where = ["install"] + +[tool.setuptools.package-data] +"*" = ["*"] + diff --git a/write_distinfo.py b/write_distinfo.py deleted file mode 100644 index a594d98..0000000 --- a/write_distinfo.py +++ /dev/null @@ -1,77 +0,0 @@ -import hashlib -import base64 -import sys -from pathlib import Path - - -def main(base_folder: str, package_name: str, version: str, tag: str): - """ -Creates a dist-info directory in the current working directory, -Copies the METADATA.in file in the dist-info directory, -replaces @PACKAGE_VERSION@ by version and @PACKAGE_NAME@ by name -Creates RECORD and WHEEL files - """ - base_folder_path = Path(base_folder) - - if not base_folder_path.exists(): - raise NotADirectoryError(f"base_folder {base_folder} is not a directory") - - version_file = base_folder_path / "__init__.py" - - with version_file.open("x") as f: - f.write(f"__version__=\"{version}\"") - - dist_info_folder = base_folder_path / f"{package_name}-{version}.dist-info" - if not dist_info_folder.exists(): - dist_info_folder.mkdir() - - metadata_file = Path(__file__).parent / "METADATA.in" - if not metadata_file.exists(): - raise FileNotFoundError(f"Missing {metadata_file}") - - copy_metadata_file = dist_info_folder / metadata_file - with metadata_file.open("r") as forigin: - with copy_metadata_file.open("w") as ftarget: - for line in forigin: - ftarget.write( - line - .replace("@PACKAGE_VERSION@", version) - .replace("@PACKAGE_NAME@", package_name) - ) - - path = dist_info_folder / "RECORD" - with path.open("w") as record: - for subdir in [base_folder_path, path]: - if not subdir.is_dir(): - continue - for fpath in subdir.iterdir(): - if not fpath.is_file(): - continue - - if fpath.name == "RECORD": - record.write(f"{str(fpath)},,\n") - continue - - with fpath.open("rb") as file_tmp: - data = file_tmp.read() - - digest = hashlib.sha256(data).digest() - size = len(data) - - checksum = base64.urlsafe_b64encode(digest).decode() - record.write(f"{fpath},sha256={checksum},{size}\n") - - path = dist_info_folder / "WHEEL" - with path.open("w") as wheel: - wheel.write("Wheel-Version: 1.0\n") - wheel.write("Generator: custom\n") - wheel.write("Root-Is-Purelib: false\n") - wheel.write(f"Tag: {tag}\n") - - -if __name__ == "__main__": - if len(sys.argv) != 5: - raise ValueError("no name/version/tag") - base_folder, name, version, tag = sys.argv[1:] - main(base_folder=base_folder, package_name=name, version=version, tag=tag) - From dc920cfa3a9394d1b3bc12a1ba5901b2225b4cec Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 18:28:51 +0200 Subject: [PATCH 25/40] Using pyproject.toml and python build to build wheel (WIP) --- build-wheels-windows.bat | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index d69ba37..67c4131 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -129,6 +129,8 @@ Dependencies.exe -modules %BUILD_DIR%\_medcoupling.pyd cd %SCRIPT_PATH% +xcopy /y %BUILD_DIR% "./build_dir" + python -m build --wheel %BUILD_DIR% python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()" diff --git a/pyproject.toml b/pyproject.toml index 825b4de..bed8ad4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ Repository = "https://git.salome-platform.org/gitweb" requires = ["setuptools>=60", ] [tool.setuptools.packages.find] -where = ["install"] +where = ["build_dir"] [tool.setuptools.package-data] "*" = ["*"] From bd7ac7b2f13e4af923e69eb68f5b774fd9efc3c3 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 19:14:07 +0200 Subject: [PATCH 26/40] Changed wheel generation path --- .github/workflows/stable.yml | 5 +++-- build-wheels-windows.bat | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index bb05b6c..3094b76 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -41,6 +41,7 @@ jobs: contents: write strategy: matrix: + version: [9.12.0] include: - abi: cp38 python-version: '3.8' @@ -67,7 +68,7 @@ jobs: uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: - files: wheelhouse/medcoupling-${{ matrix.version }}-${{ matrix.abi }}-${{ matrix.abi }}-win_amd64.whl + files: dist/*.whl - name: Upload if: startsWith(github.ref, 'refs/tags/') shell: bash -l {0} @@ -76,5 +77,5 @@ jobs: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} run: | conda install -y twine - twine upload --non-interactive wheelhouse/*.whl + twine upload --non-interactive dist/*.whl diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 67c4131..d272649 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -1,6 +1,6 @@ @echo on -set VERSION="9.12.0" +set VERSION=%1% set ABI=%2% set "MED_VERSION=4.1.1" set PY_VER=%ABI:~2,1%.%ABI:~3% From c90cf61e98a9af124b7559f267b9a7aec3ab4e78 Mon Sep 17 00:00:00 2001 From: bahugo Date: Fri, 19 Apr 2024 19:47:27 +0200 Subject: [PATCH 27/40] (WIP) added print in .bat --- build-wheels-windows.bat | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index d272649..3f22cb8 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -128,9 +128,14 @@ curl -LO https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Depend Dependencies.exe -modules %BUILD_DIR%\_medcoupling.pyd cd %SCRIPT_PATH% +echo %BUILD_DIR% +dir %BUILD_DIR% xcopy /y %BUILD_DIR% "./build_dir" +echo "./build_dir" +dir build_dir + python -m build --wheel %BUILD_DIR% python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()" From 8c0f981d022b46d29b74fe26c21ab391e20c2980 Mon Sep 17 00:00:00 2001 From: bahugo Date: Mon, 22 Apr 2024 12:31:11 +0200 Subject: [PATCH 28/40] (WIP) Reworking windows compilation --- build-wheels-windows.bat | 72 +++++++++++++++++++++------------------- pyproject.toml | 14 ++++++-- 2 files changed, 49 insertions(+), 37 deletions(-) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 3f22cb8..ba2bdfa 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -16,14 +16,16 @@ echo "PYTAG=%PYTAG%" echo "TAG=%TAG%" echo "PATH=%PATH%" -set BUILD_DIR="C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages" +set BUILD_DIR="%SCRIPTPATH%\build_dir" +set MEDCOUPLING_BUILD_DIR="%BUILD_DIR%\medcoupling" set PYTHON_ROOT=%pythonLocation% python --version +python -m pip install build call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 :: metis -git clone --depth 1 -b v5.1.1-DistDGL-v0.5 https://github.com/KarypisLab/METIS.git +git clone --depth 1 -b v5.1.1-DistDGL-v0.5 https://github.com/KarypisLab/METIS.git METIS git clone --depth 1 -b METIS-v5.1.1-DistDGL-0.5 https://github.com/KarypisLab/GKlib.git METIS/GKlib sed -i "s|//#define IDXTYPEWIDTH 32|#define IDXTYPEWIDTH 32|g" METIS\include\metis.h sed -i "s|//#define REALTYPEWIDTH 32|#define REALTYPEWIDTH 64|g" METIS\include\metis.h @@ -31,18 +33,18 @@ mkdir METIS\build\windows mkdir METIS\build\xinclude copy METIS\include\metis.h METIS\build\xinclude copy METIS\include\CMakeLists.txt METIS\build\xinclude -cmake -LAH -S METIS -B build_metis -DCMAKE_INSTALL_PREFIX=C:/Libraries/metis -DCMAKE_BUILD_TYPE=Release +cmake -LAH -S METIS -B build_metis -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%/metis -DCMAKE_BUILD_TYPE=Release cmake --build build_metis --config Release -mkdir C:\Libraries\metis\include -copy METIS\include\metis.h C:\Libraries\metis\include -mkdir C:\Libraries\metis\lib -copy build_metis\libmetis\Release\metis.lib C:\Libraries\metis\lib +mkdir %BUILD_DIR%\metis\include +copy METIS\include\metis.h %BUILD_DIR%\metis\include +mkdir %BUILD_DIR%\metis\lib +copy build_metis\libmetis\Release\metis.lib %BUILD_DIR%\metis\lib :: libxml2 -git clone --depth 1 -b v2.10.4 https://github.com/GNOME/libxml2.git +git clone --depth 1 -b v2.10.4 https://github.com/GNOME/libxml2.git libxml2 pushd libxml2\win32 cscript configure.js compiler=msvc iconv=no icu=no zlib=no lzma=no python=no ^ - prefix=C:\Libraries\libxml2 include=C:\Libraries\libxml2\include lib=C:\Libraries\libxml2\lib + prefix=%BUILD_DIR%\libxml2 include=%BUILD_DIR%\libxml2\include lib=%BUILD_DIR%\libxml2\lib nmake /f Makefile.msvc nmake /f Makefile.msvc install popd @@ -55,7 +57,7 @@ pushd boost_%BOOST_VERSION:.=_% call bootstrap.bat .\b2 install ^ --build-dir=build_boost ^ - --prefix=C:\Libraries\boost ^ + --prefix=%BUILD_DIR%\boost ^ toolset=msvc-14.3 ^ architecture=x86 ^ address-model=64 ^ @@ -80,8 +82,8 @@ call bootstrap.bat popd :: hdf5 -git clone --depth 1 -b hdf5-1_10_3 https://github.com/HDFGroup/hdf5.git -cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=C:/Libraries/hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF +git clone --depth 1 -b hdf5-1_10_3 https://github.com/HDFGroup/hdf5.git hdf5 +cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%/hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF cmake --build build_hdf5 --config Release --target install :: med @@ -95,48 +97,50 @@ echo "extracting med" 7z x med-%MED_VERSION%.tar > nul echo "end extracting med" dir -cmake -LAH -S med-%MED_VERSION% -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ +cmake -LAH -S med-%MED_VERSION% -B build_med -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%/med -DHDF5_ROOT_DIR=%BUILD_DIR%/hdf5 ^ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF cmake --build build_med --config Release --target install -git clone --depth 1 -b V%VERSION:.=_% https://git.salome-platform.org/gitpub/tools/configuration.git +git clone --depth 1 -b V%VERSION:.=_% https://git.salome-platform.org/gitpub/tools/configuration.git configuration pip install scipy -git clone --depth 1 -b V%VERSION:.=_% http://git.salome-platform.org/gitpub/tools/medcoupling.git -cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=C:/Libraries/medcoupling ^ - -DMEDFILE_ROOT_DIR=C:/Libraries/med ^ - -DMETIS_ROOT_DIR=C:/Libraries/metis ^ - -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ - -DLIBXML2_ROOT_DIR=C:/Libraries/libxml2 ^ - -DBOOST_ROOT_DIR=C:/Libraries/boost ^ - -DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DCONFIGURATION_ROOT_DIR=%CD%/configuration ^ +git clone --depth 1 -b V%VERSION:.=_% http://git.salome-platform.org/gitpub/tools/medcoupling.git medcoupling +cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%/medcoupling ^ + -DMEDFILE_ROOT_DIR=%BUILD_DIR%/med ^ + -DMETIS_ROOT_DIR=%BUILD_DIR%/metis ^ + -DHDF5_ROOT_DIR=%BUILD_DIR%/hdf5 ^ + -DLIBXML2_ROOT_DIR=%BUILD_DIR%/libxml2 ^ + -DBOOST_ROOT_DIR=%BUILD_DIR%/boost ^ + -DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DCONFIGURATION_ROOT_DIR=%SCRIPTPATH%/configuration ^ -DPYTHON_LIBRARY=%PYTHON_ROOT%\libs\python%ABI:~2%.lib -DPYTHON_INCLUDE_DIR=%PYTHON_ROOT%\include ^ -DPYTHON_EXECUTABLE=%PYTHON_ROOT%\python.exe ^ -DMEDCOUPLING_PARTITIONER_METIS=OFF -DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DMEDCOUPLING_PARTITIONER_METIS=ON -DMEDCOUPLING_USE_64BIT_IDS=OFF cmake --build build_medcoupling --config Release --target install :: build wheel -xcopy /y C:\Libraries\libxml2\bin\*.dll %BUILD_DIR% -xcopy /y C:\Libraries\hdf5\bin\hdf5.dll %BUILD_DIR% -xcopy /y C:\Libraries\med\lib\medC.dll %BUILD_DIR% -xcopy /y C:\Libraries\medcoupling\lib\*.dll %BUILD_DIR% -rem xcopy /y C:\Libraries\boost\lib\*.dll %BUILD_DIR% +xcopy /y %BUILD_DIR%\libxml2\bin\*.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DIR%\hdf5\bin\hdf5.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DIR%\med\lib\medC.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DIR%\medcoupling\lib\*.dll %MEDCOUPLING_BUILD_DIR% +rem xcopy /y %BUILD_DIR%\boost\lib\*.dll %MEDCOUPLING_BUILD_DIR% curl -LO https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release_.without.peview.exe.zip 7z x Dependencies_x64_Release_.without.peview.exe.zip -Dependencies.exe -modules %BUILD_DIR%\_medcoupling.pyd +Dependencies.exe -modules %MEDCOUPLING_BUILD_DIR%\_medcoupling.pyd cd %SCRIPT_PATH% -echo %BUILD_DIR% -dir %BUILD_DIR% +echo %MEDCOUPLING_BUILD_DIR% +dir %MEDCOUPLING_BUILD_DIR% -xcopy /y %BUILD_DIR% "./build_dir" -echo "./build_dir" -dir build_dir +python -m build --wheel . -python -m build --wheel %BUILD_DIR% +set WHEEL_FILE="medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl" + +copy ".\dist\medcoupling-%VERSION%-py3-none-any.whl" %WHEEL_FILE% + +python -m pip install %WHEEL_FILE% python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()" python -c "import medcoupling as mc; print(mc.MEDCouplingHasNumPyBindings())" diff --git a/pyproject.toml b/pyproject.toml index bed8ad4..e6bbc91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,8 +29,16 @@ Repository = "https://git.salome-platform.org/gitweb" requires = ["setuptools>=60", ] [tool.setuptools.packages.find] -where = ["build_dir"] +where = ["build_dir/medcoupling"] -[tool.setuptools.package-data] -"*" = ["*"] +[tool.pixi.project] +channels = ["conda-forge"] +platforms = ["win-64", "linux-64"] +[tool.pixi.host-dependencies] +python = "~=3.8.19" + +[tool.pixi.dependencies] +pip = "*" +# [tool.pixi.pypi-dependencies] +# medcoupling = { path = ".", editable = true } From 5a15e1bc74bb6b114feeaf6f4d94643698cf35d2 Mon Sep 17 00:00:00 2001 From: bahugo Date: Mon, 22 Apr 2024 12:36:57 +0200 Subject: [PATCH 29/40] (WIP) windows installation --- build-wheels-windows.bat | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index ba2bdfa..774ef75 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -19,6 +19,9 @@ echo "PATH=%PATH%" set BUILD_DIR="%SCRIPTPATH%\build_dir" set MEDCOUPLING_BUILD_DIR="%BUILD_DIR%\medcoupling" set PYTHON_ROOT=%pythonLocation% + +mkdir %MEDCOUPLING_BUILD_DIR% + python --version python -m pip install build From c854d6eda0ab520c5ca9758ea65fe23c9c3853da Mon Sep 17 00:00:00 2001 From: bahugo Date: Mon, 22 Apr 2024 14:30:51 +0200 Subject: [PATCH 30/40] (WIP) added artifacts --- .github/workflows/stable.yml | 5 ++++ build-wheels-windows.bat | 56 +++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 3094b76..2f4f733 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -61,6 +61,11 @@ jobs: - name: Build shell: cmd run: call .\build-wheels-windows.bat ${{ matrix.version }} ${{ matrix.abi }} + with: + name: compilation_output + path: | + build_dir + dist - uses: conda-incubator/setup-miniconda@v2 with: miniforge-version: latest diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 774ef75..00b44da 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -17,9 +17,11 @@ echo "TAG=%TAG%" echo "PATH=%PATH%" set BUILD_DIR="%SCRIPTPATH%\build_dir" +set BUILD_DEP_DIR="%BUILD_DIR%\dependencies" set MEDCOUPLING_BUILD_DIR="%BUILD_DIR%\medcoupling" set PYTHON_ROOT=%pythonLocation% +mkdir %BUILD_DEP_DIR% mkdir %MEDCOUPLING_BUILD_DIR% python --version @@ -27,6 +29,8 @@ python -m pip install build call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 +cd %BUILD_DIR% + :: metis git clone --depth 1 -b v5.1.1-DistDGL-v0.5 https://github.com/KarypisLab/METIS.git METIS git clone --depth 1 -b METIS-v5.1.1-DistDGL-0.5 https://github.com/KarypisLab/GKlib.git METIS/GKlib @@ -36,18 +40,18 @@ mkdir METIS\build\windows mkdir METIS\build\xinclude copy METIS\include\metis.h METIS\build\xinclude copy METIS\include\CMakeLists.txt METIS\build\xinclude -cmake -LAH -S METIS -B build_metis -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%/metis -DCMAKE_BUILD_TYPE=Release +cmake -LAH -S METIS -B build_metis -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/metis -DCMAKE_BUILD_TYPE=Release cmake --build build_metis --config Release -mkdir %BUILD_DIR%\metis\include -copy METIS\include\metis.h %BUILD_DIR%\metis\include -mkdir %BUILD_DIR%\metis\lib -copy build_metis\libmetis\Release\metis.lib %BUILD_DIR%\metis\lib +mkdir %BUILD_DEP_DIR%\metis\include +copy METIS\include\metis.h %BUILD_DEP_DIR%\metis\include +mkdir %BUILD_DEP_DIR%\metis\lib +copy build_metis\libmetis\Release\metis.lib %BUILD_DEP_DIR%\metis\lib :: libxml2 git clone --depth 1 -b v2.10.4 https://github.com/GNOME/libxml2.git libxml2 pushd libxml2\win32 cscript configure.js compiler=msvc iconv=no icu=no zlib=no lzma=no python=no ^ - prefix=%BUILD_DIR%\libxml2 include=%BUILD_DIR%\libxml2\include lib=%BUILD_DIR%\libxml2\lib + prefix=%BUILD_DEP_DIR%\libxml2 include=%BUILD_DEP_DIR%\libxml2\include lib=%BUILD_DEP_DIR%\libxml2\lib nmake /f Makefile.msvc nmake /f Makefile.msvc install popd @@ -60,7 +64,7 @@ pushd boost_%BOOST_VERSION:.=_% call bootstrap.bat .\b2 install ^ --build-dir=build_boost ^ - --prefix=%BUILD_DIR%\boost ^ + --prefix=%BUILD_DEP_DIR%\boost ^ toolset=msvc-14.3 ^ architecture=x86 ^ address-model=64 ^ @@ -86,7 +90,7 @@ popd :: hdf5 git clone --depth 1 -b hdf5-1_10_3 https://github.com/HDFGroup/hdf5.git hdf5 -cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%/hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF +cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF cmake --build build_hdf5 --config Release --target install :: med @@ -100,7 +104,7 @@ echo "extracting med" 7z x med-%MED_VERSION%.tar > nul echo "end extracting med" dir -cmake -LAH -S med-%MED_VERSION% -B build_med -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%/med -DHDF5_ROOT_DIR=%BUILD_DIR%/hdf5 ^ +cmake -LAH -S med-%MED_VERSION% -B build_med -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/med -DHDF5_ROOT_DIR=%BUILD_DEP_DIR%/hdf5 ^ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF cmake --build build_med --config Release --target install @@ -109,12 +113,12 @@ git clone --depth 1 -b V%VERSION:.=_% https://git.salome-platform.org/gitpub/too pip install scipy git clone --depth 1 -b V%VERSION:.=_% http://git.salome-platform.org/gitpub/tools/medcoupling.git medcoupling -cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%/medcoupling ^ - -DMEDFILE_ROOT_DIR=%BUILD_DIR%/med ^ - -DMETIS_ROOT_DIR=%BUILD_DIR%/metis ^ - -DHDF5_ROOT_DIR=%BUILD_DIR%/hdf5 ^ - -DLIBXML2_ROOT_DIR=%BUILD_DIR%/libxml2 ^ - -DBOOST_ROOT_DIR=%BUILD_DIR%/boost ^ +cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/medcoupling ^ + -DMEDFILE_ROOT_DIR=%BUILD_DEP_DIR%/med ^ + -DMETIS_ROOT_DIR=%BUILD_DEP_DIR%/metis ^ + -DHDF5_ROOT_DIR=%BUILD_DEP_DIR%/hdf5 ^ + -DLIBXML2_ROOT_DIR=%BUILD_DEP_DIR%/libxml2 ^ + -DBOOST_ROOT_DIR=%BUILD_DEP_DIR%/boost ^ -DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DCONFIGURATION_ROOT_DIR=%SCRIPTPATH%/configuration ^ -DPYTHON_LIBRARY=%PYTHON_ROOT%\libs\python%ABI:~2%.lib -DPYTHON_INCLUDE_DIR=%PYTHON_ROOT%\include ^ -DPYTHON_EXECUTABLE=%PYTHON_ROOT%\python.exe ^ @@ -122,11 +126,11 @@ cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DIR cmake --build build_medcoupling --config Release --target install :: build wheel -xcopy /y %BUILD_DIR%\libxml2\bin\*.dll %MEDCOUPLING_BUILD_DIR% -xcopy /y %BUILD_DIR%\hdf5\bin\hdf5.dll %MEDCOUPLING_BUILD_DIR% -xcopy /y %BUILD_DIR%\med\lib\medC.dll %MEDCOUPLING_BUILD_DIR% -xcopy /y %BUILD_DIR%\medcoupling\lib\*.dll %MEDCOUPLING_BUILD_DIR% -rem xcopy /y %BUILD_DIR%\boost\lib\*.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DEP_DIR%\libxml2\bin\*.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DEP_DIR%\hdf5\bin\hdf5.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DEP_DIR%\med\lib\medC.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DEP_DIR%\medcoupling\lib\*.dll %MEDCOUPLING_BUILD_DIR% +rem xcopy /y %BUILD_DEP_DIR%\boost\lib\*.dll %MEDCOUPLING_BUILD_DIR% curl -LO https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release_.without.peview.exe.zip 7z x Dependencies_x64_Release_.without.peview.exe.zip @@ -136,15 +140,15 @@ cd %SCRIPT_PATH% echo %MEDCOUPLING_BUILD_DIR% dir %MEDCOUPLING_BUILD_DIR% - python -m build --wheel . +set ORIGIN_WHEEL_FILE="medcoupling-%VERSION%-py3-none-any.whl" set WHEEL_FILE="medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl" -copy ".\dist\medcoupling-%VERSION%-py3-none-any.whl" %WHEEL_FILE% +move /y ".\dist\%ORIGIN_WHEEL_FILE%" ".\dist\%WHEEL_FILE%" -python -m pip install %WHEEL_FILE% +REM python -m pip install %WHEEL_FILE% -python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()" -python -c "import medcoupling as mc; print(mc.MEDCouplingHasNumPyBindings())" -python -c "import medcoupling as mc; print(mc.MEDCouplingHasSciPyBindings())" +REM python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()" +REM python -c "import medcoupling as mc; print(mc.MEDCouplingHasNumPyBindings())" +REM python -c "import medcoupling as mc; print(mc.MEDCouplingHasSciPyBindings())" From 26abc8f72446d2a9d537f44f6f2880892f78ec33 Mon Sep 17 00:00:00 2001 From: bahugo Date: Mon, 22 Apr 2024 14:32:55 +0200 Subject: [PATCH 31/40] (WIP) added artifacts --- .github/workflows/stable.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 2f4f733..d0e7209 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -61,6 +61,8 @@ jobs: - name: Build shell: cmd run: call .\build-wheels-windows.bat ${{ matrix.version }} ${{ matrix.abi }} + - name: Archive production artifacts + uses: actions/upload-artifact@v4 with: name: compilation_output path: | From fa2ecac39b3ddf0cfa1b88de2d9e0062322e4c2c Mon Sep 17 00:00:00 2001 From: bahugo Date: Mon, 22 Apr 2024 15:11:10 +0200 Subject: [PATCH 32/40] (WIP) compilation on windows --- build-wheels-windows.bat | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 00b44da..06c290c 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -25,13 +25,14 @@ mkdir %BUILD_DEP_DIR% mkdir %MEDCOUPLING_BUILD_DIR% python --version -python -m pip install build +python -m pip install build scipy call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 -cd %BUILD_DIR% +pushd %BUILD_DIR% :: metis +echo "---- METIS INSTALLATION ----" git clone --depth 1 -b v5.1.1-DistDGL-v0.5 https://github.com/KarypisLab/METIS.git METIS git clone --depth 1 -b METIS-v5.1.1-DistDGL-0.5 https://github.com/KarypisLab/GKlib.git METIS/GKlib sed -i "s|//#define IDXTYPEWIDTH 32|#define IDXTYPEWIDTH 32|g" METIS\include\metis.h @@ -46,8 +47,10 @@ mkdir %BUILD_DEP_DIR%\metis\include copy METIS\include\metis.h %BUILD_DEP_DIR%\metis\include mkdir %BUILD_DEP_DIR%\metis\lib copy build_metis\libmetis\Release\metis.lib %BUILD_DEP_DIR%\metis\lib +echo "---- ENDED METIS INSTALLATION ----" :: libxml2 +echo "---- libxml2 INSTALLATION ----" git clone --depth 1 -b v2.10.4 https://github.com/GNOME/libxml2.git libxml2 pushd libxml2\win32 cscript configure.js compiler=msvc iconv=no icu=no zlib=no lzma=no python=no ^ @@ -55,8 +58,10 @@ cscript configure.js compiler=msvc iconv=no icu=no zlib=no lzma=no python=no ^ nmake /f Makefile.msvc nmake /f Makefile.msvc install popd +echo "---- ENDED libxml2 INSTALLATION ----" :: boost +echo "---- BOOST INSTALLATION ----" set "BOOST_VERSION=1.80.0" curl -LO https://boostorg.jfrog.io/artifactory/main/release/%BOOST_VERSION%/source/boost_%BOOST_VERSION:.=_%.zip 7z x boost_%BOOST_VERSION:.=_%.zip > nul @@ -87,13 +92,17 @@ call bootstrap.bat --layout=system ^ --with-serialization --with-filesystem --with-date_time --with-chrono --with-thread --with-regex --with-system popd +echo "---- ENDED BOOST INSTALLATION ----" :: hdf5 +echo "---- HDF5 INSTALLATION ----" git clone --depth 1 -b hdf5-1_10_3 https://github.com/HDFGroup/hdf5.git hdf5 cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF cmake --build build_hdf5 --config Release --target install +echo "---- ENDED HDF5 INSTALLATION ----" :: med +echo "---- MED INSTALLATION ----" REM The download link changed (it's generated after filing a form on salome website) echo "downloading med" curl -LO https://files.salome-platform.org/Salome/medfile/med-%MED_VERSION%.tar.gz @@ -110,7 +119,6 @@ cmake --build build_med --config Release --target install git clone --depth 1 -b V%VERSION:.=_% https://git.salome-platform.org/gitpub/tools/configuration.git configuration -pip install scipy git clone --depth 1 -b V%VERSION:.=_% http://git.salome-platform.org/gitpub/tools/medcoupling.git medcoupling cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/medcoupling ^ @@ -124,17 +132,22 @@ cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DEP -DPYTHON_EXECUTABLE=%PYTHON_ROOT%\python.exe ^ -DMEDCOUPLING_PARTITIONER_METIS=OFF -DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DMEDCOUPLING_PARTITIONER_METIS=ON -DMEDCOUPLING_USE_64BIT_IDS=OFF cmake --build build_medcoupling --config Release --target install +popd +echo "---- ENDED MED INSTALLATION ----" :: build wheel +echo "---- BUILDING WHEEL ----" xcopy /y %BUILD_DEP_DIR%\libxml2\bin\*.dll %MEDCOUPLING_BUILD_DIR% xcopy /y %BUILD_DEP_DIR%\hdf5\bin\hdf5.dll %MEDCOUPLING_BUILD_DIR% xcopy /y %BUILD_DEP_DIR%\med\lib\medC.dll %MEDCOUPLING_BUILD_DIR% xcopy /y %BUILD_DEP_DIR%\medcoupling\lib\*.dll %MEDCOUPLING_BUILD_DIR% rem xcopy /y %BUILD_DEP_DIR%\boost\lib\*.dll %MEDCOUPLING_BUILD_DIR% +echo "Checking compilation file integrity" curl -LO https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release_.without.peview.exe.zip 7z x Dependencies_x64_Release_.without.peview.exe.zip Dependencies.exe -modules %MEDCOUPLING_BUILD_DIR%\_medcoupling.pyd +echo "Ended checking compilation file integrity" cd %SCRIPT_PATH% echo %MEDCOUPLING_BUILD_DIR% @@ -146,6 +159,7 @@ set ORIGIN_WHEEL_FILE="medcoupling-%VERSION%-py3-none-any.whl" set WHEEL_FILE="medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl" move /y ".\dist\%ORIGIN_WHEEL_FILE%" ".\dist\%WHEEL_FILE%" +echo "---- ENDED BUILDING WHEEL ----" REM python -m pip install %WHEEL_FILE% From 0b4c684980d43f4e290ef70ec256d07d7fc11f3e Mon Sep 17 00:00:00 2001 From: bahugo Date: Mon, 22 Apr 2024 15:28:12 +0200 Subject: [PATCH 33/40] (WIP) added echo --- build-wheels-windows.bat | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 06c290c..0ea0427 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -47,6 +47,7 @@ mkdir %BUILD_DEP_DIR%\metis\include copy METIS\include\metis.h %BUILD_DEP_DIR%\metis\include mkdir %BUILD_DEP_DIR%\metis\lib copy build_metis\libmetis\Release\metis.lib %BUILD_DEP_DIR%\metis\lib +dir %BUILD_DEP_DIR%/metis echo "---- ENDED METIS INSTALLATION ----" :: libxml2 @@ -58,6 +59,7 @@ cscript configure.js compiler=msvc iconv=no icu=no zlib=no lzma=no python=no ^ nmake /f Makefile.msvc nmake /f Makefile.msvc install popd +dir %BUILD_DEP_DIR%/libxml2 echo "---- ENDED libxml2 INSTALLATION ----" :: boost @@ -92,6 +94,7 @@ call bootstrap.bat --layout=system ^ --with-serialization --with-filesystem --with-date_time --with-chrono --with-thread --with-regex --with-system popd +dir %BUILD_DEP_DIR%/boost echo "---- ENDED BOOST INSTALLATION ----" :: hdf5 @@ -99,6 +102,7 @@ echo "---- HDF5 INSTALLATION ----" git clone --depth 1 -b hdf5-1_10_3 https://github.com/HDFGroup/hdf5.git hdf5 cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF cmake --build build_hdf5 --config Release --target install +dir %BUILD_DEP_DIR%/hdf5 echo "---- ENDED HDF5 INSTALLATION ----" :: med @@ -133,6 +137,7 @@ cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DEP -DMEDCOUPLING_PARTITIONER_METIS=OFF -DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DMEDCOUPLING_PARTITIONER_METIS=ON -DMEDCOUPLING_USE_64BIT_IDS=OFF cmake --build build_medcoupling --config Release --target install popd +dir %BUILD_DEP_DIR%/medcoupling echo "---- ENDED MED INSTALLATION ----" :: build wheel From 82b023ceb535ee965b6736ab6653b8b288b55e93 Mon Sep 17 00:00:00 2001 From: bahugo Date: Mon, 22 Apr 2024 15:52:59 +0200 Subject: [PATCH 34/40] (WIP) windows compilation --- .github/workflows/stable.yml | 2 +- build-wheels-windows.bat | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index d0e7209..f11bc33 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -66,7 +66,7 @@ jobs: with: name: compilation_output path: | - build_dir + build_dir/dependencies dist - uses: conda-incubator/setup-miniconda@v2 with: diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 0ea0427..a46019e 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -59,8 +59,9 @@ cscript configure.js compiler=msvc iconv=no icu=no zlib=no lzma=no python=no ^ nmake /f Makefile.msvc nmake /f Makefile.msvc install popd -dir %BUILD_DEP_DIR%/libxml2 +dir echo "---- ENDED libxml2 INSTALLATION ----" +dir %BUILD_DEP_DIR%\libxml2 :: boost echo "---- BOOST INSTALLATION ----" @@ -94,15 +95,16 @@ call bootstrap.bat --layout=system ^ --with-serialization --with-filesystem --with-date_time --with-chrono --with-thread --with-regex --with-system popd -dir %BUILD_DEP_DIR%/boost +dir echo "---- ENDED BOOST INSTALLATION ----" +dir %BUILD_DEP_DIR%\boost :: hdf5 echo "---- HDF5 INSTALLATION ----" git clone --depth 1 -b hdf5-1_10_3 https://github.com/HDFGroup/hdf5.git hdf5 cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF cmake --build build_hdf5 --config Release --target install -dir %BUILD_DEP_DIR%/hdf5 +dir %BUILD_DEP_DIR%\hdf5 echo "---- ENDED HDF5 INSTALLATION ----" :: med @@ -126,20 +128,25 @@ git clone --depth 1 -b V%VERSION:.=_% https://git.salome-platform.org/gitpub/too git clone --depth 1 -b V%VERSION:.=_% http://git.salome-platform.org/gitpub/tools/medcoupling.git medcoupling cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/medcoupling ^ - -DMEDFILE_ROOT_DIR=%BUILD_DEP_DIR%/med ^ - -DMETIS_ROOT_DIR=%BUILD_DEP_DIR%/metis ^ - -DHDF5_ROOT_DIR=%BUILD_DEP_DIR%/hdf5 ^ - -DLIBXML2_ROOT_DIR=%BUILD_DEP_DIR%/libxml2 ^ - -DBOOST_ROOT_DIR=%BUILD_DEP_DIR%/boost ^ - -DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DCONFIGURATION_ROOT_DIR=%SCRIPTPATH%/configuration ^ + -DMEDFILE_ROOT_DIR=%BUILD_DEP_DIR%\med ^ + -DMETIS_ROOT_DIR=%BUILD_DEP_DIR%\metis ^ + -DHDF5_ROOT_DIR=%BUILD_DEP_DIR%\hdf5 ^ + -DLIBXML2_ROOT_DIR=%BUILD_DEP_DIR%\libxml2 ^ + -DBOOST_ROOT_DIR=%BUILD_DEP_DIR%\boost ^ + -DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DCONFIGURATION_ROOT_DIR=%SCRIPTPATH%\configuration ^ -DPYTHON_LIBRARY=%PYTHON_ROOT%\libs\python%ABI:~2%.lib -DPYTHON_INCLUDE_DIR=%PYTHON_ROOT%\include ^ -DPYTHON_EXECUTABLE=%PYTHON_ROOT%\python.exe ^ -DMEDCOUPLING_PARTITIONER_METIS=OFF -DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DMEDCOUPLING_PARTITIONER_METIS=ON -DMEDCOUPLING_USE_64BIT_IDS=OFF cmake --build build_medcoupling --config Release --target install popd -dir %BUILD_DEP_DIR%/medcoupling +dir echo "---- ENDED MED INSTALLATION ----" +dir %BUILD_DEP_DIR%\medcoupling + +popd +dir + :: build wheel echo "---- BUILDING WHEEL ----" xcopy /y %BUILD_DEP_DIR%\libxml2\bin\*.dll %MEDCOUPLING_BUILD_DIR% From e51ad9ebba3319a09449a9738988ca3b9c075b52 Mon Sep 17 00:00:00 2001 From: bahugo Date: Mon, 22 Apr 2024 19:14:22 +0200 Subject: [PATCH 35/40] (WIP) windows compilation --- build-wheels-windows.bat | 57 +++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index a46019e..12f4e2c 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -16,20 +16,23 @@ echo "PYTAG=%PYTAG%" echo "TAG=%TAG%" echo "PATH=%PATH%" +set DEP_DIR="%SCRIPTPATH%\dependencies_tmp" set BUILD_DIR="%SCRIPTPATH%\build_dir" set BUILD_DEP_DIR="%BUILD_DIR%\dependencies" set MEDCOUPLING_BUILD_DIR="%BUILD_DIR%\medcoupling" set PYTHON_ROOT=%pythonLocation% +mkdir %DEP_DIR% mkdir %BUILD_DEP_DIR% mkdir %MEDCOUPLING_BUILD_DIR% python --version python -m pip install build scipy -call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 +REM call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 +call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 -pushd %BUILD_DIR% +pushd %DEP_DIR% :: metis echo "---- METIS INSTALLATION ----" @@ -41,13 +44,13 @@ mkdir METIS\build\windows mkdir METIS\build\xinclude copy METIS\include\metis.h METIS\build\xinclude copy METIS\include\CMakeLists.txt METIS\build\xinclude -cmake -LAH -S METIS -B build_metis -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/metis -DCMAKE_BUILD_TYPE=Release +cmake -LAH -S METIS -B build_metis -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%\metis -DCMAKE_BUILD_TYPE=Release cmake --build build_metis --config Release -mkdir %BUILD_DEP_DIR%\metis\include -copy METIS\include\metis.h %BUILD_DEP_DIR%\metis\include -mkdir %BUILD_DEP_DIR%\metis\lib -copy build_metis\libmetis\Release\metis.lib %BUILD_DEP_DIR%\metis\lib -dir %BUILD_DEP_DIR%/metis +mkdir %BUILD_DIR%\metis\include +copy METIS\include\metis.h %BUILD_DIR%\metis\include +mkdir %BUILD_DIR%\metis\lib +copy build_metis\libmetis\Release\metis.lib %BUILD_DIR%\metis\lib +dir %BUILD_DIR%\metis echo "---- ENDED METIS INSTALLATION ----" :: libxml2 @@ -55,13 +58,13 @@ echo "---- libxml2 INSTALLATION ----" git clone --depth 1 -b v2.10.4 https://github.com/GNOME/libxml2.git libxml2 pushd libxml2\win32 cscript configure.js compiler=msvc iconv=no icu=no zlib=no lzma=no python=no ^ - prefix=%BUILD_DEP_DIR%\libxml2 include=%BUILD_DEP_DIR%\libxml2\include lib=%BUILD_DEP_DIR%\libxml2\lib + prefix=%BUILD_DIR%\libxml2 include=%BUILD_DIR%\libxml2\include lib=%BUILD_DIR%\libxml2\lib nmake /f Makefile.msvc nmake /f Makefile.msvc install popd dir echo "---- ENDED libxml2 INSTALLATION ----" -dir %BUILD_DEP_DIR%\libxml2 +dir %BUILD_DIR%\libxml2 :: boost echo "---- BOOST INSTALLATION ----" @@ -72,7 +75,7 @@ pushd boost_%BOOST_VERSION:.=_% call bootstrap.bat .\b2 install ^ --build-dir=build_boost ^ - --prefix=%BUILD_DEP_DIR%\boost ^ + --prefix=%BUILD_DIR%\boost ^ toolset=msvc-14.3 ^ architecture=x86 ^ address-model=64 ^ @@ -97,14 +100,14 @@ call bootstrap.bat popd dir echo "---- ENDED BOOST INSTALLATION ----" -dir %BUILD_DEP_DIR%\boost +dir boost :: hdf5 echo "---- HDF5 INSTALLATION ----" git clone --depth 1 -b hdf5-1_10_3 https://github.com/HDFGroup/hdf5.git hdf5 -cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF +cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%\hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF cmake --build build_hdf5 --config Release --target install -dir %BUILD_DEP_DIR%\hdf5 +dir %BUILD_DIR%\hdf5 echo "---- ENDED HDF5 INSTALLATION ----" :: med @@ -119,7 +122,7 @@ echo "extracting med" 7z x med-%MED_VERSION%.tar > nul echo "end extracting med" dir -cmake -LAH -S med-%MED_VERSION% -B build_med -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/med -DHDF5_ROOT_DIR=%BUILD_DEP_DIR%/hdf5 ^ +cmake -LAH -S med-%MED_VERSION% -B build_med -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%\med -DHDF5_ROOT_DIR=%BUILD_DIR%\hdf5 ^ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF cmake --build build_med --config Release --target install @@ -127,13 +130,13 @@ git clone --depth 1 -b V%VERSION:.=_% https://git.salome-platform.org/gitpub/too git clone --depth 1 -b V%VERSION:.=_% http://git.salome-platform.org/gitpub/tools/medcoupling.git medcoupling -cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DEP_DIR%/medcoupling ^ - -DMEDFILE_ROOT_DIR=%BUILD_DEP_DIR%\med ^ - -DMETIS_ROOT_DIR=%BUILD_DEP_DIR%\metis ^ - -DHDF5_ROOT_DIR=%BUILD_DEP_DIR%\hdf5 ^ - -DLIBXML2_ROOT_DIR=%BUILD_DEP_DIR%\libxml2 ^ - -DBOOST_ROOT_DIR=%BUILD_DEP_DIR%\boost ^ - -DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DCONFIGURATION_ROOT_DIR=%SCRIPTPATH%\configuration ^ +cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%\medcoupling ^ + -DMEDFILE_ROOT_DIR=%BUILD_DIR%\med ^ + -DMETIS_ROOT_DIR=%BUILD_DIR%\metis ^ + -DHDF5_ROOT_DIR=%BUILD_DIR%\hdf5 ^ + -DLIBXML2_ROOT_DIR=%BUILD_DIR%\libxml2 ^ + -DBOOST_ROOT_DIR=%BUILD_DIR%\boost ^ + -DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DCONFIGURATION_ROOT_DIR=%DEP_DIR%\configuration ^ -DPYTHON_LIBRARY=%PYTHON_ROOT%\libs\python%ABI:~2%.lib -DPYTHON_INCLUDE_DIR=%PYTHON_ROOT%\include ^ -DPYTHON_EXECUTABLE=%PYTHON_ROOT%\python.exe ^ -DMEDCOUPLING_PARTITIONER_METIS=OFF -DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DMEDCOUPLING_PARTITIONER_METIS=ON -DMEDCOUPLING_USE_64BIT_IDS=OFF @@ -142,17 +145,17 @@ popd dir echo "---- ENDED MED INSTALLATION ----" -dir %BUILD_DEP_DIR%\medcoupling +dir %BUILD_DIR%\medcoupling popd dir :: build wheel echo "---- BUILDING WHEEL ----" -xcopy /y %BUILD_DEP_DIR%\libxml2\bin\*.dll %MEDCOUPLING_BUILD_DIR% -xcopy /y %BUILD_DEP_DIR%\hdf5\bin\hdf5.dll %MEDCOUPLING_BUILD_DIR% -xcopy /y %BUILD_DEP_DIR%\med\lib\medC.dll %MEDCOUPLING_BUILD_DIR% -xcopy /y %BUILD_DEP_DIR%\medcoupling\lib\*.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DIR%\libxml2\bin\*.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DIR%\hdf5\bin\hdf5.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DIR%\med\lib\medC.dll %MEDCOUPLING_BUILD_DIR% +xcopy /y %BUILD_DIR%\medcoupling\lib\*.dll %MEDCOUPLING_BUILD_DIR% rem xcopy /y %BUILD_DEP_DIR%\boost\lib\*.dll %MEDCOUPLING_BUILD_DIR% echo "Checking compilation file integrity" From 8ead7dec127bd68723bfaf373a05d7608f28be2f Mon Sep 17 00:00:00 2001 From: bahugo Date: Mon, 22 Apr 2024 19:20:31 +0200 Subject: [PATCH 36/40] (WIP) windows compilation --- build-wheels-windows.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 12f4e2c..cb74c96 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -29,8 +29,8 @@ mkdir %MEDCOUPLING_BUILD_DIR% python --version python -m pip install build scipy -REM call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 -call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 +call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 +REM call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 pushd %DEP_DIR% From 52adddaa64af6dfc456c065c7622d340a5a875ed Mon Sep 17 00:00:00 2001 From: bahugo Date: Tue, 23 Apr 2024 10:25:27 +0200 Subject: [PATCH 37/40] (WIP) compilation windows --- .github/workflows/stable.yml | 6 +- build-wheels-windows-legacy.bat | 139 ++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 build-wheels-windows-legacy.bat diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index f11bc33..ef55608 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -41,7 +41,9 @@ jobs: contents: write strategy: matrix: - version: [9.12.0] + version: [9.11.0, + # 9.12.0 + ] include: - abi: cp38 python-version: '3.8' @@ -60,7 +62,7 @@ jobs: update-environment: true - name: Build shell: cmd - run: call .\build-wheels-windows.bat ${{ matrix.version }} ${{ matrix.abi }} + run: call .\build-wheels-windows-legacy.bat ${{ matrix.version }} ${{ matrix.abi }} - name: Archive production artifacts uses: actions/upload-artifact@v4 with: diff --git a/build-wheels-windows-legacy.bat b/build-wheels-windows-legacy.bat new file mode 100644 index 0000000..9218c18 --- /dev/null +++ b/build-wheels-windows-legacy.bat @@ -0,0 +1,139 @@ +@echo on +set VERSION=%1% +set ABI=%2% +set PY_VER=%ABI:~2,1%.%ABI:~3% + +echo "ABI=%ABI%" +echo "PY_VER=%PY_VER%" +echo "PATH=%PATH%" + +set PYTHON_ROOT=%pythonLocation% +python --version + +call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 +REM call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 + +:: metis +git clone --depth 1 -b v5.1.1-DistDGL-v0.5 https://github.com/KarypisLab/METIS.git +git clone --depth 1 -b METIS-v5.1.1-DistDGL-0.5 https://github.com/KarypisLab/GKlib.git METIS/GKlib +sed -i "s|//#define IDXTYPEWIDTH 32|#define IDXTYPEWIDTH 32|g" METIS\include\metis.h +sed -i "s|//#define REALTYPEWIDTH 32|#define REALTYPEWIDTH 64|g" METIS\include\metis.h +mkdir METIS\build\windows +mkdir METIS\build\xinclude +copy METIS\include\metis.h METIS\build\xinclude +copy METIS\include\CMakeLists.txt METIS\build\xinclude +cmake -LAH -S METIS -B build_metis -DCMAKE_INSTALL_PREFIX=C:/Libraries/metis -DCMAKE_BUILD_TYPE=Release +cmake --build build_metis --config Release +mkdir C:\Libraries\metis\include +copy METIS\include\metis.h C:\Libraries\metis\include +mkdir C:\Libraries\metis\lib +copy build_metis\libmetis\Release\metis.lib C:\Libraries\metis\lib + +:: libxml2 +git clone --depth 1 -b v2.10.4 https://github.com/GNOME/libxml2.git +pushd libxml2\win32 +cscript configure.js compiler=msvc iconv=no icu=no zlib=no lzma=no python=no ^ + prefix=C:\Libraries\libxml2 include=C:\Libraries\libxml2\include lib=C:\Libraries\libxml2\lib +nmake /f Makefile.msvc +nmake /f Makefile.msvc install +popd + +:: boost +set "BOOST_VERSION=1.80.0" +curl -LO https://boostorg.jfrog.io/artifactory/main/release/%BOOST_VERSION%/source/boost_%BOOST_VERSION:.=_%.zip +7z x boost_%BOOST_VERSION:.=_%.zip > nul +pushd boost_%BOOST_VERSION:.=_% +call bootstrap.bat +.\b2 install ^ + --build-dir=build_boost ^ + --prefix=C:\Libraries\boost ^ + toolset=msvc-14.3 ^ + architecture=x86 ^ + address-model=64 ^ + variant=release ^ + threading=multi ^ + link=shared ^ + -j4 ^ + -s NO_COMPRESSION=1 ^ + -s NO_ZLIB=1 ^ + -s NO_BZIP2=1 ^ + -s ZLIB_INCLUDE=%PREFIX%\Library\include ^ + -s ZLIB_LIBPATH=%PREFIX%\Library\lib ^ + -s ZLIB_BINARY=z ^ + -s BZIP2_INCLUDE=%PREFIX%\Library\include ^ + -s BZIP2_LIBPATH=%PREFIX%\Library\lib ^ + -s BZIP2_BINARY=libbz2 ^ + -s ZSTD_INCLUDE=%PREFIX%\Library\include ^ + -s ZSTD_LIBPATH=%PREFIX%\Library\lib ^ + -s ZSTD_BINARY=zstd ^ + --layout=system ^ + --with-serialization --with-filesystem --with-date_time --with-chrono --with-thread --with-regex --with-system +popd + +:: hdf5 +git clone --depth 1 -b hdf5-1_10_3 https://github.com/HDFGroup/hdf5.git +cmake -LAH -S hdf5 -B build_hdf5 -DCMAKE_INSTALL_PREFIX=C:/Libraries/hdf5 -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_EXAMPLES=OFF +cmake --build build_hdf5 --config Release --target install + +:: med +set "MED_VERSION=4.1.1" +REM curl -LO https://files.salome-platform.org/Salome/other/med-%MED_VERSION%.tar.gz +curl -LO https://files.salome-platform.org/Salome/medfile/med-%MED_VERSION%.tar.gz +7z x med-%MED_VERSION%.tar.gz > nul +7z x med-%MED_VERSION%.tar > nul +cmake -LAH -S med-%MED_VERSION%_SRC -B build_med -DCMAKE_INSTALL_PREFIX=C:/Libraries/med -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ + -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF +cmake --build build_med --config Release --target install + +git clone --depth 1 -b V%VERSION:.=_% https://git.salome-platform.org/gitpub/tools/configuration.git + +pip install scipy + +git clone --depth 1 -b V%VERSION:.=_% http://git.salome-platform.org/gitpub/tools/medcoupling.git +cmake -LAH -S medcoupling -B build_medcoupling -DCMAKE_INSTALL_PREFIX=C:/Libraries/medcoupling ^ + -DMEDFILE_ROOT_DIR=C:/Libraries/med ^ + -DMETIS_ROOT_DIR=C:/Libraries/metis ^ + -DHDF5_ROOT_DIR=C:/Libraries/hdf5 ^ + -DLIBXML2_ROOT_DIR=C:/Libraries/libxml2 ^ + -DBOOST_ROOT_DIR=C:/Libraries/boost ^ + -DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DCONFIGURATION_ROOT_DIR=%CD%/configuration ^ + -DPYTHON_LIBRARY=%PYTHON_ROOT%\libs\python%ABI:~2%.lib -DPYTHON_INCLUDE_DIR=%PYTHON_ROOT%\include ^ + -DPYTHON_EXECUTABLE=%PYTHON_ROOT%\python.exe ^ + -DMEDCOUPLING_PARTITIONER_METIS=OFF -DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DMEDCOUPLING_PARTITIONER_METIS=ON -DMEDCOUPLING_USE_64BIT_IDS=OFF +cmake --build build_medcoupling --config Release --target install + +:: build wheel +xcopy /y C:\Libraries\libxml2\bin\*.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages +xcopy /y C:\Libraries\hdf5\bin\hdf5.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages +xcopy /y C:\Libraries\med\lib\medC.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages +xcopy /y C:\Libraries\medcoupling\lib\*.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages +rem xcopy /y C:\Libraries\boost\lib\*.dll C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages + +curl -LO https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release_.without.peview.exe.zip +7z x Dependencies_x64_Release_.without.peview.exe.zip +Dependencies.exe -modules C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages\_medcoupling.pyd + +mkdir .\build_dir\medcoupling +xcopy /y C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages .\build_dir\medcoupling + +python -m build --wheel . + +set ORIGIN_WHEEL_FILE="medcoupling-%VERSION%-py3-none-any.whl" +set WHEEL_FILE="medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl" + +move /y ".\dist\%ORIGIN_WHEEL_FILE%" ".\dist\%WHEEL_FILE%" + +REM pushd C:\Libraries\medcoupling\lib\python%PY_VER%\site-packages +REM mkdir medcoupling-%VERSION%.dist-info +REM sed "s|@PACKAGE_VERSION@|%VERSION%|g" %GITHUB_WORKSPACE%\METADATA.in > medcoupling-%VERSION%.dist-info\METADATA +REM type medcoupling-%VERSION%.dist-info\METADATA +REM echo Wheel-Version: 1.0 > medcoupling-%VERSION%.dist-info\WHEEL +REM echo medcoupling-%VERSION%.dist-info\RECORD,, > medcoupling-%VERSION%.dist-info\RECORD +REM mkdir %GITHUB_WORKSPACE%\wheelhouse +REM 7z a -tzip %GITHUB_WORKSPACE%\wheelhouse\medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl *.py *.pyd *.dll medcoupling-%VERSION%.dist-info +REM pip install %GITHUB_WORKSPACE%\wheelhouse\medcoupling-%VERSION%-%ABI%-%ABI%-win_amd64.whl +REM pushd %GITHUB_WORKSPACE% +REM +REM python -c "import medcoupling as mc; print(mc.__version__); mc.ShowAdvancedExtensions()" +REM python -c "import medcoupling as mc; print(mc.MEDCouplingHasNumPyBindings())" +REM python -c "import medcoupling as mc; print(mc.MEDCouplingHasSciPyBindings())" From 18e4a7ecf512106d22ab99f0b89768f32f8b3bf4 Mon Sep 17 00:00:00 2001 From: bahugo Date: Tue, 23 Apr 2024 14:14:18 +0200 Subject: [PATCH 38/40] (WIP) windows compilation --- .github/workflows/stable.yml | 7 +++---- build-wheels-windows.bat | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index ef55608..06a892f 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -41,9 +41,7 @@ jobs: contents: write strategy: matrix: - version: [9.11.0, - # 9.12.0 - ] + version: [9.11.0, 9.12.0 ] include: - abi: cp38 python-version: '3.8' @@ -62,13 +60,14 @@ jobs: update-environment: true - name: Build shell: cmd - run: call .\build-wheels-windows-legacy.bat ${{ matrix.version }} ${{ matrix.abi }} + run: call .\build-wheels-windows.bat ${{ matrix.version }} ${{ matrix.abi }} - name: Archive production artifacts uses: actions/upload-artifact@v4 with: name: compilation_output path: | build_dir/dependencies + build_dir/metis dist - uses: conda-incubator/setup-miniconda@v2 with: diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index cb74c96..0c42cdb 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -27,7 +27,6 @@ mkdir %BUILD_DEP_DIR% mkdir %MEDCOUPLING_BUILD_DIR% python --version -python -m pip install build scipy call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 REM call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 @@ -51,7 +50,7 @@ copy METIS\include\metis.h %BUILD_DIR%\metis\include mkdir %BUILD_DIR%\metis\lib copy build_metis\libmetis\Release\metis.lib %BUILD_DIR%\metis\lib dir %BUILD_DIR%\metis -echo "---- ENDED METIS INSTALLATION ----" +echo "---- ENDED METIS INSTALLATION ---- :: libxml2 echo "---- libxml2 INSTALLATION ----" @@ -126,6 +125,8 @@ cmake -LAH -S med-%MED_VERSION% -B build_med -DCMAKE_INSTALL_PREFIX=%BUILD_DIR%\ -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF cmake --build build_med --config Release --target install +python -m pip install scipy + git clone --depth 1 -b V%VERSION:.=_% https://git.salome-platform.org/gitpub/tools/configuration.git configuration From a09cb1c818686f12aa10d33a20fa488f6c70fb97 Mon Sep 17 00:00:00 2001 From: bahugo Date: Tue, 23 Apr 2024 14:15:53 +0200 Subject: [PATCH 39/40] (WIP) compilation windows --- build-wheels-windows.bat | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 0c42cdb..404a909 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -18,12 +18,10 @@ echo "PATH=%PATH%" set DEP_DIR="%SCRIPTPATH%\dependencies_tmp" set BUILD_DIR="%SCRIPTPATH%\build_dir" -set BUILD_DEP_DIR="%BUILD_DIR%\dependencies" set MEDCOUPLING_BUILD_DIR="%BUILD_DIR%\medcoupling" set PYTHON_ROOT=%pythonLocation% mkdir %DEP_DIR% -mkdir %BUILD_DEP_DIR% mkdir %MEDCOUPLING_BUILD_DIR% python --version @@ -157,7 +155,7 @@ xcopy /y %BUILD_DIR%\libxml2\bin\*.dll %MEDCOUPLING_BUILD_DIR% xcopy /y %BUILD_DIR%\hdf5\bin\hdf5.dll %MEDCOUPLING_BUILD_DIR% xcopy /y %BUILD_DIR%\med\lib\medC.dll %MEDCOUPLING_BUILD_DIR% xcopy /y %BUILD_DIR%\medcoupling\lib\*.dll %MEDCOUPLING_BUILD_DIR% -rem xcopy /y %BUILD_DEP_DIR%\boost\lib\*.dll %MEDCOUPLING_BUILD_DIR% +rem xcopy /y %BUILD_DIR%\boost\lib\*.dll %MEDCOUPLING_BUILD_DIR% echo "Checking compilation file integrity" curl -LO https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release_.without.peview.exe.zip From 710bf678383395e509ed125392bdc39e1c84a353 Mon Sep 17 00:00:00 2001 From: bahugo Date: Tue, 23 Apr 2024 14:49:54 +0200 Subject: [PATCH 40/40] (WIP) windows compilation --- build-wheels-windows.bat | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-wheels-windows.bat b/build-wheels-windows.bat index 404a909..e677f4f 100644 --- a/build-wheels-windows.bat +++ b/build-wheels-windows.bat @@ -2,7 +2,7 @@ set VERSION=%1% set ABI=%2% -set "MED_VERSION=4.1.1" +set MED_VERSION="4.1.1" set PY_VER=%ABI:~2,1%.%ABI:~3% set PLATFORM="win_amd64" set PYTAG=%ABI% @@ -146,8 +146,6 @@ echo "---- ENDED MED INSTALLATION ----" dir %BUILD_DIR%\medcoupling -popd -dir :: build wheel echo "---- BUILDING WHEEL ----" @@ -163,6 +161,9 @@ curl -LO https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Depend Dependencies.exe -modules %MEDCOUPLING_BUILD_DIR%\_medcoupling.pyd echo "Ended checking compilation file integrity" +popd +dir + cd %SCRIPT_PATH% echo %MEDCOUPLING_BUILD_DIR% dir %MEDCOUPLING_BUILD_DIR%