Skip to content
代码片段 群组 项目
提交 97ff2b75 编辑于 作者: genshen's avatar genshen
浏览文件

Initial commit

上级
无相关合并请求
# General for mac
.DS_Store
.AppleDouble
.LSOverride
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
cmake-build-release/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
### CMake template
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
### C template
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
### C++ template
# Prerequisites
# Compiled Object files
*.slo
# Precompiled Headers
# Compiled Dynamic libraries
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
# Executables
cmake_minimum_required(VERSION 3.0)
project(misa-kmc)
set(CMAKE_CXX_STANDARD 11)
include(config.cmake)
include(dependency.cmake)
add_subdirectory(src)
#if (KMC_TOOLS_BUILD_ENABLE_FLAG)
# add_subdirectory(tools)
#endif ()
################################
## test configure
################################
if (KMC_TEST_BUILD_ENABLE_FLAG)
MESSAGE(STATUS "TEST is enabled")
add_subdirectory(tests)
endif ()
set(PNOHS_VERSION "0.1.0")
option(KMC_OpenMP_ENABLE_FLAG "Use OpenMP" OFF) #change this flag to OFF to disable OpenMP
option(KMC_MPI_ENABLE_FLAG "Use MPI library" OFF) #change this flag to false to disable mpi
option(KMC_TEST_BUILD_ENABLE_FLAG "Enable test" ON) # enable test
option(KMC_TEST_MPI_ENABLE_FLAG "Enable MPI in test" ON) # enable mpi in test, its value depends on option MPI_ENABLE_FLAG.
option(KMC_TOOLS_BUILD_ENABLE_FLAG "Enable tools building" ON) # building tools directory.
option(KMC_DEBUG_ENABLE_FLAG "Enable tools building" ON) # enable debug mode building.
if (PNOHS_DEBUG_ENABLE_FLAG)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
endif ()
## architecture ralated values.
# option(ARCH_SW "Enable sunway athread" OFF) # enable sunway athread if its running on sunway system.
#############
## const ##
#############
set(KMC_LIB_NAME kmc)
set(KMC_EXECUTE_BIN_NAME ${PROJECT_NAME})
# test
set(KMC_UINT_TEST_NAME "misa-kmc-unit-tests")
\ No newline at end of file
################################
# MPI and OpenMP
################################
if (KMC_OpenMP_ENABLE_FLAG)
find_package(OpenMP REQUIRED)
if (OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif ()
endif ()
if (KMC_MPI_ENABLE_FLAG)
find_package(MPI REQUIRED)
MESSAGE(STATUS "MPI_INCLUDE dir:" ${MPI_INCLUDE_PATH})
MESSAGE(STATUS "MPI_LIBRARIES dir:" ${MPI_LIBRARIES})
if (MPI_CXX_COMPILE_FLAGS)
set(COMPILE_FLAGS "${COMPILE_FLAGS} ${MPI_CXX_COMPILE_FLAGS}")
endif ()
if (MPI_CXX_LINK_FLAGS)
set(LINK_FLAGS "${LINK_FLAGS} ${MPI_CXX_LINK_FLAGS}")
endif ()
include_directories(${MPI_CXX_INCLUDE_PATH})
set(KMC_EXTRA_LIBS ${KMC_EXTRA_LIBS} ${MPI_CXX_LIBRARIES}) #add mpi lib
endif ()
##### mpi and openmp end
#include(pkg.dep.cmake)
#set(KMC_VENDOR_PATH ${VENDOR_PATH})
#set(KMC_VENDOR_SRC_PATH ${KMC_VENDOR_PATH}/src)
#set(KMC_VENDOR_INCLUDE_PATH ${KMC_VENDOR_PATH}/include)
#set(KMC_VENDOR_PKG_PATH ${KMC_VENDOR_PATH}/pkg)
################################
###### kiwi framework globally
################################
set(KMC_EXTRA_LIBS fmt kiwi ${KMC_EXTRA_LIBS})
building_config.h
\ No newline at end of file
include(configure.cmake)
set(HEADER_FILES
atom.h
type_define.h
)
set(SOURCE_FILES
atom.cpp
)
# set binary path and lib storage path for compiling process.
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
# make lib.
add_library(${KMC_LIB_NAME} STATIC ${HEADER_FILES} ${SOURCE_FILES})
target_include_directories(
${KMC_LIB_NAME}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
# make binary
add_executable(${KMC_EXECUTE_BIN_NAME} main.cpp )
target_link_libraries(${KMC_EXECUTE_BIN_NAME} PRIVATE ${KMC_LIB_NAME} ${EXTRA_LIBS})
##########################
##### install files
##########################
# install bin and libs.
install(TARGETS ${KMC_LIB_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
# install header.
install(DIRECTORY "./"
DESTINATION "include"
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.hpp"
)
\ No newline at end of file
//
// Created by genshen on 2018/11/7.
//
//
// Created by genshen on 2018/11/7.
//
#ifndef MISA_KMC_ATOM_H
#define MISA_KMC_ATOM_H
class AtomTypes {
public:
int a;
};
#endif //MISA_KMC_ATOM_H
## generate configure file
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/building_config.in"
"${CMAKE_CURRENT_SOURCE_DIR}/building_config.h"
)
//
// Created by genshen on 2018/11/7.
//
int main() {
return 0;
}
//
// Created by genshen on 2018/11/9.
//
#ifndef MISA_KMC_TYPE_DEFINE_H
#define MISA_KMC_TYPE_DEFINE_H
/**
* the type of atom lattice position in cartesian coordinate system
*/
typedef unsigned long _type_atom_pos;
#endif //MISA_KMC_TYPE_DEFINE_H
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册