Skip to content

Commit

Permalink
conditional mpfr
Browse files Browse the repository at this point in the history
  • Loading branch information
AngryMaciek committed Aug 5, 2023
1 parent 8a25d08 commit 9b10b39
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Compile Docs Test Program
working-directory: ${{env.test-directory}}
run: g++ --std=c++17 test.cpp -o test -lmpfr -lgmp
run: g++ -DUSEMPFR=1 --std=c++17 test.cpp -o test -lmpfr -lgmp

- name: Execute Test Program
working-directory: ${{env.test-directory}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:

- name: Compile Test Program
working-directory: ${{env.working-directory}}
run: g++ -O0 -fprofile-arcs -ftest-coverage -fno-elide-constructors -Wall --std=c++17 --coverage -o test test.cpp -lmpfr -lgmp
run: g++ -DUSEMPFR=1 -O0 -fprofile-arcs -ftest-coverage -fno-elide-constructors -Wall --std=c++17 --coverage -o test test.cpp -lmpfr -lgmp

- name: Execute Test Program
working-directory: ${{env.working-directory}}
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:

- name: Compile Test Program
working-directory: ${{env.working-directory}}
run: g++ -O0 -Wall --std=c++17 -o test test.cpp -lmpfr -lgmp
run: g++ -DUSEMPFR=1 -O0 -Wall --std=c++17 -o test test.cpp -lmpfr -lgmp

- name: Analyze Test Program Exec
working-directory: ${{env.working-directory}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Compile Test Program
working-directory: ${{env.working-directory}}
run: g++ --std=c++17 test.cpp -o test -lmpfr -lgmp
run: g++ --std=c++17 test.cpp -o test

- name: Execute Test Program
working-directory: ${{env.working-directory}}
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:

- name: Compile Test Program
working-directory: ${{env.test-directory}}
run: g++ --std=c++17 test.cpp -o test -lmpfr -lgmp
run: g++ --std=c++17 test.cpp -o test

- name: Execute Test Program
working-directory: ${{env.test-directory}}
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:

- name: Compile Test Program
shell: bash -l {0}
run: g++ --std=c++17 -I$CONDA_PREFIX/include -L$CONDA_PREFIX/lib .test/install/test.cpp -o test -lmpfr -lgmp
run: g++ --std=c++17 .test/install/test.cpp -o test

- name: Execute Test Program
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test:
@mkdir .test/unit/hypercomplex
@cp hypercomplex/Hypercomplex.hpp .test/unit/hypercomplex/Hypercomplex.hpp
@cp hypercomplex/Polynomial.hpp .test/unit/hypercomplex/Polynomial.hpp
@g++ -O0 -Wall --std=c++17 -o test .test/unit/test.cpp -lmpfr -lgmp
@g++ -DUSEMPFR=1 -O0 -Wall --std=c++17 -o test .test/unit/test.cpp -lmpfr -lgmp
@./test [unit] -d yes -w NoAssertions --use-colour yes --benchmark-samples 100 --benchmark-resamples 100000
@rm -rf .test/unit/hypercomplex test

Expand Down
7 changes: 7 additions & 0 deletions hypercomplex/Hypercomplex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
#ifndef HYPERCOMPLEX_HYPERCOMPLEX_HPP_
#define HYPERCOMPLEX_HYPERCOMPLEX_HPP_

// Conditional MPFR inclusion
#ifndef USEMPFR
#define USEMPFR 0
#endif
#if USEMPFR
#include <mpfr.h>
#endif

#include <cassert>
#include <cmath>
#include <iostream>
Expand Down

0 comments on commit 9b10b39

Please sign in to comment.