forked from psi4/psi4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Einsums to build system (psi4#3050)
* einsumsdemo * leave fnocc alone * right einsums * what's wrong * zlib * clang * range * spell * finish off * more * Update ein_test.cc --------- Co-authored-by: Justin Turney <justin.turney@gmail.com>
- Loading branch information
Showing
19 changed files
with
260 additions
and
10 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
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
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ foreach(dir | |
dkh | ||
ecpint | ||
libefp | ||
einsums | ||
erd | ||
gau2grid | ||
gdma | ||
|
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,58 @@ | ||
if(${ENABLE_Einsums}) | ||
find_package(Einsums 0.3 CONFIG) | ||
|
||
if(TARGET Einsums::einsums) | ||
get_property(_loc TARGET Einsums::einsums PROPERTY LOCATION) | ||
message(STATUS "${Cyan}Found Einsums${ColourReset}: ${_loc} (found version ${Einsums_VERSION})") | ||
add_library(einsums_external INTERFACE) # dummy | ||
|
||
# reset below necessary as find_package clears it. better solution sought | ||
set(TargetHDF5_DIR ${STAGED_INSTALL_PREFIX}/share/cmake/TargetHDF5 CACHE PATH "path to externally detected TargetHDF5Config.cmake" FORCE) | ||
else() | ||
if(${CMAKE_INSIST_FIND_PACKAGE_Einsums}) | ||
message(FATAL_ERROR "Suitable Einsums could not be externally located as user insists") | ||
endif() | ||
|
||
include(ExternalProject) | ||
message(STATUS "Suitable Einsums could not be located, ${Magenta}Building Einsums${ColourReset} instead.") | ||
|
||
if(${BUILD_SHARED_LIBS}) | ||
set(_a_only OFF) | ||
else() | ||
set(_a_only ON) | ||
endif() | ||
|
||
set(_einsums_dir "share/cmake/Einsums") | ||
|
||
ExternalProject_Add(einsums_external | ||
DEPENDS lapack_external | ||
hdf5_external | ||
URL https://github.com/Einsums/Einsums/archive/v0.3.tar.gz | ||
UPDATE_COMMAND "" | ||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STAGED_INSTALL_PREFIX} | ||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} | ||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} | ||
-DEINSUMS_STATIC_BUILD=${_a_only} | ||
-DEXTRA_C_FLAGS=${CMAKE_C_FLAGS} | ||
-DEXTRA_CXX_FLAGS=${CMAKE_CXX_FLAGS} | ||
-DEINSUMS_INSTALL_CMAKEDIR=${_einsums_dir} | ||
# -DENABLE_XHOST=${ENABLE_XHOST} | ||
-DEINSUMS_ENABLE_TESTING=OFF | ||
-DEINSUMS_USE_HPTT=ON | ||
# -DOpenMP_LIBRARY_DIRS=${OpenMP_LIBRARY_DIRS} | ||
-DTargetLAPACK_DIR=${TargetLAPACK_DIR} | ||
-DTargetHDF5_DIR=${TargetHDF5_DIR} | ||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} | ||
-DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} | ||
CMAKE_CACHE_ARGS -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} | ||
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} | ||
-DTargetOpenMP_FIND_COMPONENTS:STRING=C;CXX) | ||
|
||
set(Einsums_DIR ${STAGED_INSTALL_PREFIX}/${_einsums_dir} CACHE PATH "path to internally built EinsumsConfig.cmake" FORCE) | ||
endif() | ||
else() | ||
add_library(einsums_external INTERFACE) # dummy | ||
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
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 |
---|---|---|
|
@@ -43,6 +43,7 @@ foreach(dir_name | |
psimrcc | ||
sapt | ||
scfgrad | ||
dummy_einsums | ||
) | ||
add_subdirectory(${dir_name}) | ||
endforeach () |
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,29 @@ | ||
list(APPEND sources | ||
ein_test.cc | ||
) | ||
|
||
if(TARGET Einsums::einsums) | ||
psi4_add_module(bin dummy_einsums sources) | ||
target_link_libraries( | ||
dummy_einsums | ||
PRIVATE | ||
Einsums::einsums | ||
) | ||
endif() | ||
|
||
if(DEFINED ENV{CONDA_TOOLCHAIN_BUILD}) | ||
if(APPLE) | ||
# * possibly these should be exported from Einsums somehow | ||
# * when using conda clang, compiling against an old SDK & | ||
# an openmp symbols is absent | ||
# * afaik, envvar above is defined when `conda activate envvar_w_compilers`. | ||
# There's a CONDA_BACKUP_CONDA_TOOLCHAIN_BUILD envvar when not activated. | ||
# So hopefully, this doesn't interfere with system compilers. | ||
target_compile_definitions( | ||
dummy_einsums | ||
PUBLIC | ||
_LIBCPP_DISABLE_AVAILABILITY | ||
H5CPP_USE_OMP_ALIGNED_ALLOC | ||
) | ||
endif() | ||
endif() |
Oops, something went wrong.