fortran-lang / fpm-haskell

The legacy Haskell implementation of fpm. No longer under active development.
MIT License
2 stars 3 forks source link

Error message on Cygwin - "pwd -W" #13

Open arjenmarkus opened 4 years ago

arjenmarkus commented 4 years ago

I have tried to build fpm on Windows/Cygwin and got an error message. The output to screen was:

$ stack build Preparing to install GHC to an isolated location. This will not interfere with any system-level installation. Downloaded ghc-8.6.5. Already downloaded. Already downloaded. Decompressing ghc-8.6.5.tar.xz...

7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18

Processing archive: C:\Users\markus\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5.tar.xz

Extracting ghc-8.6.5.tar

Everything is Ok

Size: 1773445120 Compressed: 280280296 Extracting ghc-8.6.5.tar... Extracted total of 9780 files from ghc-8.6.5.tar GHC installed to C:\Users\markus\AppData\Local\Programs\stack\x86_64-windows\ghc-8.6.5\ Cloning 536a5e6ffb148d0dd4e4c4b120913a6744097676 from https://github.com/kowainik/tomland.git Received ExitFailure 1 when running Raw command: "C:\cygwin\bin\git.EXE" submodule update --init --recursive Run from: C:\cygwin\tmp\with-repo1848\cloned Standard error:

/usr/libexec/git-core/git-sh-setup: line 344: pwd: -W: invalid option pwd: usage: pwd [-LP] Unable to determine absolute path of git directory

Apparently, an option -W to the "pwd" command is being used that does not exist in the Cygwin version of "pwd".

How to proceed?

arjenmarkus commented 4 years ago

The Linux version requires that I install parts of "stack" in /usr/local/bin. Unfortunately, I do not have root/sudo access to the Linux systems I can log on to, so that makes it difficult for me to test fpm on Linux.

LKedward commented 4 years ago

Hi @arjenmarkus, if you don't have root access on linux, please follow the manual installation procedure for stack.

LKedward commented 4 years ago

The cygwin error appears to be a fundamental incompatibility between stack and the cygwin environment (at least for this command) - I've been able to run stack build successfully on Windows via command prompt after installing git for windows. I haven't verified stack test in command prompt because I use gfortran via msys2. I don't see any reason why fpm built in this manner won't subsequently work from within cygwin.

Aside: interestingly, stack appears to install the msys2 environment on windows when stack build is run. msys2 is a newer fork of cygwin which I switched to (from cygwin) a year ago - I find I have much fewer compatibility problems with msys2.

arjenmarkus commented 4 years ago

Hi Laurence,

thanks for that reference. I hoped this morning that I might be able to use a VM for Linux, but that fails - sigh. Oh well, the instructions should help me solve that via the regular machine.

Regards,

Arjen

Op ma 22 jun. 2020 om 09:58 schreef Laurence Kedward < notifications@github.com>:

Hi @arjenmarkus https://github.com/arjenmarkus, if you don't have root access on linux, please follow the manual installation procedure https://docs.haskellstack.org/en/stable/install_and_upgrade/#manual-download_2 for stack.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fortran-lang/fpm/issues/106#issuecomment-647352518, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YR7ROV7PMBUWOC2VIWDRX4FJHANCNFSM4OD2ZINA .

arjenmarkus commented 4 years ago

Hi Laurence,

one reason for sticking to Cygwin for me is the better (?) support for installing packages. I have MinGW-w64/MSYS2 installed as well, perhaps I should indeed try it that way too.

Regards,

Arjen

Op ma 22 jun. 2020 om 10:28 schreef Laurence Kedward notifications@github.com:

The cygwin error appears to be a fundamental incompatibility between stack and the cygwin environment (at least for this command) - I've been able to run stack build successfully on Windows via command prompt after installing git for windows. I haven't verified stack test in command prompt because I use gfortran via msys2. I don't see any reason why fpm built in this manner won't subsequently work from within cygwin.

Aside: interestingly, stack appears to install the msys2 environment on windows when stack build is run. msys2 is a newer fork of cygwin which I switched to (from cygwin) a year ago - I find I have much fewer compatibility problems with msys2.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

LKedward commented 4 years ago

Hi Arjen,

one reason for sticking to Cygwin for me is the better (?) support for installing packages.

This is a fair point - it would be good to support running fpm on Cygwin, even if that means building fpm outside of Cygwin as I demonstrated.

Laurence

arjenmarkus commented 4 years ago

Hi Laurence,

just tried this, but now the "stack build" command produces the following output;

