Commit bcc0e9cd authored by Torin Stetina's avatar Torin Stetina
Browse files

Merge branch 'libint_bump' into 'minor_rc'

Libint update

See merge request chronusq/chronusq_dev!67
parents 74afa5f3 222bfbd4
......@@ -3,12 +3,7 @@
!*fockbuild*
external/mxx
external/cxxblacs
external/libint2/include
external/libint2/lib
external/libint2/share
external/libint2/src
external/libint2/tmp
external/libint2/libint*/
external/libint2*
external/openblas/include
external/openblas/lib
external/openblas/src
......
......@@ -10,11 +10,9 @@ build_intel:
name: "$CI_JOB_ID-$CI_JOB_NAME"
script:
- source /home/ci_software/intel-19.1.sh
- rm -fr external/libint2
- ln -s /sw/libint/2/5/0/intel/19/1 external/libint2
- mkdir build
- cd build
- cmake -DCMAKE_CXX_FLAGS='-O3' -DCMAKE_C_FLAGS='-O3' -DCMAKE_Fortran_FLAGS='-O3' ..
- cmake -DLibint2_ROOT=/sw/libint/2/5/0/intel/19/1 =-DCMAKE_CXX_FLAGS='-O3' -DCMAKE_C_FLAGS='-O3' -DCMAKE_Fortran_FLAGS='-O3' ..
- make -j5
- ctest
......@@ -27,11 +25,9 @@ build_gcc:
name: "$CI_JOB_ID-$CI_JOB_NAME"
script:
- source /home/ci_software/gcc-8.2.0.sh
- rm -fr external/libint2
- ln -s /sw/libint/2/5/0/gcc/8/2/0 external/libint2
- mkdir build
- cd build
- cmake -DCMAKE_CXX_FLAGS='-O3' -DCMAKE_C_FLAGS='-O3' -DCMAKE_Fortran_FLAGS='-O3' ..
- cmake -DLibint2_ROOT=/sw/libint/2/5/0/gcc/8/2/0 -DCMAKE_CXX_FLAGS='-O3' -DCMAKE_C_FLAGS='-O3' -DCMAKE_Fortran_FLAGS='-O3' ..
- make -j5
- ctest
......@@ -44,10 +40,8 @@ build_mpi_gcc:
name: "$CI_JOB_ID-$CI_JOB_NAME"
script:
- source /home/ci_software/gcc-8.2.0_mpich-3.2.1.sh
- rm -fr external/libint2
- ln -s /sw/libint/2/5/0/gcc/8/2/0 external/libint2
- mkdir build
- cd build
- cmake -DCMAKE_CXX_FLAGS='-O3' -DCMAKE_C_FLAGS='-O3' -DCMAKE_Fortran_FLAGS='-O3' -DCQ_ENABLE_MPI=ON -DCQ_SCALAPACK_LIBRARIES="$SCALAPACK_LIBRARY_DIR/libscalapack.a" -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Release ..
- cmake -DLibint2_ROOT=/sw/libint/2/5/0/gcc/8/2/0 -DCMAKE_CXX_FLAGS='-O3' -DCMAKE_C_FLAGS='-O3' -DCMAKE_Fortran_FLAGS='-O3' -DCQ_ENABLE_MPI=ON -DCQ_SCALAPACK_LIBRARIES="$SCALAPACK_LIBRARY_DIR/libscalapack.a" -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Release ..
- make -j6
- make test
......@@ -20,20 +20,49 @@
# Contact the Developers:
# E-Mail: xsli@uw.edu
#
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
project(ChronusQ CXX C Fortran)
set(ChronusQ_VERSION_MAJOR 0)
set(ChronusQ_VERSION_MINOR 3)
set(ChronusQ_VERSION_PATCH 3)
cmake_minimum_required(VERSION 3.11...3.14 FATAL_ERROR)
project(ChronusQ
VERSION 0.3.3
DESCRIPTION
"Chronus Quantum is an ab initio computational chemistry \
software package that focuses on explicitly time-dependent and unconventional \
post-SCF quantum mechanical methods."
LANGUAGES CXX C Fortran)
# -----------------------------------------------------------------------------
# Options
# -----------------------------------------------------------------------------
option(CQ_ENABLE_MPI "Enable MPI parallelism" OFF)
option(ENABLE_COVERAGE "Enable coverage and profiling" OFF)
option(CQ_LINALG_USESYSTEM "Use System defaults for LA libs" OFF)
option(CQ_EXTERNAL_OPENMP "Force linking to an external OpenMP library" OFF)
# Libint building options
set(BUILD_LIBINT_TYPES NONE ALLOW FORCE)
set(CQ_BUILD_LIBINT_TYPE ALLOW CACHE STRING "Disable, enable, or force CQ to build libint")
set_property(CACHE CQ_BUILD_LIBINT_TYPE PROPERTY STRINGS ${BUILD_LIBINT_TYPES})
if ( NOT CQ_BUILD_LIBINT_TYPE IN_LIST BUILD_LIBINT_TYPES )
message ( FATAL_ERROR "CQ_BUILD_LIBINT_TYPE must be one of ${BUILD_LIBINT_TYPES}" )
endif()
# Whether to build in external or build directory
option(CQ_EXTERNAL_IN_BUILD_DIR "Build external dependencies in the build directory" OFF)
if ( NOT FETCHCONTENT_BASE_DIR AND NOT CQ_EXTERNAL_IN_BUILD_DIR )
set ( FETCHCONTENT_BASE_DIR "${PROJECT_SOURCE_DIR}/external"
CACHE STRING "" FORCE )
endif()
# -----------------------------------------------------------------------------
# Add specified paths to CMAKE_PREFIX_PATH
if( MPI_PREFIX )
set( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${MPI_PREFIX} )
......@@ -112,7 +141,7 @@ include(HandleLA)
message( "ChronusQ Dependencies" )
include(FindLibint)
include(HandleLibint)
include(FindLibXC)
set(CQEX_LINK ${CQ_EXT_LINK} )
......
#!/bin/sh
LIBINT2_DIR=libint-2.5.0-beta.2
cd external/libint2
if [ -d "$LIBINT2_DIR" ]; then
cd $LIBINT2_DIR
else
echo "Unpacking Libint"
tar xf "$LIBINT2_DIR".tgz
cd $LIBINT2_DIR
./configure --prefix=$PWD/.. --with-cxx=$CXX CXXFLAGS="-w -O3 $CXXFLAGS"
fi
echo "Compiling Libint"
make install -j$1
echo "Libint Compiled!"
#!/bin/sh
rm -fr CMakeFiles Testing include src tests
rm -fr CMakeFiles Testing include src tests _deps external
rm -f CMakeCache.txt CTestTestfile.cmake Makefile cmake_install.cmake
#!/bin/sh
rm -fr external/libint2/include
rm -fr external/libint2/lib
rm -fr external/libint2/libint*/
rm -fr external/libint2/share
rm -fr external/libint2-build
rm -fr external/libint2-src
rm -fr external/libint2-subbuild
rm -fr external/libint2
#
# This file is part of the Chronus Quantum (ChronusQ) software package
#
# Copyright (C) 2014-2020 Li Research Group (University of Washington)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Contact the Developers:
# E-Mail: xsli@uw.edu
#
include(ExternalProject)
set( LIBINT2_PREFIX ${PROJECT_SOURCE_DIR}/external/libint2 )
set( LIBINT2_INCLUDEDIR ${LIBINT2_PREFIX}/include
${LIBINT2_PREFIX}/include/libint2 )
set( LIBINT2_LIBDIR ${LIBINT2_PREFIX}/lib )
add_definitions(-DLIBINT2_DOES_NOT_INLINE_)
include_directories("${LIBINT2_INCLUDEDIR}")
link_directories("${LIBINT2_LIBDIR}")
if( NOT EXISTS "${LIBINT2_PREFIX}/include/libint2.hpp" )
ExternalProject_Add(libint
PREFIX ${LIBINT2_PREFIX}
URL "${LIBINT2_PREFIX}/libint-2.5.0-beta.2.tgz"
CONFIGURE_COMMAND ./configure
--prefix=${LIBINT2_PREFIX}
CXX=${CMAKE_CXX_COMPILER}
CXXFLAGS=${CMAKE_CXX_FLAGS}
BUILD_COMMAND make -j2
BUILD_IN_SOURCE 1
INSTALL_COMMAND make install
)
list(APPEND CQEX_DEP libint)
message( STATUS "Opting to build a copy of Libint2" )
else()
message( STATUS "Found Libint2 installation!" )
endif()
list(APPEND CQ_EXT_LINK ${LIBINT2_LIBDIR}/libint2.a)
#
# This file is part of the Chronus Quantum (ChronusQ) software package
#
# Copyright (C) 2014-2020 Li Research Group (University of Washington)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Contact the Developers:
# E-Mail: xsli@uw.edu
#
include(FetchContent)
message ( "\n == Libint ==\n" )
#
# Find preinstalled Libint unless turned off
#
if ( NOT CQ_BUILD_LIBINT_TYPE STREQUAL "FORCE" )
find_package ( Libint2 QUIET )
# Prefer CMake installed
if ( TARGET Libint2::int2 )
get_target_property ( libint_alias Libint2::int2 ALIASED_TARGET )
if ( libint_alias )
add_library ( ChronusQ::Libint2 ALIAS ${libint_alias} )
else()
add_library ( ChronusQ::Libint2 ALIAS Libint2::int2 )
endif()
# Otherwise create dummy target
elseif ( DEFINED Libint2_ROOT )
set ( LIBINT2_LIBRARIES_FOUND FALSE )
if ( EXISTS "${Libint2_ROOT}/lib/libint2.a" )
set ( LIBINT2_LIBRARIES "${Libint2_ROOT}/lib/libint2.a" )
set ( LIBINT2_LIBRARIES_FOUND TRUE )
elseif ( EXISTS "${Libint2_ROOT}/lib/liblibint2.a" )
set ( LIBINT2_LIBRARIES "${Libint2_ROOT}/lib/liblibint2.a" )
set ( LIBINT2_LIBRARIES_FOUND TRUE )
endif()
if ( LIBINT2_LIBRARIES_FOUND AND
EXISTS "${Libint2_ROOT}/include/libint2.hpp" )
set ( LIBINT2_INCLUDE_DIRS
${Libint2_ROOT}/include
${Libint2_ROOT}/include/libint2
)
add_library ( ChronusQ::Libint2 INTERFACE IMPORTED )
set_target_properties ( ChronusQ::Libint2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBINT2_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${LIBINT2_LIBRARIES}"
)
set ( LIBINT2_FOUND TRUE )
endif()
endif()
if ( LIBINT2_FOUND )
message ( STATUS "Found External Libint Installation" )
endif()
endif()
#
# Build Libint if a suitable libint hasn't been found
#
if ( NOT TARGET ChronusQ::Libint2 )
if ( NOT CQ_BUILD_LIBINT_TYPE STREQUAL "NONE" )
message( STATUS "Opting to build a copy of Libint" )
# Set prefix
if ( CQ_EXTERNAL_IN_BUILD_DIR )
set ( CUSTOM_LIBINT_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/libint2 )
else()
set ( CUSTOM_LIBINT_PREFIX ${PROJECT_SOURCE_DIR}/external/libint2 )
endif()
# Update policy for Libint
set(CMAKE_POLICY_DEFAULT_CMP0074 NEW)
FetchContent_Declare (
Libint2
PREFIX ${CUSTOM_LIBINT_PREFIX}
GIT_REPOSITORY "https://urania.chem.washington.edu/chronusq/libint-cq.git"
GIT_TAG "2.7.0-beta.5"
)
FetchContent_GetProperties ( Libint2 )
if ( NOT Libint2_POPULATED )
message ( STATUS "Downloading Libint..." )
FetchContent_Populate ( Libint2 )
message ( STATUS "Downloading Libint - Done" )
add_subdirectory ( ${libint2_SOURCE_DIR} ${libint2_BINARY_DIR} )
endif()
add_library ( ChronusQ::Libint2 ALIAS libint2 )
else()
message ( FATAL_ERROR "Suitable Libint installation could not be found! \
Set Libint2_ROOT to the prefix of the Libint installation or turn \
CQ_ALLOW_BUILD_LIBINT on."
)
endif()
endif()
list(APPEND CQ_EXT_LINK ChronusQ::Libint2)
message ( " == End Libint ==\n" )
......@@ -21,6 +21,7 @@
# E-Mail: xsli@uw.edu
#
add_library(basisset STATIC reference.cxx basisset.cxx basisset_eval.cxx)
target_link_libraries ( basisset PUBLIC ChronusQ::Libint2 )
if(TARGET libint)
add_dependencies(basisset libint)
......
......@@ -24,6 +24,8 @@ set( CQLAPACK_SRC eig.cxx factorization.cxx solve.cxx svd.cxx )
set( CQBLAS_SRC blas1.cxx blas3.cxx blasext.cxx blasutil.cxx matfunc.cxx)
add_library(cqlinalg STATIC ${CQLAPACK_SRC} ${CQBLAS_SRC})
target_link_libraries ( cqlinalg PUBLIC ChronusQ::Libint2 )
list(APPEND CQEX_LINK cqlinalg)
set(CQEX_LINK ${CQEX_LINK} PARENT_SCOPE)
......
......@@ -27,7 +27,7 @@ set(OPT_SRC input/molopts.cxx input/basisopts.cxx
input/intsopts.cxx input/miscopts.cxx input/respopts.cxx
procedural.cxx)
add_library(cxxcq STATIC ${INPUT_SRC} ${OPT_SRC})
target_link_libraries( cxxcq PUBLIC ChronusQ::HDF5 )
target_link_libraries( cxxcq PUBLIC ChronusQ::HDF5 ChronusQ::Libint2 )
list(INSERT CQEX_LINK 0 cxxcq)
set(CQEX_LINK ${CQEX_LINK} PARENT_SCOPE)
......
......@@ -34,7 +34,7 @@ aointegrals/giaointegrals_onee_engine.cxx
aointegrals/giaointegrals_twoe_engine.cxx
impl.cxx)
target_link_libraries( electronintegrals PUBLIC ChronusQ::HDF5 )
target_link_libraries( electronintegrals PUBLIC ChronusQ::HDF5 ChronusQ::Libint2 )
if(TARGET libint)
add_dependencies(electronintegrals libint)
......
......@@ -21,6 +21,7 @@
# E-Mail: xsli@uw.edu
#
add_library(itersolver STATIC impl.cxx)
target_link_libraries ( itersolver PUBLIC ChronusQ::Libint2 )
# Append aointegrals to executable link
list(APPEND CQEX_LINK itersolver)
......
......@@ -27,6 +27,7 @@ arithmetic/squarematrix.cxx
arithmetic/paulispinormatrices.cxx
arithmetic/scaledmatrix.cxx
impl.cxx)
target_link_libraries ( matrix PUBLIC ChronusQ::Libint2 )
# Append electronintegrals to executable link
list(APPEND CQEX_LINK matrix)
......
......@@ -21,6 +21,7 @@
# E-Mail: xsli@uw.edu
#
add_library(molecule STATIC molecule.cxx)
target_link_libraries ( molecule PUBLIC ChronusQ::Libint2 )
# Append molecule to executable link
list(APPEND CQEX_LINK molecule)
......
......@@ -21,6 +21,7 @@
# E-Mail: xsli@uw.edu
#
add_library(quantum STATIC impl.cxx)
target_link_libraries ( quantum PUBLIC ChronusQ::Libint2 )
# Append aointegrals to executable link
list(APPEND CQEX_LINK quantum)
......
......@@ -21,7 +21,7 @@
# E-Mail: xsli@uw.edu
#
add_library(realtime STATIC fields.cxx impl.cxx)
target_link_libraries( realtime PUBLIC ChronusQ::HDF5 )
target_link_libraries( realtime PUBLIC ChronusQ::HDF5 ChronusQ::Libint2 )
# Append aointegrals to executable link
list(APPEND CQEX_LINK realtime)
......
......@@ -21,7 +21,7 @@
# E-Mail: xsli@uw.edu
#
add_library(response STATIC impl.cxx)
target_link_libraries( response PUBLIC ChronusQ::HDF5 )
target_link_libraries( response PUBLIC ChronusQ::HDF5 ChronusQ::Libint2 )
# Append aointegrals to executable link
list(APPEND CQEX_LINK response)
......
......@@ -21,7 +21,7 @@
# E-Mail: xsli@uw.edu
#
add_library(singleslater STATIC impl.cxx)
target_link_libraries( singleslater PUBLIC ChronusQ::HDF5 )
target_link_libraries( singleslater PUBLIC ChronusQ::HDF5 ChronusQ::Libint2 )
# Append aointegrals to executable link
list(APPEND CQEX_LINK singleslater)
......
......@@ -21,7 +21,7 @@
# E-Mail: xsli@uw.edu
#
add_library(wavefunction STATIC impl.cxx)
target_link_libraries( wavefunction PUBLIC ChronusQ::HDF5 )
target_link_libraries( wavefunction PUBLIC ChronusQ::HDF5 ChronusQ::Libint2 )
# Append aointegrals to executable link
list(APPEND CQEX_LINK wavefunction)
......
......@@ -22,7 +22,7 @@
#
add_library(x2c STATIC impl.cxx x2c.cxx atomic.cxx)
target_link_libraries( x2c PUBLIC ChronusQ::HDF5 )
target_link_libraries( x2c PUBLIC ChronusQ::HDF5 ChronusQ::Libint2 )
# Append x2c to executable link
list(APPEND CQEX_LINK x2c)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment