How to install and configure the EclipseFP Haskell plugin for Eclipse? - eclipse

Can somone who has done this tell me exactly what to do? The documentation is lacking and what is there is incomplete and incorrect.
I've got the plugin installed, and told it to usethe GHC installation that I have as part of the Haskell Platform but Run As.. only shows me Run GHCi session. According to the cheat sheet, I should see Haskell Application.
Also missing are instructions for where to find the hugs executable, and the Cabal installation that the Haskell Preferences seems to suggest I should have.
Can anyone point out what I've missed?
I'm a Haskell beginner, hence trying to get Eclipse set up so I can play with it...

It seems that currently there is no way to create a non-interactive launch configuration
via GUI. However, you can do that by manually editing config files. The following instructions work with Eclipse 3.5.2, EclipseFP 2.0.2:
Make sure there exists a GHCI configuration.
Close Eclipse.
Go to directory .metadata/.plugins/org.eclipse.debug.core/launches in the root of your workspace.
There should be a file named something like "Main (project src).launch". Copy it under whatever name you wish, for instance "Run Main.launch"
Open your copied file in a text editor and replace the option --interactive with -e main.
Save the file and start eclipse. You should see the new run configuration "Run Main". When you run it, EclipseFP executes your Main.hs file, redirecting both input and output to the console view.
Also, it seems that you haven't configured cabal yet. You first need to install it (from your distribution repositories, or here if you're using Windows). Then go to Scion and Cabal preferences and point them to your cabal executable. After you click OK the compilation of Scion should start. If it gives you errors, read what packages are missing and install them via cabal install pkg-name. (I had to install happy with --global flag, and for QuickCheck I had to manually set the 2.* version). To rerun Scion compilation, restart Eclipse.

Related

How does one debug a module that is run as a script (with -m flag) from within PyDev?

I have a module that is part of a library I am writing. The library has multiple executables. These are run from the command line as a script with the syntax python3 -m mypackage.mysubpackage.MyModule
I am familiar with eclipse, its debugger and PyDev, but I have not found how to set a debug/run configuration to launch MyModule within PyDev.
I have tried to add -m or -m mypackage.mysubpackage.MyModule as VM arguments to python.exe within the Arguments section of the Debug Configuration, but this does not work even setting the appropriate working directory to have mypackage in the PYTHONPATH.
I know how to launch the program outside eclipse and connect it to eclipse using a debug server. I know I can also make a little auxiliary script that is not part of the library just to launch the program so I can run it inside eclipse, but I would prefer the convenience of being able to launch the module directly within eclipse itself and I feel PyDev should be able to do this.
If you just press F9 PyDev should launch your module.
Although note it'll launch the file directly. If you require it to be launched with the -m flag (so that your relative imports resolve in that file), you can configure it in the preference:
preferences > PyDev > Run > Launch modules with python -m ...
PyDev will compute the module name based on the file location and PYTHONPATH configured in this case.
p.s.: You may want to take a look at http://www.pydev.org/manual_101_run.html for more details on re-launching your module, unit-tests, etc.

Eclipse can't find MinGW. Why?

I installed both correctly, but it doesn't matter if I set up the path to compiler correctly or not because it can't find gcc and g++. I checked it with explorer, they were at the correct location. I tried everything I could, even I ran Eclipse in backwards compatibility mode and as an administrator.
EDIT: I'll using Visual Studio 2012 for a while if Eclipse can't be at least as user friendly to having find a solution to the problem under one hour via web.
Download this , chose the desired compilers (gcc and g++) . Make sure you have the value C:\mingw64 in PATH variable under environment variables .
I had to reload my workspace in order to get Eclipse to recognize that.
Also, I had updated the Path variable.
Please follow the same in your case.
I couldn't make the Eclipse (LUNA) to find MinGW on my computer (there were no MinGW available in Preferences>C/C++/New C/C++ Project Wizard) even after I have specified PATH as "C:\MinGW\bin" in Preferences>C/C++/Build>Environment, so what I did afterwards was:
Create a simple "Hello world" C project without specifying any toolchains
(at this step I tried to Build All, and it failed)
Go to Project>Properties, suprisingly, here I could see MinGW GCC as an available choice for Current toolchain. Select it.
Now I could build and run the project
Hopefully, it helps!

Setting up Pylint with PyDev

