Skip to content

Commit

Permalink
Merge pull request #116 from Cosmoglobe/devel
Browse files Browse the repository at this point in the history
Merging BP10 run into master
  • Loading branch information
dncnwtts authored Nov 19, 2021
2 parents a783d06 + 54ea666 commit 3aa493e
Show file tree
Hide file tree
Showing 312 changed files with 400,387 additions and 13,903 deletions.
73 changes: 61 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
*.mod
*.o
*.optrpt
*.a
*.gitignore
#---------------------------------------------------------------
# Compiled python modules.
#---------------------------------------------------------------
.Python
*.pyc
*.swp
*comm_like_sampler
*comm_like_tools
*comm_like_tools_mpi
*comm_process_resfiles
*commander

# Setuptools distribution folder.
/dist/
/sdist/
# Python egg metadata, regenerated from source files by setuptools.
eggs/
.eggs/
develop-eggs/
*.egg-info/
*.egg
# Python cache files
__pycache__/
#---------------------------------------------------------------
# CMake miscellaneous files
#---------------------------------------------------------------
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
Expand All @@ -21,3 +27,46 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
build*/
downloads/
lib/
lib64/
#---------------------------------------------------------------
# Fortran compiled output
#---------------------------------------------------------------
*.mod
*.smod
*.o
*.optrpt
*.a
*.swp
*.swo
*comm_like_sampler
*comm_like_tools
*comm_like_tools_mpi
*comm_process_resfiles
*commander
*sharp_test
*.gitignore

#---------------------------------------------------------------
# Editors
#---------------------------------------------------------------
.vscode/
.idea/
# Vagrant
.vagrant/
# Mac/OSX
.DS_Store
# Windows
Thumbs.db
# vim
*.swp

#---------------------------------------------------------------
# Other
#---------------------------------------------------------------
# QUIET beam files
commander3/todscripts/quiet/quiet_qband_beam_effective_v1.fits
commander3/todscripts/quiet/quiet_qband_bandpass_v1.txt
commander3/todscripts/quiet/quiet_qband_beam_instrumental_v1.fits
85 changes: 57 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,79 @@
# along with Commander3. If not, see <https://www.gnu.org/licenses/>.
#
#================================================================================

# just a short message to signify start of configuration script
# Ensure out-of-source build
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR
"\n-------------------------------------------------------------------"
"\n IN-SOURCE BUILDS ARE NOT ALLOWED!"
"\nTo sucessfully run CMake configuration, please, do the following:"
"\n1. Delete the CMakeCache.txt file and the CMakeFiles directory"
" created inside current (root) directory. For instance, on Linux do: "
"\n $ rm -r CMakeCache.txt CMakeFiles/"
"\n2. Create new directory (any name will do, but usually it is called build)"
" and re-run CMake configuration from it. For example, on Linux do:"
"\n $ mkdir build && cd build"
"\n $ cmake [CMake variable 1] [...] [CMake variable n] .."
"\n3. Run compilation command to install Commander3, e.g.: "
"\n $ cmake --build . --target install -j n"
"\n where n is the number of processors to utilize."
"\nFor more information, please refer to official documentation: "
"\n https://docs.beyondplanck.science"
"\nIn case you have any questions, feel free to post them on our forum:"
"\n https://forums.beyondplanck.science/"
"\n-------------------------------------------------------------------"
)
endif()
# Just a short message to signify start of configuration script
message(STATUS "===============================================================")
message(STATUS "Welcome to automatic Commander3 installer!")
message(STATUS "Issued under: GNU GPLv3 license")
message(STATUS "Official repo: https://github.com/Cosmoglobe/Commander")
message(STATUS "Documentation: https://docs.beyondplanck.science")
message(STATUS "Documentation: https://cosmoglobe.github.io/Commander/#/")
message(STATUS "Forum: https://forums.beyondplanck.science/")
message(STATUS "===============================================================")
message(STATUS "Scanning your system. Please, wait a moment...")
#message(STATUS "---------------------------------------------------------------")
# the necessary minimum to set-up cmake
cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
project(CommanderSuperbuild
DESCRIPTION "Complete installer for Commander 3"
VERSION 1.1.0
LANGUAGES Fortran CXX C #Python
# The necessary minimum to set-up cmake-based project
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(Commander3
DESCRIPTION "Complete installer for Commander 3."
VERSION 1.3.0
LANGUAGES Fortran CXX C
HOMEPAGE_URL "https://github.com/Cosmoglobe/Commander"
)
# Looking for python
find_package(Python REQUIRED COMPONENTS Interpreter)

# ensuring that we do out-of-source build
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.")
endif()

# including native cmake commands
# Including native cmake commands
include(CMakePrintHelpers)
include(CMakeDependentOption)
# enables content population at configure time
include(FetchContent)
# including external project routines to enable superbuild pattern
# Enables content population at configure time
#include(FetchContent)
# Including external project routines to enable superbuild pattern
include(ExternalProject)
# verify that Fortran and CXX compilers can properly talk to each other
# Including useful macro to operate with project options
include(CMakeDependentOption)
# Verify that Fortran and CXX compilers can properly talk to each other
include(FortranCInterface)
FortranCInterface_VERIFY(CXX)
# check if given fortran source compiles
# Check if given fortran source compiles
include(CheckFortranSourceCompiles)
# the -fPIC flag
# The -fPIC flag
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# the -flto
# The -flto

# adding project modules dir (with .cmake extension)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# including cmake modules
include(project_instructions)
# adding commander3 source files
# Adding project modules dir (with .cmake extension)
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake"
"${CMAKE_SOURCE_DIR}/cmake/modules"
"${CMAKE_SOURCE_DIR}/cmake/compilers"
"${CMAKE_SOURCE_DIR}/cmake/projects"
"${CMAKE_SOURCE_DIR}/cmake/third_party/cfitsio/cmake"
"${CMAKE_SOURCE_DIR}/cmake/third_party/curl/CMake"
)
# Including custom cmake modules
include(main)
# Adding commander3 source files
# Note: I have added commander.cmake as an "independent" project
# so there is no need for other cmake lists. Advantage of this
# approach is that everything located in the same folder (cmake)
Expand Down
Loading

0 comments on commit 3aa493e

Please sign in to comment.