Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Mathias Kraus
abakus
Commits
d8ef71e9
Commit
d8ef71e9
authored
Dec 07, 2007
by
Michael Pyne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in proper configure check for mpfr.
svn path=/trunk/playground/utils/abakus/; revision=745805
parent
3603cf6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
CMakeLists.txt
CMakeLists.txt
+18
-0
src/CMakeLists.txt
src/CMakeLists.txt
+1
-1
src/numerictypes.h
src/numerictypes.h
+1
-1
No files found.
CMakeLists.txt
View file @
d8ef71e9
...
...
@@ -4,6 +4,24 @@ set (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
FIND_PACKAGE
(
KDE4 REQUIRED
)
include
(
KDE4Defaults
)
include
(
CheckCXXSourceCompiles
)
# Check for libmpfr and libgmp, and verify existence of _mpfr_struct
set
(
CMAKE_REQUIRED_LIBRARIES gmp mpfr
)
check_cxx_source_compiles
(
"#include <mpfr.h>
int main() {
mpfr_t a;
mpfr_ptr ptr;
__mpfr_struct debug;
mpfr_init(a);
return 0;
}
"
HAVE_MPFR
)
INCLUDE_DIRECTORIES
(
${
KDE4_INCLUDES
}
${
QT4_INCLUDES
}
)
ADD_DEFINITIONS
(
${
QT_DEFINITIONS
}
${
KDE4_DEFINITIONS
}
)
...
...
src/CMakeLists.txt
View file @
d8ef71e9
...
...
@@ -123,8 +123,8 @@ set(abakus_SRCS
)
set
(
MPFR_LIBS
)
set
(
HAVE_MPFR 0
)
IF
(
HAVE_MPFR
)
MESSAGE
(
"Using the MPFR high-precision mathematics library"
)
SET
(
MPFR_LIBS mpfr gmp
)
ELSE
(
HAVE_MPFR
)
SET
(
abakus_SRCS
${
abakus_SRCS
}
hmath.cpp number.c
)
...
...
src/numerictypes.h
View file @
d8ef71e9
...
...
@@ -260,7 +260,7 @@ public:
explicit
number
(
const
QByteArray
&
str
)
{
m_t
=
(
mpfr_ptr
)
new
__mpfr_struct
;
mpfr_init_set_str
(
m_t
r
,
str
.
constData
(),
10
,
RoundDirection
);
mpfr_init_set_str
(
m_t
,
str
.
constData
(),
10
,
RoundDirection
);
}
explicit
number
(
int
i
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment