ezyang 2017-03-06 19:51:31
but we don't have any feature tests for things like avx support
ezyang 2017-03-06 19:51:49
that sort of thing is usually done with a Configure script
ezyang 2017-03-06 19:52:08
The way this works is you run the Configure script, this generates a buildinfo which is then "added" to the Cabal package description, for flags and stuff
ezyang 2017-03-06 19:52:18
Actually, now that I think of it, I'm not convinced that this wouldn't solve your problem!
piyush-kurur 2017-03-06 19:53:23
ezyang: I would want the code to be compiled in any case because often the machine where the code is run will be different from the machine where it s executed
ezyang 2017-03-06 19:54:03
"If only gcc had {-# GCC_OPTIONS ... #-}"
piyush-kurur 2017-03-06 19:54:17
ezyang: that is not enough
piyush-kurur 2017-03-06 19:54:54
often you have the following situation. Debian package builder builds on say a machine without avx2
piyush-kurur 2017-03-06 19:55:10
but it is to be run on a machine with avx2
piyush-kurur 2017-03-06 19:55:21
one needs something like a fat binary
ezyang 2017-03-06 19:55:32
piyush-kurur: Put this in the ticket!
piyush-kurur 2017-03-06 19:56:13
ezyang: it is there in the ticket that is referred to but yes I will add this point
ongy 2017-03-06 19:58:15
piyush-kurur: I don't know the exact details, but I do know that we do that somewhere in a C library. But I think there's some trick with compiler intrinsics
ongy 2017-03-06 19:58:28
you can get an array of supported extensions form the CPU in *some* way
piyush-kurur 2017-03-06 19:58:48
ongy: cpuid ?
ongy 2017-03-06 19:59:07
possible, I have only read a bit of backlog, so if you got a reason not to use it, I probably missed it
piyush-kurur 2017-03-06 20:00:00
ongy: we were discussing the following ticket for cabal https://github.com/haskell/cabal/issues/4294
Squarism 2017-03-06 20:04:42
ski, Thanks but thats greek to me.
piyush-kurur 2017-03-06 20:07:02
ezyang: I have added a comment on the build machine being different from the target machine
piyush-kurur 2017-03-06 20:09:22
ongy: If you have better ideas please pitch in.
ezyang 2017-03-06 20:09:22
thanks
winny 2017-03-06 20:09:22
https://en.wikipedia.org/wiki/Wilmington_insurrection_of_1898
winny 2017-03-06 20:09:22
oops wrong channel
ongy 2017-03-06 20:09:22
not really. http://stackoverflow.com/questions/12925989/gcc-enable-compiler-flags-only-on-specific-functions could work for some cases
piyush-kurur 2017-03-06 20:10:31
ongy: that looks like it should solve many of my use cases thanks
ongy 2017-03-06 20:10:50
but I think this should be done by the build system. Or have cabal invoke make for the more complex cases? Adding foreing build capabilities to cabal will only go so far
piyush-kurur 2017-03-06 20:10:50
ezyang: just have a look at the url that ongy pointed out
ezyang 2017-03-06 20:11:28
oh that's nice
ezyang 2017-03-06 20:11:36
can you use that instead?
piyush-kurur 2017-03-06 20:12:01
ezyang: I think a lot of problems will be handled by it I guess.
piyush-kurur 2017-03-06 20:13:39
I will add the link to the ticket
piyush-kurur 2017-03-06 20:15:44
ongy: your github id (for reference in the ticket)
Squarism 2017-03-06 20:19:22
ski, that was a concrete explaination. Thanks!
ski 2017-03-06 20:21:20
Squarism : as i said, this is pretty heavy-weight (in that you have to define a new type `AB' (and `Tag' needs to be defined)) / inflexible (hard to vary `A' and `B') .. but this encoding can sometimes be useful (e.g. when making several mutually recursive types (usually ASTs), where you want to untangle the recursion for `Fix'-trick purposes)
Squarism 2017-03-06 20:22:36
ski, so would you recommend that approach over type famillies?
ski 2017-03-06 20:26:04
i'm not quite sure how the type family thing is supposed to go here
CIKIDING 2017-03-06 20:26:32
hallo
amy_ 2017-03-06 20:26:42
bored :(
liste 2017-03-06 20:26:52
hello CIKIDING