From 55540e9f351aa253d2522ff66ba43f4cc688b758 Mon Sep 17 00:00:00 2001 From: John Kelley Date: Tue, 21 Feb 2017 14:13:28 -0600 Subject: [PATCH 1/8] MacOS needs libc++ for std::terminate(). Make sure config.h is installed with the other include files. --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d43e74..8eba26d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,10 +96,15 @@ SET_TARGET_PROPERTIES(photospline PROPERTIES ) INSTALL (TARGETS photospline LIBRARY DESTINATION lib) FOREACH(header ${core_HEADERS}) - FILE(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/include ${header}) + IF (${header} MATCHES "${CMAKE_BINARY_DIR}/.*") + FILE(RELATIVE_PATH relpath ${CMAKE_BINARY_DIR}/include ${header}) + ELSE() + FILE(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/include ${header}) + ENDIF (${header} MATCHES "${CMAKE_BINARY_DIR}/.*") GET_FILENAME_COMPONENT(dir ${relpath} DIRECTORY) INSTALL(FILES ${header} DESTINATION ${PHOTOSPLINE_INCDIR}/${dir}) endforeach(header ${core_HEADERS}) + SET (PHOTOSPLINE_LDFLAGS "-L${PHOTOSPLINE_LIBDIR} -lphotospline") SET (PHOTOSPLINE_LDFLAGS ${PHOTOSPLINE_LDFLAGS} @@ -164,6 +169,8 @@ IF (BUILD_SPGLAM) ) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") LIST (APPEND fitter_LINK_LIBRARIES pthread rt) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + LIST (APPEND fitter_LINK_LIBRARIES c++) endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") SET_TARGET_PROPERTIES(spglam PROPERTIES From 488556b68e25f5a7fb2e4dd13290d7abb94495f0 Mon Sep 17 00:00:00 2001 From: John Kelley Date: Tue, 21 Feb 2017 15:54:57 -0600 Subject: [PATCH 2/8] Python bindings apparently need SuiteSparse --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8eba26d..aaea0ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,7 +207,7 @@ ENDIF() # Python interface -IF(PYTHON_FOUND) +IF(PYTHON_FOUND AND SUITESPARSE_FOUND) MESSAGE("-- Will build the python module") LIST (APPEND python_SOURCES @@ -249,9 +249,8 @@ IF(PYTHON_FOUND) OUTPUT_STRIP_TRAILING_WHITESPACE) INSTALL(TARGETS pyphotospline LIBRARY DESTINATION ${PYTHON_MODULE_DIR}) ELSEIF(NOT PYTHON_FOUND) - MESSAGE("-- Python not found, skipping build of python module") -ENDIF(PYTHON_FOUND) - + MESSAGE("-- Python or SuiteSparse not found, skipping build of python module") +ENDIF(PYTHON_FOUND AND SUITESPARSE_FOUND) # ----------------------------------------------------------------------------- # Create a script for configuring the user environment From 10a5fd7de1fcd8a04795c704c86980ef9c3e1fe9 Mon Sep 17 00:00:00 2001 From: John Kelley Date: Fri, 3 Mar 2017 15:03:02 -0600 Subject: [PATCH 3/8] Add is_supported helper function --- include/photospline/splinetable.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/photospline/splinetable.h b/include/photospline/splinetable.h index 7b0e807..603021c 100644 --- a/include/photospline/splinetable.h +++ b/include/photospline/splinetable.h @@ -388,6 +388,15 @@ class splinetable{ assert(dim= lower_extent(i)); + supported &= (x[i] <= upper_extent(i)); + } + return supported; + } ///Get the period of the spline in a given dimension double get_period(uint32_t dim) const{ assert(dim Date: Wed, 31 May 2017 10:56:01 -0500 Subject: [PATCH 4/8] Cleanup after merge --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 415b5b7..cb240bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,8 +135,9 @@ IF (BUILD_SPGLAM) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries(spglam PUBLIC pthread rt) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - target_link_libraries(spglam PUBLIC pthread c++) +# Test if this is still necessary +# elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +# target_link_libraries(spglam PUBLIC c++) endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Assume that if TBB can be found, we need to link # against it to use SuiteSparse @@ -163,7 +164,7 @@ ENDIF() # Python interface -IF(PYTHON_FOUND AND SUITESPARSE_FOUND) +IF(PYTHON_FOUND) MESSAGE("-- Will build the python module") LIST (APPEND python_SOURCES From c7f881ce1045543b05c77820a8b122124131fb04 Mon Sep 17 00:00:00 2001 From: John Kelley Date: Wed, 31 May 2017 10:57:06 -0500 Subject: [PATCH 5/8] libc++ still needed for MacOS --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb240bf..332b246 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,9 +135,8 @@ IF (BUILD_SPGLAM) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries(spglam PUBLIC pthread rt) -# Test if this is still necessary -# elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -# target_link_libraries(spglam PUBLIC c++) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + target_link_libraries(spglam PUBLIC c++) endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Assume that if TBB can be found, we need to link # against it to use SuiteSparse From f8cde472f160093c9de4ef74aa16cca35c07562a Mon Sep 17 00:00:00 2001 From: John Kelley Date: Wed, 14 Jun 2017 14:55:27 -0500 Subject: [PATCH 6/8] Remove AVX flag --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 332b246..035aadf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ target_compile_features (photospline ) target_compile_options (photospline PUBLIC -O3) IF (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86_64)$") - target_compile_options (photospline PUBLIC -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mavx -march=native) + target_compile_options (photospline PUBLIC -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -march=native) ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") target_compile_options (photospline PUBLIC -maltivec) ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc") From 52220d75844d6ff88647053a1b83d614bc6f6543 Mon Sep 17 00:00:00 2001 From: John Kelley Date: Wed, 14 Jun 2017 16:28:44 -0500 Subject: [PATCH 7/8] Revert to SSE2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 035aadf..1058dfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ target_compile_features (photospline ) target_compile_options (photospline PUBLIC -O3) IF (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86_64)$") - target_compile_options (photospline PUBLIC -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -march=native) + target_compile_options (photospline PUBLIC -msse2 -march=native) ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") target_compile_options (photospline PUBLIC -maltivec) ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc") From f6836c7ffc00a41277ce426f3e5d2a2e6d83e57a Mon Sep 17 00:00:00 2001 From: John Kelley Date: Wed, 14 Jun 2017 16:42:06 -0500 Subject: [PATCH 8/8] Remove -march=native and add -mfpmath=sse --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1058dfe..37d5682 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ target_compile_features (photospline ) target_compile_options (photospline PUBLIC -O3) IF (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86_64)$") - target_compile_options (photospline PUBLIC -msse2 -march=native) + target_compile_options (photospline PUBLIC -msse2 -mfpmath=sse) ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") target_compile_options (photospline PUBLIC -maltivec) ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")