Skip to content

Commit

Permalink
Remove Ninja and fix external libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
twesterhout committed Feb 12, 2021
1 parent f94971d commit ff299cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
19 changes: 15 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ set -o pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd -L | sed 's://:/:g')"
WORKDIR="${SCRIPT_DIR}/third_party/build"

get_num_procs() {
if [[ "$OSTYPE" == "darwin"* ]]; then
sysctl -n hw.logicalcpu
else
nproc
fi
}

download_lattice_symmetries() {
mkdir -vp "$WORKDIR"
pushd "$WORKDIR"
Expand All @@ -31,12 +39,13 @@ build_static_lib() {
export CFLAGS="-march=nocona -mtune=haswell -fstack-protector-strong -fno-plt -ffunction-sections"
export LDFLAGS="-Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -Wl,--disable-new-dtags"
export PREFIX="${SCRIPT_DIR}/third_party/lattice-symmetries"
cmake -GNinja -DCMAKE_INSTALL_PREFIX="$PREFIX" \
cmake \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DLatticeSymmetries_ENABLE_UNIT_TESTING=OFF \
..
cmake --build .
cmake --build . -- -j$(get_num_procs)
cmake --build . --target install
popd
popd
Expand All @@ -46,10 +55,12 @@ generate_buildinfo() {
cat <<-EOF
include-dirs:
${PREFIX}/include
extra-libraries:
lattice_symmetries
extra-lib-dirs:
${PREFIX}/lib64
${PREFIX}/lib
extra-libraries:
lattice_symmetries
stdc++
EOF
}

Expand Down
3 changes: 0 additions & 3 deletions spin-ed.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ library
, SpinED.Internal
, Prelude
other-modules: Paths_spin_ed
extra-libraries: lattice_symmetries
, stdc++
, gomp
ghc-options: -O2
-fexpose-all-unfoldings
-fspecialise-aggressively
Expand Down

0 comments on commit ff299cf

Please sign in to comment.