-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from xrq-phys/pfaffine-blocked+cmake
CMake Support for Blocked Pfaffian
- Loading branch information
Showing
14 changed files
with
174 additions
and
34 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
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,16 @@ | ||
# for AOCC | ||
|
||
set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE) | ||
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE) | ||
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall -Wformat -Werror=format-security") | ||
set(CMAKE_C_FLAGS_RELEASE "-Wno-unknown-pragmas -O3 -DNDEBUG -DHAVE_SSE2" CACHE STRING "" FORCE) | ||
|
||
set(CMAKE_Fortran_COMPILER "flang" CACHE STRING "" FORCE) | ||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -DHAVE_SSE2" CACHE STRING "" FORCE) | ||
|
||
# for AOCL | ||
set(BLA_VENDOR "FLAME" CACHE STRING "" FORCE) | ||
|
||
# for BLIS & block pfaffian | ||
set(BLIS_ARTIFACT_CONFIG "amd64") | ||
set(PFAFFIAN_BLOCKED ON) |
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,20 @@ | ||
# for Fujitsu Compiler in Clang-mode | ||
set(CMAKE_C_COMPILER "mpifccpx" CACHE STRING "" FORCE) | ||
set(CMAKE_CXX_COMPILER "mpiFCCpx" CACHE STRING "" FORCE) | ||
set(CMAKE_C_FLAGS_RELEASE "-Nclang -Ofast -DNDEBUG" CACHE STRING "" FORCE) | ||
set(CMAKE_CXX_FLAGS_RELEASE "-Nclang -Ofast -DNDEBUG" CACHE STRING "" FORCE) | ||
|
||
set(CMAKE_Fortran_COMPILER "mpifrtpx" CACHE STRING "" FORCE) | ||
set(CMAKE_Fortran_FLAGS_RELEASE "-Kfast,parallel -DNDEBUG -DFUJITSU" CACHE STRING "" FORCE) | ||
|
||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE) | ||
set(OpenMP_Fortran_FLAGS "-Kopenmp" CACHE STRING "" FORCE) | ||
set(CMAKE_EXE_LINKER_FLAGS "-fopenmp" CACHE STRING "" FORCE) | ||
|
||
# for SSL2 | ||
set(BLAS_LIBRARIES "-SSL2" CACHE STRING "" FORCE) | ||
set(LAPACK_LIBRARIES ${BLAS_LIBRARIES} CACHE STRING "" FORCE) | ||
|
||
# for BLIS & block pfaffian | ||
set(BLIS_ARTIFACT_CONFIG "a64fx") | ||
set(PFAFFIAN_BLOCKED ON) |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# for GCC Compiler | ||
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE) | ||
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE) | ||
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall -Wformat -Werror=format-security") | ||
set(CMAKE_C_FLAGS_RELEASE "-O3 -Wno-unknown-pragmas ") | ||
Set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE) | ||
set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE) |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
if(NOT DEFINED BLIS_ARTIFACT_CONFIG) | ||
execute_process( | ||
COMMAND uname -m | ||
COMMAND tr -d '\n' | ||
OUTPUT_VARIABLE ARCHITECTURE) | ||
if(${ARCHITECTURE} STREQUAL "x86_64") | ||
execute_process( | ||
COMMAND cat /proc/cpuinfo | ||
COMMAND grep Intel | ||
COMMAND head -1 | ||
COMMAND tr -d '\n' | ||
OUTPUT_VARIABLE UARCH_INTEL) | ||
if(NOT "${UARCH_INTEL} " STREQUAL " ") | ||
set(BLIS_ARTIFACT_CONFIG "intel64") | ||
else() | ||
set(BLIS_ARTIFACT_CONFIG "amd64") | ||
endif() | ||
elseif(${ARCHITECTURE} STREQUAL "aarch64" OR | ||
${ARCHITECTURE} STREQUAL "arm64") | ||
# Currently SVE requires being set manually. | ||
set(BLIS_ARTIFACT_CONFIG "arm64") | ||
else() | ||
message(FATAL_ERROR "Failed to recognize architecture ${ARCHITECTURE}.") | ||
endif() | ||
endif(NOT DEFINED BLIS_ARTIFACT_CONFIG) | ||
|
||
message(STATUS "Downloading BLIS artifact...") | ||
|
||
set(BLIS_ARCHIVE ${CMAKE_CURRENT_BINARY_DIR}/libblis_artifact.tar.gz) | ||
if(${BLIS_ARTIFACT_CONFIG} STREQUAL "intel64") | ||
set(BLIS_ARTIFACT_URL https://github.com/xrq-phys/blis/releases/download/sv0.8.1+arm/libblis_intel64_gcc.tar.gz) | ||
elseif(${BLIS_ARTIFACT_CONFIG} STREQUAL "amd64") | ||
set(BLIS_ARTIFACT_URL https://github.com/xrq-phys/blis/releases/download/sv0.8.1+arm/libblis_amd64_gcc.tar.gz) | ||
elseif(${BLIS_ARTIFACT_CONFIG} STREQUAL "arm64") | ||
set(BLIS_ARTIFACT_URL https://github.com/xrq-phys/blis/releases/download/sv0.8.1+arm/libblis_cortexa57_aarch64-linux-gnu-gcc.tar.gz) | ||
elseif(${BLIS_ARTIFACT_CONFIG} STREQUAL "armsve") | ||
set(BLIS_ARTIFACT_URL https://github.com/xrq-phys/blis/releases/download/sv0.8.1+arm/libblis_armsve_aarch64-linux-gnu-gcc-10.tar.gz) | ||
elseif(${BLIS_ARTIFACT_CONFIG} STREQUAL "a64fx") | ||
set(BLIS_ARTIFACT_URL https://github.com/xrq-phys/blis/releases/download/sv0.8.1+arm/libblis_a64fx_aarch64-linux-gnu-gcc-10.tar.gz) | ||
else() | ||
message(FATAL_ERROR "Not BLIS artifact available.") | ||
endif() | ||
|
||
message("${BLIS_ARTIFACT_URL} ${BLIS_ARCHIVE}") | ||
file(DOWNLOAD "${BLIS_ARTIFACT_URL}" "${BLIS_ARCHIVE}") | ||
|
||
add_custom_command( | ||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib/libblis.a | ||
${CMAKE_CURRENT_BINARY_DIR}/include/blis/blis.h | ||
COMMAND ${CMAKE_COMMAND} -E tar -zxf ${BLIS_ARCHIVE} | ||
DEPENDS ${BLIS_ARCHIVE}) | ||
add_custom_target(blis_target | ||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lib/libblis.a) | ||
add_custom_target(blis_include | ||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/blis/blis.h) | ||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/blis) | ||
|
||
add_library(blis STATIC IMPORTED GLOBAL) | ||
set_target_properties(blis PROPERTIES | ||
IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/lib/libblis.a) | ||
add_dependencies(blis blis_target) | ||
|
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,18 @@ | ||
# include guard | ||
cmake_minimum_required(VERSION 2.8.0 ) | ||
|
||
if(${CMAKE_PROJECT_NAME} STREQUAL "Project") | ||
message(FATAL_ERROR "cmake should be executed not for 'src' subdirectory, but for the top directory of mVMC.") | ||
endif(${CMAKE_PROJECT_NAME} STREQUAL "Project") | ||
|
||
add_definitions(-DBLAS_EXTERNAL) | ||
add_definitions(-DF77_COMPLEX_RET_INTEL) | ||
include_directories(../pfaffine/src) | ||
|
||
add_library(pfupdates STATIC | ||
pf_interface.cc | ||
../pfaffine/src/skpfa.cc | ||
../pfaffine/src/sktdf.cc | ||
../pfaffine/src/sktdi.cc) | ||
target_compile_definitions(pfupdates PRIVATE -D_CC_IMPL) | ||
|