Skip to content

Commit

Permalink
fixed header definitons to include complex macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke-Pratley committed Jul 18, 2018
2 parents 8921767 + e3f35dd commit 20d1203
Show file tree
Hide file tree
Showing 354 changed files with 37,053 additions and 26,325 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*.mexa64
*.mexmaci64
*~
*pys2let.c
*.idea/

core
vgcore.*
*.dat
220 changes: 65 additions & 155 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,155 +1,65 @@
#------------------

cmake_minimum_required(VERSION 2.6)

INCLUDE (CheckLibraryExists)

# http://www.cmake.org/Wiki/CMake:How_To_Write_Platform_Checks
# http://www.cmake.org/cmake/help/cmake2.6docs.html

project(s2let)
enable_language(C)
enable_language(Fortran)

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_LIST_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_LIST_DIR}/lib)

#------------------
# Dependencies
#------------------

# FFTW
link_directories($ENV{FFTW}/lib)

# SSHT
include_directories($ENV{SSHT}/include/c)
link_directories($ENV{SSHT}/lib/c)

# CFITSIO
find_path(CFITSIO_INCLUDE_DIR fitsio.h
PATH_SUFFIXES libcfitsio3 libcfitsio0 cfitsio
PATHS
$ENV{CFITSIO}/include
)
find_library(CFITSIO_LIB NAMES cfitsio
PATHS
$ENV{CFITSIO}/lib
)
if(CFITSIO_INCLUDE_DIR AND CFITSIO_LIB)
set(CFITSIO_FOUND TRUE)
else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
set(CFITSIO_FOUND FALSE)
endif(CFITSIO_INCLUDE_DIR AND CFITSIO_LIB)
# Link if found
if (CFITSIO_FOUND)
include_directories($ENV{CFITSIO}/include)
link_directories($ENV{CFITSIO}/lib)
endif (CFITSIO_FOUND)

# HEALPIX
find_library(HEALPIX_LIB NAMES healpix
PATHS
$ENV{HEALPIX}/lib
)
if(HEALPIX_LIB)
set(HEALPIX_FOUND TRUE)
else (HEALPIX_LIB)
set(HEALPIX_FOUND FALSE)
endif(HEALPIX_LIB)
# Link if found
if (HEALPIX_FOUND)
include_directories($ENV{HEALPIX}/include)
link_directories($ENV{HEALPIX}/lib)
endif (HEALPIX_FOUND)

#------------------
# Compiler flags : custom if needed
#------------------

# get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
# Wall -O3 -g -fopenmp")
# if (Fortran_COMPILER_NAME STREQUAL "gfortran")
# #elseif (Fortran_COMPILER_NAME STREQUAL "ifort")
# set(CMAKE_Fortran_FLAGS "-TODO")
#elseif (Fortran_COMPILER_NAME STREQUAL "g77")
# set(CMAKE_Fortran_FLAGS "-TODO")
#else (Fortran_COMPILER_NAME STREQUAL "gfortran")
# set(CMAKE_Fortran_FLAGS "-TODO")
#endif (Fortran_COMPILER_NAME STREQUAL "gfortran")

#------------------
# Standard configuration, main library
#------------------

set(LIBS_C "-lfftw3 -lssht")
set(LIBTAG_C "-L${LIBRARY_OUTPUT_PATH} -ls2let -lm -lc")
message("Library output :" ${LIBRARY_OUTPUT_PATH})

# Standard library
set(C_SRC "src/main/c/s2let_axisym_lm.c" "src/main/c/s2let_axisym_mw.c" "src/main/c/s2let_idl_mw.c" "src/main/c/s2let_math.c" "src/main/c/s2let_mw.c" "src/main/c/s2let_tiling.c")

# Test executables
set(C_TESTEXE "src/test/c/s2let_test.c")

# Main executables
set(C_EXE "src/main/c/s2let_denoising_demo.c")

#------------------
# CFITS and HEALPIX options
#------------------

# Additional files if CFITSIO is present
if (CFITSIO_FOUND)
message("CFITSIO library was found")
set(C_SRC ${C_SRC} "src/main/c/s2let_fits.c")
set(LIBS_C ${LIBS_C} "-lcfitsio")
set(C_EXE ${C_EXE} "src/main/c/s2let_axisym_mw_analysis_real.c")
set(C_EXE ${C_EXE} "src/main/c/s2let_axisym_mw_synthesis_real.c")
endif (CFITSIO_FOUND)

