Skip to content

Commit

Permalink
debug examples
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed May 7, 2024
1 parent 546a7f3 commit 45ba5c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[build]
rustflags = "-C target-cpu=native"
rustflags = "-C target-cpu=x86-64"

[env]
HIPCC_VERBOSE = "1"
HYPERBEAM_HIP_ARCH = "native"
22 changes: 9 additions & 13 deletions .github/workflows/run-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,21 @@ jobs:
- name: Run C examples
run: |
cargo build
echo "*** Compiling C examples ***"
# The macOS runner has clang symlinked as gcc, and attempting to alias
# gcc as /usr/local/bin/gcc doesn't work! Why???
if [ "$RUNNER_OS" == "Linux" ]; then
gcc -O3 examples/fee.c -o fee -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
gcc -O3 examples/fee_parallel.c -o fee_parallel -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
gcc -O3 -fopenmp examples/fee_parallel_omp.c -o fee_parallel_omp -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
gcc -O3 examples/fee_get_freqs.c -o fee_get_freqs -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
gcc -O3 examples/analytic.c -o analytic -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
gcc -O3 examples/analytic_parallel.c -o analytic_parallel -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
export CC=gcc
else
/usr/local/bin/gcc-12 -O3 examples/fee.c -o fee -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
/usr/local/bin/gcc-12 -O3 examples/fee_parallel.c -o fee_parallel -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
/usr/local/bin/gcc-12 -O3 -fopenmp examples/fee_parallel_omp.c -o fee_parallel_omp -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
/usr/local/bin/gcc-12 -O3 examples/fee_get_freqs.c -o fee_get_freqs -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
/usr/local/bin/gcc-12 -O3 examples/analytic.c -o analytic -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
/usr/local/bin/gcc-12 -O3 examples/analytic_parallel.c -o analytic_parallel -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
brew install gcc@12
export CC=$(brew --prefix gcc)/bin/gcc-12
fi
$CC -O3 examples/fee.c -o fee -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
$CC -O3 examples/fee_parallel.c -o fee_parallel -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
$CC -O3 -fopenmp examples/fee_parallel_omp.c -o fee_parallel_omp -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
$CC -O3 examples/fee_get_freqs.c -o fee_get_freqs -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
$CC -O3 examples/analytic.c -o analytic -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
$CC -O3 examples/analytic_parallel.c -o analytic_parallel -I ./include/ -L ./target/debug/ -l mwa_hyperbeam
echo "*** Running C examples ***"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./target/debug/ ./fee mwa_full_embedded_element_pattern.h5
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./target/debug/ ./fee_parallel mwa_full_embedded_element_pattern.h5
Expand Down

0 comments on commit 45ba5c7

Please sign in to comment.