<div dir="ltr">No, I'm not - I'm using arm-apple-darwin10-cabal --config-file=path/to/arm.config install vector, which yields:<div>







<p class="">Resolving dependencies...</p>
<p class="">All the requested packages are already installed:</p>
<p class="">vector-0.10.9.1</p>
<p class="">Use --reinstall if you want to reinstall anyway.</p><p class="">Though it doesn't look like it's actually installed:</p><p class="">arm-apple-darwin10-ghc-pkg<span class=""> </span><span class="">list</span></p>
<p class="">/usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d</p><p class="">   Cabal-1.18.1.2</p><p class="">   array-0.5.0.0</p><p class="">   base-4.7.0.0</p><p class="">   bin-package-db-0.0.0.0</p><p class="">
   binary-0.7.1.0</p><p class="">   bytestring-0.10.4.0</p><p class="">   containers-0.5.3.1</p><p class="">   deepseq-1.3.0.2</p><p class="">   directory-1.2.0.2</p><p class="">   filepath-1.3.0.2</p><p class="">   ghc-prim-0.3.1.0</p>
<p class="">   hoopl-3.10.0.0</p><p class="">   hpc-0.6.0.1</p><p class="">   integer-simple-0.1.1.0</p><p class="">   old-locale-1.0.0.6</p><p class="">   pretty-1.1.1.1</p><p class="">   process-1.2.0.0</p><p class="">   rts-1.0</p>
<p class="">   template-haskell-2.9.0.0</p><p class="">   time-1.4.1</p><p class="">   transformers-0.3.0.0</p><p class="">






























</p><p class="">   unix-2.7.0.0</p><p class="">If I don't include my arm.config file I get this:</p><p class="">arm-apple-darwin10-cabal<span class=""> </span><span class="">install</span><span class=""> </span><span class="">vector</span></p>
<p class="">Resolving dependencies...</p><p class="">Configuring primitive-0.5.1.0...</p><p class="">Failed to install primitive-0.5.1.0</p><p class="">Last 10 lines of the build log ( /Users/schell/.cabal/logs/primitive-0.5.1.0.log ):</p>
<p class="">cabal: Error: some packages failed to install:</p><p class="">primitive-0.5.1.0 failed during the configure step. The exception was:</p><p class="">ExitFailure 127</p><p class="">















</p><p class="">vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install</p><p class=""><br></p></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 20, 2013 at 8:11 PM, Maxwell Swadling <span dir="ltr"><<a href="mailto:maxwellswadling@gmail.com" target="_blank">maxwellswadling@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">were you using cabal sandbox? If so, delete the cabal sandbox and cabal install the dependencies (vector in this case is missing).</div>
<div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Sat, Dec 21, 2013 at 3:08 PM, Schell Scivally <span dir="ltr"><<a href="mailto:efsubenovex@gmail.com" target="_blank">efsubenovex@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Okay, the hsc2hs step worked and I have IOS/Touch.hs. Now the next error is:<div><br>







<div><span>arm-apple-darwin10-ghc</span><span> </span>-staticlib<span> </span>Main.hs<span> </span>-threaded</div></div><div>







<p>IOS/Touch.hsc:6:8:</p>
<p>    Could not find module ‛Data.Vector.Storable’</p><div>
<p>    Use -v to see a list of the files searched for.</p><p><br></p></div><p>Is there a way for me to manually include the Data.Vector.Storable package?</p></div></div><div><div><div class="gmail_extra">
<br><br>
<div class="gmail_quote">On Fri, Dec 20, 2013 at 6:26 PM, Maxwell Swadling <span dir="ltr"><<a href="mailto:maxwellswadling@gmail.com" target="_blank">maxwellswadling@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div style="word-wrap:break-word"><div><blockquote type="cite"><div dir="ltr"><p>So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of the reasons I'm trying to use cabal, since it seems to be pretty good at running hsc2hs on that file automagically. Though ghc is supposed to work with .hsc, no?</p>


<p>If I try to compile Touch.hsc by itself I get something interesting:</p><p>arm-apple-darwin10-ghc<span> </span><span>IOS/Touch.hsc</span><span> </span></p></div></blockquote></div><div>GHC doesn't!</div><div><br></div>


<div>You should be able to run `hsc2hs IOS/Touch/Touch.hsc` and it will produce `IOS/Touch/Touch.hs`.</div><div><br></div><div>You will have to add any header include paths you need (CocoaTouch ?).</div><div><br></div><div>


