These are chat archives for symengine/symengine

10th
Nov 2016
Brent Lewis
@coder0xff
Nov 10 2016 01:12
I have the following in my projects CMakeLists.txt http://pastebin.com/r4tV6psk but it doesn't build the teuchos library.
Makefile default build in Ubuntu
Isuru Fernando
@isuruf
Nov 10 2016 02:23
@coder0xff, teuchos is not used by default. (Debug mode or WITH_BFD would trigger a teuchos build)
@ShikharJ, can you post the error message in full?
Brent Lewis
@coder0xff
Nov 10 2016 04:07
Is there a CMake variable for the list of libraries that I should pass to target_link_libraries?
Isuru Fernando
@isuruf
Nov 10 2016 04:14
@coder0xff, you should just use the target symengine and it should have all the libraries linked to it
Brent Lewis
@coder0xff
Nov 10 2016 04:23
If I do just symengine I get "unresolved external symbol"s from Teuchos in VS in debug
Isuru Fernando
@isuruf
Nov 10 2016 04:24
@coder0xff, did you use the target or just the library?
Brent Lewis
@coder0xff
Nov 10 2016 04:24
Though, this might be part of the problem: https://github.com/coder0xff/Plange/blob/master/CMakeLists.txt#L22
target_link_libraries(plc parlex utilities LLVMCore LLVMSupport symengine)
I just spent a few weeks trying to get all my stuff to build in VS, but now I'm having *nix problems. :/
Isuru Fernando
@isuruf
Nov 10 2016 04:26
Ah right, you are not using subproject
Maybe you can load SymEngineConfig.cmake
That is out-of-date at line 42
Isuru Fernando
@isuruf
Nov 10 2016 04:30
This should work, target_link_libraries(plc parlex utilities LLVMCore LLVMSupport ${SYMENGINE_LIBRARIES})
Otherwise it's a symengine bug
@coder0xff, include("${DEP_DIR}/symengine/CMake/SymEngineConfig.cmake") this location is only true for windows
Brent Lewis
@coder0xff
Nov 10 2016 04:32
Sorry, that line's outdated too. I'll push my changes real quick.
Shikhar Jaiswal
@ShikharJ
Nov 10 2016 04:33
@isuruf It is an error that my IDE (CLion) is showing (underlining with red). It says "Error after Macro Substitution: Invalid Suffix on Floating Constant". My guess would be that the _Complex_I macro expands to a value of type const float _Complex.
Brent Lewis
@coder0xff
Nov 10 2016 04:34
I'm running a build on this copy ATM
Isuru Fernando
@isuruf
Nov 10 2016 04:34
@coder0xff, that should work. can you try printing ${SYMENGINE_LIBRARIES} to see whether teuchos is there for a debug build?
Brent Lewis
@coder0xff
Nov 10 2016 04:34
sure
Isuru Fernando
@isuruf
Nov 10 2016 04:35
@ShikharJ, can you run make and send the error ?
Shikhar Jaiswal
@ShikharJ
Nov 10 2016 04:37
Scanning dependencies of target symengine
[  1%] Building CXX object symengine/CMakeFiles/symengine.dir/cwrapper.cpp.o
In file included from /usr/include/c++/5/complex.h:36:0,
                 from /home/shikhar/symengine/symengine/cwrapper.h:7,
                 from /home/shikhar/symengine/symengine/cwrapper.cpp:5:
/home/shikhar/symengine/symengine/constants.h:61:43: error: expected unqualified-id before ‘__extension__’
 extern SYMENGINE_EXPORT RCP<const Number> I;
                                           ^
