Comments (9)
@marknj : I installed Anaconda Python as suggested, followed by pyqt through conda. Also installed f90wrap through pip (that failed, but downloading the source and running setup.py install seemed to work fine)
I also added mingw (64-bit) as recommended on the page you posted. I then created the distutils.cfg file (step 3), and added extra entries to the system path.
So, I got much further along than before, because the f90wrap python module was added successfully.
In powershell, I then ran my CMake scripts to create Makefiles (from a build directory) with the command
cmake ../../ -G "MinGW Makefiles"
It created the Makefiles, and when I ran "mingw32-make.exe", it went through the compilation commands in the Makefiles to build my libraries. That's where I noticed this error:
Traceback (most recent call last):
File "c:\users\ananth\anaconda3\lib\site-packages\f90wrap-0.1.4-py2.7-win-amd64.egg\EGG-INFO\scripts\f90wrap", line 303, in main
remove_optional_arguments)
TypeError: transform_to_generic_wrapper() takes exactly 12 arguments (14 given)
Edit: I'm digging around to see if there's any other hits for this error; wanted to report on the progress
from f90wrap.
Maybe this helps: https://synchroversum.wordpress.com/2016/03/03/windows-f2py-f90wrap-mingw-gfortran/
from f90wrap.
from f90wrap.
@nenanth : I found some links concerning this problem:
https://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat
https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/
http://www.microsoft.com/en-us/download/details.aspx?id=44266
Let me know if you finally managed to get f90wrap to work. I'm also very interested in setting up f90wrap for my colleagues who use Windows as their OS.
Edit: Just saw that you edited your message. You don't get the "unable to find vcvarsall.bat" error message anymore it seems.
from f90wrap.
@marknj sorry for the confusion. I deleted my earlier post because I thought I'd solved it, but the error is back again (restarting the computer might have had something to do with it.. I'm working through it to get back to where I was last night)
from f90wrap.
Here's a more detailed update
I have in my PATH variable the following locations
- C:\Users\Ananth\Anaconda3\Library\mingw-w64\bin
- C:\Users\Ananth\Anaconda3\Scripts (location of f90wrap)
- C:\Users\Ananth\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\VC (renamed folder 9.0 to VC, location of vcvarsall.bat)
- C:\Users\Ananth\Anaconda3\Lib\site-packages\f90wrap-0.1.4-py2.7-win-amd64.egg\f90wrap.libs (for resolving a dll not found error)
- C:\Users\Ananth\Anaconda3 (for python.exe)
After installing Microsoft C++ libraries for Python, I created a distutils.cfg file with the lines
[build]
compiler=mingw32
and put the file in C:\Users\Ananth\Anaconda3\Lib\distutils
I ran the command
python setup.py install
to build the f90wrap module from source code.
Then after running my Makefiles (command "mingw-32.exe" on CMake-generated Makefiles), it creates the python module, but runs into this one additional error related to "signal.h". The error repeats for several instances in the API, I'm copy pasting one such instance below. It seems to be related to interrupt signal handling. I think everything else may be in place.. just this one missing piece needs to be linked.
signal.h is present on my disk in
C:\Users\Ananth\Anaconda3\pkgs\mingwpy-0.1.0-py27_2\share\mingwpy\x86_64-w64-mingw32\include
Terminal output:
.\src.win-amd64-2.7_hydramodule.c: In function 'f2py_rout__hydra_f90wrap_rotorpower':
.\src.win-amd64-2.7_hydramodule.c:11087:29: error: 'SIGINT' undeclared (first use in this function)
_npy_sig_save = PyOS_setsig(SIGINT, f90wrap_abort_int_handler);
error: Command "gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1500 -IC:/Users/Ananth/Dropbox/design/hydra/cmake/build/bin/modules_hydra -I.\src.win-amd64-2.7.\src.win-amd64-2.7 -IC:\Users\Ananth\Anaconda3\lib\site-packages\numpy\core\include -IC:\Users\Ananth\Anaconda3\include -IC:\Users\Ananth\Anaconda3\PC -c .\src.win-amd64-2.7_hydramodule.c -o .\Release.\src.win-amd64-2.7_hydramodule.o" failed with exit status 1
I'm gonna try to include the location of signal.h in path and see what happens..
Edit: I tried it, unfortunately the error seems to be something else. That's as far as I got.
from f90wrap.
Seems that one should rather let Visual Studio compile: ContinuumIO/anaconda-issues#271
from f90wrap.
from f90wrap.
@marknj @jameskermode
I got a working (hack) solution without MSVS: I copied signal.h into Anaconda/include and added the following line to f2py-f90wrap
#include<signal.h>
after #include<string.h>
I'm not sure if the second part is required. Also, even if I explicitly add the path to signal.h as an include path (and verify that gcc is invoked with the correct include paths) the final gcc compilation command fails with the SIGINT error, so i copied signal.h from the mingwpy share folder into the Anaconda include path.
What doesn't work yet:
- instantiating data structures from Python (as opposed to keeping memory in Fortran modules)
- openmp for gfortran
Edit: for first issue, new thread opened: see #77
from f90wrap.
Related Issues (20)
- IndentationError with python 3.9 HOT 5
- Extra (unnecessary) newline character in .py file for long variable names HOT 3
- more explanations on the provided examples HOT 2
- Handling reserved Python words in f90wrap HOT 6
- Help wrapping a project HOT 7
- Data type determined at run time
- Issues with Compiling MPI Program HOT 3
- Support for Intel oneAPI2022
- multidimensional arrays in derived types broken if compiled with long integers as default HOT 1
- Python 3.11 support HOT 8
- Pre-build f90wrap wheels for windows HOT 3
- Derived types containing allocatable character arrays
- `integer, value, intent(in)`/`integer, value` arguments converted to/wrapped as `real`
- Wrong module class name in a call to `f90wrap.runtime.FortranDerivedTypeArray` HOT 2
- numpy > 1.23 support HOT 2
- Switch to pyproject.toml based build system HOT 7
- duplicate symbol in formal argument list HOT 2
- Issues on Mac OS X - for f90wrap 0.2.12 HOT 1
- BUG: Routines including procedure arguments (callbacks) are excluded HOT 1
- Can `f90wrap`parse FORD docstrings?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from f90wrap.