I would recommend a vanilla makefile to run `hsc2hs` then `ghc`.</div><div><div><br><div><div>On 21/12/2013, at 1:01 PM, Schell Scivally <<a href="mailto:efsubenovex@gmail.com" target="_blank">efsubenovex@gmail.com</a>> wrote:</div>


<br><blockquote type="cite"><div dir="ltr">Carter: Yes, I've followed the instructions on the wiki and updated Xcode's build settings.<div>Maxwell: When I try it errors with:<span> </span></div><div><br></div><div>


arm-apple-darwin10-ghc<span> </span><span>Main.hs</span><span> </span><span>-o</span><span> </span><span>Main.a</span></div><p>Main.hs:5:8:</p><p>    Could not find module ‛IOS.Touch’</p><p>    Use -v to see a list of the files searched for.</p>


<p><br></p><p>And then following it down the rabbit hole:</p><p>arm-apple-darwin10-ghc<span> </span><span>Main.hs</span><span> </span><span>-o</span><span> </span><span>Main.a</span><span> </span><span>-v</span></p><p>Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by GHC version 7.6.3</p>


<p>Using binary package database: /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache</p><p>wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12</p><p>wired-in package integer-simple mapped to integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff</p>


<p>
wired-in package base mapped to base-4.7.0.0-725128dc24ae24a83ca24be4defe9728</p><p>wired-in package rts mapped to builtin_rts</p><p>wired-in package template-haskell mapped to template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba</p>


<p>wired-in package dph-seq not found.</p><p>wired-in package dph-par not found.</p><p>Hsc static flags: </p><p>wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12</p><p>wired-in package integer-simple mapped to integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff</p>


<p>wired-in package base mapped to base-4.7.0.0-725128dc24ae24a83ca24be4defe9728</p><p>wired-in package rts mapped to builtin_rts</p><p>wired-in package template-haskell mapped to template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba</p>


<p>wired-in package dph-seq not found.</p><p>wired-in package dph-par not found.</p><p>
*** Chasing dependencies:</p><p>Chasing modules from: *Main.hs</p><p><br></p><p>Main.hs:5:8:</p><p>    Could not find module ‛IOS.Touch’</p><p>    Locations searched:</p><p>
      IOS/Touch.hs</p><p>      IOS/Touch.lhs</p><p>*** Deleting temp files:</p><p>Deleting: </p><p>*** Deleting temp dirs:</p><div>




































<br></div><p>Deleting: </p><p><br></p><p>So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of the reasons I'm trying to use cabal, since it seems to be pretty good at running hsc2hs on that file automagically. Though ghc is supposed to work with .hsc, no?</p>


<p>If I try to compile Touch.hsc by itself I get something interesting:</p><p>arm-apple-darwin10-ghc<span> </span><span>IOS/Touch.hsc</span><span> </span></p><p>ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7): IOS/Touch.hsc</p>


<p>Undefined symbols for architecture armv7:</p><p>  "_ZCMain_main_closure", referenced from:</p><p>      _main in ghc85846_2.o</p><p>ld: symbol(s) not found for architecture armv7</p><p>clang: error: linker command failed with exit code 1 (use -v to see invocation)</p>


<p>ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7s): IOS/Touch.hsc</p>


<p>Undefined symbols for architecture armv7s:</p><p>  "_ZCMain_main_closure", referenced from:</p><p>      _main in ghc85846_2.o</p><p>ld: symbol(s) not found for architecture armv7s</p><p>clang: error: linker command failed with exit code 1 (use -v to see invocation)</p>


<p>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: a-armv7.o (No such file or directory)</p><p>rm: a-armv7.o: No such file or directory</p><div>






















<br></div><p>rm: a-armv7s.o: No such file or directory</p></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling <span dir="ltr"><<a href="mailto:maxwellswadling@gmail.com" target="_blank">maxwellswadling@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><span>Can you run </span><span style="background-color:rgba(255,255,255,0)">arm-apple-darwin10-ghc  Blocks.hs -o Blocks.a ?</span></div>



<div><span><br></span></div><div><span>Also I'm not sure why you have a Main.a as well. You should link the Blocks.a in Xcode. You shouldn't need two .a's. <br></span><br><span>__END__</span><span><font color="#888888">
Maxwell Swadling</font></span></div><div><div><div><br>On 21 Dec 2013, at 12:43 pm, Carter Schonwald <<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>> wrote:<br>
<br></div><blockquote type="cite">Aren't there some settings that need to be manipulated in Xcode? Like "don't run strip. Just don't"?  Are you doing that stuff?<span></span><br><br>On Friday, December 20, 2013, Schell Scivally  wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry in the last message I meant "(with the list of _warnings_ mentioned on the wiki)".</div>




