Code Monkey home page Code Monkey logo

Comments (9)

nenanth avatar nenanth commented on June 30, 2024 1

@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.

marknj avatar marknj commented on June 30, 2024

Maybe this helps: https://synchroversum.wordpress.com/2016/03/03/windows-f2py-f90wrap-mingw-gfortran/

from f90wrap.

nenanth avatar nenanth commented on June 30, 2024

from f90wrap.

marknj avatar marknj commented on June 30, 2024

@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.

nenanth avatar nenanth commented on June 30, 2024

@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.

nenanth avatar nenanth commented on June 30, 2024

Here's a more detailed update
I have in my PATH variable the following locations

  1. C:\Users\Ananth\Anaconda3\Library\mingw-w64\bin
  2. C:\Users\Ananth\Anaconda3\Scripts (location of f90wrap)
  3. C:\Users\Ananth\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\VC (renamed folder 9.0 to VC, location of vcvarsall.bat)
  4. 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)
  5. 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.

marknj avatar marknj commented on June 30, 2024

Seems that one should rather let Visual Studio compile: ContinuumIO/anaconda-issues#271

from f90wrap.

nenanth avatar nenanth commented on June 30, 2024

from f90wrap.

nenanth avatar nenanth commented on June 30, 2024

@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:

  1. instantiating data structures from Python (as opposed to keeping memory in Fortran modules)
  2. openmp for gfortran

Edit: for first issue, new thread opened: see #77

from f90wrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.