# Additional files if HEALPIX is present
if (HEALPIX_FOUND)
message("HEALPIX library was found")
set(CMAKE_Fortran_COMPILER_INIT gfortran)
set(CMAKE_Fortran_FLAGS "-O3 -ffree-form -lgfortran -DGFORTRAN -fno-second-underscore -fopenmp")
message("Setting F90 compilation flags as: ${CMAKE_Fortran_FLAGS}")
set(C_SRC ${C_SRC} "src/main/f90/s2let_hpx.f90" "src/main/c/s2let_hpx.c" "src/main/c/s2let_axisym_hpx.c" "src/main/c/s2let_idl_hpx.c")
set(LIBS_C ${LIBS_C} "-lgfortran -fopenmp -lhealpix")
set(C_EXE ${C_EXE} "src/main/c/s2let_hpx_demo.c")
set(C_EXE ${C_EXE} "src/main/c/s2let_axisym_hpx_analysis_real.c")
set(C_EXE ${C_EXE} "src/main/c/s2let_axisym_hpx_synthesis_real.c")
set(C_TESTEXE ${C_TESTEXE} "src/test/c/s2let_hpx_test.c")
endif (HEALPIX_FOUND)

# Create library
include_directories(${CMAKE_CURRENT_LIST_DIR}/include)
add_library(s2let ${C_SRC})

#------------------
# Config test executables
#------------------

set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
foreach (p ${C_TESTEXE})
get_filename_component(q ${p} NAME_WE)
message( "Executable : ${q} " )
add_executable (${q} ${p})
add_dependencies(${q} s2let)
target_link_libraries(${q} ${LIBTAG_C} ${LIBS_C})
add_test (${q} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${q})
endforeach (p)

enable_testing()

#------------------
# Config main executables
#------------------
foreach (p ${C_EXE})
get_filename_component(q ${p} NAME_WE)
message( "Executable : ${q} " )
add_executable (${q} ${p})
add_dependencies(${q} s2let)
target_link_libraries(${q} ${LIBTAG_C} ${LIBS_C})
endforeach (p)

#------------------
cmake_minimum_required(VERSION 3.7)
option(openmp "Enable OpenMP" on)
option(fPIC "Enable fPIC (only for gcc)" on)
option(tests "Enable testing" on)

project(s2let C)


set(S2let_VERSION "1.1b1")
set(S2let_BUILD "CMake")
set(CMAKE_C_STANDARD 99)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

find_package(FFTW3 REQUIRED COMPONENT SERIAL DOUBLE)
find_package(OpenMP QUIET)
find_package(Ssht REQUIRED)
find_package(So3 REQUIRED)

list(APPEND C_SRC src/main/c/s2let_transform_axisym_lm.c
src/main/c/s2let_transform_axisym_mw.c src/main/c/s2let_math.c
src/main/c/s2let_mw.c src/main/c/s2let_tiling.c
src/main/c/s2let_synthesis.c
src/main/c/s2let_lm.c
src/main/c/s2let_alloc.c
src/main/c/s2let_helper.c
src/main/c/s2let_analysis.c
)

add_library(s2let STATIC ${C_SRC})
target_include_directories(s2let PUBLIC ${FFTW3_INCLUDE_DIRS})
target_include_directories(s2let PUBLIC ${Ssht_INCLUDE_DIR})
target_include_directories(s2let PUBLIC ${So3_INCLUDE_DIR})
target_include_directories(s2let PRIVATE ${PROJECT_SOURCE_DIR}/include/)
if(OpenMP_C_FOUND AND openmp)
target_link_libraries(s2let OpenMP::OpenMP_C)
endif()
target_link_libraries(s2let ${Ssht_LIBRARY})
target_link_libraries(s2let ${So3_LIBRARY})
target_link_libraries(s2let ${FFTW3_DOUBLE_SERIAL_LIBRARY})

if(fPIC)
set_target_properties(s2let PROPERTIES COMPILE_FLAGS "${FFTW3_DEFINITIONS} -fPIC")
else()
set_target_properties(s2let PROPERTIES COMPILE_FLAGS "${FFTW3_DEFINITIONS}")
endif()

install(TARGETS s2let EXPORT S2letTargets ARCHIVE DESTINATION lib PUBLIC_HEADER)
install(FILES
include/s2let.h include/s2let_error.h include/s2let_hpx.h include/s2let_lm.h include/s2let_mw.h include/s2let_tiling.h include/s2let_transform_axisym_mw.h
include/s2let_alloc.h include/s2let_fits.h include/s2let_idl_hpx.h include/s2let_math.h include/s2let_so3.h include/s2let_transform_axisym_hpx.h include/s2let_types.h
include/s2let_analysis.h include/s2let_helper.h include/s2let_idl_mw.h include/s2let_mex.h include/s2let_synthesis.h include/s2let_transform_axisym_lm.h
DESTINATION include)
#building about and test executables
add_executable(s2let_about src/main/c/s2let_about.c)
target_compile_definitions(s2let_about PRIVATE S2LET_VERSION="${S2let_VERSION}" S2LET_BUILD="${S2let_BUILD}")
set_target_properties(s2let_about PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

include("exporting")

if(tests)
add_executable(s2let_test src/test/c/s2let_test.c)
target_include_directories(s2let_test PRIVATE ${PROJECT_SOURCE_DIR}/include/)
target_link_libraries(s2let_test s2let)
endif()
31 changes: 23 additions & 8 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,44 @@ DESCRIPTION
scale-discretised wavelet transforms on the sphere.

CURRENT VERSION
Release 2.0b1, September 2015
Release 2.1b1, November 2016

PREVIOUS VERSIONS
Release 2.0b1, September 2015
Release 1.1b1, October 2013
Release 1.0b1, November 2012

AUTHORS
B. Leistedt (www.ixkael.com/blog)
J. D. McEwen (www.jasonmcewen.org)
B. Leistedt (www.ixkael.com/blog)
M. Buttner
J. Y. H. Chan (www.mssl.ucl.ac.uk/~yhjc2/)
J. D. McEwen (www.jasonmcewen.org)


REFERENCES

J. D. McEwen, M. Büttner, B. Leistedt, H. V. Peiris, Y. Wiaux, P. Vandergheynst, Spin scale-discretised wavelets on the sphere, IEEE TSP, 2015 .
J. D. McEwen, M. Büttner, B. Leistedt, H. V. Peiris and Y. Wiaux,
Directional spin wavelets on the sphere, IEEE TSP, submitted, 2015
(arXiv:1509.06749).

J. D. McEwen, M. Büttner, B. Leistedt, H. V. Peiris, Y. Wiaux, A novel sampling theorem on the rotation group, IEEE TSP, 2015.
J. D. McEwen, M. Büttner, B. Leistedt, H. V. Peiris and Y. Wiaux,
A novel sampling theorem on the rotation group, IEEE TSP, 2015
(arXiv:1508.03101).

B. Leistedt, Y. Wiaux, P. Vandergheynst and J. D. McEwen,
B. Leistedt, J. D. McEwen, P. Vandergheynst and Y. Wiaux,
S2LET: A code to perform fast wavelet analysis on the sphere,
Astronomy & Astrophysics, 558, A128, 2013 (arXiv:1211.1680)
Astronomy & Astrophysics, 558, A128, 2013 (arXiv:1211.1680).

J. D. McEwen and Y. Wiaux, A novel sampling theorem on the
sphere, IEEE Trans. Sig. Proc., 59, 2011 (arXiv:1110.6298).
sphere, IEEE TSP, 59, 2011 (arXiv:1110.6298).

J. D. McEwen, Ridgelet transform on the sphere,
IEEE TSP, submitted, 2015 (arXiv:1510.01595).

J. Y. H. Chan, B. Leidtedt, T.D. Kitching and J. D. McEwen,
Second-generation curvelets on the sphere,
IEEE TSP, 65(1):5-14, 2017 (arXiv:1511.05578).


DOCUMENTATION
See doc/index.html
Expand Down
Loading

0 comments on commit 20d1203

Please sign in to comment.