Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MS Windows support #94

Open
jacobwilliams opened this issue May 30, 2017 · 19 comments
Open

MS Windows support #94

jacobwilliams opened this issue May 30, 2017 · 19 comments
Assignees
Labels

Comments

@jacobwilliams
Copy link

FoBiS doesn't currently work on Windows. It seems to fail pretty early with:

Traceback (most recent call last):
  File "C:\Anaconda3\Scripts\FoBiS.py", line 21, in <module>
    main()
  File "C:\Anaconda3\lib\site-packages\fobis\fobis.py", line 45, in main
    run_fobis()
  File "C:\Anaconda3\lib\site-packages\fobis\fobis.py", line 58, in run_fobis
    configuration = FoBiSConfig(fake_args=fake_args)
  File "C:\Anaconda3\lib\site-packages\fobis\FoBiSConfig.py", line 58, in __init__
    self.fobos = Fobos(cliargs=self.cliargs, print_n=self.print_b, print_w=self.print_r)
  File "C:\Anaconda3\lib\site-packages\fobis\Fobos.py", line 60, in __init__
    if cliargs.fobos:
AttributeError: 'Namespace' object has no attribute 'fobos'

Probably there are other issues as well. I can try to take a crack at this if you want. It would be great if it also worked on Windows (for poor Fortran Windows users).

@szaghi szaghi added the bug label May 30, 2017
@szaghi szaghi self-assigned this May 30, 2017
@szaghi
Copy link
Owner

szaghi commented May 30, 2017

@jacobwilliams

Dear Jacob,

FoBiS doesn't currently work on Windows.

I was afraid about this... MS Windows is out of my scope.

It seems to fail pretty early with:

This sounds good, at least. Are you using Python 2 or 3? Python 3 is still in an early phase of support, namely I have not yet studied in details how correctly support also Python 3.

Probably there are other issues as well. I can try to take a crack at this if you want. It would be great if it also worked on Windows (for poor Fortran Windows users).

I would like to support all poor people, no matter the OS, but I am afraid I am not up to the task. If you can test it on MS Windows I can try to fix, but alone I will fail: my MS Windows "facility" lacks of a compiler still 😄

I cannot say when, but I can try to install GNU gcc on my virtualized MS Windows (yes, I had to use it due to my colleagues who seem to cannot live without MS Office...).

I'll dig it deeper soon (I hope).

Thank you very much for reporting this, it is really appreciated.

Cheers

@jacobwilliams
Copy link
Author

I am happy to help (but won't have time for a couple of weeks).

@szaghi
Copy link
Owner

szaghi commented Jun 1, 2017

@jacobwilliams

Do not worry, you are the only MS user I am aware of 😄

@f-baerenbold
Copy link

Any updates? Same error here (Win7, Anaconda w python 3.6)

@zimmermm
Copy link

The issue could well be related to python 3.
The verison I that has been merged with pull request #93 (https://github.com/zimmermm/FoBiS) works well for me under windows and with python 2.7.

@zimmermm
Copy link

Ok, found the issue!
Argparse behaves differently in python 3 than in python 2.7 (see https://stackoverflow.com/questions/22990977/why-does-this-argparse-code-behave-differently-between-python-2-and-3). The good news, there is a simple fix for it.
I'll try to fix&pull request tomorrow..

@zimmermm
Copy link

zimmermm commented Aug 23, 2017

It seems I was a little hasty. I can't reproduce the behaviour you describe (I don't use Anaconda though).

I only had some issues with the ANSI escape sequences which I resolved in the following fork: based on FoBiS 2.2.6, https://github.com/zimmermm/FoBiS

I'll try to track down the above behaviour with @Diftin who is also using anaconda..

@zimmermm
Copy link

Ooh, I can reproduce the above behaviour if I don't name the specific 'subparser'.

@jacobwilliams & @Diftin: The correct command to build a project is: FoBiS.py build
Tell me if this solves the problem for you.

@f-baerenbold
Copy link

No, still same error message.

@zimmermm
Copy link

I also tested FoBiS.py (my forked version) with Anaconda 4.4.0, Win7, via Windows CMD or GitBash and it works perfectly. The issue must be specific to your installation/windows machine.

@szaghi
Copy link
Owner

szaghi commented Aug 25, 2017

Dear @Diftin @zimmermm @jacobwilliams ,

I am very sorry for my delay, but August has been my summer holidays, I'll come back in office next Monday. Anyhow, I cannot help with MS Windows. If your forks work well, I'll be happy to merge them into the mainstream repo.

Cheers.

@f-baerenbold
Copy link

I uninstalled Anaconda and downloaded Python 3.62 from python.org and now it works fine with the forked version!

@f-baerenbold
Copy link

Also works with Anaconda for me now.

@szaghi
Copy link
Owner

szaghi commented Sep 4, 2017

@Diftin @zimmermm

Hi all,

I am came back. Can you make aware of your recent progresses? Recently I have disabled colors in some FoBiS "modes" because it causes some issues, maybe it was related to your issues.

Can I merge your forks?

Cheers

@zimmermm
Copy link

zimmermm commented Sep 4, 2017

Hi Stefano
Welcome back! Short summary is: your current version (2.2.6) works perfectly on windows when colors are disabled.

I couldn't reproduce the initial issue that @Diftin and @jacobwilliams reported. For @Diftin the issue was resolved 1) after uninstalling Anaconda and installing Python 3.62 from python.org and 2) also after reinstalling Anaconda; both times using the current FoBiS version on github and disabling the colors. (I am not sure if the GitHub version is the same as you find on pip?)

The colors infact cause some issues! I first thought it is only on windows cmd because it cannot handle the \033[ escape sequences. That's why I import and enable 'colorama' in my forked version when the script runs on a windows platform. However, I now realized that the colors also cause some issues on linux. I therefore completely disabled the colors when I work with FoBiS (but this is not yet online).

Maybe you can close my pull request and just disable the colors for the moment? And also update the version on pip.

Cheers

@jacobwilliams
Copy link
Author

The current version works for me on Windows with intel but I have to make one change. In Compiler.py, change:

   self.modsw = '-module '

to

   self.modsw = '/module:'

Since the Windows syntax for this different from the Linux one.

Also I get various warnings like:

ifort: command line warning #10161: unrecognized source type 'bin\obj\json_value_module.o'; object file assumed

I think because on Windows, it wants the extension to be .obj.

@szaghi
Copy link
Owner

szaghi commented Mar 21, 2018

Hi Jacob,

as you know I have not access to a Windows PC, thus it is difficult for me to support MS Windows feature, but later today I'll try to integrate your patch.

@szaghi
Copy link
Owner

szaghi commented Sep 15, 2020

@zimmermm @jacobwilliams @Diftin @zbeekman

Can I close this issue?

Cheers

@jacobwilliams
Copy link
Author

It would be nice to have Windows support. :)

The first issue is easily fixed I think like this:

    if platform.system()=='Windows':
      self.modsw = '/module:'
    else:
      self.modsw = '-module '

but the .o assumption is made in many parts of the code. It would need to be compiler/platform specific, then we could set .obj for Windows+Intel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants