FoBiS icon indicating copy to clipboard operation
FoBiS copied to clipboard

MS Windows support

Open jacobwilliams opened this issue 7 years ago • 19 comments

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

jacobwilliams avatar May 30 '17 14:05 jacobwilliams

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

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

szaghi avatar May 30 '17 14:05 szaghi

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

jacobwilliams avatar Jun 01 '17 04:06 jacobwilliams

@jacobwilliams

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

szaghi avatar Jun 01 '17 06:06 szaghi

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

f-baerenbold avatar Aug 21 '17 19:08 f-baerenbold

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 avatar Aug 22 '17 11:08 zimmermm

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 avatar Aug 22 '17 11:08 zimmermm

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 avatar Aug 23 '17 10:08 zimmermm

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.

zimmermm avatar Aug 23 '17 13:08 zimmermm

No, still same error message.

f-baerenbold avatar Aug 24 '17 08:08 f-baerenbold

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.

zimmermm avatar Aug 24 '17 10:08 zimmermm

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.

szaghi avatar Aug 25 '17 06:08 szaghi

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

f-baerenbold avatar Aug 25 '17 10:08 f-baerenbold

Also works with Anaconda for me now.

f-baerenbold avatar Aug 25 '17 11:08 f-baerenbold

@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

szaghi avatar Sep 04 '17 09:09 szaghi

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

zimmermm avatar Sep 04 '17 10:09 zimmermm

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.

jacobwilliams avatar Mar 20 '18 21:03 jacobwilliams

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 avatar Mar 21 '18 08:03 szaghi

@zimmermm @jacobwilliams @Diftin @zbeekman

Can I close this issue?

Cheers

szaghi avatar Sep 15 '20 09:09 szaghi

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.

jacobwilliams avatar Dec 14 '20 16:12 jacobwilliams