I have installed pylint via easy_install. I can run pylint <filename> with success. But pydev refuses to use it.
I checked "use pylint"
I configured correct path
I updated my python interpreter in eclipse to have pylit in pythonpath
I use Eclipse Galileo
I have build automatically checked
I tried cleaning whole project and no errors
What am I doing wrong?
I'm guessing you may need to mark the folder that contains your code as a source folder. You can do this under project properties.
Project->Properties->PyDev-PYTHONPATH
add relevant folders to the list of sources.
I've noticed that Pydev won't run Pylint on files with dashes (hyphens) the the filename; according to the Pydev devs, '-' is not a valid Python module name character, and it doesn't look like they intend to fix it:
http://sourceforge.net/tracker/index.php?func=detail&aid=1915426&group_id=85796&atid=577329
http://sourceforge.net/tracker/index.php?func=detail&aid=2888890&group_id=85796&atid=577332
As if nobody writes scripts in Python... Grumble grumble...
To provide an alternative solution, pylint can be used as an External Tool in Eclipse. This requires having previously installed the pylint package for a Python installation.
Remember to first have a pylintrc file somewhere where pylint can find it, failing which a "No config file found" error is printed. Typically I would touch pylintrc inside the project directory, and keep the file in version control. For reference, see pylint command-line options.
In Eclipse, select Run, External Tools, External Tools Configurations.... Click the toolbar button to create a New launch configuration. Configure as below or as desired:
Name: pylint
Location: ${system_path:pylint}
Working Directory: ${project_loc}
Arguments: --reports=n "${resource_loc}"
Remember to click inside an open file to switch focus to it before running the above external tool for it. Failing this, an error can occur.
The output of the external tool will by default be printed to the console.
Related: Setting up pep8 as an External Tool in Eclipse

How to launch eclipse from a command line on MacOS with a workspace pathname

On linux:
eclipse PathnameToWorkspace
works fine, and launches eclipse on the workspace.
I've never been able to figure out the MacOS moral equivalent, given the MacOS application tree structure.
I suspect this is not a hard problem.
./eclipse -data <workspace-path> (see also How do I run Eclipse in the Eclipse Wiki).
On my system there's a link to the eclipse binary from /Applications/eclipse/eclipse, and I find that just running that will start Eclipse with my default workspace.
You might also find the Eclipse binary in '/Applications/Eclipse.app/Contents/MacOS/eclipse'.
When I start Eclipse like this (from the command line) I find that my Mac will not always switch to the desktop where Eclipse is started, so that I will have to go hunt for the Eclipse window with Exposé/Misson Control (Ctrl-Up Arrow). – This is especially true when I'm have two monitors connected to my Mac.
Since I found typing the full path to eclipse annoying, I simply added a symlink to it from /opt/local/bin and made sure that directory is in my $PATH:
cd /opt/local/bin
sudo ln -s /Applications/eclipse/eclipse .
echo 'PATH="$PATH:/opt/local/bin' >>~/.bashrc
After that, just issuing the command eclipse (without the preceding /Applications/eclipse part) works as it should.
After doing lots of hit and try I have added following into my bash_profile and I am able to launch eclipse from terminal.
(Note: Eclipse is inside Application)
export PATH="$PATH:/Applications/Eclipse.app/Contents/MacOS"
Hope it will be helpful for beginner like me.

Compiling FFMPEG on Windows using Wascana

Has anyone ever tried, or had any success at getting Wascana (Eclipse CDT + MinGW for Windows) to compile FFMPEG under Windows. Apparently it is possible, there is even a tutorial at Craig Shaw's website but I have not been able to make it work.
I run ./configure on the FFMPEG source code then create a new project in Eclipse and point it at the source but it doesn't recognise it as a Makefile project. I think I need to create a builder which works with MinGW but my feeble attempts so far have been unsuccessful.
Hey, I can answer my own question! After a lot of fiddling around, I have come up with the procedure:
NOTE: This is for Wascana 0.9.3 and a Sep 2008 SVN version of FFMPEG.
Prepare Environment
After installing Wascana, you'll need to update various MinGW and MSYS packages. Download and unpack the following (you can download them from the MinGW website):
MSYS packages:
bash-3.1
coreutils-5.97
m4-1.4.7
make-3.81
MinGW packages:
w32api-3.12
MinGW Runtime 3.15
Build
Unpack the FFMPEG source code and configure like so (do not compile it yet):
./configure --enable-memalign-hack --disable-shared --enable-static --disable-mmx --disable-mmx2 --disable-optimizations --disable-stripping
Launch Wascana/Eclipse and create a new C project.
Do not select "Hello World" project, just select a Makefile project and select the MinGW toolchain.
Set the project path to wherever your FFMPEG source code is.
Click finish and the source should build itself!
Install
Right click the project and select Make Targets > Create.
In the dialog, set both the Make Target and Target name to "install".
Run the target you just created. This will install the FFMPEG libraries.
Execute and Debug
Open the Debug Dialog
Right-click on "C/C++ Local Application" and choose "New"
Fill in the project name and select the EXE you want to run (in my case, ffplay_g.exe)
Go to the debugger tab and change the debugger to "MinGW gdb Debugger"
I also had to make sure a copy of SDL.dll was in the ffmpeg directory.
Phew, what an ordeal. That all worked for me, hopefully it will work for you too!
install last MSYS and MinGW
Cf.
link text
When I run the debugging I get "gdb.exe has encountered a problem and needs to close...."
I updated to gdb 6.8 and succeeded to debug