<div><br><br><div>On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally <span dir="ltr"><<a>efsubenovex@gmail.com</a>></span> wrote:<br>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'll sum up the process I'm going through. I `cd` into Blocks where Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal --config-file=path/to/arm/config build`. The config file was created by arm-apple-darwin10-cabal the first time I ran it. The build ends in two different ways depending on the `ghc-options` field in the Blocks.cabal file. With ghc-options: -staticlib -threaded it errors (or warns, or outputs - as it isn't specified):<br>


<p>Resolving dependencies...</p><p>Configuring Blocks-0.1.0.0...</p><p>Building Blocks-0.1.0.0...</p><p>Preprocessing executable 'Blocks' for Blocks-0.1.0.0...</p><p>Linking dist-arm/build/Blocks/Blocks.a ...</p>

<p>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lpthread</p>
<div>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lpthread is not an object file (not allowed in a library)</div><div><br></div><div>With ghc-options: -staticlib it looks like the build completes (with the list of errors mentioned on the wiki). I then have two libs, src/Main.a and dist-arm/build/Blocks/Blocks.a</div>






<div><br></div><div>I then add either Blocks.a or Main.a to my project (or both, which I've also tried). Then I build for my device with command-b. Both static libs are ignored for each architecture and then clang ends in a linker error. Here is the build log from Xcode: <a href="http://lpaste.net/97304" target="_blank">http://lpaste.net/97304</a> and my setup: <a href="https://gist.github.com/schell/f3a737171ce2f6b1119c" target="_blank">https://gist.github.com/schell/f3a737171ce2f6b1119c</a> and the source: <a href="https://github.com/schell/blocks-ios/" style="font-size:13.333333969116211px;font-family:arial,sans-serif" target="_blank">https://github.com/schell/blocks-ios/</a></div>






<div><br></div><div>Please let me know if you need more information. </div></div><div><br><br><div>On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally <span dir="ltr"><<a>efsubenovex@gmail.com</a>></span> wrote:<br>



<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Currently I'm using `arm-apple-darwin10-cabal --config-file=path/to/my/arm/config build<div><br></div>

<div>The cabal file and the rest of the source can be found at <a href="https://github.com/schell/blocks-ios/" target="_blank">https://github.com/schell/blocks-ios/</a></div>
<div><br></div><div>I'm following the directions at <a href="https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS" target="_blank">https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS</a> as much as possible but I don't really know how to use ghc to build all the files in a project (when I try it can't find the IOS.Touch module), which is why I'm trying to use cabal. That wiki page says nothing of using cabal so I'm assuming that I'm in dragon territory with most of this, so forgive me if I'm making some obvious mistake.</div>







<div><br></div></div><div><br><br><div>On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling <span dir="ltr"><<a>maxwellswadling@gmail.com</a>></span> wrote:<br>


<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>How are you compiling the static library? What command are you using?<br><br>__END__<div>Maxwell Swadling</div>


</div><div><div><br>On 21 Dec 2013, at 10:24 am, Schell Scivally <<a>efsubenovex@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr">


Carter pointed out I only mentioned the warning. ld spits out a warning and then the build fails in the linking phase because the static lib was ignored and not linked, making the main() provided by the lib undefined:<div>








<br></div><div><p>ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (armv7): /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a</p>


<p>ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks</p></div></div></blockquote></div></div></blockquote></div></div></blockquote></div></div></blockquote></div></div></blockquote>

</blockquote></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Schell Scivally<br><a href="http://blog.efnx.com/" target="_blank">http://blog.efnx.com</a><br><a href="http://github.com/schell" target="_blank">http://github.com/schell</a><br>



<a href="http://twitter.com/schellsan" target="_blank">http://twitter.com/schellsan</a>
</div>
</blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Schell Scivally<br><a href="http://blog.efnx.com" target="_blank">http://blog.efnx.com</a><br><a href="http://github.com/schell" target="_blank">http://github.com/schell</a><br>


<a href="http://twitter.com/schellsan" target="_blank">http://twitter.com/schellsan</a>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>Maxwell Swadling<br><div><br></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Schell Scivally<br><a href="http://blog.efnx.com" target="_blank">http://blog.efnx.com</a><br><a href="http://github.com/schell" target="_blank">http://github.com/schell</a><br>
<a href="http://twitter.com/schellsan" target="_blank">http://twitter.com/schellsan</a>
</div>