-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
84 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Building with VS 2019-C++ and MINGW64-gfortran 8.1 | ||
|
||
* It appears that for newer Pythons one should use Visual C++ as a compiler, rather than MINGW64-GCC. | ||
* For newer versions of numpy, you apparently need a recent version of MINGW64-gfortran. The one that comes with Anaconda (as part of the mingw package) is 4.7.0 which does not work! | ||
|
||
Here is how I have managed to build a wheel for Python 3.7 that seems to work: | ||
|
||
* I have Visual Studio 2017 installed for C++ stuff, however, the VS build tools are available for free. Try here for download details: https://wiki.python.org/moin/WindowsCompilers> | ||
** Anaconda might also have the VC build tools (package vc) but I have never used it. | ||
* Create a conda environment: conda create -n "pscbuild" python=3.7 ipython pip wheel numpy scipy matplotlib | ||
** Alternatively, if using an existing environment, make sure the Anaconda mingw package is not installed (remove it now) | ||
* I unpacked MINGW64 that I obtained here (https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z/download) based on the information I found here (https://stackoverflow.com/questions/48826283/compile-fortran-module-with-f2py-and-python-3-6-on-windows-10) | ||
* In a terminal I then activated the conda environment and added the new GCC to the path (making sure there was no existing gcc) | ||
** conda activate pscbuild | ||
** path=c:\tools\mingw64\bin;%path% | ||
* Build/install PySCeS with python setup.py build --compiler=msvc --fcompiler=gfortran install bdist_wheel | ||
|
||
For conda build we need the following: | ||
|
||
* Open a VS2015 terminal (v10) and change to your build directory | ||
** path=c:\tools\mingw64\bin;%path% | ||
** path="c:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64";%path% | ||
* 3.6 <= Python < 3.8 | ||
** conda build --python 3.6 --numpy 1.15 . | ||
** conda build --python 3.7 --numpy 1.15 . | ||
* Python >= 3.8 | ||
** conda build --python 3.8 --numpy 1.18 . | ||
|
||
* cleanup and upload | ||
** conda build purge | ||
** conda clean --all | ||
** anaconda upload -u pysces-builds\* | ||
|
||
|
||
|
||
Brett 2020 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
copy ..\_h_env\libs\libpython27.dll.a ..\_h_env\libs\libpython27.a | ||
copy ..\_h_env\libs\libmsvcr90.dll.a ..\_h_env\libs\libmsvcr90.a | ||
"%PYTHON%" setup.py build --compiler=mingw32 install --record=record.txt | ||
::copy ..\_h_env\libs\libpython27.dll.a ..\_h_env\libs\libpython27.a | ||
::copy ..\_h_env\libs\libmsvcr90.dll.a ..\_h_env\libs\libmsvcr90.a | ||
"%PYTHON%" setup.py build --compiler=msvc --fcompiler=gfortran install --record=record.txt | ||
if errorlevel 1 exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters