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 dbe0ee6..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} 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/boost.cmake b/boost.cmake index 22e81b2..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,7 +43,7 @@ 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} BUILD_COMMAND ${BUILDEM_ENV_STRING} ./b2 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/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/dlib.cmake b/dlib.cmake index 7bb3c6e..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} 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/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 27602f5..32c9b8c 100644 --- a/gmp.cmake +++ b/gmp.cmake @@ -15,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} 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/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/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 719d400..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. @@ -124,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) @@ -136,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/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/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..4d34c4f 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,19 +16,26 @@ 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) + 1.4.2 + matplotlib-1.4.2.tar.gz + 7d22efb6cce475025733c50487bd8898 + http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.4.2) 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} 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 2fbe10a..50008dc 100644 --- a/mpfr.cmake +++ b/mpfr.cmake @@ -18,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} 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 68c7b95..28861ee 100644 --- a/nose.cmake +++ b/nose.cmake @@ -1,5 +1,6 @@ # # Install nose library from source. +# Dependency for iPython amongst other things. # if (NOT nose_NAME) 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 4fc2ce2..e680772 100644 --- a/openblas.cmake +++ b/openblas.cmake @@ -10,8 +10,7 @@ include (ExternalProject) include (ExternalSource) external_git_repo (openblas - #v0.2.8 - HEAD + 4d42368214f2fd102b2d163c086e0f2d8c166dc6 https://github.com/xianyi/OpenBLAS) message ("Installing ${openblas_NAME} into ilastik build area: ${BUILDEM_DIR} ...") @@ -23,15 +22,28 @@ ExternalProject_Add(${openblas_NAME} UPDATE_COMMAND "" PATCH_COMMAND "" CONFIGURE_COMMAND "" - # Added Sandybridge target. This is required for SandyBridge architecture. It also will optimize for Haswell architechture, which includes Clearwell. - BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) NO_AVX=1 NO_AFFINITY=1 TARGET=SANDYBRIDGE -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 - # Added Sandybridge target. This is required for SandyBridge architecture. It also will optimize for Haswell architechture, which includes Clearwell. - INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) PREFIX=${BUILDEM_DIR} TARGET=SANDYBRIDGE 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 7318eed..4fce495 100644 --- a/opencv.cmake +++ b/opencv.cmake @@ -12,34 +12,39 @@ 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/ + 2.4.8.3 + 2.4.8.3.tar.gz + a64feba01bd74c36ddf04d560d9cafd3 + https://github.com/Itseez/opencv/archive/ ) 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} 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} - -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} - 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/opengm.cmake b/opengm.cmake index b965fea..fe10245 100644 --- a/opengm.cmake +++ b/opengm.cmake @@ -11,17 +11,24 @@ 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} @@ -29,13 +36,20 @@ ExternalProject_Add(${opengm_NAME} 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} -DCMAKE_CXX_FLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} - -DWITH_CPLEX=ON + -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/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/python-fix-readline-bug.sh b/patches/python-fix-readline-bug.sh deleted file mode 100644 index d024a6b..0000000 --- a/patches/python-fix-readline-bug.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -mv $1/lib/python2.7/lib-dynload/readline.so $1/lib/python2.7/lib-dynload/readline.so.disabled \ No newline at end of file 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/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/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..890e932 100644 --- a/psutil.cmake +++ b/psutil.cmake @@ -13,10 +13,11 @@ include (BuildSupport) include (python) external_source (psutil - 0.6.1 - psutil-0.6.1.tar.gz - 3cfcbfb8525f6e4c70110e44a85e907e - http://psutil.googlecode.com/files) + 2.1.1 + psutil-2.1.1.tar.gz + 72a6b15d589fab11f6ca245b775bc3c6 + https://pypi.python.org/packages/source/p/psutil +) message ("Installing ${psutil_NAME} into FlyEM build area: ${BUILDEM_DIR} ...") ExternalProject_Add(${psutil_NAME} 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/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.cmake b/python.cmake index a8b01ca..a9ed885 100644 --- a/python.cmake +++ b/python.cmake @@ -16,6 +16,9 @@ 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 @@ -49,7 +52,7 @@ 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} @@ -65,19 +68,12 @@ ExternalProject_Add(${python_NAME} ${PYTHON_DEBUG_CONFIG_ARGS} "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}" "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}" - BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) + 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 ) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - ExternalProject_Add_Step(${python_NAME} ${python_NAME}-fix-readline-bug - COMMAND bash ${PATCH_DIR}/python-fix-readline-bug.sh ${PYTHON_PREFIX} - DEPENDEES install - ) -endif() - set (PYTHON_INCLUDE_PATH ${PYTHON_PREFIX}/include/python2.7) set (PYTHON_LIBRARY_FILE ${PYTHON_PREFIX}/lib/libpython2.7.${BUILDEM_PLATFORM_DYLIB_EXTENSION}) set (PYTHON_EXE ${PYTHON_PREFIX}/bin/python) 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/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..b0b21b9 --- /dev/null +++ b/shapely.cmake @@ -0,0 +1,44 @@ +# +# 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_source (shapely + 1.4.3 + Shapely-1.4.3.tar.gz + 0b152ead7004cb359a1d5430e0eb94ca + http://pypi.python.org/packages/source/S/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} + URL ${shapely_URL} + URL_MD5 ${shapely_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(${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..2456071 --- /dev/null +++ b/sima.cmake @@ -0,0 +1,54 @@ +# +# 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_source (sima + 0.3.1 + sima-0.3.1.tar.gz + 5910ea2c8c1bbcd7deb001ce64a5a9f4 + http://pypi.python.org/packages/source/s/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} + URL ${sima_URL} + URL_MD5 ${sima_MD5} + 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/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/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/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 4a8f918..31abfb9 100644 --- a/vigra.cmake +++ b/vigra.cmake @@ -64,18 +64,19 @@ 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} 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