Skip to content

Commit

Permalink
Merge pull request #1939 from Nerei/bugfix/install_rpath_for_pycaffe
Browse files Browse the repository at this point in the history
[cmake] fix install rpath for pycaffe
  • Loading branch information
shelhamer committed Feb 22, 2015
2 parents 682d9da + 5e06d16 commit cb1f4d6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
# QtCreator files
*.user

# PyCharm files
.idea

# OSX dir files
.DS_Store

Expand Down
5 changes: 5 additions & 0 deletions cmake/Misc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOLEAN "Use link paths for shared library rpath")
set(CMAKE_MACOSX_RPATH TRUE)

list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${CMAKE_INSTALL_PREFIX}/lib __is_systtem_dir)
if(${__is_systtem_dir} STREQUAL -1)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
endif()

# ---[ Funny target
if(UNIX OR APPLE)
add_custom_target(symlink_to_build COMMAND "ln" "-sf" "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/build"
Expand Down
6 changes: 4 additions & 2 deletions cmake/Summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,19 @@ function(caffe_print_configuration_summary)
caffe_status(" C++ compiler : ${CMAKE_CXX_COMPILER}")
caffe_status(" Release CXX flags : ${__flags_rel}")
caffe_status(" Debug CXX flags : ${__flags_deb}")
caffe_status(" BUILD_SHARED_LIBS : ${BUILD_SHARED_LIBS}")
caffe_status(" Build type : ${CMAKE_BUILD_TYPE}")
caffe_status("")
caffe_status(" BUILD_SHARED_LIBS : ${BUILD_SHARED_LIBS}")
caffe_status(" BUILD_python : ${BUILD_python}")
caffe_status(" BUILD_matlab : ${BUILD_matlab}")
caffe_status(" BUILD_docs : ${BUILD_docs}")
caffe_status(" CPU_ONLY : ${CPU_ONLY}")
caffe_status("")
caffe_status("Dependencies:")
caffe_status(" BLAS : " APPLE THEN "Yes (vecLib)" ELSE "Yes (${BLAS})")
caffe_status(" Boost : Yes (ver. ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION})")
caffe_status(" glog : Yes")
caffe_status(" gflags : Yes")
caffe_status(" gflags : Yes")
caffe_status(" protobuf : " PROTOBUF_FOUND THEN "Yes (ver. ${PROTOBUF_VERSION})" ELSE "No" )
caffe_status(" lmdb : " LMDB_FOUND THEN "Yes (ver. ${LMDB_VERSION})" ELSE "No")
caffe_status(" Snappy : " SNAPPY_FOUND THEN "Yes (ver. ${Snappy_VERSION})" ELSE "No" )
Expand Down
14 changes: 9 additions & 5 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if(NOT HAVE_PYTHON)
endif()

include_directories(${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
file(GLOB_RECURSE python_srcs ${PROJECT_SOURCE_DIR}/python/*.cpp)
file(GLOB_RECURSE python_srcs ${CMAKE_SOURCE_DIR}/python/*.cpp)

add_library(pycaffe SHARED ${python_srcs})
target_link_libraries(pycaffe ${Caffe_LINK} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES})
Expand All @@ -22,9 +22,13 @@ if(UNIX OR APPLE)
endif()

# ---[ Install
file(GLOB files *.py requirements.txt)
install(FILES ${files} DESTINATION python)
install(DIRECTORY caffe DESTINATION python)
install(TARGETS pycaffe DESTINATION python/caffe)
file(GLOB files1 *.py requirements.txt)
install(FILES ${files1} DESTINATION python)

file(GLOB files2 caffe/*.py)
install(FILES ${files2} DESTINATION python/caffe)
install(TARGETS pycaffe DESTINATION python/caffe)
install(DIRECTORY caffe/imagenet caffe/proto caffe/test DESTINATION python/caffe)



0 comments on commit cb1f4d6

Please sign in to comment.