cmake is not able to properly read paths from windows's unix-like shells - windows

I followed llvm-clang install instructions but having issues with configure command line. I tried both MSYS2 64 bit and Windows mingw for the purpose but similar issues appear: cmake seems confusing between windows and unix paths.
Thus, when I try MSYS2 the following error message is thrown:
File /d/mylib/llvm/D:/mylib/llvm/utils/llvm-build/llvmbuild/main.py does not exist.
It seems that prefix /d/mylib/llvm/ is wrongly added to the path. Note that in this case am using cmake installed with pacman -S cmake
On the other hand, when using windows mingw64 (that comes with git windows), am getting this error
CMake Error: File /d/mylib/llvm/utils/TableGen/LLVMBuild.txt does not exist
though the path is correct... Note that I in this case am using cmake installed directly on windows (using windows gui).
Any ideas please?

Related

nvim_treesitter installation on windows

bad English (sorry).
I'm trying to get nvim_treesitter to work on my windows machine, on my Linux one it worked great but now when I try on windows the :checkhealth nvim_treesitter gives:
health#nvim_treesitter#check
Installation
ERROR: tree-sitter executable not found
OK: git executable found.
ERROR: cc executable not found.
ADVICE:
Check that either gcc or clang is in your $PATH
Parser/Features H L F I
Legend: H[ighlight], L[ocals], F[olds], I[ndents]
*) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang}
and I'm totally new to this thing, any advice would help:)
The main issue from my perspective is "ERROR: cc executable not found.". It means nvim_treesitter couldn't find any compiler on your machine, and so no parsers could be compiled and installed when you issue ":TSInstall {some_parser_name}" commands.
If you have Visual Studio installed (since nvim gets compiled by VS 2017, it's fine to have 2017 or 2019 studio, I guess), try this:
Run "x64 Native Tools Command Prompt for VS 201x" if you've downloaded nvim-win64 release package or "x86 Native Tools Command Prompt for VS 201x" otherwise (nvim-win32 package)
Run nvim in this command prompt (i.e. nvim-qt GUI)
Install any parsers you want, let's say ":TSInstall c". Output should look like this:
Downloading...
Compiling...
Treesitter parser for c has been installed.
Optionally run :checkhealth nvim_treesitter again to see if everything is fine
Thereafter you can run nvim in any console, not via VS Tools one only (still use it to install or update parsers though).
Please also see https://github.com/nvim-treesitter/nvim-treesitter/wiki/Windows-support for various instructions.
For the Error: tree-sitter: You can checkout creating parsers and follow the description or you download the windows binary of the binary files and put it into a directory on your PATH.
For the Error: cc: You need to install gcc
Try to apply this vsc tutorial from Prerequisites №3
I had the same issue. It helped me.
Ok, here's what I've done and what helped me:
Go to https://www.msys2.org and follow ALL of the installation steps that are described there:
Download and install
Run pacman -Syu comman
Run pacman -S --needed base-devel mingw-w64-x86_64-toolchain and choose mingw-w64-x86_64-gcc there.
After everything is installed, put into your PATH Environment Variable the path to MinGW64\bin folder (if you installed everything to the default folder it will be c:\msys64\mingw64\bin)
And you are good to go! Now open nvim and run
:TSInstall <yourlang>
For example, :TSInstall php
PS: you can get the list of available languages using :TSInstallInfo

Installing Make in Cygwin

I am trying to build a Linux project in windows 7 environment usign cygwin. However I am continuously getting below error while configuring make for cygwin installation.
-bash: make: command not found
After searching on inernet the only solution is re running of setup and installed make package. I have installed automake1.15 but it is in noarch folder and there is no binary make.exe in bin folder.
run command setup-x86_64.exe -q --packages=make(because make is not installed) in command prompt where the setup-x86_64.exe file is available
There's a big difference between the 2:
[GNU]: Automake - Generates Makefile templates
[GNU]: GNU Make - Builds software from sources (via Makefiles)
So you need to select Make from Cygwin setup.
Notes:
Automake (or any package, as a matter of fact) is downloaded in the noarch dir, when it's compatible with any OS (Cygwin, in this case) architecture (32 bit and 64 bit (currently)), meaning that it doesn't contain binaries (.exes, .dlls (.sos)), only script-like files
Make on the other hand, does contain binaries (/usr/bin/make itself it is a binary) and will be downloaded in the appropriate dir (x86_64 or x86)
The download dir is not the same thing as the installation dir (there may be more than one, and it's under Cygwin installation dir)
For more (generic) details, check [Cygwin]: Installing and Updating Cygwin Packages.
[Cygwin]: Cygwin FAQ - Does the Cygwin Setup program accept command-line arguments? might also be a good starting point for command line options (check [SO]: Installing Make in Cygwin (#PJain's answer)).
Final note: Cygwin is kind of obsolete. Switch to WSL(2), which runs a real Ubuntu (no wrappers / adapters) as a VM (in Hyper-V - which runs at a totally different level).

omnet++ installation error in windows 7

I am tring to install omnet++ but it gives me error "windows can not find ",is there anyone can help
I have been trying mingmenv.cmd gives me the same error
it gives as shown below error when I try to install:
First of all, did you unpack the OMNeT Windows installation file with the on-board ZIP tools or another program? Try to use programs like WinRAR or 7-Zip to unpack the OMNeT++ installation, the on-board ZIP tool from Windows 7 might have problems with the MinGW files.
Second, does the path to the OMNeT++ installation contain any spaces or special characters? This might also be the source of errors.
Third, does the message immediately show after you start the mingwenv.cmd or after you start it and try to run ./configure or make to configure and build OMNeT?? Check if no antivirus might block the OMNeT sources / helper programs.
General note: under Windows, you always use the mingwenv.cmd shell to compile OMNeT, the normal Windows command environment does not have the necessary paths or settings for OMNMeT.

CLion Installation: Cmake compilers not found, GDB not found

I'm switching from VS to CLion and they said I needed to install Cygwin and CMake. I then installed both of them. I tried use bundled, but CLion still gives me these errors make: not found C Compiler: not found C++ Compiler: not found GDB: not found.
I have installed CMake under the path C:\Users\Gaga\Downloads\cmake-3.4.1 but I don't see a cmake.exe, the closest thing is cmake.cxx.
Without these I'm not able to compile anything, please help
In the "Use specified" field I put C:\cygwin64\bin\cmake.exe your path may be different. Just ensure you have CMake, Make, gdb and gcc installed already in Cygwin (using the Cygwin setup.exe not via the CMake website) but I believe Clion checks if you have them installed after inputting the path.
The workaround would be to use MinGW. If you download it from the website it should come with cmake, and take care of the errors.
http://mingw.org/
When extract it and go to the installer you should check something like gcc and then from the top left corner something like 'install packages'
Be sure not to accidentally download the source, which I did, which would lead you toward this error: CLion: CMake Errors Source directory does not exist
Edit: So over a year later, I've learned a little more about Cygwin and mingw beyond what the internet says. CLion needs a "Unix-like" environment. If you use CLion on MacOS or a Linux it's already Unix based. Anything that is "POSIX" compliant will work. CygWin is a terminal emulator for windows where Unix commands like mkdir work. MinGW is something similar but not posix. Comes with GCC tho. I'm still a noob.
I had the same problem.
While installing cygwin, need to select the packages of cmake, gcc, gdb
Got the answer from the below link.
Select Packages while installing cygwin
After the installation go to the configuration page and select the cygwin directory. CLion will identify the configuration and you are done...

How to compile a yacc (.y) file using Bison in Windows environment?

I've read http://dinosaur.compilertools.net/bison/bison_5.html#SEC25. But following those instruction i can not compile my yacc file using bison
How do i compile my file in windows 7 ... ?
Please help me to do this.
There is a common reason why bison will not operate properly on Windows and is mentioned in the install instructions but often overlooked. It is important that the name of the location of the directory that bison (and flex) is installed in (the path) does not contain a space. in particular this means that it cannot be placed under C:\Program Files\. The problem is that this directory might be suggest as the default install location. It is sometimes necessary to manually change the default to somethings else (like C:\GnuWin\ or similar). It is also usually necessary to manually add the appropriate directory to the PATH environment variable. Once this has been done there should be no problems in running bison and flex from the command prompt. It would normally be used in the following way:
flex lang.l
bison lang.y
gcc -o lang.exe lang.tab.c -lfl
It is not necessary to install MinGW, Cygwin or use Powershell or a VM or use linux as indicated by #DavidHefferman
If you still can't get it right, I even have an instructional video!
Using those Unix commands in Windows PowerShell might work, but I'm not sure and I'm currently not on Windows, so I can't check it.
If that fails you could try installing Cygwin (a basic Linux environment in Windows). You'd have to select the bison package during installation. It comes with its own shell that you can use.
Actually my personal favorite when programming under Windows is setting up a virtual machine with VirtualBox. That way you could use a real Linux environment without actually leaving Windows.
Good luck!

Resources