Giter Site home page Giter Site logo

cwrap's People

Contributors

h12w avatar mewmew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cwrap's Issues

gmime library

Tried to run it on gmime library and got this:
/usr/local/include/gmime-2.6/gmime/gmime.h:26:33: error: gmime/gmime-version.h: No such file or directory

I guess some settings are wrong, but which ones?

Wrapping Fitz from MuPDF not working as expected

Hello -- firstly, thank you for your work here. I'm excited to use this package.

I'm attempting to use this project to create bindings for MuPDF's Fitz. I'm using your MuPDF example as a reference, but my code is not working. Any advice would be greatly appreciated.

Here's my directory setup. I effectively cloned MuPDF and plucked out the include/ directory:

./
|  main.go
|  include/
|  | mupdf/
|  |  | fitz.h
|  |  | memento.h
|  |  | pdf.h
|  |  | ucdn.h
|  |  | fitz/
|  |  |  | lots of fitz headers...
|  |  | helpers
|  |  |  | helpers...
|  |  | pdf/
|  |  |  | pdf headers...

My go code:

package main

import (
	. "h12.io/cwrap"
	"fmt"
)

const (
	Ldflags   = "LDFLAGS: /usr/local/lib/libmupdf.a /usr/local/lib/libmupdf-js-none.a -lm -lfreetype -ljpeg -lopenjp2 -ljbig2dec -lssl -lcrypto"
)

var (
	fitz = &Package{
		PacName: "fitz",
		PacPath: "go-fitz/",
		From: Header{
			Dir:         "include/",
			File:        "mupdf/fitz.h",
			NamePattern: `(?i:\Afz(.*))`,
			Excluded: []string{
				"fz_get_annot_type",
				"fz_open_file_w",
			},
			CgoDirectives: []string{Ldflags},
		},
		Included: []*Package{},
	}
)

func main() {
    err := fitz.Wrap()

    if err != nil {
        fmt.Println(err)
    }
}

And, the errors I'm getting. I'm at a complete loss for how to solve the first error about the "angled include." The second one is about relative imports, and I'm able to make it go away by flattening all of the fitz code into one directory. But, I don't think that's the right way to solve the issue:

./_cwrap-2668373447.h:2:10: error: 'mupdf/fitz.h' file not found with <angled> include; use "quotes" instead
#include <mupdf/fitz.h>
         ^~~~~~~~~~~~~~
         "mupdf/fitz.h"
In file included from ./_cwrap-2668373447.h:2:
./mupdf/fitz.h:30:10: fatal error: 'mupdf/fitz/version.h' file not found
#include "mupdf/fitz/version.h"
         ^~~~~~~~~~~~~~~~~~~~~~
exit status 1

Thank you in advance for your help!

Problem with wrapping gsl function which takes in a work []float

func Spearman(data1 []float64, stride1 int, data2 []float64, stride2 int, n int) (work float64, ret float64) {

_work := (*C.double)(unsafe.Pointer(&work))
_ret := C.gsl_stats_spearman(_data1, _stride1, _data2, _stride2, _n, _work)
ret = float64(_ret)
return

}

From the documentation of gsl Spearman (https://www.gnu.org/software/gsl/manual/html_node/Correlation.html) the function definition is:

double gsl_stats_spearman (const double data1[], const size_t stride1, const double data2[], const size_t stride2, const size_t n, double work[])

Additional workspace of size 2*n is required in work. What is the best thing to do here. Do I manually modify the wrapper so that I can pass in the correct size of []float in "work"?

See corresponding golang nuts thread:

https://groups.google.com/forum/#!topic/golang-nuts/vNUqbdP1tpQ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.