-
Notifications
You must be signed in to change notification settings - Fork 244
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
experimental NTL support for cmake #543
Conversation
/opt/local # DarwinPorts | ||
/opt/csw # Blastwave | ||
/opt | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change this to,
FIND_PATH(NTL_INCLUDE_DIR NTL/RR.h
HINTS
$ENV{NTLDIR}
)
/opt/local | ||
/opt/csw | ||
/opt | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIND_LIBRARY(NTL_LIBRARY
NAMES ntl
HINTS
$ENV{NTLDIR}
)
CMakeLists.txt
Outdated
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") | ||
|
||
find_package(GMP REQUIRED) | ||
find_package(MPFR REQUIRED) | ||
find_package(NTL REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this optional as NTL with MPIR on windows 64-bit assumes LP64 and doesn't work.
Something like,
option(WITH_NTL "Build with NTL interface" OFF)
if (WITH_NTL)
find_package(NTL REQUIRED)
endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does one check this ? Is it cmake -D???
for some value of ???
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, cmake -DWITH_NTL=yes
would enable it.
CMakeLists.txt
Outdated
@@ -182,16 +184,17 @@ endforeach() | |||
file(GLOB TEMP "${CMAKE_SOURCE_DIR}/*.h") | |||
list(APPEND HEADERS ${TEMP}) | |||
|
|||
add_library(flint ${SOURCES}) | |||
add_library(flint SHARED ${SOURCES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it impossible to build static libraries if needed. There's an option cmake -DBUILD_SHARED_LIBS=on
which would build a shared library. (You could change the default value of off in BUILD_SHARED_LIBS to on if you like)
Thanks - today I touched cmake configs for the 1st time - no wonder this is very far from prefect. |
By the way, how do you test flint's cmake build? |
We don't. We had CI for a while, but it wasn't passing anyway, so we switched it off. |
cmake build does not seem to be working on Linux (Ubuntu 18) --- as well as on FreeBSD, in fact - I overlooked this) for me,
whereas on the system I install libflint using apt and see
So there is a linking problem. What is this? A bug in Cmake? (As NTL is a C++ library, it's less obvious for cmake what to do). Same with cmake versions 3.12.1 and 3.13.4. |
Cmake ntl
After the update from @isuruf it seems to be possible to build and test with NTL on linux (latest Ubunti 18, and Gentoo) and FreeBSD, however tests get stuck on |
You are probably building in Debug mode. Did you try |
It tries to factor some huge polynomials. I think @isuruf is right. I must speed that code up some day. |
OK, this works, thanks. |
I've added 11a4f5d to allow building on Gentoo, where GMP headers have a different layout to what's programmed in |
dimpase#2 changes some default options and fixes some things |
Add flags from makefile build
here is a passing with tests and NTL cmake Travis build: https://travis-ci.com/dimpase/flint2/builds/101585015 from https://github.com/dimpase/flint2/tree/travis_cmake Would you like this merged into this PR? |
Yes, go ahead and put it into this PR. Thanks for your efforts. |
@dimpase, do you mind adding a cmake job in addition to the other CI jobs? |
yes, that's what I am going to do, add things in my experimental branch to the pull request (naturally, adding them to the other CI things) |
Thanks. I've got a branch that fixes cmake builds on windows CI (except for 4 tests) on top of this branch. I'll send that when this PR is merged. |
OK, I think I'm done with this, please review. |
Probably Travis script may be made more clear by using their "matrix" stuff, but this can be done later. |
Thanks. I'll wait for @isuruf to sign off on it, then I'll merge it. I'm virtually ignorant about CMake. |
for more knowledgeable in cmake people to look at. It does build on FreeBSD.