/home/shikhar/symengine/symengine/constants.h:61:43: error: expected ‘)’ before ‘__extension__’
/home/shikhar/symengine/symengine/cwrapper.cpp: In function ‘void basic_const_I(basic_struct*)’:
/home/shikhar/symengine/symengine/cwrapper.cpp:129:23: error: expected unqualified-id before ‘(’ token
     s->m = SymEngine::I;
                       ^
/home/shikhar/symengine/symengine/cwrapper.cpp:129:23: error: unable to find numeric literal operatoroperator""iF’
     s->m = SymEngine::I;
                       ^
/home/shikhar/symengine/symengine/cwrapper.cpp:129:23: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
/home/shikhar/symengine/symengine/cwrapper.cpp: In function ‘CWRAPPER_OUTPUT_TYPE complex_double_get(__complex__ double, basic_struct*)’:
/home/shikhar/symengine/symengine/cwrapper.cpp:443:18: error: unable to find numeric literal operatoroperator""iF’
     d = i.imag()*_Complex_I;
                  ^
/home/shikhar/symengine/symengine/cwrapper.cpp:443:18: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
symengine/CMakeFiles/symengine.dir/build.make:808: recipe for target 'symengine/CMakeFiles/symengine.dir/cwrapper.cpp.o' failed
make[2]: *** [symengine/CMakeFiles/symengine.dir/cwrapper.cpp.o] Error 1
CMakeFiles/Makefile2:159: recipe for target 'symengine/CMakeFiles/symengine.dir/all' failed
make[1]: *** [symengine/CMakeFiles/symengine.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Isuru Fernando
@isuruf
Nov 10 2016 04:38
This is a conflict of SymEngine::I and the macro I. do #undef I after including complex.h
Shikhar Jaiswal
@ShikharJ
Nov 10 2016 04:39
I'll try that and get back to you if necessary. Thanks!
Brent Lewis
@coder0xff
Nov 10 2016 04:42
looking good on the VS Debug side so far. Output of var as requested: symengine;teuchos;C:/Users/Brent/Desktop/plange.build/Dependencies/mpir/mpir.lib
Good on *nix side too. Thanks. Would you comment on https://github.com/coder0xff/Plange/blob/master/CMakeLists.txt#L58 which is for MSVC ? I was unable to get the teuchos .lib to build in MSVC debug without the explicit -DCMAKE_BUILD_TYPE
Which forced me to move the config step into the build step so that ${CMAKE_CFG_INTDIR} would work
Isuru Fernando
@isuruf
Nov 10 2016 04:53
That's strange. Although, I'm not surprised because CMake supports multiple configurations and symengine doesn't support that.
I mean CMake supports multiple configurations for MSVC
Brent Lewis
@coder0xff
Nov 10 2016 04:54
Right
With this trick I've worked around symengine not supporting it
different build directories for different configs
Isuru Fernando
@isuruf
Nov 10 2016 04:55
Do you have experience with it?
How do I link to both Release and Debug without different build directories?
Brent Lewis
@coder0xff
Nov 10 2016 04:56
I have the install directory the same for all configurations, so whichever build is the last to be ran installs the right library version
Isuru Fernando
@isuruf
Nov 10 2016 04:58
What I meant was, to support symengine for multiple configurations, how do I link to say Release and Debug versions of mpir and how do I handle a situation where only one library is found?
Brent Lewis
@coder0xff
Nov 10 2016 05:00
It's completely dependent on the super build. The symengine ExternalProject depends on https://github.com/coder0xff/Plange/blob/master/CMakeLists.txt#L42 being done before configuration even happens. There is ever only a debug lib or a release lib.
Shikhar Jaiswal
@ShikharJ
Nov 10 2016 06:07
[  1%] Building CXX object symengine/CMakeFiles/symengine.dir/cwrapper.cpp.o
In file included from /usr/include/c++/5/complex.h:36:0,
                 from /home/shikhar/symengine/symengine/cwrapper.h:7,
                 from /home/shikhar/symengine/symengine/cwrapper.cpp:5:
/home/shikhar/symengine/symengine/cwrapper.cpp: In function ‘CWRAPPER_OUTPUT_TYPE complex_double_get(__complex__ double, basic_struct*)’:
/home/shikhar/symengine/symengine/cwrapper.cpp:442:18: error: unable to find numeric literal operatoroperator""iF’
     d = i.imag()*_Complex_I + i.real();
                  ^
/home/shikhar/symengine/symengine/cwrapper.cpp:442:18: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
symengine/CMakeFiles/symengine.dir/build.make:808: recipe for target 'symengine/CMakeFiles/symengine.dir/cwrapper.cpp.o' failed
make[2]: *** [symengine/CMakeFiles/symengine.dir/cwrapper.cpp.o] Error 1
CMakeFiles/Makefile2:159: recipe for target 'symengine/CMakeFiles/symengine.dir/all' failed
make[1]: *** [symengine/CMakeFiles/symengine.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
@isuruf I am still facing this error.
RiteshKB
@RiteshKB
Nov 10 2016 11:27
@isuruf can u tell me how to change mpir files to gmp?
Shikhar Jaiswal
@ShikharJ
Nov 10 2016 15:38
@isuruf The problem is that using -fext-numeric-literals works locally (as the gcc version I use is 5.4.0) but this command fails for all the previous versions on Travis builds.
Most of them use 4.6.3
Isuru Fernando
@isuruf
Nov 10 2016 15:51
@RiteshKB, what do you mean?
Isuru Fernando
@isuruf
Nov 10 2016 15:59
@RiteshKB, I think it's easier to return a struct instead of using double complex from C99.
typedef struct dcomplex {
    double real;
    double imag;
} dcomplex;