Skip to content

Commit 0e41e05

Browse files
committed
Merge branch 'master' of https://github.com/SRI-CSL/libpoly
2 parents 1f52c78 + a0873c8 commit 0e41e05

File tree

5 files changed

+1046
-445
lines changed

5 files changed

+1046
-445
lines changed

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ env:
2828
# iam: the precise versions are need, so we know whether we have to install
2929
# or just choose. I picked these, because only 2.7.15 and 3.6.7 needs to be built (on osx).
3030
# the linux image has these versions already.
31-
- CMAKE_BUILD_TYPE=Debug PYTHON=2.7.15
31+
# iam: i remove the 2.7.15 because its no longer a going concern.
32+
# - CMAKE_BUILD_TYPE=Debug PYTHON=2.7.15
3233
- CMAKE_BUILD_TYPE=Debug PYTHON=3.6.7
33-
- CMAKE_BUILD_TYPE=Release PYTHON=2.7.15
34+
# - CMAKE_BUILD_TYPE=Release PYTHON=2.7.15
3435
- CMAKE_BUILD_TYPE=Release PYTHON=3.6.7
3536

3637
install:

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ For example, to use Python3 you can configure the project with
6060
cmake .. -DPython_ADDITIONAL_VERSIONS=3
6161
```
6262

63+
### Python Version Skew
64+
65+
On some platforms (i.e. Mac) cmake picks different python installations for the headers and library. If this happens,
66+
you might try:
67+
```cmake
68+
cmake .. -DCMAKE_BUILD_TYPE=$type -DPYTHON_LIBRARY=$pythonlibrary -DPYTHON_INCLUDE_DIR=$pythonheaderfiledir
69+
```
70+
For example:
71+
```
72+
cmake .. -DCMAKE_BUILD_TYPE=Release -DPYTHON_LIBRARY=/opt/homebrew/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib -DPYTHON_INCLUDE_DIR=/opt/homebrew/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/include/python3.9/
73+
```
6374
## Installing Prebuilt Binaries
6475

6576
Currently you can install the libpoly library (without python support) either using

src/CMakeLists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,16 @@ endif()
122122
# Linux, FreeBSD, and old versions of Darwin (and probably other systems) don't use fPIC by default.
123123
# We just check for Linux and FreeBSD here.
124124
#
125-
if(LIBPOLY_BUILD_STATIC_PIC AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
125+
if(LIBPOLY_BUILD_STATIC_PIC)
126126
add_library(static_pic_poly STATIC ${poly_SOURCES})
127127
set_target_properties(static_pic_poly PROPERTIES OUTPUT_NAME picpoly POSITION_INDEPENDENT_CODE true)
128128

129129
add_library(static_pic_polyxx STATIC ${polyxx_SOURCES})
130130
set_target_properties(static_pic_polyxx PROPERTIES OUTPUT_NAME picpolyxx POSITION_INDEPENDENT_CODE true)
131131
target_link_libraries(static_pic_polyxx static_pic_poly)
132+
133+
if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD"))
134+
set_target_properties(static_pic_poly PROPERTIES EXCLUDE_FROM_ALL ON)
135+
set_target_properties(static_pic_polyxx PROPERTIES EXCLUDE_FROM_ALL ON)
136+
endif()
132137
endif()

src/number/algebraic_number.c

+4
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,8 @@ void lp_algebraic_number_op(
667667
integer_neg(lp_Z, &p_neg, &a->I.a.a);
668668
dyadic_rational_get_den(&a->I.a, &q);
669669
coefficient_construct_linear(ctx, &f_a, &q, &p_neg, var_x);
670+
lp_integer_destruct(&p_neg);
671+
lp_integer_destruct(&q);
670672
}
671673
if (trace_is_enabled("algebraic_number")) {
672674
tracef("f_a = "); coefficient_print(ctx, &f_a, trace_out); tracef("\n");
@@ -684,6 +686,8 @@ void lp_algebraic_number_op(
684686
integer_neg(lp_Z, &p_neg, &b->I.a.a);
685687
dyadic_rational_get_den(&b->I.a, &q);
686688
coefficient_construct_linear(ctx, &f_b, &q, &p_neg, var_y);
689+
lp_integer_destruct(&p_neg);
690+
lp_integer_destruct(&q);
687691
}
688692
if (trace_is_enabled("algebraic_number")) {
689693
tracef("f_b = "); coefficient_print(ctx, &f_b, trace_out); tracef("\n");

0 commit comments

Comments
 (0)