stack build No setup information found for ghc-8.6.5 on your platform. This probably means a GHC bindist has not yet been added for OS key 'linux64-gmp4'. Supported versions: ghc-7.8.4, ghc-7.10.2, ghc-7.10.3, ghc-8.0.1, ghc-8.0.2, ghc-8.2.1, ghc-8.2.2, ghc-8.4.2

I am not sure this is relevant, but the OS is fairly old - CentOS 6, if I am not mistaken.

Regards,

Arjen

Op ma 22 jun. 2020 om 09:58 schreef Laurence Kedward < notifications@github.com>:

Hi @arjenmarkus https://github.com/arjenmarkus, if you don't have root access on linux, please follow the manual installation procedure https://docs.haskellstack.org/en/stable/install_and_upgrade/#manual-download_2 for stack.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fortran-lang/fpm/issues/106#issuecomment-647352518, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YR7ROV7PMBUWOC2VIWDRX4FJHANCNFSM4OD2ZINA .

arjenmarkus commented 4 years ago

Well, the good news is that after installing the version of stack and git for "plain Windows", building fpm went smoothly and I could build a simple (one-source-file) program. (Some juggling required: I have gfortran installed for Cygwin and MinGW-w64/MSYS2, not for "plain Windows", but from a Cygwin command window, it works fine)

Regards,

Arjen

Op ma 22 jun. 2020 om 16:20 schreef Arjen Markus <arjen.markus895@gmail.com

:

Hi Laurence,

just tried this, but now the "stack build" command produces the following output;

stack build No setup information found for ghc-8.6.5 on your platform. This probably means a GHC bindist has not yet been added for OS key 'linux64-gmp4'. Supported versions: ghc-7.8.4, ghc-7.10.2, ghc-7.10.3, ghc-8.0.1, ghc-8.0.2, ghc-8.2.1, ghc-8.2.2, ghc-8.4.2

I am not sure this is relevant, but the OS is fairly old - CentOS 6, if I am not mistaken.

Regards,

Arjen

Op ma 22 jun. 2020 om 09:58 schreef Laurence Kedward < notifications@github.com>:

Hi @arjenmarkus https://github.com/arjenmarkus, if you don't have root access on linux, please follow the manual installation procedure https://docs.haskellstack.org/en/stable/install_and_upgrade/#manual-download_2 for stack.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fortran-lang/fpm/issues/106#issuecomment-647352518, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YR7ROV7PMBUWOC2VIWDRX4FJHANCNFSM4OD2ZINA .

LKedward commented 4 years ago

Hi Arjen, Unfortunately I won't be much help with the CentOS error but I'm glad you were able to get it working on Windows also. Are you able to run stack test in the fpm root folder under Cygwin? I was encountering an error with the makefile test case when I did this under msys2.

Laurence

For future users: it seems stack build is incompatible with the Cygwin environment, but fpm can still be used in Cygwin if built in "Plain Windows" as done by myself and Arjen.

arjenmarkus commented 4 years ago

Hi Laurence,

I just ran "stack test" and I get errors as well:

gfortran -c -J/fortran/fpm/fpm/test/example_packages/with_makefile/build/gfortran_debug/with_makefile -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fbounds-check -fcheck-array-temporaries -fbacktrace -o /fortran/fpm/fpm/test/example_packages/with_makefile/build/gfortran_debug/with_makefile/hello_makefile.o src/hello_makefile.f90 f951: Warning: Nonexistent include directory ‘/fortran/fpm/fpm/test/example_packages/with_makefile/build/gfortran_debug/with_makefile’ [-Wmissing-include-dirs] src/hello_makefile.f90:10:25:

10 | end module hello_makefile | 1 Fatal Error: Cannot open module file ‘/fortran/fpm/fpm/test/example_packages/with_makefile/build/gfortran_debug/with_makefile/hello_makefile.mod0’ for writing at (1): No such file or directory compilation terminated.

So, indeed the same case is failing here as well.

Regards,

Arjen

Op ma 22 jun. 2020 om 20:15 schreef Laurence Kedward notifications@github.com:

Hi Arjen, Unfortunately I won't be much help with the CentOS error but I'm glad you were able to get it working on Windows also. Are you able to run stack test in the fpm root folder under Cygwin? I was encountering an error with the makefile test case when I did this under msys2.

Laurence

For future users: it seems stack build is incompatible with the Cygwin environment, but fpm can still be used in Cygwin if built in "Plain Windows" as done by myself and Arjen.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

LKedward commented 4 years ago

Hi Arjen, Thanks for confirming - I wasn't sure if something was wrong with my msys2 setup. Not sure what the problem is, but it looks like it only affects the makefile builds. Regards, Laurence