github-actions[bot] on gh-pages
deploy: fd031ff65db5c885fcd11c8… (compare)
rikardn on master
Support Mul and Pow in is_real … Merge pull request #1923 from r… (compare)
github-actions[bot] on gh-pages
deploy: d21d3b513404c48071ea96d… (compare)
rikardn on master
Use override for overriding fun… Merge pull request #1919 from r… (compare)
Hi,
I'm trying to build symengine and I am running into some errors when I set the -DCMAKE_BUILD_TYPE=Debug and -DWITH_BFD=yes.
/home/naveen/dev/symengine/symengine/utilities/teuchos/Teuchos_stacktrace.cpp: In function ‘void {anonymous}::process_section(bfd*, asection*, void*)’:
/home/naveen/dev/symengine/symengine/utilities/teuchos/Teuchos_stacktrace.cpp:193:8: error: ‘bfd_get_section_flags’ was not declared in this scope; did you mean ‘bfd_set_section_flags’?
193 | if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~
| bfd_set_section_flags
/home/naveen/dev/symengine/symengine/utilities/teuchos/Teuchos_stacktrace.cpp:197:25: error: ‘bfd_get_section_vma’ was not declared in this scope; did you mean ‘bfd_set_section_vma’?
197 | bfd_vma section_vma = bfd_get_section_vma(abfd, section);
| ^~~~~~~~~~~~~~~~~~~
| bfd_set_section_vma
/home/naveen/dev/symengine/symengine/utilities/teuchos/Teuchos_stacktrace.cpp:203:49: error: cannot convert ‘bfd*’ to ‘const asection*’ {aka ‘const bfd_section*’}
203 | bfd_size_type section_size = bfd_section_size(abfd, section);
| ^~~~
| |
| bfd*
In file included from /home/naveen/dev/symengine/symengine/utilities/teuchos/Teuchos_stacktrace.cpp:73:
/usr/include/bfd.h:1206:35: note: initializing argument 1 of ‘bfd_size_type bfd_section_size(const asection*)’
1206 | bfd_section_size (const asection *sec)
| ~~~~~~~~~~~~~~~~^~~
make[2]: *** [symengine/utilities/teuchos/CMakeFiles/teuchos.dir/build.make:128: symengine/utilities/teuchos/CMakeFiles/teuchos.dir/Teuchos_stacktrace.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:784: symengine/utilities/teuchos/CMakeFiles/teuchos.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
I did search a little and found out that binutils-dev>2.34 has a change in its API. Can anyone help me out in fixing this?
I compiled without these options and the build was successful. Even ctest works. However, I have a question. Can I actually use the library directly in C++? I tried to compile this piece of code, but I get an error again.
#include <symengine/basic.h>
#include <symengine/symbol.h>
using SymEngine::Basic;
using SymEngine::Symbol;
using SymEngine::RCP;
using SymEngine::symbol;
int main()
{
RCP<const Basic> x = symbol("x");
}
This is the error I get.
(base) naveen@naveen-Legion-Y545:~/dev/projects$ g++ symengine.cpp
/usr/bin/ld: /tmp/ccSCjgXA.o: in function `SymEngine::RCP<SymEngine::Symbol const> SymEngine::make_rcp<SymEngine::Symbol const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
symengine.cpp:(.text._ZN9SymEngine8make_rcpIKNS_6SymbolEJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEENS_3RCPIT_EEDpOT0_[_ZN9SymEngine8make_rcpIKNS_6SymbolEJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEENS_3RCPIT_EEDpOT0_]+0x48): undefined reference to `SymEngine::Symbol::Symbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
Add
or a Mul
object. So for example (a + b) * (c + d)
wouldn't be represented that way internally, it would first be expanded to a * c + ...etc
. Is that impression correct or is there something I've missed?
x + x
is canonicalized to 2*x
cmake
command successfully with -DGMP_LIBRARY="c:/.../lib -DGMP_INCLUDE_DIR="c:/.../lib" -DCMAKE_BUILD_TYPE="Debug"
where it was able to find the directory of the manually built gmp
library.make
it fails, throwing cannot find C:/gmp/lib: Permission denied
, which is weird since it exists & is accessible .
-- Could NOT find SymEngine (missing: SymEngine_DIR)
CMakeLists.txt
contains
cmake_minimum_required(VERSION 3.15.5)
find_package(SymEngine 0.8.1 CONFIG PATHS ~/.conan/data/symengine/0.8.1)
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} "-std=c++0x")
include_directories(${SYMENGINE_INCLUDE_DIRS})
add_executable(example main_example.cpp)
target_link_libraries(example ${SYMENGINE_LIBRARIES})
cmake
to find symengine? I used conan
to install symengine
vec_basic vec;
vec.push_back(integer(1));
vec.push_back(symbol("b"));
vec.push_back(symbol("c"));
DenseMatrix A = DenseMatrix(3, 3, vec);
Ok, so I installed miniconda and installed the symengine successfully(all following the instructions from github and the install page). but when I try to run the command conda env create -f symedocs.yml
it returns what I think it's an error message, the following:
EnvironmentFileNotFound: 'C:\Users\me\miniconda3\symedocs.yml' file not found
I tried creating the file manually and searching for solutions online but wasn't successfull
conda install python-symengine
if you don't want to build the docs yourself
pip install symengine