MinGW or Cygwin GCC? - eclipse

I want to install a GCC compiler in Windows for the Eclipse IDE. I know there are two options: MinGW GCC or Cygwin GCC. Which one is better for Eclipse CDT? Any experience or suggestions will be appreciated.

Using Cygwin means your program will be dependent on cygwin1.dll, which is essentially a layer that allows POSIX functionality to be used in a Windows environment. Compiling with the standard MinGW GCC provides no such dependancy. This means however, if you intend to compile with MinGW GCC, you will not have access to POSIX functions such as fork() and exec().
For more information on the differences between Cygwin and MinGW, see here.

My offhand thoughts are, if you need cygwin, you need it. For instance compiling programs that were developed for Unix and have symbolic links and shell scripts in the build system.
If you don't need it, you don't want it. And compiling under linux on a virtual machine is often a better choice than going the cygwin route.
So mingw is perfectly fine. Works fine, simple to use.
Also: You might consider codelite (www.codelite.org) instead of Eclipse.

Personally I like Cygwin better, it has a lot of installation options and it feels a lot like the terminal you'll find on a Linux machine. It provides a pretty substantial set of Linux-like capabilities, something that Windows fails at miserably.

Cygwin and Mingw are not interchangeable alternatives. Cygwin is used to compile POSIX API programs, Mingw is used compile Windows API programs.
Chose one or the other depending on what kind program you're going to write.

Wikipedia Says:
MinGW forked from version 1.3.3 of Cygwin. Although both Cygwin and MinGW can be used to port UNIX software to Windows, they have different approaches: Cygwin aims to provide a complete POSIX layer that provides emulations of several system calls and libraries that exist on Linux, UNIX, and the BSD variants. The POSIX layer runs on top of Windows, sacrificing performance where necessary for compatibility. Accordingly, this approach requires Windows programs written with Cygwin to run on top of a copylefted compatibility library that must be distributed with the program, along with the program's source code. MinGW aims to provide native functionality and performance via direct Windows API calls. Unlike Cygwin, MinGW does not require a compatibility layer DLL and thus programs do not need to be distributed with source code.
Because MinGW is dependent upon Windows API calls, it cannot provide a full POSIX API; it is unable to compile some UNIX applications that can be compiled with Cygwin. Specifically, this applies to applications that require POSIX functionality like fork(), mmap() or ioctl() and those that expect to be run in a POSIX environment. Applications written using a cross-platform library that has itself been ported to MinGW, such as SDL, wxWidgets, Qt, or GTK+, will usually compile as easily in MinGW as they would in Cygwin.
The combination of MinGW and MSYS provides a small, self-contained environment that can be loaded onto removable media without leaving entries in the registry or files on the computer. Cygwin Portable provides a similar feature. By providing more functionality, Cygwin becomes more complicated to install and maintain.
It is also possible to cross-compile Windows applications with MinGW-GCC under POSIX systems. This means that developers do not need a Windows installation with MSYS to compile software that will run on Windows without Cygwin.

Related

Vim plugin does not recognize existing Perl support

I've been using the CoqIDE plugin for Vim on Linux machines for editing Coq files. Now I'm trying to install it on Windows 8. But when I try to source the plugin, I get
Your vim doesn't support Perl. Install it before using CoqIDE mode.
which is strange, because with :version I clearly see +perl/dyn included. Is this different from the +perl that I need?
I heard somewhere that you need to have Perl installed before Vim to get a Perl-enabled Vim, so I tried that as well. I uninstalled Vim, installed Strawberry Perl 5.18.2.2 (64bit), and reinstalled Vim. Still the same problem.
If the solution involves manually compiling binaries, I would really appreciate detailed instructions as I don't have any experience with it.
+perl/dyn just specifies that Vim has been compiled with dynamic Perl support; it doesn't yet check that the Perl library can be loaded successfully. To do that, try executing a Perl command, e.g.:
:perl VIM::Msg("Hello")
This probably yields on your system:
E370: Could not load library perl510.dll
Sorry, this command is disabled: the Perl library could not be loaded.
Next, you'd then have to investigate whether a proper Perl version has been installed and the DLL is accessible (though the PATH).
Download DWIMPerl for windows. I'm running win7 64 and gvim 7.4.2. Using strawberryperl and activeperl resulted in :echo has('perl') to yield 0. By switching to DWIMPerl (and ensuring my PATH env variables are proper) :echo has('perl') now yields 1 using the standard gvim distribution. This is important for vim extensions like dbext which require proper support for perl interfaces.

How to use MPI (openMPI or MPICH2) with minGW - GNU gfortran compiler

I am using the eclipse PTP IDE to develop MPI code, I want to be able to compile MPI on windows, it seems to provide c++ and c binding, but I am writing using fortran and gfortran compiler and would like to work in windows, the current problem doesn't exist on linux because there it is possible to compile the libraries locally in linux and use the .mod modules.
I wanted to compile the modules using cygwin but the GNU gfortran version on cygwin is too old, and I wasn't successful openMPI or MPICH2 on windows using miniGW
any suggestions? maybe using c++ binding in fortran 2003, I write my code in fortran 2003 so it support this feature.
Documentation on this issue is lacking.
Thank you.
According to the MPICH2 Installer's Guide MPICH2 can be built under cygwin (see section 9.3 of the same document), so the version of gfortran shouldn't be an issue. Have you followed the instructions in this document (in particular section 2)?

Compile native Windows executable from perl source on linux

I have a perl script on a linux system that I would like to compile to generate an executable that runs natively on Windows. I would like to do this with free software, preferably Perl PAR / pp. Is this possible?
You need to run pp on a windows machine to make a windows binary. I know it works, I've done it. Any Linux specific code will need to be made at least platform-independent or windows specific, but Perl is a generally platform independent language. Using File::Spec will help.

Compile GTK+ with Cygwin

I have created an application in linux with GTK2 as GUI. It uses some linux-specific headers (e.g. arpa/inet.h) so to run under Windows I have to compile it with Cygwin. I downloaded the latest installer and choose to install GTK2 and its dependencies. My program compiled fine. But it needs X server to be running! I has old-style, ugly graphics and it doesn't open in a different window, like all Windows' applications do, but inside X server's window. Because of this it can't be portable. I found that guide, which is exactly what I need, but I get an error when I run "make" for GTK2 (undefined reference for _IID_IFilePersist, although I have uuid installed - also tried it with gtk2.20). Can you suggest what to do to build my application with cygwin? Or what do I need to install for the "_IID_IFilePersist" error? Thanks in advance!
There's prebuilt packages for windows that doesn't rely on X. http://gtk-win.sourceforge.net/home/index.php/Downloads
If you don't want X server to be running, then you're going to have to port the linux-specific parts of your code and compile with MinGW rather than Cygwin.

