Skip to content

Commit

Permalink
output .deps and start to fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliu committed Dec 22, 2014
1 parent aedecac commit feb7e46
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
6 changes: 4 additions & 2 deletions lib/configure
Original file line number Diff line number Diff line change
Expand Up @@ -3747,12 +3747,12 @@ if [ -d "$cuda_prefix" ]; then
MKLDFLAGS="$MKLDFLAGS-lcuda -lcudart -lcublas "

if [ -d "$cuda_prefix/lib64" ]; then
MKLDFLAGS="$MKLDFLAGS-L\"$cuda_prefix/lib64\" "
MKLDFLAGS="$MKLDFLAGS-L$cuda_prefix/lib64 "

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, x86_64" >&5
$as_echo "yes, x86_64" >&6; }
else
MKLDFLAGS="$MKLDFLAGS-l\"$cuda_prefix/lib\" "
MKLDFLAGS="$MKLDFLAGS-l$cuda_prefix/lib "

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, i386" >&5
$as_echo "yes, i386" >&6; }
Expand Down Expand Up @@ -3790,6 +3790,8 @@ DISCFLAGS="${DISCFLAGS%"${DISCFLAGS##*[![:space:]]}"}"

echo -e "\n \033[1mUSE\033[m: \033[4m$CC\033[m\n \033[1mCOMPILE FLAGS\033[m: \033[4m$DISCFLAGS\033[m\n \033[1mLINK FLAGS\033[m: \033[4m$MKLDFLAGS\033[m\n"

echo $MKLDFLAGS > .deps

ac_config_files="$ac_config_files config.mk"


Expand Down
6 changes: 4 additions & 2 deletions lib/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ if [[ -d "$cuda_prefix" ]]; then
AC_SUBST(DEFINE_MACROS, ["$DEFINE_MACROS-D HAVE_CUDA "])
AC_SUBST(MKLDFLAGS, ["$MKLDFLAGS-lcuda -lcudart -lcublas "])
if [[ -d "$cuda_prefix/lib64" ]]; then
AC_SUBST(MKLDFLAGS, ["$MKLDFLAGS-L\"$cuda_prefix/lib64\" "])
AC_SUBST(MKLDFLAGS, ["$MKLDFLAGS-L$cuda_prefix/lib64 "])
AC_MSG_RESULT([yes, x86_64])
else
AC_SUBST(MKLDFLAGS, ["$MKLDFLAGS-l\"$cuda_prefix/lib\" "])
AC_SUBST(MKLDFLAGS, ["$MKLDFLAGS-l$cuda_prefix/lib "])
AC_MSG_RESULT([yes, i386])
fi
else
Expand All @@ -112,6 +112,8 @@ AC_SUBST(DISCFLAGS, ["${DISCFLAGS%"${DISCFLAGS@%:@@%:@*@<:@!@<:@:space:@:>@@:>@}

echo -e "\n \033@<:@1mUSE\033@<:@m: \033@<:@4m$CC\033@<:@m\n \033@<:@1mCOMPILE FLAGS\033@<:@m: \033@<:@4m$DISCFLAGS\033@<:@m\n \033@<:@1mLINK FLAGS\033@<:@m: \033@<:@4m$MKLDFLAGS\033@<:@m\n"

echo $MKLDFLAGS > .deps

AC_CONFIG_FILES(config.mk)

AC_OUTPUT
10 changes: 4 additions & 6 deletions site/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
# For more see: https://github.com/mojombo/jekyll/wiki/Permalinks
permalink: /:categories/:title

exclude: [".rbenv-version", "README.md", "Rakefile"]
auto: false
pygments: false
exclude: [".rbenv-version", "README.md", "Rakefile", "makefile"]
highlighter: null
markdown: kramdown

kramdown:
use_coderay: true

coderay:
coderay_css: class
coderay:
coderay_css: class

# Themes are encouraged to use these universal variables
# so be sure to set them if your theme uses them.
Expand Down
2 changes: 1 addition & 1 deletion site/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ doc:
cd .. && doxygen .doxygen.conf && cd site && ./_doxygen.sh

clean:
rm -f _site/* _doxygen/*
rm -rf _site/* _doxygen/*
15 changes: 10 additions & 5 deletions site/tutorial/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ title: Getting Started

Install
-------

ccv is very lightweight. There is no concept of 'install'. If you want to use ccv, statically linking to it is sufficient. To the extreme, it is recommended to drop ccv source code into your project and use it directly.

For old-schooler, run 'make' in /lib directory will generate the libccv.a archive. From there, you can statically link to it by -lccv. For example, you have ccv source compiled in ~/ccv/, and you want to compile ~/studies/sift.c with ccv.
For old-schooler, run `./configure && make` in `/lib` directory will generate `libccv.a` for static linking with `-lccv`. For example, you have ccv source compiled in `~/ccv/`, and you want to compile `~/studies/sift.c` with ccv.

clang -L"~/ccv/lib" -I"~/ccv/lib" sift.c -lccv `cat ~/ccv/lib/.deps`

clang -L"~/ccv/lib" -I"~/ccv/lib" sift.c -lccv `cat ~/ccv/lib/.LN` -lm
That it. The only magic sauce is `~/ccv/lib/.deps`, which gives you all the dependencies you have to link to when you compile ccv the first time. If your ccv compiled with no dependency, it is empty (and ccv works with zero dependency).

That it. The only magic sauce is ~/ccv/lib/.LN, which gives you all the dependencies you have to link to when you compile ccv the first time. If your ccv compiled with no dependency, it is empty (and ccv works with zero dependency).
*Remember to checkout `./serve/makefile` to see how a real-world program that uses ccv organizes.*

Read a Photo
------------

Let's start with something small.

{:lang="c"}
#include <ccv.h>
int main(int argc, char** argv)
{
Expand All @@ -26,14 +29,15 @@ Let's start with something small.
ccv_write(image, argv[2], 0, CCV_IO_PNG_FILE, 0);
return 0;
}
{:lang="c"}

If your ccv build has dependency on libjpeg or libpng, the code above is sufficient to load any JPEG or PNG file into memory and save a grayscale version to the disk.

Detect a Face
-------------

Yes, knowing how to read a photo is sufficient to write an application that can do, for example, face detection.

{:lang="c"}
#include <ccv.h>
int main(int argc, char** argv)
{
Expand All @@ -52,5 +56,6 @@ Yes, knowing how to read a photo is sufficient to write an application that can
ccv_matrix_free(image);
return 0;
}
{:lang="c"}

That's it.

0 comments on commit feb7e46

Please sign in to comment.