While trying to compile a program on Cygwin, I received the following error:
'x86_64-w64-mingw32-as' is not recognized as an internal or external command, operable program or batch file.
I believe 'x86_64-w64-mingw32-as' is a cross assembler for MinGW64. I have tried finding the package that contains this, but none of the packages on the Cygwin installer appear to have this assembler.
Do I need to install one of the packages, or do I need to do something else?
You can answer yourself using
http://cygwin.com/packages/
or cygcheck -p x86_64-w64-mingw32-as
Related
enter image description here
I have basically tried every tutorial out there and still cant run valgrind.
So far....
I installed valgrind from their website to directory 'memcheck'
tar xvf valgrind-3.18.1.tar.bz2
the picture is the outcome of "./configure" ,I cant tell if it was successful or not.
then the command "make" gives: make: *** No targets specified and no makefile found. Stop.
and the same for "make install"
this is what i tried to do. How to install valgrind properly?
If the output from configure contains "configure: error:" then it failed.
Installing with your package manager will be easiest.
Otherwise, you will need
A C compiler (e.g., gcc or clang), always.
GNU make, always.
Perl, probably always.
Sed and awk, always.
Autotools, m4, if regenerating the configure script.
Lots of packages if you want to generate the docs.
A C++ compiler (g++ or clang++) if you want to build and run the regression tests.
i am new to stackflow and i previously i have no background in computer system and programming. However, now i need to run analysis under cygwin for my bioinformatics project. I encounter some error when i try to compile a file name 'zone_b.linux'using cygwin, to produce an executable program. The linux file is download from web https://github.com/haddocking/HADDOCK-binding-sites-tutorial/blob/master/ana_scripts/zone_b.linux. When i try to compile using the following command under cygwin it produce the following error:
$ gcc zone_b.linux
/usr/lib/gcc/i686-pc-cygwin/6.4.0/../../../libcygwin.a(libcmain.o): In
function `main':
/usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/lib/libcmain.c:37: undefined
reference to `WinMain#16'
collect2: error: ld returned 1 exit status
Error description
I search the following error under stackoverflow, and i found two post with similar problem.
First is the post from undefined reference to `WinMain#16'. It stated that the problem is due the Microsoft'linker uses a runtime library entry point(winMainCRTStartup) that calls Microsoft's non-standard WinMain instead of standard main. So, i try the post's suggestion of including the entry by following command
$ gcc zone_b.linux /entry:winMainCRTStartup
gcc: error: /entry:winMainCRTStartup: No such file or directory
However i get the error no such file or directory. I think maybe it is because i am running under cygwin not mingW.
Second post is the Undefined reference to WinMain in Cygwin. From the post, it said use -c compile flag to only produce object file. However, for my case, i am not using any -c. Therefore, i think it is not relevant to my issue.
I would appreciate if anyone could kindly explain to me since i am new to this computing area. Thank you.
zone_b.linux is the compiled and linked executable program to run on a linux machine. It is a 32-bit ELF binary file. It will not work on a Windows machine, even using cygwin or mingw32, without re-compulation.
You probably have to compile zone_b.f, a FORTRAN source file, using the gfortran compiler to create a zone_b.exe that is usable in cygwin. I saw no instructions for this, but try something like gcc zone_b.f and cross fingers. Be sure gfortran is installed using cygwin setup.
You will also need to (re-)build the other executables (cluster_struc and contact) by performing make in the ana_scripts directory. Any supplied executables (from the git clone ... or a downloaded .zip file) will not work under cygwin.
You will need to have perl and python installed. I think perl is installed by default. You can install python2 using cygwin setup. The python script looked like it will work with python2 or python3, whichever is the default. On cygwin, today, python2 is the default python. I don't do perl, so cross your fingers.
I have been working through the LLVM Kaleidoscope Tutorial for OCaml. On the third part of the tutorial, I have navigated to the example code in the folder
OCaml-Kaleidoscope\Chapter3
I am encountering an issue when compiling with
ocamlbuild toy.byte
on cygwin. This is the code given in the tutorial to compile.
The error I am getting is
mkdir 'C:\Users\setup\Compiler\llvm\examples\OCaml-Kaleidoscope\Chapter3\_build'
''ocamlopt.opt unix.cmxa -I 'C:\OCaml\lib\ocamlbuild' 'C:\OCaml\lib\ocamlbuild/ocamlbuildlib.cmxa' myocamlbuild.ml 'C:\OCaml\lib\ocamlbuild/ocamlbuild.cmx' -o myocamlbuild.exe
'x86_64-w64-mingw32-as' is not recognized as an internal or external command,
operable program or batch file.
File "myocamlbuild.ml", line 1:
Error: Assembler error, input left in file C:\cygwin64\tmp\camlasmc2c035.s
Exit code 2 while executing this command:
''ocamlopt.opt unix.cmxa -I 'C:\OCaml\lib\ocamlbuild' 'C:\OCaml\lib\ocamlbuild/ocamlbuildlib.cmxa' myocamlbuild.ml 'C:\OCaml\lib\ocamlbuild/ocamlbuild.cmx' -o myocamlbuild.exe
I am using version 3.8.0 of llvm and version 4.02.3 of OCaml from this link.
What do I need to do to fix this?
Read the error message carefully. It says:
'x86_64-w64-mingw32-as' is not recognized as an internal or external command, operable program or batch file.
So you do not install x86_64-w64-mingw32-as, a Cygwin cross assembler for MinGW64.
If you are not familiar with resolving this kind of problems by yourself, I strongly discourage using Cygwin OCaml nor MinGW OCaml, since you will face a lot of them. Using Linux (probably on a virtual environment like VirtualBox or Vmware) is the smoothest way to play with OCaml+LLVM.
I'm attempting to compile a relatively simple Fortran executable so that it can be passed around to other Windows users that don't have Cygwin (or something of the sort) installed, however, I'm unable to get the executable to operate as a standalone. I've tried gfortran -static file.f and gfortran -static-libgfortran file.f, however other users always encounter this error:
The program can’t start because cygwin1.dll is missing from your computer. Try reinstalling the program to fix this problem.
From what I've read online (e.g. here), the -static option should be sufficient. I have verified that running the executable from my machine (DOS prompt) does work.
I have gcc (gfortran) version 4.7.3. I should also point out this is my first attempt at compiling portable Fortran.
Update
After realizing that this isn't a gfortran-specific issue (thanks to replies here), searches led me to related posts here and here
This is partially explained in the Cygwin FAQ. The solution is to install the mingw64-i686-gcc-fortran package with its dependencies, and cross-compile your code with i686-w64-mingw32-gfortran -static.
Just package the cygwin1.dll along with your binary file (both in the same folder) then it will run just fine.
I am trying to compile a simple hello world program in Haskell, with Haskell Platform 2011.2.0.1. If I load the code in WinGHCi, and use the GUI to compile, the .exe is created. Then I can run the .exe from Cygwin.
But if I try to compile the code in Cygwin (using ghc --make), linker fails. But again, if I compile from the Windows cmd prompt, then the compile+linker works fine.
Are there any other environment variables I need to import into Cygwin, to make the compile+linker work in it? I have put the following dirs in my Cygwin PATH: 2011.2.0.1/lib/extralibs/bin, 2011.2.0.1/bin (these are the only two valid Haskell related entries that I could see in the Windows environment variables).
I also noticed a couple of invalid items in the Windows environment variables (this looks like a bug in the Haskell installation):
(system var) C/ProgramFiles/Haskell/bin - this dir does not exist because I have installed Haskell in D disk.
(user var) userxxx/ApplicationData/cabal/bin - this dir does not exist.
I tried to file a bug report in HaskellPlatform, but I dont have permission to do it.
Without access to your development environment or a listing of the errors that you're getting, I can only assume that the issue is related to the way that you've set up your PATH.
GHC on Windows comes bundled with its own gcc compiler (for C code) and ld linker. If you've installed Cygwin, you've probably also installed the MinGW toolchain, which comes with its own version of gcc and ld. Then, you've probably made your PATH variable list /usr/bin before the path to the Haskell Platform binary directories, which makes ghc find the MinGW linker and C compiler before it finds the versions that were bundled with GHC.
You need to make sure that the HP directories are listed before the Cygwin directories. It should not be like this:
$ echo $PATH
/bin:/usr/bin:.../2011.2.0.1/bin
Instead, it should be like this:
$ echo $PATH
.../2011.2.0.1/bin:/bin:/usr/bin
This is only a guess at what the issue might be, and you should provide more details for a better diagnosis.