forked from liuliu/ccv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
97 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,99 @@ | ||
#!/usr/bin/env sh | ||
|
||
if [ "$1" = "force" ] ; then | ||
rm -f .cc.conf .def.conf .l.conf | ||
rm -f .CC .DEF .LN | ||
fi | ||
|
||
if [ -e .cc.conf ] ; then | ||
CC=`cat .cc.conf` | ||
if [ ! -e .CC -o ! -e .DEF -o ! -e .LN ] ; then | ||
echo "\n There are a few questions for you:\n" | ||
fi | ||
|
||
if [ -e .CC ] ; then | ||
CC=`cat .CC` | ||
else | ||
read -p "default compiler: clang [Y/n] ? " yn | ||
echo -n " Default compiler: \033[4mclang\033[m [Y/n] ? " | ||
read yn | ||
case $yn in | ||
[nN]* ) read -p "your favorite compiler: " CC | ||
[nN]* ) read -p " Your favorite compiler: " CC | ||
break;; | ||
* ) CC='clang' | ||
break;; | ||
esac | ||
echo $CC > .cc.conf | ||
echo $CC > .CC | ||
fi | ||
|
||
if [ -e .def.conf -a -e .l.conf ] ; then | ||
CFLAGS=`cat .def.conf` | ||
LDFLAGS=`cat .l.conf` | ||
if [ -e .DEF -a -e .LN ] ; then | ||
CFLAGS=`cat .DEF` | ||
LDFLAGS=`cat .LN` | ||
else | ||
CFLAGS="" | ||
LDFLAGS="" | ||
read -p "with SSE2 [Y/n] ? " yn | ||
CFLAGS=" " | ||
LDFLAGS=" " | ||
echo -n " Enable \033[4mSSE2\033[m [Y/n] ? " | ||
read yn | ||
case $yn in | ||
[nN]* ) break;; | ||
* ) CFLAGS="$CFLAGS-msse2 " | ||
break;; | ||
esac | ||
read -p "with libjpeg [Y/n] ? " yn | ||
echo -n " With \033[4mlibjpeg\033[m [Y/n] ? " | ||
read yn | ||
case $yn in | ||
[nN]* ) break;; | ||
* ) CFLAGS="$CFLAGS-D HAVE_LIBJPEG " | ||
LDFLAGS="$LDFLAGS-ljpeg " | ||
break;; | ||
esac | ||
read -p "with libpng [Y/n] ? " yn | ||
echo -n " With \033[4mlibpng\033[m [Y/n] ? " | ||
read yn | ||
case $yn in | ||
[nN]* ) break;; | ||
* ) CFLAGS="$CFLAGS-D HAVE_LIBPNG " | ||
LDFLAGS="$LDFLAGS-lpng -lz " | ||
break;; | ||
esac | ||
read -p "with gsl [Y/n] ? " yn | ||
echo -n " With \033[4mgsl\033[m [Y/n] ? " | ||
read yn | ||
case $yn in | ||
[nN]* ) break;; | ||
* ) CFLAGS="$CFLAGS-D HAVE_GSL " | ||
LDFLAGS="$LDFLAGS-lgsl " | ||
break;; | ||
esac | ||
read -p "with fftw3 [Y/n] ? " yn | ||
echo -n " With \033[4mfftw3\033[m [Y/n] ? " | ||
read yn | ||
case $yn in | ||
[nN]* ) break;; | ||
* ) CFLAGS="$CFLAGS-D HAVE_FFTW3 " | ||
LDFLAGS="$LDFLAGS-lfftw3f -lfftw3 " | ||
break;; | ||
esac | ||
|
||
read -p "with liblinear [Y/n] ? " yn | ||
echo -n " With \033[4mliblinear\033[m [Y/n] ? " | ||
read yn | ||
case $yn in | ||
[nN]* ) break;; | ||
* ) CFLAGS="$CFLAGS-D HAVE_LIBLINEAR " | ||
LDFLAGS="$LDFLAGS-llinear " | ||
break;; | ||
esac | ||
read -p "with cblas [Y/n] ? " yn | ||
echo -n " With \033[4mcblas\033[m [Y/n] ? " | ||
read yn | ||
case $yn in | ||
[nN]* ) break;; | ||
* ) CFLAGS="$CFLAGS-D HAVE_CBLAS " | ||
LDFLAGS="$LDFLAGS-lblas " | ||
break;; | ||
esac | ||
read -p "use openmp [y/N] ? " yn | ||
echo -n " Use \033[4mopenmp\033[m [y/N] ? " | ||
read yn | ||
case $yn in | ||
[yY]* ) CFLAGS="$CFLAGS-D USE_OPENMP -fopenmp " | ||
LDFLAGS="$LDFLAGS-lgomp " | ||
break;; | ||
* ) break;; | ||
esac | ||
echo $CFLAGS > .def.conf | ||
echo $LDFLAGS > .l.conf | ||
echo $CFLAGS > .DEF | ||
echo $LDFLAGS > .LN | ||
fi | ||
|
||
echo "\nsummary:\nuse: $CC\nwith following compile flags:\n$CFLAGS\nand link flags:\n$LDFLAGS\n" | ||
echo "\n \033[1mUSE\033[m: \033[4m$CC\033[m\n \033[1mCOMPILE FLAGS\033[m: \033[4m$CFLAGS\033[m\n \033[1mLINK FLAGS\033[m: \033[4m$LDFLAGS\033[m\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
CC = `cat ../../lib/.cc.conf` | ||
LDFLAGS = -L"../../lib" -lccv -pthread `cat ../../lib/.l.conf` | ||
CFLAGS = -O3 -msse2 -Wall -I"../../lib" -I"../" `cat ../../lib/.def.conf` | ||
CC = `cat ../../lib/.CC` | ||
LDFLAGS = -L"../../lib" -lccv -pthread `cat ../../lib/.LN` | ||
CFLAGS = -O3 -msse2 -Wall -I"../../lib" -I"../" `cat ../../lib/.DEF` | ||
TARGETS = algebra.tests util.tests numeric.tests basic.tests memory.tests | ||
|
||
test: all | ||
for test in $(TARGETS) ; do ./"$$test" ; done | ||
@for test in $(TARGETS) ; do ./"$$test" ; done | ||
|
||
all: $(TARGETS) | ||
|
||
clean: | ||
rm *.o ../../lib/*.o ../../lib/3rdparty/*.o ../../lib/libccv.a $(TARGETS) | ||
|
||
%.tests: %.tests.o libccv.a | ||
$(CC) -o $@ $< $(LDFLAGS) | ||
@echo "$(CC) -o $@ $< $(LDFLAGS)" | ||
@$(CC) -o $@ $< $(LDFLAGS) | ||
|
||
libccv.a: | ||
${MAKE} -C ../../lib | ||
|
||
%.o: %.c ../../lib/ccv.h | ||
$(CC) $(INCFLAGS) $< -o $@ -c $(CFLAGS) | ||
@echo "$(CC) $(INCFLAGS) $< -o $@ -c $(CFLAGS)" | ||
@$(CC) $(INCFLAGS) $< -o $@ -c $(CFLAGS) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
test: | ||
${MAKE} -C funct ; ${MAKE} -C regression | ||
${MAKE} -C functional ; ${MAKE} -C regression | ||
|
||
clean: | ||
rm *.o ../lib/*.o ../lib/3rdparty/*.o ../lib/libccv.a funct/*.tests regression/*.tests | ||
rm *.o ../lib/*.o ../lib/3rdparty/*.o ../lib/libccv.a functional/*.tests regression/*.tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
CC = `cat ../../lib/.cc.conf` | ||
LDFLAGS = -L"../../lib" -lccv -pthread `cat ../../lib/.l.conf` | ||
CFLAGS = -O3 -msse2 -Wall -I"../../lib" -I"../" `cat ../../lib/.def.conf` | ||
CC = `cat ../../lib/.CC` | ||
LDFLAGS = -L"../../lib" -lccv -pthread `cat ../../lib/.LN` | ||
CFLAGS = -O3 -msse2 -Wall -I"../../lib" -I"../" `cat ../../lib/.DEF` | ||
TARGETS = defects.l0.1.tests | ||
|
||
test: all | ||
for test in $(TARGETS) ; do ./"$$test" ; done | ||
@for test in $(TARGETS) ; do ./"$$test" ; done | ||
|
||
all: $(TARGETS) | ||
|
||
clean: | ||
rm *.o ../../lib/*.o ../../lib/3rdparty/*.o ../../lib/libccv.a $(TARGETS) | ||
|
||
%.tests: %.tests.o libccv.a | ||
$(CC) -o $@ $< $(LDFLAGS) | ||
@echo "$(CC) -o $@ $< $(LDFLAGS)" | ||
@$(CC) -o $@ $< $(LDFLAGS) | ||
|
||
libccv.a: | ||
${MAKE} -C ../../lib | ||
|
||
%.o: %.c ../lib/ccv.h | ||
$(CC) $(INCFLAGS) $< -o $@ -c $(CFLAGS) | ||
@echo "$(CC) $(INCFLAGS) $< -o $@ -c $(CFLAGS)" | ||
@$(CC) $(INCFLAGS) $< -o $@ -c $(CFLAGS) |