1 / 12

Using External Libraries

Using External Libraries. Carlo Izzo. iiinstrument_x.y.z.tar.gz directory tree. CPL. recipes. iiinstrument. tests. iiinstrument. doxygen. admin. WCSLIB. m4macros. GSL. external. FFTW. SExtractor. …. Makefile.am, top iiinstrument directory. AUTOMAKE_OPTIONS = 1.8 foreign

nhu
Télécharger la présentation

Using External Libraries

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using External Libraries Carlo Izzo

  2. iiinstrument_x.y.z.tar.gz directory tree CPL recipes iiinstrument tests iiinstrument doxygen admin WCSLIB m4macros GSL external FFTW SExtractor …

  3. Makefile.am, top iiinstrument directory AUTOMAKE_OPTIONS = 1.8 foreign ACLOCAL_AMFLAGS = -I m4macros DISTCLEANFILES = *~ HTML_SUBDIRS = SUBDIRS = EXTRA_DIST = m4macros/eso.m4 m4macros/cpl.m4 admin/html.am \ doxygen/Doxyfile.in setup pkgdata_DATA = ChangeLog AUTHORS NEWS README TODO if MAINTAINER_MODE MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.h.in configure \ stamp-h.in recipes iiinstrument tests iiinstrument external iiinstrument recipes tests doxygen admin m4macros external external/Makefile.in

  4. configure.ac, top iiinstrument directory recipes iiinstrument AC_CONFIG_FILES(Makefile doxygen/Doxyfile iiinstrument/Makefile recipes/Makefile tests/Makefile) tests iiinstrument external/Makefile doxygen admin m4macros external

  5. Create file Makefile.am, external directory recipes AUTOMAKE_OPTIONS = 1.8 foreign DISTCLEANFILES = *~ EXTRA_DIST=fftw-3.1.2.tar.gz iiinstrument tests iiinstrument doxygen admin m4macros external

  6. acinclude.m4, top iiinstrument directory recipes iiinstrument “configure” should make available the necessary command line options pointing to the external library. This is done by defining in the acinclude.m4 file a IIINSTRUMENT_CHECK_FFTW macro where the FFTW_INCLUDES, FFTW_LDFLAGS, and LIBFFTW are set up properly. Example implementations of this macro can be found in the cpl.m4 macro. tests iiinstrument doxygen admin m4macros external

  7. acinclude.m4, top iiinstrument directory # IIINSTRUMENT_CHECK_FFTW #---------------- # Checks for the FFTW library and header files. AC_DEFUN([IIINSTRUMENT_CHECK_FFTW], [ AC_MSG_CHECKING([for FFTW]) iiinstrument_fftw_check_header="fftw.h" iinstrument_fftw_check_lib="libfftw.a" iiinstrument_fftw_includes="" iiinstrument_fftw_libraries="" AC_ARG_WITH(fftw, AC_HELP_STRING([--with-fftw], [location where FFTW is installed]), [ iiinstrument_with_fftw_includes=$withval/include iiinstrument_with_fftw_libs=$withval/lib ]) ESO_FIND_FILE($iiinstrument_fftw_check_header, $iiinstrument_with_fftw_includes, iiinstrument_fftw_includes) ESO_FIND_FILE($iinstrument_fftw_check_lib, $iiinstrument_with_fftw_libs, iiinstrument_fftw_libraries) recipes iiinstrument tests iiinstrument doxygen admin m4macros external

  8. acinclude.m4, top iiinstrument directory # IIINSTRUMENT_CHECK_FFTW #---------------- # Checks for the FFTW library and header files. AC_DEFUN([IIINSTRUMENT_CHECK_FFTW], [ AC_MSG_CHECKING([for FFTW]) iiinstrument_fftw_check_header="fftw.h" iinstrument_fftw_check_lib="libfftw.a" iiinstrument_fftw_includes="" iiinstrument_fftw_libraries="" AC_ARG_WITH(fftw, AC_HELP_STRING([--with-fftw], [location where FFTW is installed]), [ iiinstrument_with_fftw_includes=$withval/include iiinstrument_with_fftw_libs=$withval/lib ]) ESO_FIND_FILE($iiinstrument_fftw_check_header, $iiinstrument_with_fftw_includes, iiinstrument_fftw_includes) ESO_FIND_FILE($iinstrument_fftw_check_lib, $iiinstrument_with_fftw_libs, iiinstrument_fftw_libraries) recipes iiinstrument tests iiinstrument doxygen admin m4macros external

  9. acinclude.m4, top iiinstrument directory … ESO_FIND_FILE($iiinstrument_fftw_check_header, $iiinstrument_with_fftw_includes, iiinstrument_fftw_includes) ESO_FIND_FILE($iinstrument_fftw_check_lib, $iiinstrument_with_fftw_libs, iiinstrument_fftw_libraries) if test x"$iiinstrument_fftw_includes" = xno; then AC_MSG_ERROR([FFTW include was not found.]) fi if test x"$iiinstrument_fftw_libraries" = xno; then AC_MSG_ERROR([FFTW library was not found.]) fi AC_MSG_RESULT([FFTW library and header found.]) FFTW_INCLUDES="-I$iiinstrument_fftw_includes" FFTW_LDFLAGS="-L$iiinstrument_fftw_libraries" LIBFFTW="-lfftw" AC_SUBST(FFTW_INCLUDES) AC_SUBST(FFTW_LDFLAGS) AC_SUBST(LIBFFTW) ]) recipes iiinstrument tests iiinstrument doxygen admin m4macros external

  10. Makefile.am, bottom iiinstrument directory AUTOMAKE_OPTIONS = 1.8 foreign DISTCLEANFILES = *~ if MAINTAINER_MODE MAINTAINERCLEANFILES = Makefile.in endif CPPFLAGS = -DCX_LOG_DOMAIN=\"IiinstrumentLib\" INCLUDES = $(all_includes) noinst_HEADERS = iiinstrument_utils.h iiinstrument_pfits.h iiinstrument_dfs.h pkginclude_HEADERS = lib_LTLIBRARIES = libiiinstrument.la libiiinstrument_la_SOURCES = iiinstrument_utils.c iiinstrument_pfits.c iiinstrument_dfs.c libiiinstrument_la_LDFLAGS = libiiinstrument_la_LIBADD = libiiinstrument_la_DEPENDENCIES = recipes iiinstrument tests iiinstrument doxygen admin $(FFTW_INCLUDE) m4macros external $(CPL_LDFLAGS) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) $(FFTW_LDFLAGS) $(LIBFFTW) $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLDRS) $(LIBCPLCORE)

  11. error () { echo "Error: $cmd: $1" exit 1 } # Main cmd=`basename $0` usage="Usage: $cmd installation-path" setup_configure="./configure --prefix=$1" setup_make="make" # The destination directory for the installation is mandatory if test $# != 1; then echo "$usage" exit 1 fi # Configure the package echo "Setting up pipeline package... " if eval $setup_configure; then : else error "Package setup failed! See logfile for details." fi # Compile the pipeline echo "Building pipeline package... " if eval $setup_make; then : else error "Package build failed! See logfile for details." fi setup, top iiinstrument directory recipes iiinstrument tests iiinstrument doxygen admin m4macros # Install the pipeline echo "Installing pipeline package... " if eval $setup_make install install-html; then : else error "Package installation failed! See logfile for details." fi exit 0

  12. setup, top iiinstrument directory recipes iiinstrument cd external gunzip fftw-3.1.2.tar.gz tar -xvf fftw-3.1.2.tar cd fftw-3.1.2 ./configure –prefix=$HOME/tmp/fftw –disable-shared make make install cd .. tests iiinstrument doxygen admin –with-fftw=$HOME/tmp/fftw ./configure --prefix=$1 make make install m4macros external tmp

More Related