# darcs patch: added cppOptions and c2hsOptions

Fri Apr 20 02:38:49 EDT 2007

```Hi:

Here is what Cabal does:

\$ ./Setup.lhs -v build
C:\DOCUME~1\vivian\LOCALS~1\Temp\ghc139100_0\ghc139100_0.hc:8:37:
../src/Matlab/C/CMatrix.h: No such file or directory
D:\Apps\MSYS\1.0\local\src\MatlabCompiling\matlab.buildinfo
Preprocessing library Matlab-0.0.1...
-Ic:\Apps\MATLAB704\bin\win32\..\..\extern\include -o
src\Matlab\C\CMatrix.hs src\Matlab\C\CMatrix.chs
-Ic:\Apps\MATLAB704\bin\win32\..\..\extern\include -o src\Matlab\C\CMat.hs
src\Matlab\C\CMat.chs
.

Setup.lhs: got error code while preprocessing: Matlab.C.CMat

Here is my command that works (from MatlabCompiling/test)

\$ c2hs --cppopts=-I/c/Apps/MATLAB704/extern/include --include=../src
../src/Matlab/C/CMatrix.chs

Here is the addition to matlab.buildinfo which makes Cabal work:

c2hs-options: --cppopts=-I/c/Apps/MATLAB704/bin/win32/../../extern/include
--include=src

I'm also attaching a file which should recreate all the errors that I've
found on MinGW/WinXP.  Note that there are files outside the cabal hierarchy
to simulate headers/library which are already on the system and outside the
packager's control.

Cheers,

Vivian

> -----Original Message-----
> From: Duncan Coutts [mailto:duncan.coutts at worc.ox.ac.uk]
> Sent: Friday, 20 April 2007 6:10 p.m.
> To: Vivian McPhail
> Subject: RE: darcs patch: added cppOptions and c2hsOptions
>
> On Fri, 2007-04-20 at 16:32 +1200, Vivian McPhail wrote:
> > Hi Duncan,
> >
> > I added cppOptions because in the Cabal.cabal file there
> was a comment
> > to add cppOptions and so I did it.
>
> Ok.
>
> > With respect to c2hsOptions, the problem is that c2hs
> passes options
> > to the CPP nonstandardly (with --cppopts=), so even if I
> have an -I*
> > option in my ccOptions that gets passed to c2hs, this works
> for c2hs,
> > but doesn't get passed to the cpp that c2hs uses.
>
> Sorry, I still don't see it fully. Could you say exactly what
> the c2hs command line is that you use when it works and what
> command line cabal uses that does not work (and that your
> patch solves).
>
> > I've sent a message to the c2hs/cabal mailing list with a dummy
> > package that recreates all the problems I had on mingw/WinXP.
>
> I'm not sure that we got this. Could you send it again,
> perhaps ccing it to me directly.
>
> Duncan
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mingw-c2hs-cabal-test.zip
Type: application/x-zip-compressed
Size: 9471 bytes
Desc: not available
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9243990778923035, "perplexity": 25563.976604098716}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2013-48/segments/1386163982738/warc/CC-MAIN-20131204133302-00046-ip-10-33-133-15.ec2.internal.warc.gz"}