Comments (5)
You have to compile with -threaded.
Honestly, I don't know the right way to fix this. GHC only links the concurrency stuff into the RHS when you compile with -threaded. But these foreign primops depend on that. To my knowledge there is NOT a way to throw a more meaningful compile time error, because this is an error not at compile time per se, but in the final link phase.
Alternatively, we could rip out and duplicate the parts of the RTS we depend on (e.g. architecture portable CAS).
from haskell-lockfree.
I went ahead and made this warning prominent on the main package page:
http://hackage.haskell.org/package/atomic-primops-0.2.2.1
I'm working on a hack to duplicate the RTS functionality...
from haskell-lockfree.
This should be fixed as of the GHC 0.3 release. I took the approach of duplicating the necessary GHC RTS functionality so atomic-primops should work without -threaded
now.
http://hackage.haskell.org/package/atomic-primops-0.3
I've tried it on linux and Mac but I haven't tested on Windows yet.
There is a makefile to test with several different "ways" that I've been using (profiling, optimization, -threaded):
Please re-open this if you still have a problem.
from haskell-lockfree.
I'm afraid not. I program using Data.Atomics does compile and run without -threaded
. However, it does not work with GHCi which was, strictly speaking, the issue raised. Try loading the following .hs file in to GHCI;
import Data.Atomics
main = writeBarrier
Then:
Prelude> :l NonThreaded-CL.hs
*Main> main
...
Loading package atomic-primops-0.3 ... linking ... <interactive>: ~/.cabal/lib/atomic-primops-0.3/ghc-7.6.1/HSatomic-primops-0.3.o: unknown symbol `cas'
Then call main
. You should still see the error. I am using HEAD, as of 10 minutes ago.
from haskell-lockfree.
It looks like this is going to be fixed in issue #10
from haskell-lockfree.
Related Issues (20)
- Cannot find module "Data.Atomics.Counter.Unboxed" HOT 6
- Are memory barriers compiler reordering barriers? HOT 1
- Various cabal issues.
- Saw a genuine nondeterministic test failure
- atomic-primops: can GC duplication of pure objects screw up Tickets and cause a false negative?
- atomic-primops: ghc 8 support needed HOT 7
- Build fail on armv8
- atomic-primops: Need to make barriers inline primops HOT 3
- Missing load-store barrier HOT 1
- [chaselev-deque] stackage availability HOT 4
- Provide loop wrapper for casArrayElem? HOT 2
- Implement multi-item CAS (CASN) HOT 2
- Cut a new atomic-primops release for GHC 8.2.1 HOT 2
- testing/Fetch.hs missing from Hackage release HOT 1
- Recursion in haddocks of `atomic-primops` HOT 1
- CAS fails with newly created ticket HOT 8
- CAS very rarely fails not due to a race, in GHC >= 8.2
- [lockfree-queue]: GHC 9.4 support HOT 2
- Release chaselev-deque-0.5.0.6 on hackage HOT 1
- No more load_load_barrier in GHC HEAD HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haskell-lockfree.