Comments (10)
Any comment about this issue?
from uhc.
@asr It's probably easiest to just disable the float equality primitive in the UHC backend (for now). I can do that if you don't mind?
from uhc.
OK. Please file an Agda issue about it.
from uhc.
If the extracted/unpacked sources from the ieee746 package are on the search path of UHC then both .hs and .c should be picked up and compiled. C compilation is integrated into UHC for the 'bc' (default) backend.
from uhc.
I downloaded the ieee754 package on the ~/tmp-asr/ieee754-0.7.8
directory using cabal get ieee754
.
Now adding the -i
command-line option I got the following error:
$ uhc -i ~/tmp-asr/ieee754-0.7.8/ Test.hs
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3797:16: error: ‘feqrelf’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3799:16: error: ‘mknan’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3801:16: error: ‘ieeemeanf’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3803:16: error: ‘mknanf’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3805:16: error: ‘nextdownf’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3807:16: error: ‘nextup’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3809:16: error: ‘getnanf’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3811:16: error: ‘ieeemean’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3813:16: error: ‘getnan’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3815:16: error: ‘feqrel’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3817:16: error: ‘nextupf’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3819:16: error: ‘nextdown’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3820:16: error: ‘identicalf’ undeclared here (not in a function)
/home/asr/tmp-asr/ieee754-0.7.8//Numeric/IEEE.c:3822:16: error: ‘identical’ undeclared here (not in a function)
Note that the IEEE.c:
file is generated by UHC.
Note also I fixed a typo in the OP: ieee746 -> ieee754
Am I missing something?
from uhc.
UHC does not know which .c files to compile, i.e. there is not a real import mechanism like in Haskell nor a cabal spec & mechanism. .c files of which the .h file is used still have to be explicitly specified on the commandline invocation of UHC.
from uhc.
A MVE:
$ cat Test.hs
module Main where
foreign import ccall "id" c_id :: Double -> Double
main = print (c_id 1.0)
$ cat id.c
int
id (double x)
{
return x;
}
Using GHC:
$ ghc Test.hs id.c
$ ./Test
1.0
Using UHC:
$ uhc Test.hs id.c
[1/2] Compiling C id (id.c)
[2/2] Compiling Haskell Main (Test.hs)
Test.c:162:16: error: ‘id’ undeclared here (not in a function)
What else do I need to include when invoking UHC?
from uhc.
The "id" in the import should (as per FFI spec for Haskell) refer to an include file, say id.h, mentioning id via an extern declaration. The "id" should be "id.h id". That ought to do it...
A
On 28 Sep 2016, at 17:51, Andrés Sicard-Ramírez [email protected] wrote:
A MVE:
$ cat Test.
hsmodule Main where
foreign import ccall "id" c_id :: Double -> Double
main =
print (c_id 1.0
)foreign import ccall "identical" c_identical :: Double -> Double
main =
print (c_identical 1.0)
$ cat id.cint
id (double
x)
{return
x;
}Using GHC:
$ ghc Test.hs id.c
$ ./Test
1.0Using UHC:
Using UHC:
$ uhc Test.hs id.c
[1/2] Compiling C id (id.c)
[2/2] Compiling Haskell Main (Test.hs)
Test.c:162:16: error: ‘id’ undeclared here (not in a function)What else do I need to include when invoking UHC?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
from uhc.
That works. Thanks!
from uhc.
For future reference, I add the fixed example:
$ cat Test.hs
module Main where
foreign import ccall "id.h id" c_id :: Double -> Double
main = print (c_id 1.0)
$ cat id.h
int id (double x);
$ cat id.c
int
id (double x)
{
return x;
}
Using GHC:
$ ghc Test.hs id.c
Using UHC:
$ uhc Test.hs id.h
from uhc.
Related Issues (20)
- Separate bug trackers for UHC and uhc-light HOT 2
- -O0 broken HOT 14
- Untracked files
- Unexpected "GRIN ByteCode location names not in scope" HOT 3
- Broken compilation: No rule to make target `src/ehc/CHR/TySys/Types.chs' HOT 2
- Broken compilation: Missing modules HOT 2
- Missing GHC version used for building UHC in the `--version` option HOT 1
- Building UHC with Java backend enabled HOT 1
- hsc2hs checking not working HOT 2
- undefined reference to `hsc_fputs' HOT 3
- cabal install --uhc always fails with "fileAccess: does not exist" HOT 1
- UHC prints doubles with lower precision than GHC HOT 2
- (8 Core) Case default broken? HOT 1
- UHC prints `1.0` as `1` HOT 1
- Compilation error when using negative floats HOT 1
- Request: Addition to Stackage HOT 3
- Panic when pattern matching record syntax constructor using wrong parameter
- Adding license to repository
- Building on 10.6 with GHC 7.6.3 for PowerPC
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 uhc.