Comments (4)
I should add that this is using the headers from gsl-2.5 on Arch.
from pure-lang.
The empty output warnings seem harmless, and can be made to go away by adding -w0
to the pure-gen command. They are apparently generated by headers containing nothing but type definitions and other stuff which isn't wrapped in Pure.
The "symbol `__value' does not fit here" errors are caused by 128 bit floating point types (__float128
and __Float128
) which the language-c version 0.5.0 that we use doesn't support. Support for those was added in later language-c versions, though, and I already backported those changes to our language-c version. This is already in the AUR (haskell-language-c5 package), and will be committed here along with the corresponding changes in pure-gen shortly. This makes all these errors go away. (In gsl-2.7.1, there are still a few other unrelated syntax errors due to the gsl_spmatrix_pool
type being undefined, but I think that these are due to some mistakes in the corresponding header files, i.e., the header files not being truly self-contained. In any case they can be worked around with a -Dgsl_spmatrix_pool=void
.)
The long double*
being mapped to double *
in the C module seems to be a genuine bug. This won't have any real consequences, as the Pure module actually accepts a void *
for any of these, and the user will have to figure out a way to produce these pointers in Pure anyway. But it would still be nice to have the proper type generated on the C side, to avoid those warnings when compiling the C module. This still needs to be addressed for now.
from pure-lang.
Yes, some of the headers clearly aren't self-contained, so a better procedure is to collect all the headers in a big header file and run pure-gen on that:
DEFS=-DGSL_DISABLE_DEPRECATED
(for x in /usr/include/gsl/*.h; do echo "#include \"$x\""; done) > mygsl.h
pure-gen $DEFS -w0 -fc-auto -s '/usr/include/gsl/*::' mygsl.h
This eliminates the issue with the undefined types. I also found that I had to add a couple of libraries in compilation to make the module load properly:
# Compile the resulting C module.
gcc $DEFS -shared -o mygsl.so mygsl.c -lgsl -lgslcblas -lcblas
The resulting module now loads fine and seems to work (running a few basic examples). There still are a few symbols which seem to be in the GSL headers but aren't actually in the library, but these can just be deleted from mygsl.pure.
Just pushed the necessary changes to pure-gen and language-c. Next I'll be looking into the long double issue.
from pure-lang.
Actually, only the const long double*
pointers were being messed up. Just fixed in git, generated C code compiles cleanly now. This resolves this bug.
from pure-lang.
Related Issues (20)
- Exception handling segfaults in the msys2/mingw64 build on Windows HOT 5
- Wiki improvements
- Faust interface: Implement the Faust UI addSoundfile callback
- pure --check spurious syntax errors
- compilation on Debian stretch fail. HOT 2
- The printed output of exp(1e-15) does not correspond to the actual value HOT 1
- Can't install from apt HOT 12
- Suggestion: distribute fully-dockerized builds HOT 3
- Inline code (invalid value) HOT 2
- pure-mode for emacs? HOT 2
- Problem installing LV2 package HOT 2
- pure-docs mispackaging on Arch HOT 2
- Can turn off JIT? HOT 1
- Please make pure-lang available on Homebrew on macOS. HOT 10
- pure-octave: /bin/sh: dynamiclib: command not found HOT 1
- TeXmacs (option/plugin) HOT 9
- cabal: unrecognised command: v1-update, Maybe you meant `v2-update`? HOT 5
- pure-octave: clang: error: invalid argument '-bundle' not allowed with '-dynamiclib'
- pure-lang gnumeric package.
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 pure-lang.