diff --git a/BuildSupport.cmake b/BuildSupport.cmake index c6ab823..b0fd0b1 100644 --- a/BuildSupport.cmake +++ b/BuildSupport.cmake @@ -15,9 +15,12 @@ if (NOT BUILDEM_ENV_STRING) if (NOT BUILDEM_DIR) - message (FATAL_ERROR "ERROR: FlyEM build directory (for all downloads & builds) should be specified via -DBUILDEM_DIR= on cmake command line.") + message (FATAL_ERROR "ERROR: BuildEM build directory (for all downloads & builds) should be specified via -DBUILDEM_DIR= on cmake command line.") endif () +if (NOT BUILDEM_REPO_DIR) + message (FATAL_ERROR "ERROR: BUILDEM_REPO_DIR must be specified via your application's CMakeLists.txt file, and must be set to ${BUILDEM_DIR}/src/buildem.") +endif () # Make sure the main directories for FlyEM build directory are already # created so paths won't error out. diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index a12e2db..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,88 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6) -project (Ilastik) - -include (ExternalProject) -#include (TemplateSupport) - -############################################################################ -# Check if BUILDEM_DIR has already been assigned. If not, create a default. -set (BUILDEM_DIR "None" CACHE TYPE STRING) - -if (${BUILDEM_DIR} STREQUAL "None") - message (FATAL_ERROR "ERROR: FlyEM build directory (for all downloads & builds) should be specified via -DBUILDEM_DIR= on cmake command line.") -endif () - -message ("FlyEM downloads and builds will be placed here: ${BUILDEM_DIR}") - -############################################################################ - -############################################################################ -# Download and install buildem, if it isn't already in BUILDEM_DIR. -set (BUILDEM_REPO_DIR ${BUILDEM_DIR}/src/buildem) -if (NOT EXISTS ${BUILDEM_REPO_DIR}/python.cmake) - message ("Installing buildem repo...") - ExternalProject_Add(buildem - PREFIX ${BUILDEM_DIR} - GIT_REPOSITORY https://github.com/ilastik/buildem.git - #GIT_TAG python3 # Example of tagged branch (see doc) - UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - BUILD_IN_SOURCE 1 - INSTALL_COMMAND "" - ) - message ("\n**********************************************************\n") - message ("\nAfter running make, you must re-run the cmake command once") - message ("buildem has been downloaded!\n") - message ("\n***********************************************************\n") -else () - ############################################################################ - - # Use modules from the downloaded buildem - set (CMAKE_MODULE_PATH ${BUILDEM_REPO_DIR}) - message("Using cmake modules from ${BUILDEM_REPO_DIR}") - - # Download, compile, test, and install dependencies - # Note the auto-generated APP_DEPENDENCIES variable holds all included targets. - - include (ilastik-gui) - - add_custom_target (AppDependencies ALL - DEPENDS ${APP_DEPENDENCIES} - COMMENT "Installed all required software using buildem.") - - # Install Foo -- actual build commands should go below - - configure_file(${TEMPLATE_DIR}/ilastik_final.in ${BUILDEM_DIR}/ilastik_final) - - #INSTALL(FILES ${BUILDEM_DIR}/ilastik_final DESTINATION bin) - INSTALL(PROGRAMS ${BUILDEM_DIR}/ilastik_final DESTINATION . ) - #INSTALL(DIRECTORY ${BUILDEM_DIR}/bin DESTINATION . USE_SOURCE_PERMISSIONS) - INSTALL(PROGRAMS ${BUILDEM_DIR}/bin/python2.7 DESTINATION bin/) - INSTALL(DIRECTORY ${BUILDEM_DIR}/lib DESTINATION .) - INSTALL(DIRECTORY ${BUILDEM_DIR}/include DESTINATION .) - INSTALL(DIRECTORY ${BUILDEM_DIR}/src/volumina-HEAD DESTINATION src/) - INSTALL(DIRECTORY ${BUILDEM_DIR}/src/lazyflow-HEAD DESTINATION src/) - INSTALL(DIRECTORY ${BUILDEM_DIR}/src/ilastik-HEAD DESTINATION src/) - - SET(CPACK_GENERATOR "TGZ") - - SET(CPACK_PACKAGE_VENDOR "Heidelberg Collaboratory for Image Processing") - SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY - "Interactive image labeling and segmentation toolkit." - ) - - SET(CPACK_PACKAGE_VERSION_MAJOR "0") - SET(CPACK_PACKAGE_VERSION_MINOR "6") - SET(CPACK_PACKAGE_VERSION_PATCH "a") - - #SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-0.6.a") - - SET(CPACK_STRIP_FILES TRUE) - #SET(CPACK_PACKAGE_CONTACT "ilastik Team ") - - INCLUDE (CPack) - -############################################################################ -endif() diff --git a/ExternalSource.cmake b/ExternalSource.cmake index 98dc2b4..530490d 100644 --- a/ExternalSource.cmake +++ b/ExternalSource.cmake @@ -99,14 +99,26 @@ macro (external_source ABBREV SRC_VERSION FILENAME MD5) endmacro (external_source) # Define macro to set a number of variables per external git repo +# Note: Besides these named args, this macro accepts the following optional args: +# OVERRIDE_NAME - Used to override the _NAME and _SRC_DIR variables set by this macro macro (external_git_repo ABBREV SRC_VERSION URL) + # Check for extra (optional) macro args. + set (extra_macro_args ${ARGN}) + list(LENGTH extra_macro_args num_extra_args) # RELEASE builds are by default if (NOT ${ABBREV}_BUILD) set (${ABBREV}_BUILD "RELEASE") endif () + # By default, package NAME and SRC_DIR are -git set (external_source_name ${ABBREV}-git) + + # First optional macro arg overrides package NAME and SRC_DIR + if (${num_extra_args} GREATER 0) + list(GET extra_macro_args 0 external_source_name) + endif () + message ("Setting external_git_repo: ${external_source_name}") # Append this external source name to our list of dependencies diff --git a/README.md b/README.md index 152f52e..d396bca 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ Buildem is predicated on some basic assertions: * Developer attention should be minimized since developer time is very expensive compared to freely available computer time. * Disk space is cheap and plentiful. * Each application build process should be easily specified and automated. -* Required components should be easily shared on network drives among networked computers that can share software, i.e., the computers have compatible operating systems, because intranets have excellent bandwidth. * Required components can be automatically built from source, and CMake is a sufficiently flexible and cross-platform tool on which to base our system. * Builds of all components should be specific to OS, compiler, and compiler version to minimize conflicts in [ABI](http://en.wikipedia.org/wiki/Application_binary_interface), and we are not sure that pre-compiled components (e.g., RPMs) are available for all target machines/compilers. * Third-party pre-built packages, like Enthought Python Distribution, are not viable due to licensing costs for cluster operation as well as inability to easily adapt to new dependencies. diff --git a/golang.cmake b/golang.cmake index 5063467..0e013b3 100644 --- a/golang.cmake +++ b/golang.cmake @@ -11,9 +11,9 @@ include (ExternalSource) include (BuildSupport) external_source (golang - 1.1 - go1.1.src.tar.gz - 4933f6a2f3ec1ffb01b42fd88de03851 + 1.1.2 + go1.1.2.src.tar.gz + 705feb2246c8ddaf820d7e171f1430c5 http://go.googlecode.com/files) message ("Installing ${golang_NAME} into build area: ${BUILDEM_DIR} ...") diff --git a/ilastik-gui.cmake b/ilastik-gui.cmake index 3510bea..56ef7c6 100644 --- a/ilastik-gui.cmake +++ b/ilastik-gui.cmake @@ -42,11 +42,12 @@ configure_file(${TEMPLATE_DIR}/ilastik_script.template ${BUILDEM_DIR}/bin/ilasti set(LAUNCH_ILASTIK ilastik/tests/test_applets/pixelClassification/testPixelClassificationGui.py) configure_file(${TEMPLATE_DIR}/ilastik_script.template ${BUILDEM_DIR}/bin/ilastik_gui_test @ONLY) -# Run the gui test script -ExternalProject_add_step(${ilastik_NAME} test_ilastik_gui - DEPENDEES install_gui_test +# Run the gui test script after the ilastik-gui target is built +add_custom_command ( + TARGET ${ilastik-gui_NAME} + POST_BUILD COMMAND ${BUILDEM_ENV_STRING} ${BUILDEM_DIR}/bin/ilastik_gui_test - COMMENT "Ran ilastik gui test" + COMMENT "Running ilastik gui test" ) endif (NOT ilastik-gui_NAME) diff --git a/ilastik.cmake b/ilastik.cmake index 495de85..c7a1e38 100644 --- a/ilastik.cmake +++ b/ilastik.cmake @@ -41,9 +41,8 @@ SET(ILASTIK_VERSION ${ILASTIK_VERSION} external_git_repo (ilastik ${ILASTIK_VERSION} - http://github.com/janelia-flyem/flyem-ilastik) -set(ilastik_NAME ilastik) -set(ilastik_SRC_DIR "${BUILDEM_DIR}/src/${ilastik_NAME}") + http://github.com/janelia-flyem/flyem-ilastik + ilastik) set(lazyflow_SRC_DIR "${ilastik_SRC_DIR}/lazyflow") if("${ILASTIK_VERSION}" STREQUAL "master") diff --git a/lemon.cmake b/lemon.cmake index cf86df5..67182c3 100644 --- a/lemon.cmake +++ b/lemon.cmake @@ -11,33 +11,11 @@ include (ExternalSource) include (BuildSupport) include (PatchSupport) -## FIXME: v1.2.3 of lemon doesn't compile under clang. -## From their issue tracker (#449), it looks like the next release (v1.3) will fix this. -## For now, this means that we MUST use gcc for this package. -## As soon as v1.3 is ready, we should try to upgrade. -# -#set (CMAKE_C_COMPILER /usr/bin/gcc) -#set (CMAKE_CXX_COMPILER /usr/bin/g++) - -# This is the snapshot of the lemon commit we are using, but we are using a -# github-hosted tarball to avoid requiring CMake-2.8.10 -# -## CMake 2.8.10 is required because we want to use ExternalProject_Add with a hg repo. -#CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10) -# -#message ("FIXME: Using a tag from the lemon mainline hg repo instead of a release.") -#message (" The tests in this version don't pass.") -#message (" As soon as lemon-1.3 is released, switch to it (and uncomment the test step)!") -#external_git_repo (lemon -# 473c71baff72 -# http://lemon.cs.elte.hu/hg/lemon-main) - -# Using special cached tarball. See note above. external_source (lemon - 1.2.3 - lemon-1.2.3.tar.gz - 750251a77be450ddddedab14e5163afb - http://lemon.cs.elte.hu/pub/sources) + 1.2.4 + lemon-1.2.4.tar.gz + fd89e8bf5035b02e2622a48ac7fe0641 + http://lemon.cs.elte.hu/pub/sources) message ("Installing ${lemon_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${lemon_NAME} @@ -46,7 +24,12 @@ ExternalProject_Add(${lemon_NAME} URL_MD5 ${lemon_MD5} UPDATE_COMMAND "" PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} - ${lemon_SRC_DIR}/lemon/CMakeLists.txt ${PATCH_DIR}/lemon.patch + # This patch fixes a build error that clang detects. + # (Already fixed in lemon trunk, but not in the tarball release.) + ${lemon_SRC_DIR}/lemon/graph_to_eps.h ${PATCH_DIR}/lemon.patch + # Apparently one test file is missing from the release. + # This patch removes it from CMakeLists.txt + ${lemon_SRC_DIR}/test/CMakeLists.txt ${PATCH_DIR}/lemon-test.patch CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${lemon_SRC_DIR} -DBUILD_SHARED_LIBS=ON @@ -62,9 +45,7 @@ ExternalProject_Add(${lemon_NAME} BUILD_COMMAND ${BUILDEM_ENV_STRING} make INSTALL_COMMAND ${BUILDEM_ENV_STRING} make install - - # Sadly, the tests do not pass in this version that we are pulling. - #TEST_COMMAND ${BUILDEM_ENV_STRING} make check + TEST_COMMAND ${BUILDEM_ENV_STRING} make check ) set_target_properties(${lemon_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) diff --git a/patches/lemon-test.patch b/patches/lemon-test.patch new file mode 100644 index 0000000..c53c54a --- /dev/null +++ b/patches/lemon-test.patch @@ -0,0 +1,11 @@ +--- test/CMakeLists.txt 2013-08-26 15:10:22.000000000 -0400 ++++ test/CMakeLists.txt.patched 2013-08-26 15:10:15.000000000 -0400 +@@ -13,7 +13,7 @@ + + SET(TESTS + adaptors_test +- arc_look_up_test ++ #arc_look_up_test + bellman_ford_test + bfs_test + circulation_test diff --git a/patches/lemon.patch b/patches/lemon.patch index 69eb8ec..172b0f6 100644 --- a/patches/lemon.patch +++ b/patches/lemon.patch @@ -1,10 +1,10 @@ ---- lemon/CMakeLists.txt 2013-02-20 15:19:54.068061699 -0500 -+++ lemon/CMakeLists.txt.patched 2013-02-20 15:20:39.467490359 -0500 -@@ -57,6 +57,7 @@ - INSTALL( - TARGETS lemon - ARCHIVE DESTINATION lib -+ LIBRARY DESTINATION lib - COMPONENT library - ) +--- lemon/graph_to_eps.h 2013-08-10 06:25:53.000000000 -0400 ++++ lemon/graph_to_eps.h.patched 2013-08-26 15:01:35.000000000 -0400 +@@ -222,7 +222,6 @@ + using T::_title; + using T::_copyright; +- using T::NodeTextColorType; + using T::CUST_COL; + using T::DIST_COL; + using T::DIST_BW; diff --git a/vigra.cmake b/vigra.cmake index 19815a6..141d9d0 100644 --- a/vigra.cmake +++ b/vigra.cmake @@ -34,8 +34,6 @@ external_git_repo (vigra ${VIGRA_VERSION} http://github.com/ukoethe/vigra) -#set(vigra_NAME vigra) - if("${VIGRA_VERSION}" STREQUAL "master") set(VIGRA_UPDATE_COMMAND git checkout master && git pull) else() diff --git a/vtk.cmake b/vtk.cmake index acaad40..cb9a4b0 100644 --- a/vtk.cmake +++ b/vtk.cmake @@ -55,7 +55,11 @@ ExternalProject_Add(${vtk_NAME} -DVTK_USE_TK=OFF # NETCDF caused weird errors in vtk's xml -DVTK_USE_SYSTEM_LIBXML2=ON - BUILD_COMMAND ${BUILDEM_ENV_STRING} make + # We want vtk to be built in parallel if possible. + # Therefore we use $(MAKE) instead of 'make', which somehow enables sub-make files to use the jobserver correctly. + # See: http://stackoverflow.com/questions/2942465/cmake-and-parallel-building-with-make-jn + # And: http://www.cmake.org/pipermail/cmake/2011-April/043720.html + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) #TEST_COMMAND ${BUILDEM_ENV_STRING} make check INSTALL_COMMAND ${BUILDEM_ENV_STRING} make install )