What's a good development environment for Perl? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 months ago.
Improve this question
I develop applications using PHP or Java and will study Perl for the first time.
For PHP and Java, there are integrated development environments such as Eclipse, and debugging environment was regulated well, but, in the case of Perl, what kind of development environment do people use?
Is there a recommended IDE?
I would prefer a free debugging environment.
As Sinan stated, there are some IDEs for Perl. Padre is worth a mention. It is being actively developed by the Perl community.
From perlfaq3: Is there an IDE or Windows Perl Editor?, where it looks much nicer.
If the Padre people want their stuff in here, just add the right bits. The source lives in my perlfaq github repo. You can fork it, edit the file right in GitHub, and send me a pull request.
Is there an IDE or Windows Perl Editor?
Perl programs are just plain text, so any editor will do.
If you're on Unix, you already have an IDE--Unix itself. The Unix
philosophy is the philosophy of several small tools that each do one
thing and do it well. It's like a carpenter's toolbox.
If you want an IDE, check the following (in alphabetical order, not
order of preference):
Eclipse
The Eclipse Perl Integration Project integrates Perl
editing/debugging with Eclipse.
Enginsite
Perl Editor by EngInSite is a complete integrated development
environment (IDE) for creating, testing, and debugging Perl
scripts; the tool runs on Windows 9x/NT/2000/XP or later.
Komodo
ActiveState's cross-platform (as of October 2004, that's Windows,
Linux, and Solaris), multi-language IDE has Perl support, including
a regular expression debugger and remote debugging.
Open Perl IDE
Open Perl IDE is an integrated development environment for writing
and debugging Perl scripts with ActiveState's ActivePerl
distribution under Windows 95/98/NT/2000.
OptiPerl
OptiPerl is a Windows IDE with simulated CGI environment, including
debugger and syntax highlighting editor.
PerlBuilder
PerlBuidler is an integrated development environment for Windows
that supports Perl development.
visiPerl+
From Help Consulting, for Windows.
Visual Perl
Visual Perl is a Visual Studio.NET plug-in from ActiveState.
Zeus
Zeus for Window is another Win32 multi-language editor/IDE that
comes with support for Perl
For editors: if you're on Unix you probably have vi or a vi clone
already, and possibly an Emacs too, so you may not need to download
anything. In any Emacs, the cperl-mode (M-x cperl-mode) gives you
perhaps the best available Perl editing mode in any editor.
If you are using Windows, you can use any editor that lets you work
with plain text, such as NotePad or WordPad. Word processors, such as
Microsoft Word or WordPerfect, typically do not work since they insert
all sorts of behind-the-scenes information, although some allow you to
save files as "Text Only". You can also download text editors designed
specifically for programming, such as Textpad
and UltraEdit, among others.
If you are using Mac OS, the same concerns apply. MacPerl (for Classic
environments) comes with a simple editor. Popular external editors are
BBEdit or Alpha. Mac OS X users can use Unix editors as well.
GNU Emacs
MicroEMACS
XEmacs
Jed
or a vi clone such as
Elvis FTP, WWW
Vile
Vim
For vi lovers in general, Windows or elsewhere: vi
nvi (available from CPAN in src/misc/) is
yet another vi clone, unfortunately not available for Windows, but in
Unix platforms you might be interested in trying it out, firstly
because strictly speaking it is not a vi clone, it is the real vi, or
the new incarnation of it, and secondly because you can embed Perl
inside it to use Perl as the scripting language. nvi is not alone in
this, though: at least also vim and vile offer an embedded Perl.
The following are Win32 multilanguage editor/IDESs that support Perl:
Codewright
MultiEdit
SlickEdit
There is also a toyedit Text widget based editor written in Perl that
is distributed with the Tk module on CPAN. The ptkdb is a Perl/tk based debugger that acts
as a development environment of sorts. Perl Composer is an IDE for Perl/Tk GUI
creation.
In addition to an editor/IDE you might be interested in a more powerful
shell environment for Win32. Your options include
Bash from the Cygwin package
Ksh from the MKS Toolkit, or the Bourne shell
of the U/WIN environment
Tcsh, see also Using csh & tcsh
Zsh
MKS and U/WIN are commercial (U/WIN is free for educational and
research purposes), Cygwin is covered by the GNU Public License (but
that shouldn't matter for Perl use). The Cygwin, MKS, and U/WIN all
contain (in addition to the shells) a comprehensive set of standard
UNIX toolkit utilities.
If you're transferring text files between Unix and Windows using FTP be
sure to transfer them in ASCII mode so the ends of lines are
appropriately converted.
On Mac OS the MacPerl Application comes with a simple 32k text editor
that behaves like a rudimentary IDE. In contrast to the MacPerl
Application the MPW Perl tool can make use o Shell f the MPW itself as
an editor (with no 32k limit).
Affrus is a full Perl development environment with full debugger support.
Alpha is an editor, written and extensible in Tcl, that nonetheless has built in support for several popular markup and programming
languages including Perl and HTML.
BBEdit and BBEdit Lite are text editors for Mac OS that have a Perl sensitivity mode.
Pepper and Pe are programming language sensitive text editors for Mac
OS X and BeOS respectively.
Perl has very good debugging support. Read perldoc perldebug for details.
There are a bunch of IDEs such as ActiveState's Komodo, EPIC etc but I prefer to combine GVim (see also .vimrc for Perl programmers) with the command line. Others prefer Emacs.
Padre is getting better, but it's currently not quite up there with Komodo or EPIC.
That said, it is comparable with Ultraedit or Notepad++ at this point, less than a year after the first line of code was written.
With about 30 people actively committing, 35-40 plugins either released or in development, and translations in 20 languages, it is also moving ahead incredibly quickly.
So right now, I agree that EPIC is probably the way to go, since you've used Eclipse already.
But by this time next year it's probably going to be a different story.
If you're already familiar with debugging in Eclipse, then the EPIC plugin is exactly what you're looking for.
It's got stepped debugging within the Debug perspective, like with other languages in Eclipse. It's not as strong as the Java support, but it's got an easier learning curve than e.g. "perl -d" (the 'standard' way to debug Perl), or even learning a new editor like Emacs, with its Perl debugging integration.
What I use -- and what I've gotten the impression that most other serious Perl developers use -- is a good text editor. The only "integration" I have is via user-defined tools. For Perl, that's these:
perl -Mstrict -cw <file> # Perl "lint"
perl <file> # run file
perl -d <file> # run file in debugger
I have others for checking files in/out of version control, browsing history, etc. A good configurable editor (I'm partial to UltraEdit) will allow you to build your own environment using the tools you want instead of foisting an all-encompassing solution on you.
Komodo Edit is a free editor from Active State, probably not as feature rich as the full IDE but I find it very useful for Perl development, and it supports multiple languages.
You didn't specify which platform you're on, but on the Macintosh, TextMate is a very popular choice for Perl development. It's completely replaced Vim for me, and while it's not a full IDE, it's got alot of neat integrations in bundles specially targeted towards Perl development.