Commit e63add65 authored by buildbot's avatar buildbot

Disable dynamic lookup on OS X as it's not needed and causing issues with packaging

parent 842f2243
......@@ -139,17 +139,6 @@ MACRO(ADD_NEKTAR_LIBRARY name component type)
SET_COMMON_PROPERTIES(${name})
# Set properties for building shared libraries
IF( ${type} STREQUAL "SHARED" )
# Properties specific to Mac OSX
IF( ${CMAKE_SYSTEM} MATCHES "Darwin-*")
# We allow undefined symbols to be looked up dynamically at runtime
# from the boost libraries linked by the executables.
SET_TARGET_PROPERTIES(${name}
PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup")
ENDIF( ${CMAKE_SYSTEM} MATCHES "Darwin-*")
ENDIF( ${type} STREQUAL "SHARED" )
INSTALL(TARGETS ${name}
EXPORT Nektar++Libraries
RUNTIME DESTINATION ${NEKTAR_BIN_DIR} COMPONENT ${component} OPTIONAL
......
......@@ -69,9 +69,6 @@ macro (add_nektar_package)
write_bin_files("${PKG_INSTALL_BINS}"
"${BUILD_DIR}/targets/install_bins.txt")
# Configure project for this package
configure_file(NektarPackage.cmake.in ${BUILD_DIR}/CMakeLists.txt @ONLY)
if(PKG_TYPE STREQUAL "deb")
set(PKG_GENERATOR "DEB")
elseif(PKG_TYPE STREQUAL "rpm")
......@@ -84,6 +81,9 @@ macro (add_nektar_package)
message(ERROR "Unknown package type: ${PKG_TYPE}")
endif()
# Configure project for this package
configure_file(NektarPackage.cmake.in ${BUILD_DIR}/CMakeLists.txt @ONLY)
add_custom_target(
pkg-${PKG_TYPE}-${PKG_NAME}
rm -f ${BUILD_DIR}/CPackConfig.cmake
......
......@@ -384,14 +384,17 @@ if (NEKTAR_BUILD_LIBRARY AND RPMBUILD)
endif()
if (NEKTAR_BUILD_LIBRARY AND PKGMAKER)
# Ship MPI too, because why not
if (NEKTAR_USE_MPI)
MESSAGE(WARNING "Shipping OS X with MPI is unlikely to work!")
FIND_PROGRAM(HAVE_MPIRUN mpirun)
IF(HAVE_MPIRUN)
LIST(APPEND nektar++_BINS ${HAVE_MPIRUN})
ENDIF()
UNSET(HAVE_MPIRUN CACHE)
endif ()
if (NEKTAR_USE_PETSC)
MESSAGE(WARNING "Shipping OS X with PETSc is unlikely to work!")
endif ()
add_nektar_package(
NAME nektar++
TYPE pkgmaker
......
......@@ -6,6 +6,7 @@ project("pkg-@PKG_NAME@")
set(CPACK_OUTPUT_FILE_PREFIX "../..")
# Package details
set(CPACK_GENERATOR "@PKG_GENERATOR@")
set(CPACK_PACKAGE_NAME "@PKG_NAME@")
set(CPACK_PACKAGE_VENDOR "Imperial College London")
set(CPACK_PACKAGE_CONTACT
......@@ -18,7 +19,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR "@NEKTAR_VERSION_MAJOR@")
set(CPACK_PACKAGE_VERSION_MINOR "@NEKTAR_VERSION_MINOR@")
set(CPACK_PACKAGE_VERSION_PATCH "@NEKTAR_VERSION_PATCH@")
if(CMAKE_GENERATOR STREQUAL "DEB")
if(CPACK_GENERATOR STREQUAL "DEB")
# Debian packages
execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
......@@ -38,7 +39,7 @@ if(CMAKE_GENERATOR STREQUAL "DEB")
if (INSTALL_BINS_FILES OR INSTALL_LIBS_FILES)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
endif ()
elseif(CMAKE_GENERATOR STREQUAL "RPM")
elseif(CPACK_GENERATOR STREQUAL "RPM")
execute_process(COMMAND rpm --eval %{_arch}
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
......@@ -53,10 +54,13 @@ elseif(CMAKE_GENERATOR STREQUAL "RPM")
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-1.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
elseif(CMAKE_GENERATOR STREQUAL "PackageMaker")
elseif(CPACK_GENERATOR STREQUAL "PackageMaker")
# OS X .pkg installer -- set install location
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr/local/nektar++")
set(CPACK_PACKAGING_INSTALL_PREFIX "/")
set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/nektar++")
# This is used as part of the identifier, so make it without spaces
set(CPACK_PACKAGE_VENDOR "imperial_college_london")
else()
endif()
......@@ -143,7 +147,7 @@ if(APPLE)
get_filename_component(reqname \${req} NAME)
set(libdest \${CMAKE_INSTALL_PREFIX}/lib/\${reqname})
set(changes \${changes} \"-change\" \"\${req}\" \"@executable_path/../lib/\${reqname}\")
set(changes_lib \${changes_lib} \"-change\" \"\${req}\" \"@rpath/../lib/\${reqname}\")
set(changes_lib \${changes_lib} \"-change\" \"\${req}\" \"@loader_path/../lib/\${reqname}\")
# Copy this library
if (NOT EXISTS \${libdest})
......@@ -163,7 +167,7 @@ if(APPLE)
endif()
endforeach()
# Second pass -- fix up library to use @rpath/../lib/libName.dylib
# Second pass -- fix up library to use @loader_path/../lib/libName.dylib
foreach(req \${prereqs})
set(searchname \${req})
......@@ -178,7 +182,7 @@ if(APPLE)
execute_process(COMMAND \${cmd} RESULT_VARIABLE install_name_tool_result)
# change library install name ID
execute_process(COMMAND install_name_tool -id @rpath/../lib/\${reqname} \${libdest})
execute_process(COMMAND install_name_tool -id @loader_path/../lib/\${reqname} \${libdest})
# change @loader_path (used by some boost libs through homebrew)
endforeach()
......
......@@ -8,18 +8,12 @@ MACRO(ADD_SOLVER_EXECUTABLE name component source)
SET_COMMON_PROPERTIES(${name})
TARGET_LINK_LIBRARIES(${name} SolverUtils)
IF( ${CMAKE_SYSTEM} MATCHES "Darwin-*")
SET_TARGET_PROPERTIES(${name}
PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup -Wl,-rpath,${CMAKE_INSTALL_PREFIX}/${LIB_DIR} -Wl,-rpath,${Boost_LIBRARY_DIRS}")
ENDIF( ${CMAKE_SYSTEM} MATCHES "Darwin-*")
SET_PROPERTY(TARGET ${name} PROPERTY FOLDER ${component})
INSTALL(TARGETS ${name}
RUNTIME DESTINATION ${NEKTAR_BIN_DIR} COMPONENT ${component} OPTIONAL)
INSTALL(TARGETS ${name}
RUNTIME DESTINATION ${NEKTAR_BIN_DIR} COMPONENT ${component} OPTIONAL)
ENDMACRO(ADD_SOLVER_EXECUTABLE name component source)
......
......@@ -6,11 +6,7 @@ MACRO(ADD_UTILITIES_EXECUTABLE name component source)
TARGET_LINK_LIBRARIES(${name} SolverUtils)
IF( ${CMAKE_SYSTEM} MATCHES "Darwin-*")
SET_TARGET_PROPERTIES(${name}
PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup -Wl,-rpath,${CMAKE_INSTALL_PREFIX}/${LIB_DIR} -Wl,-rpath,${Boost_LIBRARY_DIRS}")
ENDIF( ${CMAKE_SYSTEM} MATCHES "Darwin-*")
SET_PROPERTY(TARGET ${name} PROPERTY FOLDER ${component})
SET_PROPERTY(TARGET ${name} PROPERTY FOLDER ${component})
INSTALL(TARGETS ${name}
RUNTIME DESTINATION ${NEKTAR_BIN_DIR} COMPONENT ${component})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment