From e6f98f87fc60e58e03788a409b2dd6fff92263db Mon Sep 17 00:00:00 2001 From: Andreas Tillack Date: Fri, 1 Nov 2024 16:19:12 -0400 Subject: [PATCH 1/3] Adjust setup.py to work on newer M3 Macs. --- build/python/setup.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/build/python/setup.py b/build/python/setup.py index 37ad08d..8966469 100644 --- a/build/python/setup.py +++ b/build/python/setup.py @@ -255,13 +255,14 @@ def build_extensions(self): # To get the right @rpath on macos for libraries self.extensions[0].extra_link_args.append('-Wl,-rpath,' + self.library_dirs[0]) self.extensions[0].extra_link_args.append('-Wl,-rpath,' + '/usr/lib') - + print('- extra link args: %s' % self.extensions[0].extra_link_args) # Replace current compiler to g++ self.compiler.compiler_so[0] = "g++" self.compiler.compiler_so.insert(2, "-shared") + # Remove compiler flags if we can remove_flags = ["-Wstrict-prototypes", "-Wall"] for remove_flag in remove_flags: try: @@ -270,13 +271,19 @@ def build_extensions(self): print('Warning: compiler flag %s is not present, cannot remove it.' % remove_flag) pass - self.compiler.compiler_so.append("-std=c++11") - self.compiler.compiler_so.append("-Wno-long-long") - self.compiler.compiler_so.append("-pedantic") # Source: https://stackoverflow.com/questions/9723793/undefined-reference-to-boostsystemsystem-category-when-compiling - self.compiler.compiler_so.append('-DBOOST_ERROR_CODE_HEADER_ONLY') + vina_compiler_options = [ + "-std=c++11", + "-Wno-long-long", + "-pedantic", + '-DBOOST_ERROR_CODE_HEADER_ONLY' + ] + + print('- compiler options: %s' % (self.compiler.compiler_so + vina_compiler_options)) + + for ext in self.extensions: + ext.extra_compile_args += vina_compiler_options - print('- compiler options: %s' % self.compiler.compiler_so) build_ext.build_extensions(self) From 19535162ae470cb033dc31b7e87f8bf995f5a70c Mon Sep 17 00:00:00 2001 From: Andreas Tillack Date: Fri, 1 Nov 2024 19:59:48 -0400 Subject: [PATCH 2/3] Update compile-binaries.yaml to use windows-2019 --- .github/workflows/compile-binaries.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compile-binaries.yaml b/.github/workflows/compile-binaries.yaml index 9a1b947..6e73656 100644 --- a/.github/workflows/compile-binaries.yaml +++ b/.github/workflows/compile-binaries.yaml @@ -36,7 +36,7 @@ jobs: arch: x86_64 - os: macos-latest arch: aarch64 - - os: windows-latest + - os: windows-2019 steps: - name: Checkout @@ -71,7 +71,7 @@ jobs: cd ./build/mac/release make - name: Compile Vina for Windows x64 - if: matrix.os == 'windows-latest' + if: matrix.os == 'windows-2019' run: | $Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.77.0/boost_1_77_0-msvc-14.2-64.exe" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 @@ -85,4 +85,4 @@ jobs: with: name: binaries-${{ matrix.os }}${{ matrix.arch }} path: | - ./**/release/vina* \ No newline at end of file + ./**/release/vina* From 5289b9cdca9589cabd871502032fab3a11a5fb5b Mon Sep 17 00:00:00 2001 From: Andreas Tillack Date: Fri, 1 Nov 2024 20:07:15 -0400 Subject: [PATCH 3/3] More GH action updates to enable Windows --- .github/workflows/compile-binaries.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile-binaries.yaml b/.github/workflows/compile-binaries.yaml index 6e73656..a0b6a68 100644 --- a/.github/workflows/compile-binaries.yaml +++ b/.github/workflows/compile-binaries.yaml @@ -75,7 +75,9 @@ jobs: run: | $Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.77.0/boost_1_77_0-msvc-14.2-64.exe" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - (New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe") + $wcl=(New-Object System.Net.WebClient) + $wcl.Headers.Add("user-agent", "Wget/1.21.0") + $wcl.DownloadFile($Url, "$env:TEMP\boost.exe") Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES" cd .\build\windows .\compile.bat