Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fine tuning of compiling script #9

Closed
jmlich opened this issue Jul 2, 2015 · 1 comment
Closed

Fine tuning of compiling script #9

jmlich opened this issue Jul 2, 2015 · 1 comment

Comments

@jmlich
Copy link
Contributor

jmlich commented Jul 2, 2015

I suggest to use pkg-config to get CFLAGS and LIBS parameters for opencv. It seems your current version is not working with opencv 3.0.0

gcc -O3 -I . -fno-builtin-strlen admesh/*.c simarrange.c -o ./sa -lm `pkg-config --cflags --libs opencv` -largtable2 -fopenmp -DPARALLEL

Additionally, I would suggest use of Makefile and not bundling of other libraries

all: simarrange

CFLAGS=-O3 -I . -fno-builtin-strlen  `pkg-config opencv --cflags` -DPARALLEL 
LDFLAGS=-lm `pkg-config opencv --libs` -largtable2 -ladmesh -fopenmp 

CC=gcc

simarrange: simarrange.o
simarrange.o: simarrange.c utlist.h

clean:
    rm -f simarrange simarrange.o

prefix=/usr/local

install: simarrange simarrange.1
    install -m 0755 simarrange $(prefix)/bin
    install -m 0644 simarrange.1 $(prefix)/share/man/man1

.PHONY: install
@kliment
Copy link
Owner

kliment commented Jul 2, 2015

Those are good suggestions. Can you make that a pull request?

On 07/02/2015 04:12 PM, Jozef Mlich wrote:

I suggest to use pkg-config to get CFLAGS and LIBS parameters for opencv. It seems your current version is not working with opencv 3.0.0

gcc -O3 -I . -fno-builtin-strlen admesh/*.c simarrange.c -o ./sa -lm `pkg-config --cflags --libs opencv` -largtable2 -fopenmp -DPARALLEL

Additionally, I would suggest use of Makefile and not bundling of other libraries

all: simarrange

CFLAGS=-O3 -I . -fno-builtin-strlen  `pkg-config opencv --cflags` -DPARALLEL 
LDFLAGS=-lm `pkg-config opencv --libs` -largtable2 -ladmesh -fopenmp 

CC=gcc

simarrange: simarrange.o
simarrange.o: simarrange.c utlist.h

clean:
  rm -f simarrange simarrange.o

prefix=/usr/local

install: simarrange simarrange.1
  install -m 0755 simarrange $(prefix)/bin
  install -m 0644 simarrange.1 $(prefix)/share/man/man1

.PHONY: install

Reply to this email directly or view it on GitHub:
#9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants