Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS linking fix, helper function #4

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 -mfpmath=sse)
ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
target_compile_options (photospline PUBLIC -maltivec)
ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
Expand Down Expand Up @@ -135,6 +135,8 @@ 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 c++)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Assume that if TBB can be found, we need to link
# against it to use SuiteSparse
Expand Down
9 changes: 9 additions & 0 deletions include/photospline/splinetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,15 @@ class splinetable{
assert(dim<ndim);
return(extents[dim][1]);
}
///Check if a given n-dimensional point is supported by the spline
bool is_supported(double *x) const{
bool supported = true;
for (uint32_t i=0; i < ndim; i++) {
supported &= (x[i] >= 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<ndim);
Expand Down