Commit f2122957 authored by Dave Moxey's avatar Dave Moxey
Browse files

Updates to fix OS X component packaging

parent 694bcaf2
......@@ -339,8 +339,8 @@ INSTALL(DIRECTORY ${TPDIST}/lib/
COMPONENT ThirdParty
)
IF(NEKTAR_BUILD_PACKAGES)
include(NektarPackageGenerator)
ENDIF(NEKTAR_BUILD_PACKAGES)
ADD_SUBDIRECTORY(docs)
IF(NEKTAR_BUILD_PACKAGES)
ADD_SUBDIRECTORY(pkg2)
ENDIF(NEKTAR_BUILD_PACKAGES)
\ No newline at end of file
......@@ -19,6 +19,7 @@ IF( NEKTAR_USE_MPI )
CHECK_INCLUDE_FILES (mpi.h HAVE_MPI_H)
CHECK_FUNCTION_EXISTS(MPI_Send HAVE_MPI_SEND)
SET(BUILD_MPI OFF)
SET(MPI_BUILTIN OFF CACHE INTERNAL
"Determines whether MPI is built into the compiler")
IF (NOT "${HAVE_MPI_H}" OR NOT "${HAVE_MPI_SEND}")
......@@ -27,7 +28,12 @@ IF( NEKTAR_USE_MPI )
MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY)
MARK_AS_ADVANCED(file_cmd)
INCLUDE_DIRECTORIES( ${MPI_INCLUDE_PATH} )
MESSAGE(STATUS "Found MPI: ${MPI_LIBRARY}")
IF (NOT MPI_CXX_FOUND OR NOT MPI_C_FOUND)
SET(BUILD_MPI ON)
ELSE()
MESSAGE(STATUS "Found MPI: ${MPI_LIBRARY}")
ENDIF()
ELSE()
SET(MPI_BUILTIN ON)
MESSAGE(STATUS "Found MPI: built in")
......@@ -49,6 +55,23 @@ IF( NEKTAR_USE_MPI )
ADD_DEFINITIONS(-DNEKTAR_USE_MPI)
IF (BUILD_MPI)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
mpich-3.2
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~dmoxey/mpich-3.2.tar.gz
URL_MD5 f414cfa77099cd1fa1a5ae4e22db508a
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/mpich-3.2
BINARY_DIR ${TPBUILD}/mpich-3.2
TMP_DIR ${TPBUILD}/mpich-3.2
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ./configure --prefix=${TPDIST} --disable-f77 --disable-fc --disable-mpe
)
ENDIF()
IF (THIRDPARTY_BUILD_GSMPI)
EXTERNALPROJECT_ADD(
gsmpi-1.2
......
ADD_NEKTAR_EXECUTABLE(ProjectLoc1D
COMPONENT extra-demos DEPENDS MultiRegions SOURCES ProjectLoc1D.cpp)
COMPONENT demos-extra DEPENDS MultiRegions SOURCES ProjectLoc1D.cpp)
ADD_NEKTAR_EXECUTABLE(ProjectLoc2D
COMPONENT extra-demos DEPENDS MultiRegions SOURCES ProjectLoc2D.cpp)
COMPONENT demos-extra DEPENDS MultiRegions SOURCES ProjectLoc2D.cpp)
ADD_NEKTAR_EXECUTABLE(ProjectLoc3D
COMPONENT extra-demos DEPENDS MultiRegions SOURCES ProjectLoc3D.cpp)
COMPONENT demos-extra DEPENDS MultiRegions SOURCES ProjectLoc3D.cpp)
ADD_NEKTAR_EXECUTABLE(ProjectCont1D
COMPONENT extra-demos DEPENDS MultiRegions SOURCES ProjectCont1D.cpp)
COMPONENT demos-extra DEPENDS MultiRegions SOURCES ProjectCont1D.cpp)
ADD_NEKTAR_EXECUTABLE(ProjectCont2D
COMPONENT extra-demos DEPENDS MultiRegions SOURCES ProjectCont2D.cpp)
COMPONENT demos-extra DEPENDS MultiRegions SOURCES ProjectCont2D.cpp)
ADD_NEKTAR_EXECUTABLE(ProjectCont3D
COMPONENT extra-demos DEPENDS MultiRegions SOURCES ProjectCont3D.cpp)
COMPONENT demos-extra DEPENDS MultiRegions SOURCES ProjectCont3D.cpp)
ADD_NEKTAR_EXECUTABLE(ProjectContField3D
COMPONENT extra-demos DEPENDS MultiRegions SOURCES ProjectContField3D.cpp)
COMPONENT demos-extra DEPENDS MultiRegions SOURCES ProjectContField3D.cpp)
ADD_NEKTAR_EXECUTABLE(SteadyLinearAdvectionReaction2D
COMPONENT extra-demos DEPENDS MultiRegions SOURCES SteadyLinearAdvectionReaction2D.cpp)
COMPONENT demos-extra DEPENDS MultiRegions SOURCES SteadyLinearAdvectionReaction2D.cpp)
ADD_NEKTAR_EXECUTABLE(PostProcessing
COMPONENT extra-demos DEPENDS MultiRegions SOURCES PostProcessing.cpp)
COMPONENT demos-extra DEPENDS MultiRegions SOURCES PostProcessing.cpp)
ADD_NEKTAR_TEST(ProjectionCont2D_P7)
IF (NEKTAR_USE_MPI)
......
SET(UnitTestSources
main.cpp
ScaledMatrixUnitTests.cpp
......@@ -20,26 +19,12 @@ SET(UnitTestSources
util.cpp
)
SET(UnitTestHeaders
CountedObject.h
testLinearSystem.h
testNekLinAlgAlgorithms.h
testNekManager.h
testNekPoint.h
testNekSharedArray.h
Memory/TestNekMemoryManager.h
StdRegions/testStdSegExp.h
testFoundation/testFoundation.h
testFoundation/testInterpolation.h
testFoundation/testDerivation.h
util.h
)
ADD_DEFINITIONS(-DENABLE_NEKTAR_EXCEPTIONS -DNEKTAR_UNIT_TESTS)
ADD_NEKTAR_EXECUTABLE(UnitTests unit-test UnitTestSources UnitTestHeaders)
TARGET_LINK_LIBRARIES(UnitTests LibUtilities StdRegions)
ADD_NEKTAR_EXECUTABLE(UnitTests
COMPONENT unit-test DEPENDS StdRegions SOURCES ${UnitTestSources})
ADD_TEST(NAME UnitTests COMMAND UnitTests --detect_memory_leaks=0)
SUBDIRS(LibUtilities LocalRegions Collections)
FINALISE_CPACK_COMPONENT(unit-test DESCRIPTION "Nektar++ unit tests")
SET(Sources
SET(CollectionsUnitTestsSources
main.cpp
TestHexCollection.cpp
TestQuadCollection.cpp
......@@ -8,15 +8,7 @@ SET(Sources
TestTriCollection.cpp
)
SET(Headers
)
ADD_DEFINITIONS(-DENABLE_NEKTAR_EXCEPTIONS)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
SET(ProjectName CollectionsUnitTests)
ADD_NEKTAR_EXECUTABLE(${ProjectName} unit-test Sources Headers)
TARGET_LINK_LIBRARIES(${ProjectName} Collections)
ADD_TEST(NAME Collections COMMAND ${ProjectName} --detect_memory_leaks=0)
ADD_NEKTAR_EXECUTABLE(CollectionsUnitTests
COMPONENT unit-test DEPENDS Collections SOURCES ${CollectionsUnitTestsSources})
ADD_TEST(NAME CollectionsUnitTests COMMAND CollectionsUnitTests --detect_memory_leaks=0)
SET(PrecompiledHeaderSources
SET(LibUtilitiesUnitTestSources
TestConsistentObjectAccess.cpp
TestLowerTriangularMatrix.cpp
TestMatrixStoragePolicies.cpp
......@@ -8,6 +7,7 @@ SET(PrecompiledHeaderSources
TestRawType.cpp
TestUpperTriangularMatrix.cpp
TestSharedArray.cpp
main.cpp
../util.cpp
)
......@@ -19,15 +19,10 @@ SET(UnitTestHeaders
)
ADD_DEFINITIONS(-DENABLE_NEKTAR_EXCEPTIONS)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ADD_NEKTAR_EXECUTABLE(LibUtilitiesUnitTests unit-test UnitTestSources UnitTestHeaders)
TARGET_LINK_LIBRARIES(LibUtilitiesUnitTests LibUtilities)
#SET(PrecompiledHeaderName LibUtilitiesUnitTestsPrecompiledHeader.h)
#SETUP_PRECOMPILED_HEADERS(PrecompiledHeaderSources PrecompiledHeaderName)
ADD_NEKTAR_EXECUTABLE(LibUtilitiesUnitTests
COMPONENT unit-test DEPENDS LibUtilities SOURCES ${LibUtilitiesUnitTestSources})
ADD_TEST(NAME LibUtilitiesUnitTests COMMAND LibUtilitiesUnitTests --detect_memory_leaks=0)
ADD_TEST(NAME LibUtilities COMMAND LibUtilitiesUnitTests --detect_memory_leaks=0)
SUBDIRS(LinearAlgebra)
IF( NEKTAR_USE_EXPRESSION_TEMPLATES )
......
SET(TARGET_NAME ExpressionTemplateUnitTests)
SET(Sources
SET(ExpressionTemplatesUnitTestsSources
ExpressionTemplateObjects.cpp
main.cpp
TestAliasing.cpp
......@@ -27,16 +24,7 @@ SET(Sources
../../util.cpp
)
SET(Headers
CountedObjectExpression.h
ExpressionTemplateObjects.h
../../util.h
)
ADD_DEFINITIONS(-DENABLE_NEKTAR_EXCEPTIONS -DNEKTAR_UNIT_TESTS)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ADD_NEKTAR_EXECUTABLE(${TARGET_NAME} unit-test Sources Headers)
TARGET_LINK_LIBRARIES(${TARGET_NAME} LibUtilities)
ADD_TEST(NAME ExpressionTemplates COMMAND ${TARGET_NAME} --detect_memory_leaks=0)
ADD_NEKTAR_EXECUTABLE(ExpressionTemplatesUnitTests
COMPONENT unit-test DEPENDS LibUtilities SOURCES ${ExpressionTemplatesUnitTestsSources})
ADD_TEST(NAME ExpressionTemplatesUnitTests COMMAND ExpressionTemplatesUnitTests --detect_memory_leaks=0)
SET(TARGET_NAME LinearAlgebraUnitTests)
SET(Sources
SET(LinearAlgebraUnitTestsSources
main.cpp
TestBandedMatrixOperations.cpp
TestBandedMatrixStoragePolicy.cpp
......@@ -23,14 +20,7 @@ SET(Sources
../../util.cpp
)
SET(Headers
TestCombinationRunner.h
../../util.h
)
ADD_DEFINITIONS(-DENABLE_NEKTAR_EXCEPTIONS)
ADD_NEKTAR_EXECUTABLE(${TARGET_NAME} unit-test Sources Headers)
TARGET_LINK_LIBRARIES(${TARGET_NAME} LibUtilities)
#ADD_TEST(NAME LinearAlgebra COMMAND ${TARGET_NAME} --detect_memory_leaks=0)
ADD_NEKTAR_EXECUTABLE(LinearAlgebraUnitTests
COMPONENT unit-test DEPENDS LibUtilities SOURCES ${LinearAlgebraUnitTestsSources})
ADD_TEST(NAME LinearAlgebraUnitTests COMMAND LinearAlgebraUnitTests --detect_memory_leaks=0)
SET(Sources
SET(LocalRegionsUnitTestsSources
main.cpp
TestGetCoords.cpp
)
SET(Headers
)
ADD_DEFINITIONS(-DENABLE_NEKTAR_EXCEPTIONS)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
SET(ProjectName LocalRegionsUnitTests)
ADD_NEKTAR_EXECUTABLE(${ProjectName} unit-test Sources Headers)
TARGET_LINK_LIBRARIES(${ProjectName} LocalRegions)
ADD_TEST(NAME LocalRegions COMMAND ${ProjectName} --detect_memory_leaks=0)
ADD_NEKTAR_EXECUTABLE(LocalRegionsUnitTests
COMPONENT unit-test DEPENDS LocalRegions SOURCES ${LocalRegionsUnitTestsSources})
ADD_TEST(NAME LocalRegionsUnitTests COMMAND LocalRegionsUnitTests --detect_memory_leaks=0)
......@@ -23,8 +23,6 @@ set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
set(CPACK_RPM_PACKAGE_DEBUG 0)
set(CPACK_PACKAGEMAKER_COMPONENT_INSTALL 0)
# Set up generator-specific logic (i.e. that may change the above depending on
# generator) using additional CPack configuration file.
configure_file(${CMAKE_SOURCE_DIR}/cmake/NektarCPackConfig.cmake.in
......@@ -63,7 +61,8 @@ if(APPLE)
install(CODE "
include(GetPrerequisites)
include(BundleUtilities)
file(GLOB apps \${CMAKE_INSTALL_PREFIX}/bin/*)
file(GLOB apps \"\${CMAKE_INSTALL_PREFIX}/bin/*\")
message(STATUS \"APPLIST: \${CMAKE_INSTALL_PREFIX}/bin/*\")
foreach (app \${apps})
get_filename_component(exepath \${app} DIRECTORY)
get_prerequisites(\"\${app}\" prereqs 1 1 \"\${exepath}\" \"\" \"\" 1)
......@@ -76,17 +75,19 @@ if(APPLE)
# at every library.
unset(changes)
unset(changes_lib)
# Check if thirdparty component has been set up yet
foreach(req \${prereqs})
message(STATUS \"asdf: \${req}\")
get_filename_component(reqname \${req} NAME)
set(libdest \${CMAKE_INSTALL_PREFIX}/lib/nektar++-4.3.0/\${reqname})
set(changes \${changes} \"-change\" \"\${req}\" \"@executable_path/../lib/nektar++-4.3.0/\${reqname}\")
set(changes_lib \${changes_lib} \"-change\" \"\${req}\" \"@loader_path/../lib/nektar++-4.3.0/\${reqname}\")
set(libdest \${CMAKE_INSTALL_PREFIX}/lib/nektar++-${NEKTAR_VERSION}/\${reqname})
set(changes \${changes} \"-change\" \"\${req}\" \"@executable_path/../lib/nektar++-${NEKTAR_VERSION}/\${reqname}\")
set(changes_lib \${changes_lib} \"-change\" \"\${req}\" \"@loader_path/../lib/nektar++-${NEKTAR_VERSION}/\${reqname}\")
# Copy this library
if (NOT EXISTS \${libdest})
file(COPY \${req}
DESTINATION \${CMAKE_INSTALL_PREFIX}/lib/nektar++-4.3.0
DESTINATION \${CMAKE_INSTALL_PREFIX}/lib/nektar++-${NEKTAR_VERSION}
FILE_PERMISSIONS OWNER_WRITE OWNER_READ)
# If the library was symlinked, we follow the symlink and then
......@@ -95,13 +96,13 @@ if(APPLE)
# resolve symlink
get_filename_component(req_abs \${req} REALPATH)
file(COPY \${req_abs}
DESTINATION \${CMAKE_INSTALL_PREFIX}/lib/nektar++-4.3.0
DESTINATION \${CMAKE_INSTALL_PREFIX}/lib/nektar++-${NEKTAR_VERSION}
FILE_PERMISSIONS OWNER_WRITE OWNER_READ)
endif()
endif()
endforeach()
# Second pass -- fix up library to use @loader_path/../lib/nektar++-4.3.0/libName.dylib
# Second pass -- fix up library to use @loader_path/../lib/nektar++-${NEKTAR_VERSION}/libName.dylib
foreach(req \${prereqs})
set(searchname \${req})
......@@ -111,12 +112,12 @@ if(APPLE)
endif()
get_filename_component(reqname \${req} NAME)
set(libdest \${CMAKE_INSTALL_PREFIX}/lib/nektar++-4.3.0/\${reqname})
set(libdest \${CMAKE_INSTALL_PREFIX}/lib/nektar++-${NEKTAR_VERSION}/\${reqname})
set(cmd install_name_tool \${changes_lib} \"\${libdest}\")
execute_process(COMMAND \${cmd} RESULT_VARIABLE install_name_tool_result)
# change library install name ID
execute_process(COMMAND install_name_tool -id @loader_path/../lib/nektar++-4.3.0/\${reqname} \${libdest})
execute_process(COMMAND install_name_tool -id @loader_path/../lib/nektar++-${NEKTAR_VERSION}/\${reqname} \${libdest})
# change @loader_path (used by some boost libs through homebrew)
endforeach()
......@@ -140,7 +141,6 @@ if(APPLE)
endforeach()
set(rpath_changes \${rpath_changes} -add_rpath @executable_path)
execute_process(COMMAND install_name_tool \${rpath_changes} \"\${app}\")
endforeach()
" COMPONENT ${component})
endforeach()" COMPONENT ${component})
endforeach()
endif()
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