-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now the project uses CMake for compiling, 3.8 required
- Loading branch information
1 parent
64b4e19
commit 519d7bb
Showing
20 changed files
with
204 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
*~ | ||
bin/ | ||
bin/rdf | ||
build/ | ||
*.o | ||
*.depend | ||
*.depend | ||
defines.h | ||
gitversion.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
cmake_minimum_required (VERSION 3.8) | ||
include(CheckLanguage) | ||
include(CheckCXXCompilerFlag) | ||
project (RadialDistributionFunction CXX) | ||
#set( CMAKE_VERBOSE_MAKEFILE on ) | ||
set (RadialDistributionFunction_VERSION_MAJOR \"2\") | ||
set (RadialDistributionFunction_VERSION_MINOR \"0\") | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED YES) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
#I want only std=c++11, not c++0x | ||
#check_cxx_compiler_flag("-std=c++11" HAS_CXX11) | ||
if(NOT HAS_CXX11) | ||
message(FATAL_ERROR "C++ compiler needs to allow c++11 standard") | ||
endif() | ||
|
||
option(USE_BOOST "Use Boost-qi for reading, highly improves reading performance" OFF) | ||
option(DONT_USE_CUDA "Dont compile in hybrid CPU/GPU mode, requires nvcc" ON) | ||
|
||
if(NOT DONT_USE_CUDA) | ||
check_language(CUDA) | ||
if(CMAKE_CUDA_COMPILER) | ||
enable_language(CUDA) | ||
set(USE_CUDA ON) | ||
|
||
set(CMAKE_CUDA_STANDARD 11) | ||
set(CMAKE_CUDA_STANDARD_REQUIRED ON) | ||
set(CMAKE_CUDA_SEPARABLE_COMPILATION OFF) | ||
|
||
execute_process(COMMAND bash ${PROJECT_SOURCE_DIR}/cmake/listArchs.sh OUTPUT_VARIABLE ARCHS) | ||
set(CMAKE_CUDA_FLAGS ${ARCHS} ${CMAKE_CUDA_FLAGS}) | ||
endif() | ||
endif() | ||
|
||
|
||
#set(CMAKE_CXX_FLAGS "-Wall -Wextra -fPIC" ${CMAKE_CXX_FLAGS}) | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release) | ||
endif() | ||
|
||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
include_directories(src/third_party) | ||
add_subdirectory(src) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
echo \"$(git rev-parse HEAD)\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
nvcc --help | | ||
grep '\-\-gpu-code' -A1000 | | ||
grep -Po 'compute_\K[0-9]+' | | ||
sort | | ||
uniq | | ||
awk '{print "-gencode arch=compute_"$1",code=sm_"$1}' | | ||
paste -sd" " | tr '\n' ' ' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
cmake_minimum_required (VERSION 3.8) | ||
add_executable(RadialDistributionFunction main.cpp) | ||
if(NOT DONT_USE_CUDA) | ||
SET_SOURCE_FILES_PROPERTIES(main.cpp PROPERTIES LANGUAGE CUDA) | ||
endif() | ||
|
||
set_target_properties(RadialDistributionFunction PROPERTIES OUTPUT_NAME "rdf") | ||
|
||
install(TARGETS RadialDistributionFunction RUNTIME DESTINATION bin) | ||
|
||
configure_file ( "defines.h.in" ${CMAKE_CURRENT_SOURCE_DIR}/defines.h ) | ||
|
||
|
||
find_package(Git) | ||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git") | ||
execute_process(COMMAND bash ${PROJECT_SOURCE_DIR}/cmake/gitversion.sh OUTPUT_VARIABLE GITCOMMIT) | ||
else() | ||
SET(GITCOMMIT "unknown") | ||
endif() | ||
|
||
configure_file("gitversion.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/gitversion.h") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef RDFCONFIG_H | ||
#define RDFCONFIG_H | ||
#define RadialDistributionFunction_VERSION_MAJOR @RadialDistributionFunction_VERSION_MAJOR@ | ||
#define RadialDistributionFunction_VERSION_MINOR @RadialDistributionFunction_VERSION_MINOR@ | ||
#cmakedefine USE_BOOST | ||
#cmakedefine USE_CUDA | ||
#ifdef USE_CUDA | ||
#define GPUMODE | ||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#ifndef GITVERSION_H | ||
#define GITVERSION_H | ||
#define GITVERSION @GITCOMMIT@ | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.