-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
116 lines (96 loc) · 3.76 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
if [ "$(uname)" == "Darwin" ]; then
# link against conda Clang
# # * -fno-exceptions squashes `___gxx_personality_v0` symbol and thus libc++ dependence
# ALLOPTS="-clang-name=${CLANG} ${OPTS} -fno-exceptions"
# ALLOPTSCXX="-clang-name=${CLANG} -clangxx-name=${CLANGXX} -stdlib=libc++ -I${PREFIX}/include/c++/v1 ${OPTS} -fno-exceptions -mmacosx-version-min=10.9"
# ALLOPTS="-clang-name=${CLANG} -clangxx-name=${CLANGXX} -stdlib=libc++ -I${PREFIX}/include/c++/v1 ${OPTS} -mmacosx-version-min=10.9"
# -DCMAKE_CXX_COMPILER=icpc \
# -DCMAKE_CXX_FLAGS="${ALLOPTS}" \
# configure
${BUILD_PREFIX}/bin/cmake \
-S ${SRC_DIR} \
-B build \
-G Ninja \
-D CMAKE_INSTALL_PREFIX=${PREFIX} \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_COMPILER=${CLANG} \
-D CMAKE_C_FLAGS="${CFLAGS}" \
-D CMAKE_CXX_COMPILER=${CLANGXX} \
-D CMAKE_CXX_FLAGS="${CXXFLAGS}" \
-D CMAKE_INSTALL_LIBDIR=lib \
-D BUILD_SHARED_LIBS=ON \
-D LIBINT2_SHGAUSS_ORDERING=gaussian \
-D LIBINT2_CARTGAUSS_ORDERING=standard \
-D LIBINT2_SHELL_SET=standard \
-D Eigen3_ROOT=${PREFIX} \
-D ENABLE_FORTRAN=OFF \
-D REQUIRE_CXX_API=ON \
-D REQUIRE_CXX_API_COMPILE=OFF \
-D BUILD_TESTING=ON \
-D ENABLE_XHOST=OFF \
-D CMAKE_OSX_DEPLOYMENT_TARGET="10.10" \
-D CMAKE_OSX_SYSROOT="/Users/github/Git/MacOSX-SDKs/MacOSX10.10.sdk" \
-D CMAKE_VERBOSE_MAKEFILE=ON
#-D LIBINT2_SHGAUSS_ORDERING=gaussian \ usual psi4 gss
#-D LIBINT2_SHGAUSS_ORDERING=standard \ future psi4 sss
# 2019 L2 fork
# -D BUILD_SHARED=ON \
# -D BUILD_STATIC=OFF \
# -D ENABLE_CXX11API=ON \
# -D MPFR_ROOT=${PREFIX} \
# -D BOOST_ROOT=${PREFIX} \
fi
if [ "$(uname)" == "Linux" ]; then
# load Intel compilers
set +x
source /theoryfs2/common/software/intel2021/oneapi/setvars.sh --config="/theoryfs2/common/software/intel2021/oneapi/config-no-intelpython.txt" intel64
set -x
# allow more arguments to avoid the dreaded `x86_64-conda_cos6-linux-gnu-ld: Argument list too long` upon linking
echo `getconf ARG_MAX`
ulimit -s 65535
echo `getconf ARG_MAX`
# link against conda GCC
ALLOPTS="-gnu-prefix=${HOST}- ${OPTS}"
# configure
${BUILD_PREFIX}/bin/cmake \
-S ${SRC_DIR} \
-B build \
-G Ninja \
-D CMAKE_INSTALL_PREFIX=${PREFIX} \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_COMPILER=icpc \
-D CMAKE_CXX_FLAGS="${ALLOPTS}" \
-D CMAKE_INSTALL_LIBDIR=lib \
-D BUILD_SHARED_LIBS=ON \
-D LIBINT2_SHGAUSS_ORDERING=gaussian \
-D LIBINT2_CARTGAUSS_ORDERING=standard \
-D LIBINT2_SHELL_SET=standard \
-D Eigen3_ROOT=${PREFIX} \
-D LIBINT_GENERATE_FMA=ON \
-D ENABLE_XHOST=OFF \
-D REQUIRE_CXX_API=ON \
-D REQUIRE_CXX_API_COMPILE=OFF \
-D ENABLE_FORTRAN=OFF \
-D BUILD_TESTING=ON
fi
# l2cmake
#-D BUILD_SHARED=ON \
#-D BUILD_STATIC=OFF \
#-D ERI3_PURE_SH=OFF \
#-D ERI2_PURE_SH=OFF \
#-D MPFR_ROOT=${PREFIX} \
#-D BOOST_ROOT=${PREFIX} \
#-D ENABLE_CXX11API=ON \
#-DLIBINT2_SHGAUSS_ORDERING=gaussian \ usual psi4 gss
#-DLIBINT2_SHGAUSS_ORDERING=standard \ future psi4 sss
# build & install & test
cmake --build build --target install -j${CPU_COUNT}
# This works for making a conda package out of a pre-built install
#
if [ "$(uname)" == "SpecialLinux" ]; then
PREBUILT=/psi/gits/libint2/install40
cp -pR ${PREBUILT}/* ${PREFIX}
cp ${PREFIX}/lib/pkgconfig/libint2.pc tmp0
sed "s|$PREBUILT|/opt/anaconda1anaconda2anaconda3|g" tmp0 > tmp1
cp tmp1 ${PREFIX}/lib/pkgconfig/libint2.pc
fi