diff --git a/BuildSupport.cmake b/BuildSupport.cmake index b0fd0b1..d29cb50 100644 --- a/BuildSupport.cmake +++ b/BuildSupport.cmake @@ -49,11 +49,15 @@ if (NOT EXISTS ${BUILDEM_SRC_DIR}) file (MAKE_DIRECTORY ${BUILDEM_SRC_DIR}) endif () +if (NOT EXISTS /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk) + message (FATAL_ERROR "ERROR: XCode and the OSX 10.9 SDK have to be installed. Please install XCode from the AppStore") +endif () + if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Important to use FALLBACK variable. # https://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryUsageGuidelines.html set (BUILDEM_LD_LIBRARY_VAR "DYLD_FALLBACK_LIBRARY_PATH") - set (BUILDEM_PLATFORM_SPECIFIC_ENV "MACOSX_DEPLOYMENT_TARGET=10.5") + set (BUILDEM_PLATFORM_SPECIFIC_ENV "MACOSX_DEPLOYMENT_TARGET=10.9") set (BUILDEM_PLATFORM_DYLIB_EXTENSION "dylib") else() set (BUILDEM_LD_LIBRARY_VAR "LD_LIBRARY_PATH") diff --git a/FindCplex.cmake b/FindCplex.cmake index 63488d1..4a66cf2 100644 --- a/FindCplex.cmake +++ b/FindCplex.cmake @@ -89,6 +89,7 @@ FIND_LIBRARY(CPLEX_LIBRARY ${CPLEX_ROOT_DIR}/cplex/lib/x86-64_debian4.0_4.1/static_pic #unix ${CPLEX_ROOT_DIR}/cplex/lib/x86-64_sles10_4.1/static_pic #unix ${CPLEX_ROOT_DIR}/cplex/lib/x86-64_osx/static_pic #osx + ${CPLEX_ROOT_DIR}/cplex/lib/x86-64_darwin/static_pic #osx PATHS ENV LIBRARY_PATH #unix ENV LD_LIBRARY_PATH #unix ) @@ -100,6 +101,7 @@ FIND_LIBRARY(CPLEX_ILOCPLEX_LIBRARY ${CPLEX_ROOT_DIR}/cplex/lib/x86-64_debian4.0_4.1/static_pic #unix ${CPLEX_ROOT_DIR}/cplex/lib/x86-64_sles10_4.1/static_pic #unix ${CPLEX_ROOT_DIR}/cplex/lib/x86-64_osx/static_pic #osx + ${CPLEX_ROOT_DIR}/cplex/lib/x86-64_darwin/static_pic #osx PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH ) @@ -111,6 +113,7 @@ FIND_LIBRARY(CPLEX_CONCERT_LIBRARY ${CPLEX_ROOT_DIR}/concert/lib/x86-64_debian4.0_4.1/static_pic #unix ${CPLEX_ROOT_DIR}/concert/lib/x86-64_sles10_4.1/static_pic #unix ${CPLEX_ROOT_DIR}/concert/lib/x86-64_osx/static_pic #osx + ${CPLEX_ROOT_DIR}/concert/lib/x86-64_darwin/static_pic #osx PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH ) @@ -127,6 +130,7 @@ else() HINTS ${CPLEX_ROOT_DIR}/cplex/bin/x86-64_sles10_4.1 #unix ${CPLEX_ROOT_DIR}/cplex/bin/x86-64_debian4.0_4.1 #unix ${CPLEX_ROOT_DIR}/cplex/bin/x86-64_osx #osx + ${CPLEX_ROOT_DIR}/cplex/bin/x86-64_darwin #osx ENV LIBRARY_PATH ENV LD_LIBRARY_PATH ) diff --git a/README_openblas.txt b/README_openblas.txt new file mode 100644 index 0000000..17a311b --- /dev/null +++ b/README_openblas.txt @@ -0,0 +1,15 @@ +If you are having trouble building OpenBLAS out of the box, you may need to specify your CPU Architecture. +Common architecture options include SandyBridge and Haswell. Even if your build worked correctly, it may +not be optimal. The default architecture, if not specified, is Nehalem, which is probably not the ideal +choice unless using an older computer. + +To specify the architecture simply use the TARGET flag. For example, TARGET=SANDYBRIDGE will build for +the SandyBridge architecture. Similarly, TARGET=HASWELL will target the Haswell (or Crystalwell) +architecture(s). To do this simply modify the BUILD_COMMAND to include this flag ____after____ the call +to $(MAKE) as it must be an argument to make. It is recommend the same be done for the INSTALL_COMMAND +as well. + +More information can be found on the OpenBLAS GitHub webpage ( https://github.com/xianyi/OpenBLAS/ ). A list +of architectures supported can be found here ( https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt ). +Note that at the time of writing this READNME, the list has not been updated in about a year; so, it does not +list HASWELL even though it is supported by the version we are using. \ No newline at end of file diff --git a/ann.cmake b/ann.cmake index 9928c54..2ce809c 100644 --- a/ann.cmake +++ b/ann.cmake @@ -15,8 +15,7 @@ external_source (ann 1.1.2 ann_1.1.2.tar.gz 7ffaacc7ea79ca39d4958a6378071365 - http://www.cs.umd.edu/~mount/ANN/Files/1.1.2 - FORCE) + http://www.cs.umd.edu/~mount/ANN/Files/1.1.2/) message ("Installing ${ann_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${ann_NAME} @@ -32,6 +31,7 @@ ExternalProject_Add(${ann_NAME} -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) diff --git a/backports-ssl_match_hostname.cmake b/backports-ssl_match_hostname.cmake new file mode 100644 index 0000000..8e66869 --- /dev/null +++ b/backports-ssl_match_hostname.cmake @@ -0,0 +1,37 @@ +# Provides match_hostname from Python 3 for Python 2. +# Required by tornado. + +if (NOT backports-ssl_match_hostname_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + + +include (python) + +external_source(backports-ssl_match_hostname + 3.4.0.2 + backports.ssl_match_hostname-3.4.0.2.tar.gz + 788214f20214c64631f0859dc79f23c6 + https://pypi.python.org/packages/source/b/backports.ssl_match_hostname/) + +message ("Installing ${backports-ssl_match_hostname_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${backports-ssl_match_hostname_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${backports-ssl_match_hostname_URL} + URL_MD5 ${backports-ssl_match_hostname_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${backports-ssl_match_hostname_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT backports-ssl_match_hostname_NAME) \ No newline at end of file diff --git a/blockedarray.cmake b/blockedarray.cmake index 6f3995f..ab160b8 100644 --- a/blockedarray.cmake +++ b/blockedarray.cmake @@ -31,6 +31,7 @@ ExternalProject_Add(${blockedarray_NAME} PATCH_COMMAND "" CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} -DPYTHON_EXECUTABLE=${PYTHON_EXE} diff --git a/boost.cmake b/boost.cmake index 6526bdb..d6ed2c3 100644 --- a/boost.cmake +++ b/boost.cmake @@ -17,12 +17,13 @@ set (boost_INCLUDE_DIR ${BUILDEM_INCLUDE_DIR}/boost) include_directories (${boost_INCLUDE_DIR}) external_source (boost - 1_51_0 - boost_1_51_0.tar.gz - 6a1f32d902203ac70fbec78af95b3cf8 - http://downloads.sourceforge.net/project/boost/boost/1.51.0) + 1_56_0 + boost_1_56_0.tar.bz2 + a744cf167b05d72335f27c88115f211d + http://hivelocity.dl.sourceforge.net/project/boost/boost/1.56.0) -set (boost_LIBS ${BUILDEM_LIB_DIR}/libboost_thread.${BUILDEM_PLATFORM_DYLIB_EXTENSION} +set (boost_LIBS ${BUILDEM_LIB_DIR}/libboost_container.${BUILDEM_PLATFORM_DYLIB_EXTENSION} + ${BUILDEM_LIB_DIR}/libboost_thread.${BUILDEM_PLATFORM_DYLIB_EXTENSION} ${BUILDEM_LIB_DIR}/libboost_system.${BUILDEM_PLATFORM_DYLIB_EXTENSION} ${BUILDEM_LIB_DIR}/libboost_program_options.${BUILDEM_PLATFORM_DYLIB_EXTENSION} ${BUILDEM_LIB_DIR}/libboost_python.${BUILDEM_PLATFORM_DYLIB_EXTENSION} @@ -42,18 +43,18 @@ ExternalProject_Add(${boost_NAME} UPDATE_COMMAND "" PATCH_COMMAND "" CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ./bootstrap.sh - --with-libraries=date_time,filesystem,python,regex,serialization,system,test,thread,program_options,chrono + --with-libraries=container,date_time,filesystem,python,regex,serialization,system,test,thread,program_options,chrono --with-python=${PYTHON_EXE} --prefix=${BUILDEM_DIR} - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include - BUILD_COMMAND ${BUILDEM_ENV_STRING} ./b2 + BUILD_COMMAND ${BUILDEM_ENV_STRING} ./b2 + cxxflags="${BUILDEM_ADDITIONAL_CXX_FLAGS}" linkflags="${BUILDEM_ADDITIONAL_CXX_FLAGS}" --layout=tagged -sNO_BZIP2=1 -sZLIB_INCLUDE=${BUILDEM_DIR}/include -sZLIB_SOURCE=${zlib_SRC_DIR} install BUILD_IN_SOURCE 1 - INSTALL_COMMAND ${BUILDEM_ENV_STRING} ./b2 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ./b2 + cxxflags="${BUILDEM_ADDITIONAL_CXX_FLAGS}" linkflags="${BUILDEM_ADDITIONAL_CXX_FLAGS}" -sNO_BZIP2=1 -sZLIB_INCLUDE=${BUILDEM_DIR}/include -sZLIB_SOURCE=${zlib_SRC_DIR} install diff --git a/bottleneck.cmake b/bottleneck.cmake new file mode 100644 index 0000000..0aa290c --- /dev/null +++ b/bottleneck.cmake @@ -0,0 +1,41 @@ +# Provides functions to deal with nan in NumPy arrays efficiently. +# +# Required by pandas. + + +if (NOT bottleneck_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (TemplateSupport) + +include (python) +include (numpy) +include (scipy) +include (nose) + +external_git_repo(bottleneck + v0.7.0 #4042977fa716f127a2074de011b9ef84caf2e965 + https://github.com/kwgoodman/bottleneck) + +message ("Installing ${bottleneck_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${bottleneck_NAME} + DEPENDS ${python_NAME} ${numpy_NAME} ${scipy_NAME} ${nose_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${bottleneck_URL} + GIT_TAG ${bottleneck_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${bottleneck_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT bottleneck_NAME) diff --git a/chatty.cmake b/chatty.cmake index 39d7225..a20e478 100644 --- a/chatty.cmake +++ b/chatty.cmake @@ -33,6 +33,7 @@ ExternalProject_Add(${chatty_NAME} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} -DPYTHON_EXECUTABLE=${PYTHON_EXE} -DPYTHON_INCLUDE_DIR=${PYTHON_PREFIX}/include/python2.7 "-DPYTHON_LIBRARY=${PYTHON_PREFIX}/lib/libpython2.7.${BUILDEM_PLATFORM_DYLIB_EXTENSION}" diff --git a/cloud_sptheme.cmake b/cloud_sptheme.cmake new file mode 100644 index 0000000..f9b6e1e --- /dev/null +++ b/cloud_sptheme.cmake @@ -0,0 +1,40 @@ +# +# Install cloud_sptheme from source. Provides theme for Sphinx. +# + +if (NOT cloud_sptheme_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (TemplateSupport) + +include (python) +include (sphinx) + +external_source (cloud_sptheme + 1.6 + cloud_sptheme-1.6.tar.gz + 23d5fce0b87836d9f29573d6ee6a9bc1 + https://pypi.python.org/packages/source/c/cloud_sptheme/) + +message ("Installing ${cloud_sptheme_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${cloud_sptheme_NAME} + DEPENDS ${python_NAME} ${sphinx_NAME} + PREFIX ${BUILDEM_DIR} + URL ${cloud_sptheme_URL} + URL_MD5 ${cloud_sptheme_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${cloud_sptheme_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT cloud_sptheme_NAME) diff --git a/cplex-shared.cmake b/cplex-shared.cmake index c01c184..ad455a8 100644 --- a/cplex-shared.cmake +++ b/cplex-shared.cmake @@ -27,7 +27,7 @@ find_package( Cplex REQUIRED ) if (APPLE) set(SHARED_CPLEX_COMPILE_FLAGS "-fpic -stdlib=libstdc++") set(SHARED_CPLEX_LINK_FLAGS_1 "-Wl,-all_load") - set(SHARED_CPLEX_LINK_FLAGS_2 "") + set(SHARED_CPLEX_LINK_FLAGS_2 "-stdlib=libstdc++") else() set(SHARED_CPLEX_COMPILE_FLAGS "-shared -fpic") set(SHARED_CPLEX_LINK_FLAGS_1 "-Wl,-whole-archive") diff --git a/cylemon.cmake b/cylemon.cmake index 73f5003..0e6795d 100644 --- a/cylemon.cmake +++ b/cylemon.cmake @@ -32,7 +32,7 @@ ExternalProject_Add(${cylemon_NAME} GIT_TAG ${cylemon_TAG} UPDATE_COMMAND "" CONFIGURE_COMMAND "" - BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} + BUILD_COMMAND ${BUILDEM_ENV_STRING} env "CPPFLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS}" "LDFLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS}" ${PYTHON_EXE} setup.py --no-extra-includes ${cylemon_SPECIAL_SETUP} build build_ext -I${BUILDEM_INCLUDE_DIR} -L${BUILDEM_LIB_DIR} BUILD_IN_SOURCE 1 INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install diff --git a/cytoolz.cmake b/cytoolz.cmake new file mode 100644 index 0000000..394ecac --- /dev/null +++ b/cytoolz.cmake @@ -0,0 +1,39 @@ +# +# Install cytoolz library from source +# + +if (NOT cytoolz_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_source (cytoolz + 0.7.1 + cytoolz-0.7.1.tar.gz + ddc3cc4a00fa0bdd3e7a837cd8d2df31 + https://pypi.python.org/packages/source/c/cytoolz +) + +message ("Installing ${cytoolz_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${cytoolz_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${cytoolz_URL} + URL_MD5 ${cytoolz_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND "" +) + +set_target_properties(${cytoolz_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT cytoolz_NAME) diff --git a/dask.cmake b/dask.cmake new file mode 100644 index 0000000..c977602 --- /dev/null +++ b/dask.cmake @@ -0,0 +1,39 @@ +# Provides dask, an implementation to support larger than memory arrays that can be used as NumPy ndarrays. + +if (NOT dask_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (cytoolz) +include (dill) +include (toolz) + +external_git_repo(dask + 0.2.6 #af03c7c7d7cc5e06701fd2f5153008f367ed99fe + https://github.com/ContinuumIO/dask) + + +# Download and install dask +message ("Installing ${dask_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${dask_NAME} + DEPENDS ${python_NAME} ${cytoolz_NAME} ${dill_NAME} ${toolz_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${dask_URL} + GIT_TAG ${dask_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${dask_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT dask_NAME) diff --git a/dill.cmake b/dill.cmake new file mode 100644 index 0000000..8ab8255 --- /dev/null +++ b/dill.cmake @@ -0,0 +1,36 @@ +# Provides dill, which provides support for pickling with a larger set of Python objects. + +if (NOT dill_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_git_repo(dill + dill-0.2.2 #8d3fb53d218082b14839f3e2aa6a3b0f975fb57c + https://github.com/uqfoundation/dill) + + +# Download and install dill +message ("Installing ${dill_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${dill_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${dill_URL} + GIT_TAG ${dill_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${dill_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT dill_NAME) diff --git a/dlib.cmake b/dlib.cmake index f20e40f..d13cf39 100644 --- a/dlib.cmake +++ b/dlib.cmake @@ -15,8 +15,7 @@ external_source (dlib 18.3 dlib-18.3.tar.bz2 1ad26ec7bddccf8a605e1edfd0620c65 - http://downloads.sourceforge.net/project/dclib/dlib/v18.3 - FORCE) + http://downloads.sourceforge.net/project/dclib/dlib/v18.3) message ("Installing ${dlib_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${dlib_NAME} @@ -31,6 +30,7 @@ ExternalProject_Add(${dlib_NAME} -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) diff --git a/ffmpeg.cmake b/ffmpeg.cmake new file mode 100644 index 0000000..0b5e3c1 --- /dev/null +++ b/ffmpeg.cmake @@ -0,0 +1,39 @@ +# +# Install ffmpeg from source. +# Provides support for audio and video. +# + +if (NOT ffmpeg_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +external_source (ffmpeg + 2.4.3 + ffmpeg-2.4.3.tar.bz2 + 8da635baff57d7ab704b1daca5a99b47 + http://www.ffmpeg.org/releases/ + FORCE) + +message ("Installing ${ffmpeg_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${ffmpeg_NAME} + PREFIX ${BUILDEM_DIR} + URL ${ffmpeg_URL} + URL_MD5 ${ffmpeg_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${ffmpeg_SRC_DIR}/configure + --prefix=${BUILDEM_DIR} + --disable-yasm + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + BUILD_IN_SOURCE 1 + TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check + INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install +) + +set_target_properties(${ffmpeg_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT ffmpeg_NAME) diff --git a/fontconfig.cmake b/fontconfig.cmake index 4c3f3a5..524aaab 100644 --- a/fontconfig.cmake +++ b/fontconfig.cmake @@ -35,7 +35,8 @@ if (NOT fontconfig_NAME) --prefix=${BUILDEM_DIR} --enable-shared --enable-libxml2 - LDFLAGS=-L${BUILDEM_DIR}/lib + "LDFLAGS=-L${BUILDEM_DIR}/lib ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLags=${BUILDEM_ADDITIONAL_CXX_FLAGS}" LIBXML2_CFLAGS=-I${BUILDEM_DIR}/include/libxml2 LIBXML2_LIBS=-lxml2 FREETYPE_CFLAGS=-I${BUILDEM_DIR}/include/freetype2 FREETYPE_LIBS=-lfreetype BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) diff --git a/freetype2.cmake b/freetype2.cmake index 6c97dc4..c05dfb9 100644 --- a/freetype2.cmake +++ b/freetype2.cmake @@ -28,8 +28,8 @@ ExternalProject_Add(${freetype2_NAME} CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ./configure --prefix=${BUILDEM_DIR} --enable-shared - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) BUILD_IN_SOURCE 1 INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install diff --git a/futures.cmake b/futures.cmake new file mode 100644 index 0000000..b0f64d6 --- /dev/null +++ b/futures.cmake @@ -0,0 +1,41 @@ +# +# Install futures library from source +# + +if (NOT futures_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (setuptools) + +external_source (futures + 2.1.6 + futures-2.1.6.tar.gz + cfab9ac3cd55d6c7ddd0546a9f22f453 + https://pypi.python.org/packages/source/f/futures) + +message ("Installing ${futures_NAME} into ilastik build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${futures_NAME} + DEPENDS ${python_NAME} ${setuptools_NAME} + PREFIX ${BUILDEM_DIR} + URL ${futures_URL} + URL_MD5 ${futures_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND "" +) + +set_target_properties(${futures_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + + +endif (NOT futures_NAME) + diff --git a/geos.cmake b/geos.cmake new file mode 100644 index 0000000..4d72451 --- /dev/null +++ b/geos.cmake @@ -0,0 +1,51 @@ +# +# Install geos from source. +# Provides an open source geometry engine. +# + +if (NOT geos_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +external_source (geos + 3.4.2 + geos-3.4.2.tar.bz2 + fc5df2d926eb7e67f988a43a92683bae + http://download.osgeo.org/geos/) + + +# if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +# set (GEOS_ENABLE_MACOSX_FRAMEWORK ON) +# set (GEOS_ENABLE_MACOSX_FRAMEWORK_UNIXCOMPAT ON) +# else() +# set (GEOS_ENABLE_MACOSX_FRAMEWORK OFF) +# endif() + + +message ("Installing ${geos_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${geos_NAME} + DEPENDS + PREFIX ${BUILDEM_DIR} + URL ${geos_URL} + URL_MD5 ${geos_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} + # Turns off test that is known failure on Mac and that does not appear to be fixed ( http://trac.osgeo.org/geos/ticket/299 ). + ${geos_SRC_DIR}/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp ${PATCH_DIR}/geos-CoordinateArraySequenceFactoryTest.cpp.patch + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${geos_SRC_DIR}/configure + --prefix=${BUILDEM_DIR} + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + BUILD_IN_SOURCE 1 + TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check + INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install +) + +set_target_properties(${geos_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT geos_NAME) diff --git a/gmp.cmake b/gmp.cmake index e2d9de7..32c9b8c 100644 --- a/gmp.cmake +++ b/gmp.cmake @@ -1,5 +1,6 @@ # -# Install gmp from source +# Install gmp from source. +# Provides multiple precision support. # if (NOT gmp_NAME) @@ -14,7 +15,7 @@ external_source (gmp 5.0.5 gmp-5.0.5.tar.bz2 041487d25e9c230b0c42b106361055fe - ftp://ftp.gnu.org/gnu/gmp) + ftp://ftp.gnu.org/gnu/gmp/) message ("Installing ${gmp_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${gmp_NAME} @@ -25,8 +26,8 @@ ExternalProject_Add(${gmp_NAME} PATCH_COMMAND "" CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${gmp_SRC_DIR}/configure --prefix=${BUILDEM_DIR} - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) BUILD_IN_SOURCE 1 TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check diff --git a/gmpy.cmake b/gmpy.cmake new file mode 100644 index 0000000..f5e7e8a --- /dev/null +++ b/gmpy.cmake @@ -0,0 +1,45 @@ +# Python bindings to the very versatile, established gmp, mpfr, and mpc. +# +# Used by SymPy. Though, can be used independently. + + +if (NOT gmpy_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (TemplateSupport) + +include (python) +include (gmp) +include (mpfr) +include (mpc) + + +external_source (gmpy + 2.0.5 + gmpy2-2.0.5.zip + 95f008bcab6372164358123f43e3f490 + http://pypi.python.org/packages/source/g/gmpy2/) + + +message ("Installing ${gmpy_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${gmpy_NAME} + DEPENDS ${python_NAME} ${gmp_NAME} ${mpfr_NAME} ${mpc_NAME} + PREFIX ${BUILDEM_DIR} + URL ${gmpy_URL} + URL_MD5 ${gmpy_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build --prefix=${BUILDEM_DIR} + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install --prefix=${BUILDEM_DIR} +) + +set_target_properties(${gmpy_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT gmpy_NAME) diff --git a/gtest.cmake b/gtest.cmake index 2e8c5fa..0a4c703 100644 --- a/gtest.cmake +++ b/gtest.cmake @@ -26,6 +26,7 @@ ExternalProject_Add(${gtest_NAME} CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${gtest_SRC_DIR} -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) BUILD_IN_SOURCE 1 INSTALL_COMMAND "" diff --git a/h5py.cmake b/h5py.cmake index acfd8ec..29a4326 100644 --- a/h5py.cmake +++ b/h5py.cmake @@ -15,10 +15,10 @@ include (hdf5) include (numpy) external_source (h5py - 2.1.3 - h5py-2.1.3.tar.gz - afd3c14f763339e186dd9cd24eb2eb74 - http://h5py.googlecode.com/files) + 2.3.1 + h5py-2.3.1.tar.gz + 8f32f96d653e904d20f9f910c6d9dd91 + https://pypi.python.org/packages/source/h/h5py) message ("Installing ${h5py_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${h5py_NAME} diff --git a/hdf5.cmake b/hdf5.cmake index 66f1e0e..3f71413 100644 --- a/hdf5.cmake +++ b/hdf5.cmake @@ -34,6 +34,7 @@ ExternalProject_Add(${hdf5_NAME} CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${hdf5_SRC_DIR} -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} -DHDF5_BUILD_HL_LIB=ON -DHDF_BUILD_CPP_LIB=ON -DBUILD_SHARED_LIBS=ON diff --git a/hdf5storage.cmake b/hdf5storage.cmake new file mode 100644 index 0000000..a82b256 --- /dev/null +++ b/hdf5storage.cmake @@ -0,0 +1,47 @@ +# +# A python module to provide additional support for the HDF5 format. +# Is able to load and save MATLAB v7.3 file. Will fallback to SciPy when it is unable to. +# + + +if (NOT hdf5storage_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (numpy) +include (h5py) +include (scipy) + +external_source (hdf5storage +# Run the fake file using echo to initialize the shell. + 0.1.3 + hdf5storage-0.1.3.zip + 1bdda81bd88ce2f23adbda0217e16375 + https://pypi.python.org/packages/source/h/hdf5storage/) + + +# Download and install hdf5storage +message ("Installing ${hdf5storage_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${hdf5storage_NAME} + DEPENDS ${python_NAME} ${numpy_NAME} ${h5py_NAME} ${scipy_NAME} + PREFIX ${BUILDEM_DIR} + URL ${hdf5storage_URL} + URL_MD5 ${hdf5storage_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${hdf5storage_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT hdf5storage_NAME) + diff --git a/ilastik-gui.cmake b/ilastik-gui.cmake index d0d5c5e..4cc514f 100644 --- a/ilastik-gui.cmake +++ b/ilastik-gui.cmake @@ -42,6 +42,10 @@ add_custom_target (${ilastik-gui_NAME} ALL set(SETENV_ILASTIK setenv_ilastik_gui) configure_file(${TEMPLATE_DIR}/${SETENV_ILASTIK}.in ${BUILDEM_DIR}/bin/${SETENV_ILASTIK}.sh @ONLY) +# Create exec script for easy execution. +set(SETENV_ILASTIK setenv_ilastik_gui) +configure_file(${TEMPLATE_DIR}/exec.template ${BUILDEM_DIR}/bin/exec.sh @ONLY) + # Add gui launch script set(LAUNCH_ILASTIK ilastik/ilastik.py) configure_file(${TEMPLATE_DIR}/ilastik_script.template ${BUILDEM_DIR}/bin/ilastik_gui @ONLY) diff --git a/ilastik.cmake b/ilastik.cmake index 392c285..61ad166 100644 --- a/ilastik.cmake +++ b/ilastik.cmake @@ -28,12 +28,17 @@ include (greenlet) include (cylemon) include (yapsy) include (pgmlink) +include (scikit-image) include (scikit-learn) include (nose) include (faulthandler) +include (jsonschema) # Required for the dvid extension. +include (opengm) +include (futures) +include (qimage2ndarray) # select the desired ilastik commit -set(DEFAULT_ILASTIK_VERSION "20131205") +set(DEFAULT_ILASTIK_VERSION 779685cc1e6b78b633fcd1737c5eae78e8b72ddb) # 2014-09-18 IF(NOT DEFINED ILASTIK_VERSION) SET(ILASTIK_VERSION "${DEFAULT_ILASTIK_VERSION}") ENDIF() @@ -43,28 +48,35 @@ SET(ILASTIK_VERSION ${ILASTIK_VERSION} external_git_repo (ilastik ${ILASTIK_VERSION} - https://github.com/janelia-flyem/flyem-ilastik + https://github.com/ilastik/ilastik-meta ilastik) set(lazyflow_SRC_DIR "${ilastik_SRC_DIR}/lazyflow") if("${ILASTIK_VERSION}" STREQUAL "master") - set(ILASTIK_UPDATE_COMMAND git checkout master && git pull origin master && git submodule update --init --recursive && + # If the user's build is old, he might be linked to the janelia-flyem remote + # Force the remote to update from ilastik/ilastik-meta by removing origin and adding it again + set(ILASTIK_UPDATE_COMMAND git remote rm origin && git remote add origin https://github.com/ilastik/ilastik-meta && + git fetch origin && + git checkout master && git pull origin master && git submodule update --init --recursive && cd lazyflow && git checkout master && git pull origin master && git submodule update && cd .. && cd volumina && git checkout master && git pull origin master && cd .. && cd ilastik && git checkout master && git pull origin master && cd ..) else() - set(ILASTIK_UPDATE_COMMAND git fetch && git checkout ${ILASTIK_VERSION} && git submodule update --init --recursive) + # If the user's build is old, he might be linked to the janelia-flyem remote + # Force the remote to update from ilastik/ilastik-meta by removing origin and adding it again + set(ILASTIK_UPDATE_COMMAND git remote rm origin && git remote add origin https://github.com/ilastik/ilastik-meta && + git fetch origin && git checkout ${ILASTIK_VERSION} && git submodule update --init --recursive) endif() message ("Installing ${ilastik_NAME}/${ILASTIK_VERSION} into FlyEM build area: ${BUILDEM_DIR} ...") -set (ilastik_dependencies ${vigra_NAME} ${h5py_NAME} ${psutil_NAME} ${nose_NAME} - ${blist_NAME} ${greenlet_NAME} ${yapsy_NAME} ${faulthandler_NAME} - ${cylemon_NAME} ${scikit-learn_NAME}) +set (ilastik_dependencies ${vigra_NAME} ${h5py_NAME} ${psutil_NAME} ${nose_NAME} ${futures_NAME} + ${blist_NAME} ${greenlet_NAME} ${yapsy_NAME} ${faulthandler_NAME} + ${cylemon_NAME} ${scikit-image_NAME} ${scikit-learn_NAME} ${jsonschema_NAME} ${opengm_NAME} ${qimage2ndarray_NAME}) if (${build_pgmlink}) # Tracking depends on pgmlink, which depends on CPLEX. @@ -86,6 +98,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -DLIBRARY_OUTPUT_PATH=${lazyflow_SRC_DIR}/lazyflow/drtile -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} -DPYTHON_EXECUTABLE=${PYTHON_EXE} + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} -DPYTHON_INCLUDE_DIR=${PYTHON_PREFIX}/include/python2.7 "-DPYTHON_LIBRARY=${PYTHON_PREFIX}/lib/libpython2.7.${BUILDEM_PLATFORM_DYLIB_EXTENSION}" -DPYTHON_NUMPY_INCLUDE_DIR=${PYTHON_PREFIX}/lib/python2.7/site-packages/numpy/core/include @@ -123,6 +136,10 @@ file(RELATIVE_PATH PYTHON_PREFIX_RELATIVE ${BUILDEM_DIR} ${PYTHON_PREFIX}) set(SETENV_ILASTIK setenv_ilastik_gui) configure_file(${TEMPLATE_DIR}/${SETENV_ILASTIK}.in ${BUILDEM_DIR}/bin/${SETENV_ILASTIK}.sh @ONLY) +# Create exec script for easy execution. +set(SETENV_ILASTIK setenv_ilastik_gui) +configure_file(${TEMPLATE_DIR}/exec.template ${BUILDEM_DIR}/bin/exec.sh @ONLY) + # Add headless launch script set(LAUNCH_ILASTIK "ilastik/ilastik.py --headless") configure_file(${TEMPLATE_DIR}/ilastik_script.template ${BUILDEM_DIR}/bin/ilastik_headless @ONLY) @@ -135,6 +152,7 @@ configure_file(${TEMPLATE_DIR}/ilastik_script.template ${BUILDEM_DIR}/bin/ilasti set(LAUNCH_ILASTIK ilastik/ilastik/workflows/pixelClassification/pixelClassificationClusterized.py) configure_file(${TEMPLATE_DIR}/ilastik_script.template ${BUILDEM_DIR}/bin/ilastik_clusterized @ONLY) + set_target_properties(${ilastik_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) endif (NOT ilastik_NAME) diff --git a/ilmbase.cmake b/ilmbase.cmake index c60a94b..eea276d 100644 --- a/ilmbase.cmake +++ b/ilmbase.cmake @@ -39,12 +39,19 @@ ExternalProject_Add(${ilmbase_NAME} PATCH_COMMAND ${ilmbase_PATCH_COMMAND} CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${ilmbase_SRC_DIR}/configure --prefix=${BUILDEM_DIR} - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "LDFLAGS=${BUILDEM_LDFLAGS}" + "CXXFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install ) +if (${BUILDEM_ADDITIONAL_CXX_FLAGS} MATCHES "libstdc") + ExternalProject_Add_Step(${ilmbase_NAME} ${ilmbase_NAME}-configure-stdlib + COMMAND bash ${PATCH_DIR}/ilmbase-fix-makefiles-stdlib.sh ${ilmbase_SRC_DIR}/../ilmbase-1.0.2-build + DEPENDEES configure + ) +endif() + set_target_properties(${ilmbase_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) -endif (NOT ilmbase_NAME) \ No newline at end of file +endif (NOT ilmbase_NAME) diff --git a/ipython.cmake b/ipython.cmake new file mode 100644 index 0000000..7f61689 --- /dev/null +++ b/ipython.cmake @@ -0,0 +1,44 @@ +# Standard of Python interactive programming. +# Required by Spyder. + +if (NOT ipython_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + + +include (python) +include (pyqt4) +include (sphinxcontrib-napoleon) # For sphinx extension. Doesn't necessarily need napolean, but it is nice to have and is quick to install. +include (pyzmq) +include (nose) +include (pygments) +include (tornado) +include (jinja) +include (python-markdown) + + +external_git_repo(ipython + rel-2.1.0 #681fd77d0aa43f0b2648674ce3da9185021c0e3d + https://github.com/ipython/ipython/) + +message ("Installing ${ipython_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${ipython_NAME} + DEPENDS ${python_NAME} ${sphinxcontrib-napoleon_NAME} ${pyzmq_NAME} ${nose_NAME} ${pygments_NAME} ${tornado_NAME} ${jinja_NAME} ${python-markdown_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${ipython_URL} + GIT_TAG ${ipython_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${ipython_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT ipython_NAME) diff --git a/jinja.cmake b/jinja.cmake index 3d9e0e4..7332838 100644 --- a/jinja.cmake +++ b/jinja.cmake @@ -1,5 +1,6 @@ # -# Install jinja library from source +# Install jinja library from source. +# Required by iPython. # if (NOT jinja_NAME) diff --git a/joblib.cmake b/joblib.cmake new file mode 100644 index 0000000..18b4d19 --- /dev/null +++ b/joblib.cmake @@ -0,0 +1,37 @@ +# Adds joblib support. Allows for advanced memoizing with disk and +# advanced multi-threading techniques. + +if (NOT joblib_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_git_repo(joblib + 0.7.1 # 40fc9389c4e18510ba2a19c8bd8502fdbdd7e165 + https://github.com/joblib/joblib) + + +# Download and install joblib +message ("Installing ${joblib_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${joblib_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${joblib_URL} + GIT_TAG ${joblib_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${joblib_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT joblib_NAME) \ No newline at end of file diff --git a/jsonschema.cmake b/jsonschema.cmake new file mode 100644 index 0000000..d2339b8 --- /dev/null +++ b/jsonschema.cmake @@ -0,0 +1,41 @@ +# +# Install jsonschema library from source +# + +if (NOT jsonschema_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (setuptools) + +external_source (jsonschema + 2.3.0 + jsonschema-2.3.0.tar.gz + 410075e1969a9ec1838b5a6e1313c32b + https://pypi.python.org/packages/source/j/jsonschema) + +message ("Installing ${jsonschema_NAME} into ilastik build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${jsonschema_NAME} + DEPENDS ${python_NAME} ${setuptools_NAME} + PREFIX ${BUILDEM_DIR} + URL ${jsonschema_URL} + URL_MD5 ${jsonschema_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND "" +) + +set_target_properties(${jsonschema_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + + +endif (NOT jsonschema_NAME) + diff --git a/julia.cmake b/julia.cmake new file mode 100644 index 0000000..b2ed67c --- /dev/null +++ b/julia.cmake @@ -0,0 +1,34 @@ +# Builds julia. + +if (NOT julia_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +# Need to use v0.3.0-rc1 as there is a build error in the lower versions where julia is not properly installed in ${BUILDEM_DIR}/bin. Attempts to install it there or links to the actual executable resulted in mismatches between runtime and linking libraries. Using this version resolves these problems. +external_git_repo(julia + v0.3.0-rc1 # 3737cc28bc3116b21fb2502cdccbbeef5fbcd1b3 + https://github.com/JuliaLang/julia) + +message ("Installing ${julia_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${julia_NAME} + DEPENDS "" + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${julia_URL} + GIT_TAG ${julia_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + # Julia builds its own dependencies. Trying to get it to share was not straightforward. It builds its own OpenBLAS. So, can suffer from the same problems that OpenBLAS does. Add OPENBLAS_TARGET_ARCH=xxx (where xxx is an architecture) to the BUILD_COMMAND to optimize and/or avoid particular build errors. See README_openblas.txt for details. + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + BUILD_IN_SOURCE 1 + TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) testall + INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install prefix=${BUILDEM_DIR} +) + +set_target_properties(${julia_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT julia_NAME) \ No newline at end of file diff --git a/lemon.cmake b/lemon.cmake index 7a4eead..5575801 100644 --- a/lemon.cmake +++ b/lemon.cmake @@ -16,6 +16,13 @@ external_source (lemon lemon-1.2.4.tar.gz fd89e8bf5035b02e2622a48ac7fe0641 http://lemon.cs.elte.hu/pub/sources) + +if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) + set(LEMON_OSX_CONFIG -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 + -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk) +else() + set(LEMON_OSX_CONFIG "") +endif() message ("Installing ${lemon_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${lemon_NAME} @@ -25,8 +32,9 @@ ExternalProject_Add(${lemon_NAME} UPDATE_COMMAND "" PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} # This patch fixes a build error that clang detects. - # (Already fixed in lemon trunk, but not in the tarball release.) + # Already fixed in lemon trunk, patch here in Ticket #480 ( https://lemon.cs.elte.hu/trac/lemon/attachment/ticket/480/51deaff8728a.patch ), but not in the tarball release. ${lemon_SRC_DIR}/lemon/graph_to_eps.h ${PATCH_DIR}/lemon.patch + ${lemon_SRC_DIR}/tools/lgf-gen.cc ${PATCH_DIR}/lemon-lgf-gen.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 @@ -42,6 +50,8 @@ ExternalProject_Add(${lemon_NAME} -DGLPK_LIBRARY= -DGLPK_INCLUDE_DIR= -DGLPK_ROOT_DIR= + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} + ${LEMON_OSX_CONFIG} BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install diff --git a/libfftw.cmake b/libfftw.cmake index d903cb9..78c6755 100644 --- a/libfftw.cmake +++ b/libfftw.cmake @@ -27,7 +27,7 @@ ExternalProject_Add(${libfftw_NAME} --prefix=${BUILDEM_DIR} --enable-shared LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install ) @@ -42,8 +42,8 @@ ExternalProject_Add_Step(${libfftw_NAME} singlefloat-configure --prefix=${BUILDEM_DIR} --enable-shared --enable-float # This creates libfftw3f single-precision libraries INSTEAD OF the default double libraries. - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" ) # build single-precision diff --git a/libjpeg.cmake b/libjpeg.cmake index f2af00a..e71bc55 100644 --- a/libjpeg.cmake +++ b/libjpeg.cmake @@ -25,8 +25,8 @@ ExternalProject_Add(${libjpeg_NAME} CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ./configure --prefix=${BUILDEM_DIR} --enable-shared - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) LIBTOOL=./libtool # Must use the libtool that is built in place by the libjpeg Makfile (not the system libtool!) BUILD_IN_SOURCE 1 TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check diff --git a/libpng.cmake b/libpng.cmake index e253c09..464b74c 100644 --- a/libpng.cmake +++ b/libpng.cmake @@ -36,6 +36,7 @@ ExternalProject_Add(${libpng_NAME} CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${libpng_SRC_DIR} -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install ) diff --git a/libtiff.cmake b/libtiff.cmake index 3575da9..cc59ed0 100644 --- a/libtiff.cmake +++ b/libtiff.cmake @@ -36,9 +36,10 @@ ExternalProject_Add(${libtiff_NAME} PATCH_COMMAND ${libtiff_PATCH_COMMAND} CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ./configure --prefix=${BUILDEM_DIR} - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "LDFLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} ${BUILDEM_LDFLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" --disable-jbig + --disable-cxx BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) BUILD_IN_SOURCE 1 INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install diff --git a/libxml2.cmake b/libxml2.cmake index 1fe8022..d6fac2e 100644 --- a/libxml2.cmake +++ b/libxml2.cmake @@ -16,7 +16,6 @@ if (NOT libxml2_NAME) libxml2-2.9.1.tar.gz 9c0cfef285d5c4a5c80d00904ddab380 ftp://xmlsoft.org/libxml2 - FORCE ) diff --git a/matplotlib.cmake b/matplotlib.cmake index 8836207..b016f90 100644 --- a/matplotlib.cmake +++ b/matplotlib.cmake @@ -1,5 +1,9 @@ # -# Install matplotlib library from source +# Install matplotlib library from source. +# Includes dependencies to try to avoid use of easy_install, which matplotlib will try. +# +# However, we will let matplotlib install its own copy of PyCXX and LibAgg, which it comes prepackaged with. +# This will help avoid incompatibilities. Also, some version PyCXX are not compatible with some versions of Python. # if (NOT matplotlib_NAME) @@ -12,22 +16,27 @@ include (BuildSupport) include (TemplateSupport) include (python) +include (pyqt4) +include (six) +include (setuptools) +include (pytz) +include (python-dateutil) +include (pyparsing) include (numpy) include (libpng) include (freetype2) +include (tornado) -external_source (matplotlib - 1.1.1 - matplotlib-1.1.1.tar.gz - 8cbeaae8ba9da703d926e74c3e7c8a57 - http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.1.1) +external_git_repo(matplotlib + 1.4.2 # 3a828ddb7df3bc597254f875cbbac6aadf48aee0 + https://github.com/matplotlib/matplotlib) message ("Installing ${matplotlib_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${matplotlib_NAME} - DEPENDS ${python_NAME} ${numpy_NAME} ${libpng_NAME} ${freetype2_NAME} + DEPENDS ${python_NAME} ${pyqt4} ${six_NAME} ${setuptools_NAME} ${pytz_NAME} ${python-dateutil_NAME} ${pyparsing_NAME} ${numpy_NAME} ${libpng_NAME} ${freetype2_NAME} ${tornado_NAME} PREFIX ${BUILDEM_DIR} - URL ${matplotlib_URL} - URL_MD5 ${matplotlib_MD5} + GIT_REPOSITORY ${matplotlib_URL} + GIT_TAG ${matplotlib_TAG} UPDATE_COMMAND "" PATCH_COMMAND ${TEMPLATE_EXE} ${TEMPLATE_DIR}/matplotlib-setup-cfg.template diff --git a/mpc.cmake b/mpc.cmake new file mode 100644 index 0000000..8deb742 --- /dev/null +++ b/mpc.cmake @@ -0,0 +1,45 @@ +# A useful addition to gmp and mpfr, which were already included. +# +# Required by gmpy. + +if (NOT mpc_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (PatchSupport) + +include (gmp) +include (mpfr) + +external_source (mpc + 1.0.2 + mpc-1.0.2.tar.gz + 68fadff3358fb3e7976c7a398a0af4c3 + ftp://ftp.gnu.org/gnu/mpc/) + +message ("Installing ${mpc_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${mpc_NAME} + DEPENDS ${gmp_NAME} ${mpfr_NAME} + PREFIX ${BUILDEM_DIR} + URL ${mpc_URL} + URL_MD5 ${mpc_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${mpc_SRC_DIR}/configure + --prefix=${BUILDEM_DIR} + --with-gmp=${BUILDEM_DIR} # Standard. See http://code.google.com/p/gmpy/wiki/InstallingGmpy2 + --with-mpfr=${BUILDEM_DIR} # Standard. See http://code.google.com/p/gmpy/wiki/InstallingGmpy2 + LDFLAGS=${BUILDEM_LDFLAGS} + CPPFLAGS=-I${BUILDEM_DIR}/include + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + BUILD_IN_SOURCE 1 + TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check + INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install +) + +set_target_properties(${mpc_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT mpc_NAME) \ No newline at end of file diff --git a/mpfr.cmake b/mpfr.cmake index cdef3a0..50008dc 100644 --- a/mpfr.cmake +++ b/mpfr.cmake @@ -1,5 +1,6 @@ # -# Install mpfr from source +# Install mpfr from source. +# Provides additional multiple precision support. # if (NOT mpfr_NAME) @@ -17,7 +18,7 @@ external_source (mpfr 3.1.1 mpfr-3.1.1.tar.gz 769411e241a3f063ae1319eb5fac2462 - http://www.mpfr.org/mpfr-current/) + ftp://ftp.gnu.org/gnu/mpfr/) message ("Installing ${mpfr_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${mpfr_NAME} @@ -29,6 +30,7 @@ ExternalProject_Add(${mpfr_NAME} PATCH_COMMAND ${BUILDEM_ENV_STRING} patch -N -Z -p1 < ${PATCH_DIR}/mpfr-3.1.1.patch CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${mpfr_SRC_DIR}/configure --prefix=${BUILDEM_DIR} + --with-gmp=${BUILDEM_DIR} # Standard. See http://code.google.com/p/gmpy/wiki/InstallingGmpy2 LDFLAGS=${BUILDEM_LDFLAGS} CPPFLAGS=-I${BUILDEM_DIR}/include BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) diff --git a/nanshe.cmake b/nanshe.cmake new file mode 100644 index 0000000..08a04b5 --- /dev/null +++ b/nanshe.cmake @@ -0,0 +1,43 @@ +# Activity based segmentation of Calcium image data based on ( dx.doi.org/10.1109/ISBI.2013.6556660 ). + +if (NOT nanshe_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + + +include (pip) +include (scipy-stack) +include (ilastik) +include (spams-python) +include (rank_filter) +include (cloud_sptheme) + + +external_git_repo(nanshe + HEAD + https://github.com/jakirkham/nanshe) + + +# Download and install nanshe +message ("Installing ${nanshe_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${nanshe_NAME} + DEPENDS ${pip_NAME} ${scipy-stack_NAME} ${ilastik_NAME} ${spams-python_NAME} ${rank_filter_NAME} ${cloud_sptheme_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${nanshe_URL} + GIT_TAG ${nanshe_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + BUILD_IN_SOURCE 1 + INSTALL_COMMAND "" +) + +set_target_properties(${nanshe_NAME} PROPERTIES EXCLUDE_FROM_ALL OFF) + +endif (NOT nanshe_NAME) diff --git a/nose.cmake b/nose.cmake index 48a4bcb..28861ee 100644 --- a/nose.cmake +++ b/nose.cmake @@ -1,5 +1,6 @@ # -# Install nose library from source +# Install nose library from source. +# Dependency for iPython amongst other things. # if (NOT nose_NAME) @@ -17,7 +18,7 @@ external_source (nose 1.2.1 nose-1.2.1.tar.gz 735e3f1ce8b07e70ee1b742a8a53585a - http://pypi.python.org/packages/source/n/nose/nose-1.2.1.tar.gz) + http://pypi.python.org/packages/source/n/nose) message ("Installing ${nose_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") diff --git a/numexpr.cmake b/numexpr.cmake new file mode 100644 index 0000000..e7a7de4 --- /dev/null +++ b/numexpr.cmake @@ -0,0 +1,41 @@ +# An acceleration library for use with NumPy. +# +# Used by pandas. However, it is useful by itself. + + +if (NOT numexpr_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (TemplateSupport) + +include (python) +include (numpy) +include (scipy) +include (nose) + +external_git_repo(numexpr + v2.3.1 #aba0e0a1ff1edc4cc8c82024dee1693c06aa1336 + https://github.com/pydata/numexpr) + +message ("Installing ${numexpr_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${numexpr_NAME} + DEPENDS ${python_NAME} ${numpy_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${numexpr_URL} + GIT_TAG ${numexpr_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + TEST_COMMAND "" # Would like to run this test however. Import doesn't necessarily work during build. ${BUILDEM_ENV_STRING} ${PYTHON_EXE} -c "import numexpr; numexpr.test()" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${numexpr_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT numexpr_NAME) diff --git a/openblas.cmake b/openblas.cmake index 7a963ed..e680772 100644 --- a/openblas.cmake +++ b/openblas.cmake @@ -10,7 +10,7 @@ include (ExternalProject) include (ExternalSource) external_git_repo (openblas - v0.2.8 + 4d42368214f2fd102b2d163c086e0f2d8c166dc6 https://github.com/xianyi/OpenBLAS) message ("Installing ${openblas_NAME} into ilastik build area: ${BUILDEM_DIR} ...") @@ -22,13 +22,28 @@ ExternalProject_Add(${openblas_NAME} UPDATE_COMMAND "" PATCH_COMMAND "" CONFIGURE_COMMAND "" - BUILD_COMMAND $(MAKE) NO_AVX=1 NO_AFFINITY=1 -j8 + # Add TARGET=xxx (where xxx is an architecture) to the BUILD_COMMAND to optimize and/or avoid particular build errors. See README_openblas.txt for details. + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) NO_AVX=1 NO_AFFINITY=1 -j8 BUILD_IN_SOURCE 1 - INSTALL_COMMAND $(MAKE) PREFIX=${BUILDEM_DIR} install && - ln -fs libopenblas.so ${BUILDEM_DIR}/lib/libblas.so && - ln -fs libopenblas.so ${BUILDEM_DIR}/lib/liblapack.so + # Add TARGET=xxx (where xxx is an architecture) to the BUILD_COMMAND to optimize and/or avoid particular build errors. See README_openblas.txt for details. + INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) PREFIX=${BUILDEM_DIR} install ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + ExternalProject_Add_Step(${openblas_NAME} "install_links" # Names of project and custom step + COMMAND ln -fs libopenblas.dylib ${BUILDEM_DIR}/lib/libblas.dylib && + ln -fs libopenblas.dylib ${BUILDEM_DIR}/lib/liblapack.dylib + DEPENDEES install + ) +else() + ExternalProject_Add_Step(${openblas_NAME} "install_links" # Names of project and custom step + COMMAND ln -fs libopenblas.so ${BUILDEM_DIR}/lib/libblas.so && + ln -fs libopenblas.so ${BUILDEM_DIR}/lib/liblapack.so + DEPENDEES install + ) +endif() + + set_target_properties(${openblas_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) endif (NOT openblas_NAME) diff --git a/opencv.cmake b/opencv.cmake index 10e64b8..68e5933 100644 --- a/opencv.cmake +++ b/opencv.cmake @@ -12,33 +12,36 @@ include (BuildSupport) include (PatchSupport) include (zlib) -include (openexr) include (libtiff) include (libjpeg) include (libpng) +include (openexr) +include (ffmpeg) +include (qt4) +include (python) +include (numpy) +include (sphinx) -external_source (opencv - 2.4.5 - opencv-2.4.5.tar.gz - 8eac87462c7bec8b89021b723207c623 - http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.5/ - ) +external_git_repo (opencv + 2.4.8.3 # b2790973a32eb662c165a921afe03dbfd2c65269 + https://github.com/Itseez/opencv/) set (opencv_LIBS ${BUILDEM_LIB_DIR}/libopencv_ml.so ${BUILDEM_LIB_DIR}/libopencv_core.so) message ("Installing ${opencv_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${opencv_NAME} - DEPENDS ${zlib_NAME} ${libjpeg_NAME} ${libpng_NAME} ${libtiff_NAME} ${openexr_NAME} + DEPENDS ${zlib_NAME} ${libjpeg_NAME} ${libpng_NAME} ${libtiff_NAME} ${openexr_NAME} ${ffmpeg_NAME} ${qt4_NAME} ${python_NAME} ${numpy_NAME} ${sphinx_NAME} PREFIX ${BUILDEM_DIR} - URL ${opencv_URL} - URL_MD5 ${opencv_MD5} + GIT_REPOSITORY ${opencv_URL} + GIT_TAG ${opencv_TAG} UPDATE_COMMAND "" PATCH_COMMAND "" - CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${opencv_SRC_DIR} + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${opencv_SRC_DIR} -DPYTHON_EXECUTABLE=${PYTHON_EXE} -DPYTHON_LIBRARY=${PYTHON_LIBRARY_FILE} -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_PATH} -DPYTHON_PACKAGES_PATH=${PYTHON_PREFIX}/lib/python2.7/site-packages -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} - BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) -# TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check + "-DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} -liconv -L${BUILDEM_LIB_DIR} -lswresample" + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) +# TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install ) diff --git a/openexr.cmake b/openexr.cmake index ec6bf17..3c83bad 100644 --- a/openexr.cmake +++ b/openexr.cmake @@ -50,12 +50,19 @@ ExternalProject_Add(${openexr_NAME} --prefix=${BUILDEM_DIR} --disable-ilmbasetest PKG_CONFIG_PATH=${BUILDEM_PKGCONFIG_DIR} - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install ) +if (${BUILDEM_ADDITIONAL_CXX_FLAGS} MATCHES "libstdc") + ExternalProject_Add_Step(${openexr_NAME} ${openexr_NAME}-configure-stdlib + COMMAND bash ${PATCH_DIR}/openexr-fix-makefiles-stdlib.sh ${openexr_SRC_DIR}/../openexr-1.6.1-build + DEPENDEES configure + ) +endif() + set_target_properties(${openexr_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) -endif (NOT openexr_NAME) \ No newline at end of file +endif (NOT openexr_NAME) diff --git a/opengm.cmake b/opengm.cmake index d230daf..fe10245 100644 --- a/opengm.cmake +++ b/opengm.cmake @@ -11,28 +11,45 @@ include (ExternalSource) include (BuildSupport) include (PatchSupport) +include (boost) +include (hdf5) +include (python) + external_git_repo (opengm 576dc472324a5dce40b7e9bb4c270afbd9b3da37 https://github.com/opengm/opengm) if(CPLEX_ROOT_DIR) set(CMAKE_CPLEX_ROOT_DIR "-DCPLEX_ROOT_DIR=${CPLEX_ROOT_DIR}") + set(WITH_CPLEX ON) +else() + set(WITH_CPLEX OFF) endif() message ("Installing ${opengm_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${opengm_NAME} - DEPENDS ${boost_NAME} + DEPENDS ${boost_NAME} ${hdf5_NAME} ${python_NAME} PREFIX ${BUILDEM_DIR} GIT_REPOSITORY ${opengm_URL} GIT_TAG ${opengm_TAG} UPDATE_COMMAND "" - PATCH_COMMAND "" + PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} + # This patch disables linking against the rt-lib on Mac for the combilp test + ${opengm_SRC_DIR}/src/unittest/inference/CMakeLists.txt ${PATCH_DIR}/opengm-toggle-rt.patch + # This patch adds the BUILD_PYTHON_DOCS setting, used to avoid building the sphinx documentation. + # Future versions of OpenGM will probably not need this patch. + ${opengm_SRC_DIR}/src/interfaces/python/CMakeLists.txt ${PATCH_DIR}/opengm.patch CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${opengm_SRC_DIR} -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} - -DWITH_CPLEX=ON + -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} + -DWITH_CPLEX=${WITH_CPLEX} -DWITH_BOOST=ON + -DWITH_HDF5=ON + -DBUILD_PYTHON_WRAPPER=ON + -DBUILD_PYTHON_DOCS=OFF + -DWITH_OPENMP=OFF # Mac doesn't support OpenMP ${CMAKE_CPLEX_ROOT_DIR} BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) diff --git a/openssl.cmake b/openssl.cmake index 5637396..fc7b323 100644 --- a/openssl.cmake +++ b/openssl.cmake @@ -13,9 +13,9 @@ include (BuildSupport) include (zlib) external_source (openssl - 1.0.1c - openssl-1.0.1c.tar.gz - ae412727c8c15b67880aef7bd2999b2e + 1.0.1i + openssl-1.0.1i.tar.gz + c8dc151a671b9b92ff3e4c118b174972 http://www.openssl.org/source) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") diff --git a/pandas.cmake b/pandas.cmake new file mode 100644 index 0000000..250edb2 --- /dev/null +++ b/pandas.cmake @@ -0,0 +1,50 @@ +# Data analysis (primarily linear) for Python. Part of the SciPy Stack. +# +# Includes essential dependencies and optional ones that were already included. +# Optional ones have not been included (i.e. Any data reading stuff Excel, Amazon, PyTables) or fancy HTML parsers (i.e. BeautifulSoupX). +# Required by statsmodels. + + +if (NOT pandas_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (TemplateSupport) + +include (python) +include (cython) +include (python-dateutil) +include (pytz) +include (numpy) +include (scipy) +include (matplotlib) +include (numexpr) +include (bottleneck) + + +external_git_repo(pandas + v0.12.0 #8c0a34f15f8a87def3f7ad6ebdac052de44669f2 + https://github.com/pydata/pandas) + + +message ("Installing ${pandas_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${pandas_NAME} + DEPENDS ${python_NAME} ${cython_NAME} ${python-dateutil_NAME} ${pytz_NAME} ${numpy_NAME} ${scipy_NAME} ${matplotlib_NAME} ${numexpr_NAME} ${bottleneck_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${pandas_URL} + GIT_TAG ${pandas_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pandas_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pandas_NAME) diff --git a/patches/geos-CoordinateArraySequenceFactoryTest.cpp.patch b/patches/geos-CoordinateArraySequenceFactoryTest.cpp.patch new file mode 100644 index 0000000..6c539a9 --- /dev/null +++ b/patches/geos-CoordinateArraySequenceFactoryTest.cpp.patch @@ -0,0 +1,15 @@ +diff --git a/CoordinateArraySequenceFactoryTest.cpp b/CoordinateArraySequenceFactoryTest.cpp +index 1bf6b66..8fa603e 100644 +--- a/CoordinateArraySequenceFactoryTest.cpp ++++ b/CoordinateArraySequenceFactoryTest.cpp +@@ -51,8 +51,8 @@ namespace tut + + CoordinateArrayFactoryCPtr derived; + derived = dynamic_cast(base); +- ensure( 0 != derived ); +- ensure(typeid(derived).name(), typeid(derived) == typeid(CoordinateArrayFactoryCPtr) ); ++ //ensure( 0 != derived ); ++ //ensure(typeid(derived).name(), typeid(derived) == typeid(CoordinateArrayFactoryCPtr) ); + } + catch (std::exception& e) + { diff --git a/patches/ilmbase-fix-makefiles-stdlib.sh b/patches/ilmbase-fix-makefiles-stdlib.sh new file mode 100644 index 0000000..5502aaa --- /dev/null +++ b/patches/ilmbase-fix-makefiles-stdlib.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +sed -i .bkup '283s/-rpath/-Wc,-stdlib=libstdc\+\+ -rpath/g' $1/Half/Makefile +sed -i .bkup '270s/-rpath/-Wc,-stdlib=libstdc\+\+ -rpath/g' $1/Iex/Makefile +sed -i .bkup '290s/-rpath/-Wc,-stdlib=libstdc\+\+ -rpath/g' $1/Imath/Makefile +sed -i .bkup '282s/-rpath/-Wc,-stdlib=libstdc\+\+ -rpath/g' $1/IlmThread/Makefile +rm $1/Half/Makefile.bkup +rm $1/Iex/Makefile.bkup +rm $1/Imath/Makefile.bkup +rm $1/IlmThread/Makefile.bkup \ No newline at end of file diff --git a/patches/lemon-lgf-gen.patch b/patches/lemon-lgf-gen.patch new file mode 100644 index 0000000..457e6a0 --- /dev/null +++ b/patches/lemon-lgf-gen.patch @@ -0,0 +1,108 @@ +# HG changeset patch +# User Alpar Juttner +# Date 1396968869 -7200 +# Tue Apr 08 16:54:29 2014 +0200 +# Node ID 51deaff8728aacb20463ace3626807877d608611 +# Parent e00d7b681d8e8fa6cc94353e9b30388b27138043 +Clang compatibility fix in lgf-gen.cc (#480) + +diff --git a/tools/lgf-gen.cc b/tools/lgf-gen.cc +--- a/tools/lgf-gen.cc ++++ b/tools/lgf-gen.cc +@@ -246,7 +246,7 @@ + + struct BeachIt; + +- typedef std::multimap SpikeHeap; ++ typedef std::multimap SpikeHeap; + + typedef std::multimap Beach; + +@@ -329,6 +329,7 @@ + Beach::iterator bit = beach.upper_bound(Part(site, site, site)); + + if (bit->second != spikeheap.end()) { ++ delete bit->second->second; + spikeheap.erase(bit->second); + } + +@@ -342,8 +343,8 @@ + if (prev != -1 && + circle_form(points[prev], points[curr], points[site])) { + double x = circle_point(points[prev], points[curr], points[site]); +- pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end()))); +- pit->second.it = ++ pit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end()))); ++ pit->second->it = + beach.insert(std::make_pair(Part(prev, curr, site), pit)); + } else { + beach.insert(std::make_pair(Part(prev, curr, site), pit)); +@@ -355,8 +356,8 @@ + if (next != -1 && + circle_form(points[site], points[curr],points[next])) { + double x = circle_point(points[site], points[curr], points[next]); +- nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end()))); +- nit->second.it = ++ nit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end()))); ++ nit->second->it = + beach.insert(std::make_pair(Part(site, curr, next), nit)); + } else { + beach.insert(std::make_pair(Part(site, curr, next), nit)); +@@ -366,7 +367,7 @@ + } else { + sweep = spit->first; + +- Beach::iterator bit = spit->second.it; ++ Beach::iterator bit = spit->second->it; + + int prev = bit->first.prev; + int curr = bit->first.curr; +@@ -399,10 +400,22 @@ + Beach::iterator nbit = bit; ++nbit; + int nnt = nbit->first.next; + +- if (bit->second != spikeheap.end()) spikeheap.erase(bit->second); +- if (pbit->second != spikeheap.end()) spikeheap.erase(pbit->second); +- if (nbit->second != spikeheap.end()) spikeheap.erase(nbit->second); +- ++ if (bit->second != spikeheap.end()) ++ { ++ delete bit->second->second; ++ spikeheap.erase(bit->second); ++ } ++ if (pbit->second != spikeheap.end()) ++ { ++ delete pbit->second->second; ++ spikeheap.erase(pbit->second); ++ } ++ if (nbit->second != spikeheap.end()) ++ { ++ delete nbit->second->second; ++ spikeheap.erase(nbit->second); ++ } ++ + beach.erase(nbit); + beach.erase(bit); + beach.erase(pbit); +@@ -412,8 +425,8 @@ + circle_form(points[ppv], points[prev], points[next])) { + double x = circle_point(points[ppv], points[prev], points[next]); + if (x < sweep) x = sweep; +- pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end()))); +- pit->second.it = ++ pit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end()))); ++ pit->second->it = + beach.insert(std::make_pair(Part(ppv, prev, next), pit)); + } else { + beach.insert(std::make_pair(Part(ppv, prev, next), pit)); +@@ -424,8 +437,8 @@ + circle_form(points[prev], points[next], points[nnt])) { + double x = circle_point(points[prev], points[next], points[nnt]); + if (x < sweep) x = sweep; +- nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end()))); +- nit->second.it = ++ nit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end()))); ++ nit->second->it = + beach.insert(std::make_pair(Part(prev, next, nnt), nit)); + } else { + beach.insert(std::make_pair(Part(prev, next, nnt), nit)); diff --git a/patches/openexr-fix-makefiles-stdlib.sh b/patches/openexr-fix-makefiles-stdlib.sh new file mode 100644 index 0000000..ddbbc8d --- /dev/null +++ b/patches/openexr-fix-makefiles-stdlib.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sed -i .bkup '402s/-rpath/-Wc,-stdlib=libstdc\+\+ -rpath/g' $1/IlmImf/Makefile +rm $1/IlmImf/Makefile.bkup diff --git a/patches/opengm-toggle-rt.patch b/patches/opengm-toggle-rt.patch new file mode 100644 index 0000000..4566805 --- /dev/null +++ b/patches/opengm-toggle-rt.patch @@ -0,0 +1,18 @@ +diff --git a/src/unittest/inference/CMakeLists.txt b/src/unittest/inference/CMakeLists.txt +index d2d3970..73cc575 100644 +--- a/src/unittest/inference/CMakeLists.txt ++++ b/src/unittest/inference/CMakeLists.txt +@@ -127,7 +127,12 @@ if(WITH_CPLEX) + else() + target_link_libraries(test-lpcplex ${CMAKE_THREAD_LIBS_INIT} ${CPLEX_LIBRARIES} ) + #target_link_libraries(test-lpcplex2 ${CMAKE_THREAD_LIBS_INIT} ${CPLEX_LIBRARIES} +- target_link_libraries(test-combilp ${CMAKE_THREAD_LIBS_INIT} ${CPLEX_LIBRARIES} ${HDF5_LIBRARIES} rt) ++ ++ if(LINK_RT) ++ target_link_libraries(test-combilp ${CMAKE_THREAD_LIBS_INIT} ${CPLEX_LIBRARIES} ${HDF5_LIBRARIES} rt) ++ else() ++ target_link_libraries(test-combilp ${CMAKE_THREAD_LIBS_INIT} ${CPLEX_LIBRARIES} ${HDF5_LIBRARIES}) ++ endif() + endif() + add_test(test-lpcplex ${CMAKE_CURRENT_BINARY_DIR}/test-lpcplex) + #add_test(test-lpcplex2 ${CMAKE_CURRENT_BINARY_DIR}/test-lpcplex2) diff --git a/patches/opengm.patch b/patches/opengm.patch new file mode 100644 index 0000000..77ce090 --- /dev/null +++ b/patches/opengm.patch @@ -0,0 +1,89 @@ +--- src/interfaces/python/CMakeLists.txt 2014-05-28 16:03:43.000000000 -0400 ++++ src/interfaces/python/CMakeLists.txt2 2014-05-28 16:03:38.000000000 -0400 +@@ -16,47 +16,50 @@ + + message(STATUS ${OPENGM_PYTHON_BUILD_MODULE_DIR}) + +-find_package(SPHINX) +-if(SPHINX_FOUND) +- message(STATUS "FOUND_SPHINX") ++set( BUILD_PYTHON_DOCS 0 CACHE BOOL "Build the Python documentation with Sphinx" ) + +- if(NOT DEFINED SPHINX_THEME) +- set(SPHINX_THEME default) ++if(BUILD_PYTHON_DOCS) ++ find_package(SPHINX) ++ if(SPHINX_FOUND) ++ message(STATUS "FOUND_SPHINX") ++ ++ if(NOT DEFINED SPHINX_THEME) ++ set(SPHINX_THEME default) ++ endif() ++ if(NOT DEFINED SPHINX_THEME_DIR) ++ set(SPHINX_THEME_DIR) ++ endif() ++ # configured documentation tools and intermediate build results ++ set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") ++ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build) ++ # Sphinx cache with pickled ReST documents ++ set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/opengm/_doctrees") ++ # HTML output directory ++ set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/opengm/html") ++ configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source/conf.py.in" ++ #"${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source/conf.py" ++ "${BINARY_BUILD_DIR}/conf.py" ++ @ONLY) ++ add_custom_target(python-doc ALL ++ ${SPHINX_EXECUTABLE} ++ -q -b html ++ #-c "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source" ++ -c "${BINARY_BUILD_DIR}" ++ -d "${SPHINX_CACHE_DIR}" ++ "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source" ++ "${SPHINX_HTML_DIR}" ++ COMMENT "Building HTML documentation with Sphinx") ++ add_dependencies(python-doc _opengmcore ) ++ add_dependencies(python-doc _inference ) ++ add_dependencies(python-doc _hdf5 ) ++ ++ else() ++ message(STATUS "CANNOT Building HTML documentation with Sphinx , did not find Sphinx") + endif() +- if(NOT DEFINED SPHINX_THEME_DIR) +- set(SPHINX_THEME_DIR) +- endif() +- # configured documentation tools and intermediate build results +- set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") +- file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build) +- # Sphinx cache with pickled ReST documents +- set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/opengm/_doctrees") +- # HTML output directory +- set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/opengm/html") +- configure_file( +- "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source/conf.py.in" +- #"${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source/conf.py" +- "${BINARY_BUILD_DIR}/conf.py" +- @ONLY) +- add_custom_target(python-doc ALL +- ${SPHINX_EXECUTABLE} +- -q -b html +- #-c "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source" +- -c "${BINARY_BUILD_DIR}" +- -d "${SPHINX_CACHE_DIR}" +- "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source" +- "${SPHINX_HTML_DIR}" +- COMMENT "Building HTML documentation with Sphinx") +- add_dependencies(python-doc _opengmcore ) +- add_dependencies(python-doc _inference ) +- add_dependencies(python-doc _hdf5 ) +- +-else() +- message(STATUS "CANNOT Building HTML documentation with Sphinx , did not find Sphinx") + endif() + + + + + +- diff --git a/patches/pgmlink-cmake.patch b/patches/pgmlink-cmake.patch new file mode 100644 index 0000000..93df56e --- /dev/null +++ b/patches/pgmlink-cmake.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f548f8f..aa4c603 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -110,7 +110,7 @@ if(NOT CMAKE_BUILD_TYPE) + endif(NOT CMAKE_BUILD_TYPE) + + if(NOT MSVC) +- set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wfatal-errors -std=c++98 -pedantic -pthread") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wfatal-errors -std=c++98 -pedantic -pthread") + set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # Clang is too strict to use -Werror (boost::serialization has warnings...) diff --git a/patches/pyqt4.patch b/patches/pyqt4.patch new file mode 100644 index 0000000..de78eb3 --- /dev/null +++ b/patches/pyqt4.patch @@ -0,0 +1,24 @@ +--- configure.py 2013-08-21 02:02:48.000000000 -0400 ++++ configure_2.py 2014-04-11 16:11:07.000000000 -0400 +@@ -371,8 +371,8 @@ + check_module("QtTest", "QtTest", "QTest::qSleep(0)") + check_module("QtWebKit", "qwebpage.h", "new QWebPage()") + check_module("QtXmlPatterns", "qxmlname.h", "new QXmlName()") +- check_module("phonon", "phonon/videowidget.h", +- "new Phonon::VideoWidget()") ++# check_module("phonon", "phonon/videowidget.h", ++# "new Phonon::VideoWidget()") + check_module("QtAssistant", "qassistantclient.h", + "new QAssistantClient(\"foo\")", extra_lib_dirs=ass_lib_dirs, + extra_libs=ass_libs) +@@ -518,8 +518,8 @@ + if "QtXmlPatterns" in pyqt_modules: + generate_code("QtXmlPatterns") + +- if "phonon" in pyqt_modules: +- generate_code("phonon") ++ #if "phonon" in pyqt_modules: ++ # generate_code("phonon") + + if "QtAssistant" in pyqt_modules: + generate_code("QtAssistant") diff --git a/patches/qt4-create-symlinks.sh b/patches/qt4-create-symlinks.sh new file mode 100644 index 0000000..5cfdab7 --- /dev/null +++ b/patches/qt4-create-symlinks.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +BUILDEM_DIR=$1 +FRAMEWORKS=$(ls ${BUILDEM_DIR}/lib | grep framework$) + +for i in ${FRAMEWORKS} +do + ln -s ${BUILDEM_DIR}/lib/$i/Headers ${BUILDEM_DIR}/include/`echo \$i | sed 's/.framework//g'` +done \ No newline at end of file diff --git a/patches/qt4-osx-draw-ellipse.patch b/patches/qt4-osx-draw-ellipse.patch new file mode 100644 index 0000000..f108994 --- /dev/null +++ b/patches/qt4-osx-draw-ellipse.patch @@ -0,0 +1,19 @@ +diff --git a/src/gui/painting/qpaintengine_mac.cpp b/src/gui/painting/qpaintengine_mac.cpp +index 47e51b4..92822a9 100644 +--- a/src/gui/painting/qpaintengine_mac.cpp ++++ b/src/gui/painting/qpaintengine_mac.cpp +@@ -914,8 +914,14 @@ QCoreGraphicsPaintEngine::drawEllipse(const QRectF &r) + if (state->compositionMode() == QPainter::CompositionMode_Destination) + return; + ++ // only call CGPathAddArc if the positions x and y are valid ++ CGRect rect = CGRectMake(r.x(), r.y(), r.width(), r.height()); ++ if (CGRectIsEmpty(rect) || CGRectIsInfinite(rect)) ++ return; ++ + CGMutablePathRef path = CGPathCreateMutable(); + CGAffineTransform transform = CGAffineTransformMakeScale(r.width() / r.height(), 1); ++ + CGPathAddArc(path, &transform,(r.x() + (r.width() / 2)) / (r.width() / r.height()), + r.y() + (r.height() / 2), r.height() / 2, 0, (2 * M_PI), false); + d->drawPath(QCoreGraphicsPaintEnginePrivate::CGFill | QCoreGraphicsPaintEnginePrivate::CGStroke, diff --git a/patches/qt4-osx-mavericks-configure.patch b/patches/qt4-osx-mavericks-configure.patch new file mode 100644 index 0000000..9cffd44 --- /dev/null +++ b/patches/qt4-osx-mavericks-configure.patch @@ -0,0 +1,21 @@ +--- ilastik_build_dir_2/src/qt4-git/configure 2014-04-11 17:46:22.000000000 -0400 ++++ ilastik_build_dir/src/qt4-git/configure 2014-04-11 17:31:32.000000000 -0400 +@@ -7993,10 +7993,14 @@ + QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=10.4" + fi + if echo "$CFG_MAC_ARCHS" | grep '\' > /dev/null 2>&1; then +- QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" +- QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" +- QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" +- QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5" ++# QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" ++# QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" ++# QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" ++# QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5" ++ QMakeVar add QMAKE_CFLAGS "-mmacosx-version-min=10.5" ++ QMakeVar add QMAKE_CXXFLAGS "-mmacosx-version-min=10.5" ++ QMakeVar add QMAKE_LFLAGS "-mmacosx-version-min=10.5" ++ QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -mmacosx-version-min=10.5" + fi + if echo "$CFG_MAC_ARCHS" | grep '\' > /dev/null 2>&1; then + QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5" diff --git a/patches/qt4-osx-mavericks-gui-pro.patch b/patches/qt4-osx-mavericks-gui-pro.patch new file mode 100644 index 0000000..109e88a --- /dev/null +++ b/patches/qt4-osx-mavericks-gui-pro.patch @@ -0,0 +1,77 @@ +--- ilastik_build_dir_2/src/qt4-git/src/gui/gui.pro 2014-04-11 17:46:26.000000000 -0400 ++++ ilastik_build_dir/src/qt4-git/src/gui/gui.pro 2014-04-11 17:31:23.000000000 -0400 +@@ -95,8 +95,9 @@ + mmx_compiler.commands = $$QMAKE_CXX -c -Winline + + mac { +- mmx_compiler.commands += -Xarch_i386 -mmmx +- mmx_compiler.commands += -Xarch_x86_64 -mmmx ++# mmx_compiler.commands += -Xarch_i386 -mmmx ++# mmx_compiler.commands += -Xarch_x86_64 -mmmx ++ mmx_compiler.commands += -mmmx + } else { + mmx_compiler.commands += -mmmx + } +@@ -114,8 +115,9 @@ + mmx3dnow_compiler.commands = $$QMAKE_CXX -c -Winline + + mac { +- mmx3dnow_compiler.commands += -Xarch_i386 -m3dnow -Xarch_i386 -mmmx +- mmx3dnow_compiler.commands += -Xarch_x86_64 -m3dnow -Xarch_x86_64 -mmmx ++# mmx3dnow_compiler.commands += -Xarch_i386 -m3dnow -Xarch_i386 -mmmx ++# mmx3dnow_compiler.commands += -Xarch_x86_64 -m3dnow -Xarch_x86_64 -mmmx ++ mmx3dnow_compiler.commands += -m3dnow -mmmx + } else { + mmx3dnow_compiler.commands += -m3dnow -mmmx + } +@@ -132,8 +134,9 @@ + sse3dnow_compiler.commands = $$QMAKE_CXX -c -Winline + + mac { +- sse3dnow_compiler.commands += -Xarch_i386 -m3dnow -Xarch_i386 -msse +- sse3dnow_compiler.commands += -Xarch_x86_64 -m3dnow -Xarch_x86_64 -msse ++# sse3dnow_compiler.commands += -Xarch_i386 -m3dnow -Xarch_i386 -msse ++# sse3dnow_compiler.commands += -Xarch_x86_64 -m3dnow -Xarch_x86_64 -msse ++ sse3dnow_compiler.commands += -m3dnow -msse + } else { + sse3dnow_compiler.commands += -m3dnow -msse + } +@@ -152,8 +155,10 @@ + sse_compiler.commands = $$QMAKE_CXX -c -Winline + + mac { +- sse_compiler.commands += -Xarch_i386 -msse +- sse_compiler.commands += -Xarch_x86_64 -msse ++# sse_compiler.commands += -Xarch_i386 -msse ++# sse_compiler.commands += -Xarch_x86_64 -msse ++ sse_compiler.commands += -msse ++ sse_compiler.commands += -msse + } else { + sse_compiler.commands += -msse + } +@@ -171,8 +176,10 @@ + sse2_compiler.commands = $$QMAKE_CXX -c -Winline + + mac { +- sse2_compiler.commands += -Xarch_i386 -msse2 +- sse2_compiler.commands += -Xarch_x86_64 -msse2 ++# sse2_compiler.commands += -Xarch_i386 -msse2 ++# sse2_compiler.commands += -Xarch_x86_64 -msse2 ++ sse2_compiler.commands += -msse2 ++ sse2_compiler.commands += -msse2 + } else { + sse2_compiler.commands += -msse2 + } +@@ -190,8 +197,10 @@ + ssse3_compiler.commands = $$QMAKE_CXX -c -Winline + + mac { +- ssse3_compiler.commands += -Xarch_i386 -mssse3 +- ssse3_compiler.commands += -Xarch_x86_64 -mssse3 ++# ssse3_compiler.commands += -Xarch_i386 -mssse3 ++# ssse3_compiler.commands += -Xarch_x86_64 -mssse3 ++ ssse3_compiler.commands += -mssse3 ++ ssse3_compiler.commands += -mssse3 + } else { + ssse3_compiler.commands += -mssse3 + } diff --git a/patches/readline-6.2-callback.patch b/patches/readline-6.2-callback.patch new file mode 100644 index 0000000..0ea4028 --- /dev/null +++ b/patches/readline-6.2-callback.patch @@ -0,0 +1,15 @@ +diff --git a/readline-6.2/callback.c b/readline-6.2/callback.c +index 4ee6361..7682cd0 100644 +--- a/readline-6.2/callback.c ++++ b/readline-6.2/callback.c +@@ -148,6 +148,9 @@ rl_callback_read_char () + eof = _rl_vi_domove_callback (_rl_vimvcxt); + /* Should handle everything, including cleanup, numeric arguments, + and turning off RL_STATE_VIMOTION */ ++ if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) ++ _rl_internal_char_cleanup (); ++ + return; + } + #endif + diff --git a/patches/readline-6.2-input.patch b/patches/readline-6.2-input.patch new file mode 100644 index 0000000..8fa168f --- /dev/null +++ b/patches/readline-6.2-input.patch @@ -0,0 +1,36 @@ +diff --git a/readline-6.2/input.c b/readline-6.2/input.c +index 7c74c99..b49af88 100644 +--- a/readline-6.2/input.c ++++ b/readline-6.2/input.c +@@ -409,7 +409,7 @@ rl_clear_pending_input () + int + rl_read_key () + { +- int c; ++ int c, r; + + rl_key_sequence_length++; + +@@ -429,14 +429,18 @@ rl_read_key () + { + while (rl_event_hook) + { +- if (rl_gather_tyi () < 0) /* XXX - EIO */ ++ if (rl_get_char (&c) != 0) ++ break; ++ ++ if ((r = rl_gather_tyi ()) < 0) /* XXX - EIO */ + { + rl_done = 1; + return ('\n'); + } ++ else if (r == 1) /* read something */ ++ continue; ++ + RL_CHECK_SIGNALS (); +- if (rl_get_char (&c) != 0) +- break; + if (rl_done) /* XXX - experimental */ + return ('\n'); + (*rl_event_hook) (); + diff --git a/patches/readline-6.2-patchlevel.patch b/patches/readline-6.2-patchlevel.patch new file mode 100644 index 0000000..23e43f1 --- /dev/null +++ b/patches/readline-6.2-patchlevel.patch @@ -0,0 +1,10 @@ +diff --git a/readline-6.2/patchlevel b/readline-6.2/patchlevel +index fdf4740..e0ba09d 100644 +--- a/readline-6.2/patchlevel ++++ b/readline-6.2/patchlevel +@@ -1,3 +1,3 @@ + # Do not edit -- exists only for use by patch + +-1 ++5 + diff --git a/patches/readline-6.2-shobj-conf.patch b/patches/readline-6.2-shobj-conf.patch new file mode 100644 index 0000000..9b63c93 --- /dev/null +++ b/patches/readline-6.2-shobj-conf.patch @@ -0,0 +1,32 @@ +diff --git a/readline-6.2/support/shobj-conf b/readline-6.2/support/shobj-conf +index 5a63e80..cb3095c 100644 +--- a/readline-6.2/support/shobj-conf ++++ b/readline-6.2/support/shobj-conf +@@ -157,13 +157,15 @@ freebsd[4-9]*|freebsdelf*|dragonfly*) + ;; + + # Darwin/MacOS X +-darwin[89]*|darwin10*) ++darwin[89]*|darwin1[0123]*) + SHOBJ_STATUS=supported + SHLIB_STATUS=supported + + SHOBJ_CFLAGS='-fno-common' + +- SHOBJ_LD='MACOSX_DEPLOYMENT_TARGET=10.3 ${CC}' ++# SHOBJ_LD='MACOSX_DEPLOYMENT_TARGET=10.3 ${CC}' ++ # we can finally kill Mac OS X 10.3 ++ SHOBJ_LD='${CC}' + + SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)' + SHLIB_LIBSUFF='dylib' +@@ -186,7 +188,7 @@ darwin*|macosx*) + SHLIB_LIBSUFF='dylib' + + case "${host_os}" in +- darwin[789]*|darwin10*) SHOBJ_LDFLAGS='' ++ darwin[789]*|darwin1[0123]*) SHOBJ_LDFLAGS='' + SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' + ;; + *) SHOBJ_LDFLAGS='-dynamic' + diff --git a/patches/readline-6.2-vi_mode.patch b/patches/readline-6.2-vi_mode.patch new file mode 100644 index 0000000..ebb349e --- /dev/null +++ b/patches/readline-6.2-vi_mode.patch @@ -0,0 +1,76 @@ +diff --git a/readline-6.2/vi_mode.c b/readline-6.2/vi_mode.c +index 41e1dbb..4408053 100644 +--- a/readline-6.2/vi_mode.c ++++ b/readline-6.2/vi_mode.c +@@ -1114,7 +1114,7 @@ rl_domove_read_callback (m) + rl_beg_of_line (1, c); + _rl_vi_last_motion = c; + RL_UNSETSTATE (RL_STATE_VIMOTION); +- return (0); ++ return (vidomove_dispatch (m)); + } + #if defined (READLINE_CALLBACKS) + /* XXX - these need to handle rl_universal_argument bindings */ +@@ -1234,11 +1234,19 @@ rl_vi_delete_to (count, key) + _rl_vimvcxt->motion = '$'; + r = rl_domove_motion_callback (_rl_vimvcxt); + } +- else if (vi_redoing) ++ else if (vi_redoing && _rl_vi_last_motion != 'd') /* `dd' is special */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } ++ else if (vi_redoing) /* handle redoing `dd' here */ ++ { ++ _rl_vimvcxt->motion = _rl_vi_last_motion; ++ rl_mark = rl_end; ++ rl_beg_of_line (1, key); ++ RL_UNSETSTATE (RL_STATE_VIMOTION); ++ r = vidomove_dispatch (_rl_vimvcxt); ++ } + #if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { +@@ -1316,11 +1324,19 @@ rl_vi_change_to (count, key) + _rl_vimvcxt->motion = '$'; + r = rl_domove_motion_callback (_rl_vimvcxt); + } +- else if (vi_redoing) ++ else if (vi_redoing && _rl_vi_last_motion != 'c') /* `cc' is special */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } ++ else if (vi_redoing) /* handle redoing `cc' here */ ++ { ++ _rl_vimvcxt->motion = _rl_vi_last_motion; ++ rl_mark = rl_end; ++ rl_beg_of_line (1, key); ++ RL_UNSETSTATE (RL_STATE_VIMOTION); ++ r = vidomove_dispatch (_rl_vimvcxt); ++ } + #if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { +@@ -1377,6 +1393,19 @@ rl_vi_yank_to (count, key) + _rl_vimvcxt->motion = '$'; + r = rl_domove_motion_callback (_rl_vimvcxt); + } ++ else if (vi_redoing && _rl_vi_last_motion != 'y') /* `yy' is special */ ++ { ++ _rl_vimvcxt->motion = _rl_vi_last_motion; ++ r = rl_domove_motion_callback (_rl_vimvcxt); ++ } ++ else if (vi_redoing) /* handle redoing `yy' here */ ++ { ++ _rl_vimvcxt->motion = _rl_vi_last_motion; ++ rl_mark = rl_end; ++ rl_beg_of_line (1, key); ++ RL_UNSETSTATE (RL_STATE_VIMOTION); ++ r = vidomove_dispatch (_rl_vimvcxt); ++ } + #if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + diff --git a/patches/sima-extract.py.patch b/patches/sima-extract.py.patch new file mode 100644 index 0000000..b98522c --- /dev/null +++ b/patches/sima-extract.py.patch @@ -0,0 +1,13 @@ +diff --git a/extract.py b/extract.py +index 34d14f4..9d19c34 100644 +--- a/extract.py ++++ b/extract.py +@@ -8,7 +8,7 @@ from multiprocessing import Pool, cpu_count + + import numpy as np + from scipy.sparse import vstack, diags, csc_matrix +-from scipy.sparse.linalg import inv ++from scipy.linalg import inv + + + def _demixing_matrix(dataset): diff --git a/patches/sima-misc-__init__.py.patch b/patches/sima-misc-__init__.py.patch new file mode 100644 index 0000000..7c39cf4 --- /dev/null +++ b/patches/sima-misc-__init__.py.patch @@ -0,0 +1,22 @@ +diff --git a/misc/__init__.py b/misc/__init__.py +index 87b42da..cc73f9e 100644 +--- a/misc/__init__.py ++++ b/misc/__init__.py +@@ -1,7 +1,7 @@ + import os + import itertools as it + import errno +-from distutils.version import StrictVersion ++from distutils.version import LooseVersion + + from numpy import nanmax + try: +@@ -9,7 +9,7 @@ try: + except ImportError: + cv2_available = False + else: +- cv2_available = StrictVersion(cv2.__version__) >= StrictVersion('2.4.8') ++ cv2_available = LooseVersion(cv2.__version__) >= LooseVersion('2.4.8') + + + def lazyprop(fn): diff --git a/patches/sima-motion.py.patch b/patches/sima-motion.py.patch new file mode 100644 index 0000000..942e7a0 --- /dev/null +++ b/patches/sima-motion.py.patch @@ -0,0 +1,49 @@ +diff --git a/motion.py b/motion.py +index e747353..31bc941 100644 +--- a/motion.py ++++ b/motion.py +@@ -21,7 +21,7 @@ from numpy.linalg import det, svd, pinv + from scipy.special import gammaln + from scipy.signal import fftconvolve + from scipy.cluster.vq import kmeans2 +-from scipy.stats import nanstd ++from scipy.stats import nanmean, nanstd + from scipy.stats.mstats import mquantiles + from scipy.ndimage.filters import gaussian_filter + +@@ -99,7 +99,7 @@ def _estimate_movement_model(shifts, num_rows): + shifts.shape[1] * num_rows)) + assert det(cov_matrix) > 0 + +- mean_shift = np.nanmean(shifts, axis=1) ++ mean_shift = nanmean(shifts, axis=1) + centered_shifts = np.nan_to_num( + shifts - + np.dot(mean_shift.reshape([2, 1]), np.ones([1, shifts.shape[1]])) +@@ -349,7 +349,7 @@ class _MCImagingDataset(ImagingDataset): + pixel_means, pixel_variances = self._pixel_distribution() + cov_matrix_est, decay_matrix, log_transition_matrix = \ + _estimate_movement_model(shifts, self.num_rows) +- mean_shift = np.nanmean(shifts, axis=1) ++ mean_shift = nanmean(shifts, axis=1) + + # add a bit of extra room to move around + extra_buffer = ((max_displacement - np.nanmax(shifts, 1) + +@@ -706,7 +706,7 @@ class _MCImagingDataset(ImagingDataset): + The displacement to add to each shift to align the minimal shift + with the edge of the corrected image. + """ +- good_corr = correlations >= np.nanmean(correlations) - \ ++ good_corr = correlations >= nanmean(correlations) - \ + 2 * nanstd(correlations) + # only include image frames with sufficiently high correlation + min_shifts = np.nanmin(shifts[:, good_corr], axis=1).astype(int) +@@ -760,7 +760,7 @@ class _MCImagingDataset(ImagingDataset): + array + The photon-to-intensity gains for each channel. + """ +- corr_mean = np.nanmean(correlations) ++ corr_mean = nanmean(correlations) + corr_stdev = nanstd(correlations) + # Calculate displacements between consecutive images + diffs = np.diff(shifts, axis=1) diff --git a/patches/sima-normcut.py.patch b/patches/sima-normcut.py.patch new file mode 100644 index 0000000..eb86250 --- /dev/null +++ b/patches/sima-normcut.py.patch @@ -0,0 +1,22 @@ +diff --git a/normcut.py b/normcut.py +index 48e5000..b6fc90a 100644 +--- a/normcut.py ++++ b/normcut.py +@@ -7,7 +7,7 @@ Reference + IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, + VOL. 22, NO. 8, AUGUST 2000. + """ +-from distutils.version import StrictVersion ++from distutils.version import LooseVersion + + import numpy as np + from scipy.sparse.linalg import eigsh +@@ -19,7 +19,7 @@ try: + except ImportError: + cv2_available = False + else: +- cv2_available = StrictVersion(cv2.__version__) >= StrictVersion('2.4.8') ++ cv2_available = LooseVersion(cv2.__version__) >= LooseVersion('2.4.8') + + + def normcut_vectors(affinity_matrix, k): diff --git a/patches/sima-segment.py.patch b/patches/sima-segment.py.patch new file mode 100644 index 0000000..db23f80 --- /dev/null +++ b/patches/sima-segment.py.patch @@ -0,0 +1,24 @@ +diff --git a/segment.py b/segment.py +index d927b0c..153ef8f 100644 +--- a/segment.py ++++ b/segment.py +@@ -1,6 +1,6 @@ + import os + import itertools as it +-from distutils.version import StrictVersion ++from distutils.version import LooseVersion + + import numpy as np + from scipy import sparse, ndimage +@@ -11,9 +11,9 @@ try: + except ImportError: + cv2_available = False + else: +- cv2_available = StrictVersion(cv2.__version__) >= StrictVersion('2.4.8') ++ cv2_available = LooseVersion(cv2.__version__) >= LooseVersion('2.4.8') + +-from scipy import nanmean ++from scipy.stats import nanmean + try: + from sklearn.decomposition import FastICA + except ImportError: diff --git a/patches/spams-python-setup-atlas.patch b/patches/spams-python-setup-atlas.patch new file mode 100644 index 0000000..779f1e9 --- /dev/null +++ b/patches/spams-python-setup-atlas.patch @@ -0,0 +1,67 @@ +--- setup.py_old 2014-07-09 19:03:41.996900059 +0000 ++++ setup.py 2014-07-10 20:18:55.653738878 +0000 +@@ -7,31 +7,35 @@ + # includes numpy : package numpy.distutils , numpy.get_include() + # python setup.py build --inplace + # python setup.py install --prefix=dist, +-incs = ['.'] + map(lambda x: os.path.join('spams',x),[ 'linalg', 'prox', 'decomp', 'dictLearn']) + [numpy.get_include()] + ['/usr/include/python2.7/'] ++incs = ['.'] + map(lambda x: os.path.join('spams',x),[ 'linalg', 'prox', 'decomp', 'dictLearn']) + [numpy.get_include()] + + osname = distutils.util.get_platform() +-cc_flags = ['-fPIC', '-fopenmp'] +-link_flags = ['-fopenmp', '-s' ] +-libs = ['stdc++', 'blas', 'lapack' ] ++ ++buildem_dir = os.environ["BUILDEM_DIR"] ++cc_flags = ['-fPIC', '-fopenmp', '-static-libgfortran', '-Wunused-variable'] ++link_flags = ['-fopenmp', '-static-libgfortran'] ++ ++dynamic_libs = ['stdc++', 'cblas', 'lapack'] ++static_libs = ['atlas'] ++ + libdirs = [] + ++# What's the point of a standarized build system if we are just going to route around it. + if osname.startswith("macosx"): +- cc_flags = ['-fPIC', '-fopenmp','-m32'] +- link_flags = ['-m32', '-framework', 'Python'] ++ cc_flags += ["-F" + os.path.join(buildem_dir, "Frameworks")] ++ link_flags = ['-framework', 'Python'] ++elif osname.startswith("win"): ++ # Assuming MinGW system. ++ # Don't mess with path as we have ideally set it the right way already. ++ # Don't use R for BLAS as we have built BLAS already. ++ cc_flags += ['-DWIN32'] ++ link_flags += ['-mwindows'] ++ ++# These assume GCC style syntax is allowed. Should work for clang (when they have openmp). Will not work with other compilers. ++dynamic_libs = ["-l" + _ for _ in dynamic_libs] ++static_libs = ["-Wl,-Bstatic"] + ["-l" + _ for _ in static_libs] + ["-Wl,-Bdynamic"] + +-if osname.startswith("win32"): +- cc_flags = ['-fPIC', '-fopenmp','-DWIN32'] +- link_flags = ['-fopenmp', '-mwindows'] +- path = os.environ['PATH'] +- os.environ['PATH'] = 'C:/MinGW/bin;' + path +- libs = ['stdc++', 'Rblas', 'Rlapack' ] +- libdirs = ['C:/Program Files/R/R-2.15.1/bin/i386'] +- +-if osname.startswith("win-amd64"): +- cc_flags = ['-openmp', '-EHsc', '-DWIN32', '-DCYGWIN', '-DWINDOWS', '-I','C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include'] +- link_flags = [] +- libs = [ 'Rblas', 'Rlapack' ] +- libdirs = ['C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/lib/amd64','C:/Program Files/R/R-2.15.1/bin/x64'] ++libs = dynamic_libs + static_libs + + + ##path = os.environ['PATH']; print "XX OS %s, path %s" %(osname,path) +@@ -42,7 +46,8 @@ + include_dirs = incs, + extra_compile_args = ['-DNDEBUG', '-DUSE_BLAS_LIB'] + cc_flags, + library_dirs = libdirs, +- libraries = libs, ++ # Want to control the formatting. ++ extra_objects = libs, + # strip the .so + extra_link_args = link_flags, + language = 'c++', diff --git a/patches/spams-python-setup.patch b/patches/spams-python-setup.patch new file mode 100644 index 0000000..3576e5c --- /dev/null +++ b/patches/spams-python-setup.patch @@ -0,0 +1,54 @@ +diff --git a/setup.py b/setup.py +index 2307122..64570f2 100644 +--- a/setup.py ++++ b/setup.py +@@ -7,31 +7,29 @@ import numpy + # includes numpy : package numpy.distutils , numpy.get_include() + # python setup.py build --inplace + # python setup.py install --prefix=dist, +-incs = ['.'] + map(lambda x: os.path.join('spams',x),[ 'linalg', 'prox', 'decomp', 'dictLearn']) + [numpy.get_include()] + ['/usr/include/python2.7/'] ++incs = ['.'] + map(lambda x: os.path.join('spams',x),[ 'linalg', 'prox', 'decomp', 'dictLearn']) + [numpy.get_include()] + + osname = distutils.util.get_platform() +-cc_flags = ['-fPIC', '-fopenmp'] +-link_flags = ['-fopenmp', '-s' ] +-libs = ['stdc++', 'blas', 'lapack' ] +-libdirs = [] + +-if osname.startswith("macosx"): +- cc_flags = ['-fPIC', '-fopenmp','-m32'] +- link_flags = ['-m32', '-framework', 'Python'] ++buildem_dir = os.environ["BUILDEM_DIR"] ++cc_flags = ['-fPIC', '-fopenmp', '-Wunused-variable', '-m64'] ++link_flags = ['-fopenmp'] ++ ++libs = ['stdc++', 'blas', 'lapack', 'gomp'] + +-if osname.startswith("win32"): +- cc_flags = ['-fPIC', '-fopenmp','-DWIN32'] +- link_flags = ['-fopenmp', '-mwindows'] +- path = os.environ['PATH'] +- os.environ['PATH'] = 'C:/MinGW/bin;' + path +- libs = ['stdc++', 'Rblas', 'Rlapack' ] +- libdirs = ['C:/Program Files/R/R-2.15.1/bin/i386'] ++libdirs = [os.path.join(buildem_dir, 'lib')] ++ ++# What's the point of a standarized build system if we are just going to route around it. ++if osname.startswith("macosx"): ++ cc_flags += ["-F" + os.path.join(buildem_dir, "Frameworks")] ++ link_flags = ["-F" + os.path.join(buildem_dir, "Frameworks"), '-framework', 'Python'] ++elif osname.startswith("win"): ++ # Assuming MinGW system. ++ # Don't mess with path as we have ideally set it the right way already. ++ # Don't use R for BLAS as we have built BLAS already. ++ cc_flags += ['-DWIN32'] ++ link_flags += ['-mwindows'] + +-if osname.startswith("win-amd64"): +- cc_flags = ['-openmp', '-EHsc', '-DWIN32', '-DCYGWIN', '-DWINDOWS', '-I','C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include'] +- link_flags = [] +- libs = [ 'Rblas', 'Rlapack' ] +- libdirs = ['C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/lib/amd64','C:/Program Files/R/R-2.15.1/bin/x64'] + + + ##path = os.environ['PATH']; print "XX OS %s, path %s" %(osname,path) diff --git a/patches/turn_off_mac_sys_path.patch b/patches/turn_off_mac_sys_path.patch new file mode 100644 index 0000000..d22e716 --- /dev/null +++ b/patches/turn_off_mac_sys_path.patch @@ -0,0 +1,16 @@ +--- /Users/kirkhamj/Downloads/Python-2.7.6/Lib/site.py 2013-11-10 02:36:40.000000000 -0500 ++++ /Users/kirkhamj/Documents/site.py 2014-04-21 23:12:01.000000000 -0400 +@@ -301,9 +301,10 @@ + from sysconfig import get_config_var + framework = get_config_var("PYTHONFRAMEWORK") + if framework: +- sitepackages.append( +- os.path.join("/Library", framework, +- sys.version[:3], "site-packages")) ++ pass ++ #sitepackages.append( ++ # os.path.join("/Library", framework, ++ # sys.version[:3], "site-packages")) + return sitepackages + + def addsitepackages(known_paths): diff --git a/patches/vtktiff.patch b/patches/vtktiff.patch new file mode 100644 index 0000000..e9454a1 --- /dev/null +++ b/patches/vtktiff.patch @@ -0,0 +1,14 @@ +--- tif_config.h.in 2012-10-15 22:33:21.000000000 +0200 ++++ ../../../../vtk-5.10.1/Utilities/vtktiff/tif_config.h.in 2013-12-05 17:24:47.000000000 +0100 +@@ -241,8 +241,9 @@ + /* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ + #ifndef __cplusplus +-#define inline +-//#cmakedefine inline ++# ifdef _MSC_VER ++# define inline ++# endif + #endif + + /* Define to `long' if does not define. */ diff --git a/patsy.cmake b/patsy.cmake new file mode 100644 index 0000000..2bced69 --- /dev/null +++ b/patsy.cmake @@ -0,0 +1,44 @@ +# A statistical models library. Uses a formula mini-language that is similar to R and S. +# +# Required by statsmodels, which is used by pandas. +# All dependencies included as already present. + + +if (NOT patsy_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (TemplateSupport) + +include (python) +include (numpy) +include (scipy) +include (nose) + + +external_git_repo(patsy + v0.2.1 #93ee6dcc75f7fd97e4ff46b4cf2688a013c3af40 + https://github.com/pydata/patsy/) + + +message ("Installing ${patsy_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${patsy_NAME} + DEPENDS ${python_NAME} ${numpy_NAME} ${scipy_NAME} ${nose_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${patsy_URL} + GIT_TAG ${patsy_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${patsy_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT patsy_NAME) diff --git a/pep8.cmake b/pep8.cmake new file mode 100644 index 0000000..5110950 --- /dev/null +++ b/pep8.cmake @@ -0,0 +1,37 @@ +# Provides support for PEP8. +# Required by Spyder. + +if (NOT pep8_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_git_repo(pep8 + 1.5.6 #96290d48b1334fe8542666174d7775cda3f46d9a + https://github.com/jcrocholl/pep8) + + +# Download and install pep8 +message ("Installing ${pep8_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${pep8_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${pep8_URL} + GIT_TAG ${pep8_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pep8_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pep8_NAME) \ No newline at end of file diff --git a/pgmlink.cmake b/pgmlink.cmake index 5a79ad9..c6be708 100644 --- a/pgmlink.cmake +++ b/pgmlink.cmake @@ -46,11 +46,16 @@ else() GIT_REPOSITORY ${pgmlink_URL} GIT_TAG ${pgmlink_TAG} UPDATE_COMMAND "" - PATCH_COMMAND "" + PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} + # Patch CMakeLists as it just overwrote the CXX_FLAGS + ${pgmlink_SRC_DIR}/CMakeLists.txt ${PATCH_DIR}/pgmlink-cmake.patch CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${pgmlink_SRC_DIR} -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} + "-DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} -ftemplate-depth=512" + -DCMAKE_EXE_LINKER_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} + -DCMAKE_SHARED_LINKER_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} -DWITH_PYTHON=ON -DWITH_TESTS=ON -DWITH_CHECKED_STL=OFF diff --git a/pip.cmake b/pip.cmake new file mode 100644 index 0000000..f8ebcb8 --- /dev/null +++ b/pip.cmake @@ -0,0 +1,37 @@ +# Adds pip, the python installer. + +if (NOT pip_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (setuptools) + +external_git_repo(pip + 1.5.6 # 81f21f2261d422d243f66b2dfeef0faae72ab119 + https://github.com/pypa/pip) + + +# Download and install pip +message ("Installing ${pip_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${pip_NAME} + DEPENDS ${python_NAME} ${setuptools_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${pip_URL} + GIT_TAG ${pip_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pip_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pip_NAME) diff --git a/psutil.cmake b/psutil.cmake index 338bd50..42a6d96 100644 --- a/psutil.cmake +++ b/psutil.cmake @@ -12,18 +12,16 @@ include (BuildSupport) include (python) -external_source (psutil - 0.6.1 - psutil-0.6.1.tar.gz - 3cfcbfb8525f6e4c70110e44a85e907e - http://psutil.googlecode.com/files) +external_git_repo(psutil + release-2.1.1 # 50bd135bbbd17c970afc4882b0829900e3d9bb4c + https://github.com/giampaolo/psutil) message ("Installing ${psutil_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${psutil_NAME} DEPENDS ${python_NAME} PREFIX ${BUILDEM_DIR} - URL ${psutil_URL} - URL_MD5 ${psutil_MD5} + GIT_REPOSITORY ${psutil_URL} + GIT_TAG ${psutil_TAG} UPDATE_COMMAND "" PATCH_COMMAND "" CONFIGURE_COMMAND "" diff --git a/pyflakes.cmake b/pyflakes.cmake new file mode 100644 index 0000000..4883974 --- /dev/null +++ b/pyflakes.cmake @@ -0,0 +1,39 @@ +# A passive Python analyzer and error detector. +# Required by Spyder. + +if (NOT pyflakes_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_source (pyflakes + 1.1.0 + pyflakes-0.8.1.tar.gz + 905fe91ad14b912807e8fdc2ac2e2c23 + https://pypi.python.org/packages/source/p/pyflakes/) + + +# Download and install pyflakes +message ("Installing ${pyflakes_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${pyflakes_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${pyflakes_URL} + URL_MD5 ${pyflakes_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pyflakes_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pyflakes_NAME) \ No newline at end of file diff --git a/pygments.cmake b/pygments.cmake new file mode 100644 index 0000000..a77c4b0 --- /dev/null +++ b/pygments.cmake @@ -0,0 +1,37 @@ +# Provides syntax highlighting support for Python. +# Required by iPython. Also, used by Spyder. + +if (NOT pygments_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + + +include (python) + +external_source (pygments + 1.6 + Pygments-1.6.tar.gz + a18feedf6ffd0b0cc8c8b0fbdb2027b1 + https://pypi.python.org/packages/source/P/Pygments/) + +message ("Installing ${pygments_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${pygments_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${pygments_URL} + URL_MD5 ${pygments_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pygments_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pygments_NAME) \ No newline at end of file diff --git a/pylibtiff.cmake b/pylibtiff.cmake new file mode 100644 index 0000000..e1ccea9 --- /dev/null +++ b/pylibtiff.cmake @@ -0,0 +1,45 @@ +# +# Provides a thin wrapper for libtiff to be used from Python. +# + +if (NOT pylibtiff_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (libtiff) +include (python) +include (setuptools) +include (numpy) +include (nose) + +external_source (pylibtiff + 0.4.0 + libtiff-0.4.0.tar.gz + f7cad14620548b21bf05a276a040f487 + http://pypi.python.org/packages/source/l/libtiff/) + + +# Download and install pylibtiff +message ("Installing ${pylibtiff_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${pylibtiff_NAME} + DEPENDS ${libtiff_NAME} ${python_NAME} ${setuptools_NAME} ${numpy_NAME} ${nose_NAME} + PREFIX ${BUILDEM_DIR} + URL ${pylibtiff_URL} + URL_MD5 ${pylibtiff_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pylibtiff_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pylibtiff_NAME) diff --git a/pylint.cmake b/pylint.cmake new file mode 100644 index 0000000..a21a7d9 --- /dev/null +++ b/pylint.cmake @@ -0,0 +1,39 @@ +# Another Python code analyzer and error detector like pyflakes. Also, checks for bad smells. +# Required by Spyder. + +if (NOT pylint_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_source (pylint + 1.1.0 + pylint-1.1.0.tar.gz + 017299b5911838a9347a71de5f946afc + https://pypi.python.org/packages/source/p/pylint/) + + +# Download and install pylint +message ("Installing ${pylint_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${pylint_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${pylint_URL} + URL_MD5 ${pylint_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pylint_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pylint_NAME) \ No newline at end of file diff --git a/pyparsing.cmake b/pyparsing.cmake new file mode 100644 index 0000000..fe4084e --- /dev/null +++ b/pyparsing.cmake @@ -0,0 +1,39 @@ +# Pyparsing is a dependency of matplotlib. +# Used to render formulae. + +if (NOT pyparsing_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_source (pyparsing + 2.0.1 + pyparsing-2.0.1.tar.gz + 37adec94104b98591507218bc82e7c31 + https://pypi.python.org/packages/source/p/pyparsing/) + + +# Download and install pyparsing +message ("Installing ${pyparsing_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${pyparsing_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${pyparsing_URL} + URL_MD5 ${pyparsing_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pyparsing_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pyparsing_NAME) \ No newline at end of file diff --git a/pyqt4.cmake b/pyqt4.cmake index 46b360e..dd74c89 100644 --- a/pyqt4.cmake +++ b/pyqt4.cmake @@ -48,8 +48,10 @@ ExternalProject_Add(${pyqt4_NAME} URL ${pyqt4_URL} URL_MD5 ${pyqt4_MD5} UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} ${pyqt4_SRC_DIR}/configure.py + # New patch related to new version of PyQt4, which still suffers from the same phonon bug. + PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} + ${pyqt4_SRC_DIR}/configure.py ${PATCH_DIR}/pyqt4.patch # For some reason, the configure script wants to build pyqt phonon support even if qt was built without it. This patch simply comments out phonon support. + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} PYTHONPATH=${BUILDEM_PYTHONPATH} ${PYTHON_EXE} ${pyqt4_SRC_DIR}/configure.py --confirm-license --verbose -q "${BUILDEM_DIR}/bin/qmake" diff --git a/python-dateutil.cmake b/python-dateutil.cmake new file mode 100644 index 0000000..cd11047 --- /dev/null +++ b/python-dateutil.cmake @@ -0,0 +1,41 @@ +# Used for handling any date or time. +# Required by Matplotlib. + +if (NOT python-dateutil_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (setuptools) +include (six) + +external_source (python-dateutil + 1.5 + python-dateutil-1.5.tar.gz + 35f3732db3f2cc4afdc68a8533b60a52 + https://labix.org/download/python-dateutil/) + + +# Download and install python-dateutil +message ("Installing ${python-dateutil_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${python-dateutil_NAME} + DEPENDS ${python_NAME} ${six_NAME} ${setuptools_NAME} + PREFIX ${BUILDEM_DIR} + URL ${python-dateutil_URL} + URL_MD5 ${python-dateutil_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${python-dateutil_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT python-dateutil_NAME) \ No newline at end of file diff --git a/python-markdown.cmake b/python-markdown.cmake new file mode 100644 index 0000000..ab4678f --- /dev/null +++ b/python-markdown.cmake @@ -0,0 +1,37 @@ +# Adds python-markdown, a markdown parser. + +if (NOT python-markdown_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (setuptools) + +external_git_repo(python-markdown + 2.5.2-final # a9195fd2261d8a29762f7d8fc34b520c94fd09ec + https://github.com/waylan/Python-Markdown) + + +# Download and install python-markdown +message ("Installing ${python-markdown_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${python-markdown_NAME} + DEPENDS ${python_NAME} ${setuptools_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${python-markdown_URL} + GIT_TAG ${python-markdown_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${python-markdown_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT python-markdown_NAME) diff --git a/python-matlab-bridge.cmake b/python-matlab-bridge.cmake new file mode 100644 index 0000000..298cec9 --- /dev/null +++ b/python-matlab-bridge.cmake @@ -0,0 +1,37 @@ +# Provides a simple and fast interface to MATLAB from Python using zmq. + +if (NOT python-matlab-bridge_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + + +include (python) +include (pyzmq) +include (ipython) + + +external_git_repo(python-matlab-bridge + 0.3 #a6fd3cc3adf5ef2b5e3d9b83a8050d783c76d48f + https://github.com/arokem/python-matlab-bridge) + +message ("Installing ${python-matlab-bridge_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${python-matlab-bridge_NAME} + DEPENDS ${python_NAME} ${pyzmq_NAME} ${ipython_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${python-matlab-bridge_URL} + GIT_TAG ${python-matlab-bridge_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${python-matlab-bridge_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT python-matlab-bridge_NAME) diff --git a/python.cmake b/python.cmake index 0e19b47..a9ed885 100644 --- a/python.cmake +++ b/python.cmake @@ -12,9 +12,13 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) include (ExternalProject) include (ExternalSource) include (BuildSupport) +include (PatchSupport) include (zlib) include (openssl) # without openssl, hashlib might have missing encryption methods +include (readline) # To support the readline module. +include (sqlite) # required to implement the standard module sqlite3 + # (https://docs.python.org/2/library/sqlite3.html) external_source (python 2.7.6 @@ -48,19 +52,23 @@ if (${PYTHON_BUILD_DEBUG}) endif() ExternalProject_Add(${python_NAME} - DEPENDS ${zlib_NAME} ${openssl_NAME} + DEPENDS ${zlib_NAME} ${openssl_NAME} ${readline_NAME} ${sqlite_NAME} PREFIX ${BUILDEM_DIR} URL ${python_URL} URL_MD5 ${python_MD5} UPDATE_COMMAND "" - PATCH_COMMAND "" + PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} + # This patch stops including the system Python site-packages on Python. + # Without this patch buildem versions of Python tools will either not be installed + # or not be used. This will give the false sense that something succeeded in buildem. + ${python_SRC_DIR}/Lib/site.py ${PATCH_DIR}/turn_off_mac_sys_path.patch CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${python_SRC_DIR}/configure --prefix=${BUILDEM_DIR} ${PYTHON_BINARY_TYPE_ARG} ${PYTHON_DEBUG_CONFIG_ARGS} - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include - BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) -j1 # Fails on Mavericks when multithreaded. INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) PYTHONAPPSDIR=${BUILDEM_BIN_DIR}/${python_NAME} install BUILD_IN_SOURCE 1 # Required for Mac diff --git a/pytz.cmake b/pytz.cmake new file mode 100644 index 0000000..8d604cf --- /dev/null +++ b/pytz.cmake @@ -0,0 +1,39 @@ +# Time zone definitions for Python. +# Used by Matplotlib. + +if (NOT pytz_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_source (pytz + 2014.2 + pytz-2014.2.tar.gz + c0158314605420cbf6e5328369b06145 + https://pypi.python.org/packages/source/p/pytz/) + + +# Download and install pytz +message ("Installing ${pytz_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${pytz_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${pytz_URL} + URL_MD5 ${pytz_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pytz_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pytz_NAME) \ No newline at end of file diff --git a/pyzmq.cmake b/pyzmq.cmake new file mode 100644 index 0000000..5b99a76 --- /dev/null +++ b/pyzmq.cmake @@ -0,0 +1,39 @@ +# Provides Python bindings for ZeroMQ. +# Required for iPython. + +if (NOT pyzmq_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + + +include (cython) +include (python) +include(zeromq) + + +external_git_repo(pyzmq + v14.0.1 # 28b5bef764cbe87518b589df54f6f7f5ed50964d + https://github.com/zeromq/pyzmq) + + +message ("Installing ${pyzmq_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${pyzmq_NAME} + DEPENDS ${cython_NAME} ${python_NAME} ${zeromq_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${pyzmq_URL} + GIT_TAG ${pyzmq_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py configure --zmq=${BUILDEM_DIR} + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${pyzmq_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT pyzmq_NAME) \ No newline at end of file diff --git a/qimage2ndarray.cmake b/qimage2ndarray.cmake index 6d3ea1b..d59ab99 100644 --- a/qimage2ndarray.cmake +++ b/qimage2ndarray.cmake @@ -9,7 +9,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) include (ExternalProject) include (ExternalSource) include (BuildSupport) -#include (PatchSupport) include (numpy) include (pyqt4) @@ -18,7 +17,7 @@ include (pyqt4) # it doesn't have an /include directory! # Instead, we pull directly from github. external_git_repo (qimage2ndarray - release-1.3 + release-1.3 # beaa2eca4605be443f78d6dd5cd2d4be8081d0dc https://github.com/hmeine/qimage2ndarray) message ("Installing ${qimage2ndarray_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") @@ -32,8 +31,8 @@ ExternalProject_Add(${qimage2ndarray_NAME} PATCH_COMMAND "" LIST_SEPARATOR ^^ CONFIGURE_COMMAND "" - BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} ${qimage2ndarray_SRC_DIR}/setup.py build - INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} ${qimage2ndarray_SRC_DIR}/setup.py install --prefix=${PYTHON_PREFIX} + BUILD_COMMAND ${BUILDEM_ENV_STRING} PYTHONPATH=${BUILDEM_PYTHONPATH} ${PYTHON_EXE} ${qimage2ndarray_SRC_DIR}/setup.py build + INSTALL_COMMAND ${BUILDEM_ENV_STRING} PYTHONPATH=${BUILDEM_PYTHONPATH} ${PYTHON_EXE} ${qimage2ndarray_SRC_DIR}/setup.py install --prefix=${PYTHON_PREFIX} BUILD_IN_SOURCE 1 ) diff --git a/qt4.cmake b/qt4.cmake index 7695b2b..5098058 100644 --- a/qt4.cmake +++ b/qt4.cmake @@ -9,7 +9,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) include (ExternalProject) include (ExternalSource) include (BuildSupport) -#include (PatchSupport) +include (PatchSupport) # Using PATCH_EXE so this include should be here. include(zlib) include(libpng) @@ -17,11 +17,9 @@ include(libjpeg) include(libtiff) include(freetype2) -external_source (qt4 - 4.8.3 - qt-everywhere-opensource-src-4.8.3.tar.gz - a663b6c875f8d7caa8ac9c30e4a4ec3b - http://download.qt-project.org/official_releases/qt/4.8/4.8.3) +external_git_repo(qt4 + 4.8 #682ed9df439481e1f8e8651c4aa06f1b455a2080 + https://github.com/qtproject/qt) message ("Installing ${qt4_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") @@ -42,11 +40,17 @@ endif() ExternalProject_Add(${qt4_NAME} DEPENDS ${freetype2_NAME} ${zlib_NAME} ${libpng_NAME} ${libjpeg_NAME} ${libtiff_NAME} PREFIX ${BUILDEM_DIR} - URL ${qt4_URL} - URL_MD5 ${qt4_MD5} + GIT_REPOSITORY ${qt4_URL} + GIT_TAG 4.8 UPDATE_COMMAND "" - PATCH_COMMAND "" - CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} echo "yes" | ${qt4_SRC_DIR}/configure # pipe "yes" to stdin to accept the license. + PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} + # This patch fixes ilastik crashes on OSX due to an ill-shaped ellipse + ${qt4_SRC_DIR}/src/gui/painting/qpaintengine_mac.cpp ${PATCH_DIR}/qt4-osx-draw-ellipse.patch + # This patch fixes removes Xarch_x86_64 flags from the Qt4 configure file. These flags are not appropriate for Mavericks and cause Qt4 to fail building. + ${qt4_SRC_DIR}/configure ${PATCH_DIR}/qt4-osx-mavericks-configure.patch + # This patch fixes removes Xarch_x86_64 flags from the Qt4 gui.pro file. These flags are not appropriate for Mavericks and cause Qt4 to fail building. + ${qt4_SRC_DIR}/src/gui/gui.pro ${PATCH_DIR}/qt4-osx-mavericks-gui-pro.patch + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} env CXXFLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} echo "yes" | ${qt4_SRC_DIR}/configure # pipe "yes" to stdin to accept the license. --prefix=${BUILDEM_DIR} -opensource -arch x86_64 @@ -98,7 +102,13 @@ ExternalProject_Add(${qt4_NAME} INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install ) -set_target_properties(${qt4_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + ExternalProject_Add_Step(${qt4_NAME} ${qt4_NAME}-create-symlinks + COMMAND bash ${PATCH_DIR}/qt4-create-symlinks.sh ${BUILDEM_DIR} + DEPENDEES install + ) +endif() -endif (NOT qt4_NAME) +set_target_properties(${qt4_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) +endif (NOT qt4_NAME) \ No newline at end of file diff --git a/rank_filter.cmake b/rank_filter.cmake new file mode 100644 index 0000000..fcca1bf --- /dev/null +++ b/rank_filter.cmake @@ -0,0 +1,52 @@ +# +# Install rank_filter module from source +# + +if (NOT rank_filter_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +set(DISABLE_VIGRANUMPY 0) + +include (python) +include (numpy) +include (boost) +include (vigra) +include (nose) + +external_git_repo (rank_filter + v0.1 + https://github.com/jakirkham/rank_filter) + +message("Installing ${rank_filter_NAME}/${VIGRA_VERSION} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${rank_filter_NAME} + DEPENDS ${python_NAME} ${numpy_NAME} ${boost_NAME} ${vigra_NAME} ${nose_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${rank_filter_URL} + GIT_TAG ${rank_filter_TAG} + PATCH_COMMAND "" + LIST_SEPARATOR ^^ + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${rank_filter_SRC_DIR} + -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} + -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} + -DCMAKE_EXE_LINKER_FLAGS=${BUILDEM_LDFLAGS} + -DDEPENDENCY_SEARCH_PREFIX=${BUILDEM_DIR} + -DBOOST_ROOT=${BUILDEM_DIR} + -DVIGRA_ROOT=${BUILDEM_DIR} + "-DCMAKE_CXX_FLAGS=-pthread ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "-DCMAKE_CXX_LINK_FLAGS=-pthread ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + -DCMAKE_CXX_FLAGS_RELEASE=-O2\ -DNDEBUG + -DCMAKE_CXX_FLAGS_DEBUG="${CMAKE_CXX_FLAGS_DEBUG}" + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) test + INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install +) + +set_target_properties(${rank_filter_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT rank_filter_NAME) + diff --git a/readline.cmake b/readline.cmake new file mode 100644 index 0000000..192b378 --- /dev/null +++ b/readline.cmake @@ -0,0 +1,47 @@ +# +# Install readline from source. +# + +if (NOT readline_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +external_source (readline + 6.2 + readline-6.2.tar.gz + 67948acb2ca081f23359d0256e9a271c + ftp://ftp.gnu.org/gnu/readline) + +message ("Installing ${readline_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${readline_NAME} + PREFIX ${BUILDEM_DIR} + URL ${readline_URL} + URL_MD5 ${readline_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} + # These patches are the result of smashing all of the patches from ( ftp://ftp.gnu.org/pub/gnu/readline/readline-6.2-patches/ ) into one massive patch. + # Then, they have been split out to have one patch per file changed. + ${readline_SRC_DIR}/callback.c ${PATCH_DIR}/readline-6.2-callback.patch + ${readline_SRC_DIR}/input.c ${PATCH_DIR}/readline-6.2-input.patch + ${readline_SRC_DIR}/patchlevel ${PATCH_DIR}/readline-6.2-patchlevel.patch + ${readline_SRC_DIR}/support/shobj-conf ${PATCH_DIR}/readline-6.2-shobj-conf.patch + ${readline_SRC_DIR}/vi_mode.c ${PATCH_DIR}/readline-6.2-vi_mode.patch + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${readline_SRC_DIR}/configure + --prefix=${BUILDEM_DIR} + --enable-shared + --enable-static + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + BUILD_IN_SOURCE 1 + TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check + INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install +) + +set_target_properties(${readline_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT readline_NAME) diff --git a/rope.cmake b/rope.cmake new file mode 100644 index 0000000..888ad3b --- /dev/null +++ b/rope.cmake @@ -0,0 +1,39 @@ +# Refactoring for Python. +# Required by Spyder. + +if (NOT rope_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_source (rope + 0.9.4 + rope-0.9.4.tar.gz + 6c654c6892f78008e04e2d65f9f859bb + https://pypi.python.org/packages/source/r/rope/) + + +# Download and install rope +message ("Installing ${rope_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${rope_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${rope_URL} + URL_MD5 ${rope_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${rope_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT rope_NAME) \ No newline at end of file diff --git a/scikit-image.cmake b/scikit-image.cmake index 5524393..572ea6e 100644 --- a/scikit-image.cmake +++ b/scikit-image.cmake @@ -16,10 +16,10 @@ include (numpy) include (scipy) external_source (scikit-image - 0.7.2 - scikit-image-0.7.2.tar.gz - 80eb9862fa09c7e06eda6e2a9fc4042f - http://pypi.python.org/packages/source/s/scikit-image) + 0.9.3 + scikit-image-0.9.3.tar.gz + f010e0cd46ee2996a6875c96b216e768 + https://pypi.python.org/packages/source/s/scikit-image) message ("Installing ${scikit-image_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${scikit-image_NAME} diff --git a/scipy-stack.cmake b/scipy-stack.cmake new file mode 100644 index 0000000..8eca628 --- /dev/null +++ b/scipy-stack.cmake @@ -0,0 +1,40 @@ +# Pseudo-package for installing the full SciPy stack. + +if (NOT scipy-stack_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +set(scipy-stack_NAME "scipy-stack") + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + + +include (python) +include (sphinxcontrib-napoleon) # Nice Sphinx docs +include (pyqt4) +include (numpy) +include (scipy) +include (matplotlib) +include (statsmodels) # Includes pandas as a dependency +include (scikit-image) +include (scikit-learn) +include (sympy) # Pulls in gmpy2 +include (ipython) +include (nose) + + +message ("Installing ${scipy-stack_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${scipy-stack_NAME} + DEPENDS ${python_NAME} ${sphinxcontrib-napoleon_NAME} ${pyqt4_NAME} ${numpy_NAME} ${scipy_NAME} ${matplotlib_NAME} ${statsmodels_NAME} ${scikit-image_NAME} ${scikit-learn_NAME} ${sympy_NAME} ${ipython_NAME} ${nose_NAME} + DOWNLOAD_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + TEST_COMMAND "" + INSTALL_COMMAND "" +) + +set_target_properties(${scipy-stack_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT scipy-stack_NAME) \ No newline at end of file diff --git a/shapely.cmake b/shapely.cmake new file mode 100644 index 0000000..7d50f33 --- /dev/null +++ b/shapely.cmake @@ -0,0 +1,42 @@ +# +# Provides Python bindings to GEOS as well as additional functionality in analyzing and manipulating geometric objects. +# + +if (NOT shapely_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (geos) +include (python) +include (setuptools) +include (cython) +include (numpy) + +external_git_repo(pip + 1.4.3 # 53424e60ba8b83bbdce84a8e238b201b83c53a7d + https://github.com/Toblerity/Shapely) + + +# Download and install shapely +message ("Installing ${shapely_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${shapely_NAME} + DEPENDS ${python_NAME} ${setuptools_NAME} ${cython_NAME} ${numpy_NAME} ${geos_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${shapely_URL} + GIT_TAG ${shapely_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${shapely_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT shapely_NAME) diff --git a/sima.cmake b/sima.cmake new file mode 100644 index 0000000..64d35dd --- /dev/null +++ b/sima.cmake @@ -0,0 +1,52 @@ +# +# For use in the analysis of time-series imaging data arising from fluorescence microscopy. +# + +if (NOT sima_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (numpy) +include (scipy) +include (matplotlib) +include (scikit-image) +include (shapely) +include (h5py) +include (opencv) + + +external_git_repo(sima + 0.3.1 # 5d700e518dc78aa6d478357d80dcc603b67cf3ff + https://github.com/losonczylab/sima) + + +# Download and install sima +message ("Installing ${sima_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${sima_NAME} + DEPENDS ${python_NAME} ${numpy_NAME} ${scipy_NAME} ${matplotlib_NAME} ${scikit-image_NAME} ${shapely_NAME} ${h5py_NAME} ${opencv_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${sima_URL} + GIT_TAG ${sima_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} + # Turns off test that is known failure on Mac. + ${sima_SRC_DIR}/sima/extract.py ${PATCH_DIR}/sima-extract.py.patch + ${sima_SRC_DIR}/sima/misc/__init__.py ${PATCH_DIR}/sima-misc-__init__.py.patch + ${sima_SRC_DIR}/sima/motion.py ${PATCH_DIR}/sima-motion.py.patch + ${sima_SRC_DIR}/sima/normcut.py ${PATCH_DIR}/sima-normcut.py.patch + ${sima_SRC_DIR}/sima/segment.py ${PATCH_DIR}/sima-segment.py.patch + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${sima_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT sima_NAME) diff --git a/sip.cmake b/sip.cmake index fcdd446..0e403de 100644 --- a/sip.cmake +++ b/sip.cmake @@ -34,12 +34,18 @@ ExternalProject_Add(${sip_NAME} UPDATE_COMMAND "" PATCH_COMMAND "" LIST_SEPARATOR ^^ + # Though it may seem that the -b, -d, -e, and -v flags are unnecessary, this is not the case. + # It would seem obvious that the install would happen in those locations. However, python will + # become confused if the system python has SIP installed. Thus, keeping the flags below will + # ensure that the right SIP packages can be imported by python. This is necessary for the build + # of qimage2ndarray in particular. Without the flags below, qimage2ndarray will fail to find the + # right SIP to build with. CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} ${sip_SRC_DIR}/configure.py ${EXTRA_SIP_CONFIG_FLAGS} - #-b ${PYTHON_PREFIX}/bin - #-d ${PYTHON_PREFIX}/lib/python2.7/site-packages - #-e ${PYTHON_PREFIX}/include/python2.7 - #-v ${PYTHON_PREFIX}/share/sip + -b ${PYTHON_PREFIX}/bin + -d ${PYTHON_PREFIX}/lib/python2.7/site-packages + -e ${PYTHON_PREFIX}/include/python2.7 + -v ${PYTHON_PREFIX}/share/sip BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install diff --git a/six.cmake b/six.cmake new file mode 100644 index 0000000..d32188f --- /dev/null +++ b/six.cmake @@ -0,0 +1,40 @@ +# A python standards module. Provides support for utilities in a compatible way +# between Python 2 and 3. +# Required by Matplotlib. + +if (NOT six_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_source (six + 1.6.1 + six-1.6.1.tar.gz + 07d606ac08595d795bf926cc9985674f + https://pypi.python.org/packages/source/s/six/) + + +# Download and install six +message ("Installing ${six_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${six_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${six_URL} + URL_MD5 ${six_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${six_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT six_NAME) \ No newline at end of file diff --git a/snappy.cmake b/snappy.cmake index 1fc9450..3ef38d6 100644 --- a/snappy.cmake +++ b/snappy.cmake @@ -27,8 +27,8 @@ ExternalProject_Add(${snappy_NAME} --prefix=${BUILDEM_DIR} --enable-shared --enable-static - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) BUILD_IN_SOURCE 1 TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check diff --git a/spams-python.cmake b/spams-python.cmake new file mode 100644 index 0000000..d85310c --- /dev/null +++ b/spams-python.cmake @@ -0,0 +1,45 @@ +# +# Install spams-python from source +# + +if (NOT spams-python_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (PatchSupport) + +external_source (spams-python + 2.4 + spams-python-v2.4-svn2014-03-27.tar.gz + 57b4851bf2d623fc8a23d0fd4c204694 + http://spams-devel.gforge.inria.fr/hitcounter2.php?file=33494/) + +message ("Installing ${spams-python_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${spams-python_NAME} + DEPENDS ${atlas_NAME} ${python_NAME} ${setuptools_NAME} ${numpy_NAME} ${scipy_NAME} + PREFIX ${BUILDEM_DIR} + URL ${spams-python_URL} + URL_MD5 ${spams-python_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE} + # Patches SPAMS in a way where we are sure it will run. + + # The first patch should work with any LAPACK and BLAS implementation. + ${spams-python_SRC_DIR}/setup.py ${PATCH_DIR}/spams-python-setup.patch + # If you wish to use the tuned ATLAS library as well, use this patch. + #${spams-python_SRC_DIR}/setup.py ${PATCH_DIR}/spams-python-setup-atlas.patch + + CONFIGURE_COMMAND "" + BUILD_COMMAND BUILDEM_DIR=${BUILDEM_DIR} ${BUILDEM_ENV_STRING} CC=${GCC} CXX=${GXX} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND BUILDEM_DIR=${BUILDEM_DIR} ${BUILDEM_ENV_STRING} CC=${GCC} CXX=${GXX} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${spams-python_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT spams-python_NAME) + diff --git a/sphinx.cmake b/sphinx.cmake new file mode 100644 index 0000000..3033893 --- /dev/null +++ b/sphinx.cmake @@ -0,0 +1,39 @@ +# Provide nice Python documentation output. +# Used by Spyder and iPython. + +if (NOT sphinx_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_source (sphinx + 1.2.2 + Sphinx-1.2.2.tar.gz + 3dc73ccaa8d0bfb2d62fb671b1f7e8a4 + https://pypi.python.org/packages/source/S/Sphinx/) + + +# Download and install sphinx +message ("Installing ${sphinx_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${sphinx_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${sphinx_URL} + URL_MD5 ${sphinx_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${sphinx_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT sphinx_NAME) \ No newline at end of file diff --git a/sphinxcontrib-napoleon.cmake b/sphinxcontrib-napoleon.cmake new file mode 100644 index 0000000..73b2be0 --- /dev/null +++ b/sphinxcontrib-napoleon.cmake @@ -0,0 +1,40 @@ +# Extends Sphinx to add support for Google style and Numpy style documentation. +# Much easier on the eyes and brain than Sphinx. + +if (NOT sphinxcontrib-napoleon_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (sphinx) + +external_source (sphinxcontrib-napoleon + 0.2.7 + sphinxcontrib-napoleon-0.2.7.tar.gz + 001ee10b53eba1361738ed126cd6deb2 + https://pypi.python.org/packages/source/s/sphinxcontrib-napoleon/) + + +# Download and install sphinxcontrib-napoleon +message ("Installing ${sphinxcontrib-napoleon_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${sphinxcontrib-napoleon_NAME} + DEPENDS ${python_NAME} ${sphinx_NAME} + PREFIX ${BUILDEM_DIR} + URL ${sphinxcontrib-napoleon_URL} + URL_MD5 ${sphinxcontrib-napoleon_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${sphinxcontrib-napoleon_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT sphinxcontrib-napoleon_NAME) \ No newline at end of file diff --git a/spyder.cmake b/spyder.cmake new file mode 100644 index 0000000..9dd566e --- /dev/null +++ b/spyder.cmake @@ -0,0 +1,57 @@ +# A MATLAB styled IDE for Python. +# +# Would be nice if this worked. However, it requires QtWebKit, which is currently broken. QtWebKit does not build cleanly and may require patches to Qt and/or PyQt. +# + + +message(FATAL_ERROR "Spyder does not currently work. Though it can build, it requires features from Qt and PyQt that are not currently supported. In particular, it needs to QtWebKit.") + + +if (NOT spyder_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + + +include (python) +include (pep8) +include (pyqt4) +include (sphinxcontrib-napoleon) # Nice Sphinx docs +include (nose) +include (rope) +include (pyflakes) +include (pygments) +include (pylint) +include (psutil) +include (ipython) + + +external_source (spyder + 2.2.5 + spyder-2.2.5.zip + 1c9aa650dae9f883616e917803f8a3be + https://bitbucket.org/spyder-ide/spyderlib/downloads/) + + +# Download and install spyder +message ("Installing ${spyder_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${spyder_NAME} + DEPENDS ${python_NAME} ${pep8_NAME} ${pyqt4_NAME} ${sphinxcontrib-napoleon} ${nose_NAME} ${rope_NAME} ${pyflakes_NAME} ${pygments_NAME} ${pylint_NAME} ${psutil_NAME} ${ipython_NAME} + PREFIX ${BUILDEM_DIR} + URL ${spyder_URL} + URL_MD5 ${spyder_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${spyder_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT spyder_NAME) \ No newline at end of file diff --git a/sqlite.cmake b/sqlite.cmake new file mode 100644 index 0000000..8629c07 --- /dev/null +++ b/sqlite.cmake @@ -0,0 +1,39 @@ +# Builds SQLite, which Python uses to implement the standard library module +# sqlite3 ( https://docs.python.org/2/library/sqlite3.html ). + +if (NOT sqlite_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (PatchSupport) + + +external_source (sqlite + 3.8.5 + sqlite-autoconf-3080500.tar.gz + 0544ef6d7afd8ca797935ccc2685a9ed + http://www.sqlite.org/2014/) + +message ("Installing ${sqlite_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${sqlite_NAME} + PREFIX ${BUILDEM_DIR} + URL ${sqlite_URL} + URL_MD5 ${sqlite_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${sqlite_SRC_DIR}/configure + --prefix=${BUILDEM_DIR} + LDFLAGS=${BUILDEM_LDFLAGS} + CPPFLAGS=-I${BUILDEM_DIR}/include + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install +) + +set_target_properties(${sqlite_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT sqlite_NAME) \ No newline at end of file diff --git a/statsmodels.cmake b/statsmodels.cmake new file mode 100644 index 0000000..0aa413f --- /dev/null +++ b/statsmodels.cmake @@ -0,0 +1,46 @@ +# A statistical analysis library that builds on pandas. +# +# Used in pandas place in the SciPy Stack as it requires pandas and extends in +# many ways. + + +if (NOT statsmodels_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (TemplateSupport) + +include (python) +include (cython) +include (nose) +include (numpy) +include (scipy) +include (matplotlib) +include (patsy) +include (pandas) + +external_git_repo(statsmodels + v0.5.0 #82e027e91cac47cfcfbcab754a244731cd726f06 + https://github.com/statsmodels/statsmodels) + +message ("Installing ${statsmodels_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${statsmodels_NAME} + DEPENDS ${python_NAME} ${cython_NAME} ${nose_NAME} ${numpy_NAME} ${scipy_NAME} ${matplotlib_NAME} ${patsy_NAME} ${pandas_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${statsmodels_URL} + GIT_TAG ${statsmodels_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${statsmodels_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT statsmodels_NAME) diff --git a/sympy.cmake b/sympy.cmake new file mode 100644 index 0000000..9505cae --- /dev/null +++ b/sympy.cmake @@ -0,0 +1,41 @@ +# Provides symbolic algebra support for Python. Part of the SciPy stack. + + +if (NOT sympy_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) +include (TemplateSupport) + +include (python) +include (cython) +include (gmpy) +include (numpy) +include (scipy) +include (ipython) + +external_git_repo(sympy + sympy-0.7.3 #f44c2c6afb1eaf5f1071b49bcd147e0d6197923a + https://github.com/sympy/sympy) + +message ("Installing ${sympy_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${sympy_NAME} + DEPENDS ${python_NAME} ${cython_NAME} ${gmpy_NAME} ${numpy_NAME} ${scipy_NAME} ${ipython_NAME} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${sympy_URL} + GIT_TAG ${sympy_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${sympy_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT sympy_NAME) diff --git a/templates/exec.template b/templates/exec.template new file mode 100755 index 0000000..994b717 --- /dev/null +++ b/templates/exec.template @@ -0,0 +1,11 @@ +#!/bin/bash + +export ILASTIK_PATH= + +# We assume that this script resides in BUILDEM_DIR. +export BUILDEM_DIR=$(cd `dirname $0`/.. && pwd) +echo "BUILDEM_DIR: $BUILDEM_DIR" +source $BUILDEM_DIR/bin/@SETENV_ILASTIK@.sh + +# No longer need this shell as we just wanted to set environment before executing the command. +exec $@ diff --git a/templates/setenv_ilastik_gui.in b/templates/setenv_ilastik_gui.in index 32375a0..e5a48fb 100644 --- a/templates/setenv_ilastik_gui.in +++ b/templates/setenv_ilastik_gui.in @@ -33,6 +33,8 @@ else export PYTHONPATH=$ILASTIK_PATH/lazyflow:$PYTHONPATH export PYTHONPATH=$ILASTIK_PATH/lazyflow/lazyflow/drtile:$PYTHONPATH export PYTHONPATH=$ILASTIK_PATH/volumina:$PYTHONPATH + + export PYTHONPATH=$BUILDEM_DIR/src/nanshe-git:$PYTHONPATH export PATH=$PYTHON_PREFIX/bin:$PATH export PATH=$BUILDEM_DIR/bin:$PATH diff --git a/templates/setenv_ilastik_headless.in b/templates/setenv_ilastik_headless.in index 481c696..9430644 100644 --- a/templates/setenv_ilastik_headless.in +++ b/templates/setenv_ilastik_headless.in @@ -26,6 +26,8 @@ else export PYTHONPATH=$ILASTIK_PATH/ilastik:$PYTHONPATH export PYTHONPATH=$ILASTIK_PATH/lazyflow:$PYTHONPATH export PYTHONPATH=$ILASTIK_PATH/lazyflow/lazyflow/drtile:$PYTHONPATH + + export PYTHONPATH=$BUILDEM_DIR/src/nanshe-git:$PYTHONPATH export PATH=$PYTHON_PREFIX/bin:$PATH export PATH=$BUILDEM_DIR/bin:$PATH diff --git a/thrift.cmake b/thrift.cmake index 509a786..845ad87 100644 --- a/thrift.cmake +++ b/thrift.cmake @@ -44,8 +44,8 @@ ExternalProject_Add(${thrift_NAME} --with-perl=no --with-ruby=no PY_PREFIX=${PYTHON_PREFIX} - LDFLAGS=${BUILDEM_LDFLAGS} - CPPFLAGS=-I${BUILDEM_DIR}/include + "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) BUILD_IN_SOURCE 1 INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install diff --git a/toolz.cmake b/toolz.cmake new file mode 100644 index 0000000..16c29c1 --- /dev/null +++ b/toolz.cmake @@ -0,0 +1,39 @@ +# +# Install toolz library from source +# + +if (NOT toolz_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) + +external_source (toolz + 0.7.1 + toolz-0.7.1.tar.gz + 550681a2819915c5724c7e8f22ab2334 + https://pypi.python.org/packages/source/t/toolz +) + +message ("Installing ${toolz_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${toolz_NAME} + DEPENDS ${python_NAME} + PREFIX ${BUILDEM_DIR} + URL ${toolz_URL} + URL_MD5 ${toolz_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install + BUILD_IN_SOURCE 1 + TEST_COMMAND "" + INSTALL_COMMAND "" +) + +set_target_properties(${toolz_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT toolz_NAME) diff --git a/tornado.cmake b/tornado.cmake new file mode 100644 index 0000000..aa1d766 --- /dev/null +++ b/tornado.cmake @@ -0,0 +1,39 @@ +# Web framework and asynchronous networking library (from their intro). +# Required by Matplotlib and iPython. + +if (NOT tornado_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +include (python) +include (backports-ssl_match_hostname) + + +external_git_repo(tornado + v3.1.1 # f36652d47fc42205c085ed65e740f4b155d4e5e4 + https://github.com/facebook/tornado) + + +# Download and install tornado +message ("Installing ${tornado_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") + +ExternalProject_Add(${tornado_NAME} + DEPENDS ${python_NAME} ${backports-ssl_match_hostname} + PREFIX ${BUILDEM_DIR} + GIT_REPOSITORY ${tornado_URL} + GIT_TAG ${tornado_TAG} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py build + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} ${PYTHON_EXE} setup.py install +) + +set_target_properties(${tornado_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT tornado_NAME) \ No newline at end of file diff --git a/vigra.cmake b/vigra.cmake index e48ae18..1e9e1db 100644 --- a/vigra.cmake +++ b/vigra.cmake @@ -49,6 +49,11 @@ else() set(VIGRA_UPDATE_COMMAND git fetch origin && git checkout ${VIGRA_VERSION}) endif() +set(VIGRA_CXX_FLAGS "") +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(VIGRA_CXX_FLAGS "-ftemplate-depth=1024") +endif() + message ("Installing ${vigra_NAME}/${VIGRA_VERSION} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${vigra_NAME} DEPENDS ${libjpeg_NAME} ${libtiff_NAME} ${libpng_NAME} ${openexr_NAME} ${libfftw_NAME} @@ -59,31 +64,31 @@ ExternalProject_Add(${vigra_NAME} #URL ${vigra_URL} #URL_MD5 ${vigra_MD5} UPDATE_COMMAND ${VIGRA_UPDATE_COMMAND} - PATCH_COMMAND "" + PATCH_COMMAND "" LIST_SEPARATOR ^^ CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${vigra_SRC_DIR} -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR} -DCMAKE_PREFIX_PATH=${BUILDEM_DIR} -DCMAKE_EXE_LINKER_FLAGS=${BUILDEM_LDFLAGS} -DDEPENDENCY_SEARCH_PREFIX=${BUILDEM_DIR} + -DBoost_INCLUDE_DIR=${BUILDEM_DIR}/include -DBoost_LIBRARY_DIRS=${BUILDEM_DIR}/lib # -DBoost_PYTHON_LIBRARY=${BUILDEM_DIR}/lib/libboost_python-mt.${BUILDEM_PLATFORM_DYLIB_EXTENSION} # -DBoost_PYTHON_LIBRARY_RELEASE=${BUILDEM_DIR}/lib/libboost_python-mt.${BUILDEM_PLATFORM_DYLIB_EXTENSION} # -DBoost_PYTHON_LIBRARY_DEBUG=${BUILDEM_DIR}/lib/libboost_python-mt.${BUILDEM_PLATFORM_DYLIB_EXTENSION} - # -DVIGRANUMPY_LIBRARIES=${BUILDEM_DIR}/lib/libpython2.7.${BUILDEM_PLATFORM_DYLIB_EXTENSION}^^${BUILDEM_DIR}/lib/libboost_python.${BUILDEM_PLATFORM_DYLIB_EXTENSION} + -DVIGRANUMPY_LIBRARIES=${PYTHON_PREFIX}/lib/libpython2.7.${BUILDEM_PLATFORM_DYLIB_EXTENSION}^^${BUILDEM_DIR}/lib/libboost_python.${BUILDEM_PLATFORM_DYLIB_EXTENSION}^^${BUILDEM_DIR}/lib/libboost_container.${BUILDEM_PLATFORM_DYLIB_EXTENSION} -DJPEG_INCLUDE_DIR=${BUILDEM_DIR}/include -DJPEG_LIBRARY=${BUILDEM_DIR}/lib/libjpeg.${BUILDEM_PLATFORM_DYLIB_EXTENSION} -DHDF5_CORE_LIBRARY=${BUILDEM_DIR}/lib/libhdf5.${BUILDEM_PLATFORM_DYLIB_EXTENSION} -DHDF5_HL_LIBRARY=${BUILDEM_DIR}/lib/libhdf5_hl.${BUILDEM_PLATFORM_DYLIB_EXTENSION} -DHDF5_INCLUDE_DIR=${BUILDEM_DIR}/include - -DFFTW3F_INCLUDE_DIR= + -DFFTW3F_INCLUDE_DIR=${BUILDEM_DIR}/include -DWITH_VIGRANUMPY=${WITH_VIGRANUMPY} - -DFFTW3F_LIBRARY= + -DFFTW3F_LIBRARY=${BUILDEM_DIR}/lib/libfftw3f.${BUILDEM_PLATFORM_DYLIB_EXTENSION} -DFFTW3_INCLUDE_DIR=${BUILDEM_DIR}/include -DFFTW3_LIBRARY=${BUILDEM_DIR}/lib/libfftw3.${BUILDEM_PLATFORM_DYLIB_EXTENSION} - -DCMAKE_CXX_FLAGS=-pthread - - -DCMAKE_CXX_LINK_FLAGS=-pthread + "-DCMAKE_CXX_FLAGS=-pthread ${VIGRA_CXX_FLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" + "-DCMAKE_CXX_LINK_FLAGS=-pthread ${BUILDEM_ADDITIONAL_CXX_FLAGS}" -DCMAKE_CXX_FLAGS_RELEASE=-O2\ -DNDEBUG # Some versions of gcc miscompile vigra at -O3 -DCMAKE_CXX_FLAGS_DEBUG="${CMAKE_CXX_FLAGS_DEBUG}" BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) diff --git a/vtk.cmake b/vtk.cmake index 864cecc..df090fa 100644 --- a/vtk.cmake +++ b/vtk.cmake @@ -81,6 +81,11 @@ ExternalProject_Add(${vtk_NAME} -DZLIB_INCLUDE_DIR=${BUILDEM_INCLUDE_DIR} -DZLIB_LIBRARY=${BUILDEM_LIB_DIR}/libz.${BUILDEM_PLATFORM_DYLIB_EXTENSION} + # XCode Tools 5.1 moving forward no longer supports garbage collection ( -fobjc-gc flag ). However, Mac, AFAIK + # still supports Manual and Automatic Reference Counting. According to VTK, version 6 will support automatic + # reference counting, but the version we are using does not. By setting VTK_REQUIRED_OBJCXX_FLAGS to "", manual + # reference counting is used by VTK, which should work on other Mac OS versions. + -DVTK_REQUIRED_OBJCXX_FLAGS="" # 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. diff --git a/zeromq.cmake b/zeromq.cmake new file mode 100644 index 0000000..c4cfbe1 --- /dev/null +++ b/zeromq.cmake @@ -0,0 +1,33 @@ +# A standard asynchronous message passing library. +# Required by pyzmq, which is used by iPython. + +if (NOT zeromq_NAME) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +include (ExternalProject) +include (ExternalSource) +include (BuildSupport) + +external_source (zeromq + 3.2.4 + zeromq-3.2.4.tar.gz + 39af2d41e3fb744b98d7999e291e05dc + http://download.zeromq.org/) + +message ("Installing ${zeromq_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") +ExternalProject_Add(${zeromq_NAME} + PREFIX ${BUILDEM_DIR} + URL ${zeromq_URL} + URL_MD5 ${zeromq_MD5} + UPDATE_COMMAND "" + PATCH_COMMAND "" + CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ./configure --prefix ${BUILDEM_DIR} + BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + BUILD_IN_SOURCE 1 + INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install +) + +set_target_properties(${zeromq_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) + +endif (NOT zeromq_NAME) \ No newline at end of file