Skip to content

more general build_lib script #1291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions hls4ml/templates/catapult/build_lib.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

CC=g++
if [[ "$OSTYPE" == "linux-gnu" ]]; then
CFLAGS="-O3 -fPIC -std=c++11 -fno-gnu-unique"
elif [[ "$OSTYPE" == "linux"* ]]; then
CFLAGS="-O3 -fPIC -std=c++11 -fno-gnu-unique -Wno-pragmas"
elif [[ "$OSTYPE" == "darwin"* ]]; then
CFLAGS="-O3 -fPIC -std=c++11"
CFLAGS="-O3 -fPIC -std=c++11"

# Include -fno-gnu-unique if it is there
if echo "" | ${CC} -Werror -fsyntax-only -fno-gnu-unique -xc++ - -o /dev/null &> /dev/null; then
CFLAGS+=" -fno-gnu-unique -Wno-pragmas"
fi

LDFLAGS=

# Pick up AC libraries from Catapult install first
Expand Down
10 changes: 6 additions & 4 deletions hls4ml/templates/quartus/build_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
set -e

CC=g++
if [[ "$OSTYPE" == "linux-gnu" ]]; then
CFLAGS="-O3 -fPIC -std=c++11 -fno-gnu-unique"
elif [[ "$OSTYPE" == "darwin"* ]]; then
CFLAGS="-O3 -fPIC -std=c++11"
CFLAGS="-O3 -fPIC -std=c++11"

# Include -fno-gnu-unique if it is there
if echo "" | ${CC} -Werror -fsyntax-only -fno-gnu-unique -xc++ - -o /dev/null &> /dev/null; then
CFLAGS+=" -fno-gnu-unique"
fi

LDFLAGS=
INCFLAGS="-Ifirmware/ac_types/ -Ifirmware/ap_types/"
PROJECT=myproject
Expand Down
10 changes: 6 additions & 4 deletions hls4ml/templates/symbolic/build_lib.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash

CC=g++
if [[ "$OSTYPE" == "linux-gnu" ]]; then
CFLAGS="-O3 -fPIC -std=c++11 -fno-gnu-unique"
elif [[ "$OSTYPE" == "darwin"* ]]; then
CFLAGS="-O3 -fPIC -std=c++11"
CFLAGS="-O3 -fPIC -std=c++11"

# Include -fno-gnu-unique if it is there
if echo "" | ${CC} -Werror -fsyntax-only -fno-gnu-unique -xc++ - -o /dev/null &> /dev/null; then
CFLAGS+=" -fno-gnu-unique"
fi

HLS_LIBS_PATH=mylibspath
LDFLAGS="-Wl,--no-undefined -Wl,--no-allow-shlib-undefined -Wl,--no-as-needed -Wl,-rpath,${HLS_LIBS_PATH}/lib/csim -L ${HLS_LIBS_PATH}/lib/csim -lhlsmc++-GCC46 -lhlsm-GCC46 -fno-builtin -fno-inline -Wl,-rpath,${HLS_LIBS_PATH}/tools/fpo_v7_0 -L ${HLS_LIBS_PATH}/tools/fpo_v7_0 -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel"
INCFLAGS="-Ifirmware/ap_types/"
Expand Down
10 changes: 6 additions & 4 deletions hls4ml/templates/vivado/build_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
set -e

CC=g++
if [[ "$OSTYPE" == "linux-gnu" ]]; then
CFLAGS="-O3 -fPIC -std=c++11 -fno-gnu-unique"
elif [[ "$OSTYPE" == "darwin"* ]]; then
CFLAGS="-O3 -fPIC -std=c++11"
CFLAGS="-O3 -fPIC -std=c++11"

# Include -fno-gnu-unique if it is there
if echo "" | ${CC} -Werror -fsyntax-only -fno-gnu-unique -xc++ - -o /dev/null &> /dev/null; then
CFLAGS+=" -fno-gnu-unique"
fi

LDFLAGS=
INCFLAGS="-Ifirmware/ap_types/"
PROJECT=myproject
Expand Down
10 changes: 6 additions & 4 deletions hls4ml/templates/vivado_accelerator/build_lib.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash

CC=g++
if [[ "$OSTYPE" == "linux-gnu" ]]; then
CFLAGS="-O3 -fPIC -std=c++11 -fno-gnu-unique"
elif [[ "$OSTYPE" == "darwin"* ]]; then
CFLAGS="-O3 -fPIC -std=c++11"
CFLAGS="-O3 -fPIC -std=c++11"

# Include -fno-gnu-unique if it is there
if echo "" | ${CC} -Werror -fsyntax-only -fno-gnu-unique -xc++ - -o /dev/null &> /dev/null; then
CFLAGS+=" -fno-gnu-unique"
fi

INCFLAGS="-Ifirmware/ap_types/"
PROJECT=myproject
LIB_STAMP=mystamp
Expand Down
Loading