These are chat archives for symengine/symengine

14th
Aug 2016
Brent Lewis
@coder0xff
Aug 14 2016 00:27
Interestingly, doing a find/replace on gmp.h s/__gmpz/_gmpz/g (2 and 1 underscores, vs 3 and 2) works. Where on Earth is it getting the extra underscore from?
Isuru Fernando
@isuruf
Aug 14 2016 15:05
@coder0xff, that's really weird. Did you use VS2015 to compile mpir.lib as well?
Brent Lewis
@coder0xff
Aug 14 2016 15:21
Yeah
Isuru Fernando
@isuruf
Aug 14 2016 15:23
Both in Release version or both in Debug version?
Brent Lewis
@coder0xff
Aug 14 2016 15:23
Debug for both
Isuru Fernando
@isuruf
Aug 14 2016 15:28
dll libraries or static ones? If dll, then what is the cmake version?
Brent Lewis
@coder0xff
Aug 14 2016 15:28
static
Brent Lewis
@coder0xff
Aug 14 2016 15:37
Just figured it out. I was building mpir in x64 instead of win32. Switching it seems to have solved it.
Isuru Fernando
@isuruf
Aug 14 2016 15:41
Ah, great.
Brent Lewis
@coder0xff
Aug 14 2016 15:56
Next problem: I'm using "cmake --build" to build symengine, and I'm getting a .lib that is built with /MTd despite "CMAKE_CXX_FLAGS_DEBUG" having /MDd specified
ie. built with a static MSVC runtime instead of the DLL version
Oh derp
The build type is release
It's amazing what you can miss after toiling all day, and than catch right away after a good night's rest. :)
Brent Lewis
@coder0xff
Aug 14 2016 16:16
I'm using mpir's build.vc14/msbuild.bat to create the .h and .lib files, but it does not create a gmpConfig.cmake. How do I get that?
Isuru Fernando
@isuruf
Aug 14 2016 16:17
You'll have to write a FindGMP.cmake. Upstream doesn't provide those
Brent Lewis
@coder0xff
Aug 14 2016 16:17
ok
Is symengine meant to work when added via cmake's add_subdirectory ?
I've only gotten it to build by having a custom target that calls "cmake --build"
Also, in your comment about GMP_LIBRARY, I'm assuming that it's supposed to point to a gmpConfig.cmake? Or is it just supposed to point to where the lib and h are?
Isuru Fernando
@isuruf
Aug 14 2016 16:24
You can use GMP_LIBRARIES and GMP_INCLUDE_DIRS for where lib and h are. If you want to give a full path to the library including the library name you can use GMP_LIBRARY.
Also you can use CMAKE_PREFIX_PATH to give the directory
About add_subdirectory, I don't think I've tried that. ExternalProject_Add might do the same thing you are doing now.
Brent Lewis
@coder0xff
Aug 14 2016 16:30
In the case of ExternalProject_Add, how do I get my executable to depend on the lib output?
Isuru Fernando
@isuruf
Aug 14 2016 16:36
Hmm, something like, ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_STATIC_MODULE_PREFIX}symengine${CMAKE_STATIC_LIB‌​RARY_SUFFIX} will give the library built
Brent Lewis
@coder0xff
Aug 14 2016 16:44
Setting GMP_INCLUDE_DIRS and GMP_LIBRARIES has no affect. I get "Could NOT find GMP (missing: GMP_LIBRARIES GMP_INCLUDE_DIRS)" which was why I made that change in the pull request.
Brent Lewis
@coder0xff
Aug 14 2016 17:03
In other words, the instructions in the link you gave (external-libraries) does not work with MSVC
If it had, then the patch I submitted would have had no effect. It does though.