These are chat archives for symengine/symengine

17th
Jul 2015
Sumith Kulal
@Sumith1896
Jul 17 2015 09:49
The method static RCP<const Polynomial> create() is giving some problems
Sumith Kulal
@Sumith1896
Jul 17 2015 14:58
This error is popping due to hash_set and rcp, any insights?
Francesco Biscani
@bluescarni
Jul 17 2015 15:01
it's a bit obscure what is going on.. but here: https://github.com/Sumith1896/csympy/blob/polys-hash_set/symengine/polys.h#L27 I think you need the full definition of hash_set at this point?
I'd try to move the method in the .cpp as a shot in the dark
ah wait
that's a symengine hash_set?
right I think I see it
you are trying to build a symengine hash_set with a Piranha hash_set
Sumith Kulal
@Sumith1896
Jul 17 2015 15:03
Since I use only one kind, which typdef-ed here
Francesco Biscani
@bluescarni
Jul 17 2015 15:03
or viceversa
Sumith Kulal
@Sumith1896
Jul 17 2015 15:03
Yes I use only one kind of hash_set with the customized pair we designed, hence I typdefed it
Francesco Biscani
@bluescarni
Jul 17 2015 15:04
ok sorry about the confusion
I am trying with clang now to see if it produces a better error message
I think you might be missing constructors in poly
https://github.com/Sumith1896/csympy/blob/polys-hash_set/symengine/polys.h#L23 these also look a bit funky... any particular reason why the second argument needs to be an rvalue reference?
Isuru Fernando
@isuruf
Jul 17 2015 19:09
@certik, you there?
Ondřej Čertík
@certik
Jul 17 2015 19:18
@isuruf yes
Here is the latest log that I got so far: https://ci.appveyor.com/project/certik/symengine-393wn/build/13
I am trying to make cmake pick up at least the gmp.h
Isuru Fernando
@isuruf
Jul 17 2015 19:19
That can be done. (I did it in my machine)
Ondřej Čertík
@certik
Jul 17 2015 19:20
In fact, given that the gmpxx is missing from it anyway, I would suggest to fix #478 and perhaps use mingw to install gmp
can you show me how to make it pick up gmp.h?
Isuru Fernando
@isuruf
Jul 17 2015 19:21
change libfind_include(gmpxx.h gmp) to libfind_include(gmp.h gmp)
Ondřej Čertík
@certik
Jul 17 2015 19:21
ah, I see
let me try
See here: https://ci.appveyor.com/project/certik/symengine-393wn/build/14, it still didn't pick it up, otherwise it would not say missing GMP_INCLUDE_DIRS
Ondřej Čertík
@certik
Jul 17 2015 19:37
It seems the mingw-get install gmp will be the most current and supported
and we'll just use the C interface.
Do you know where the mingw version gets installed?
so that we can point cmake to it.
Isuru Fernando
@isuruf
Jul 17 2015 19:38
C:\MinGW
install:
- set PATH=%PATH%;C:\MinGW\bin
- mingw-get update
# For MinGW to work, sh.exe must not be in the path
- rename "C:\Program Files (x86)\Git\bin\sh.exe" "sh2.exe"
- mingw-get install mingw32-gmp

build_script:
- cd C:\projects\symengine
- cmake -G "MinGW Makefiles" -DWITH_SYMENGINE_RCP=%WITH_SYMENGINE_RCP% -DCOMMON_DIR=C:\MinGW -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .
- mingw32-make
- mingw32-make install
We might want to just install MPIR or GMP from source by hand. That might be the easiest.
Isuru Fernando
@isuruf
Jul 17 2015 19:43
Ah, yes, that's a temporary failure right now
The site where it is hosted, http://prdownloads.sourceforge.net/ is down
Ondřej Čertík
@certik
Jul 17 2015 19:45
Did you manage to make cmake pick up the gmp version you mentioned on google code?
Isuru Fernando
@isuruf
Jul 17 2015 19:46
Yes
Ondřej Čertík
@certik
Jul 17 2015 19:46
Looks like source forge will be down for a while: https://twitter.com/sfnet_ops?lang=en
Can you post a PR that does that in appveyor?
Isuru Fernando
@isuruf
Jul 17 2015 19:47
But there are linker problems. I think it's because of a library mismatch. I'll try to build it with MSVC
Ondřej Čertík
@certik
Jul 17 2015 19:47
linking only happens once symengine builds
so the whole symengine built in msvc?
Isuru Fernando
@isuruf
Jul 17 2015 19:48
Yep, that link I mentioned is a pre-built mpir for vc10. I'll try to build mpir from source and see
Ondřej Čertík
@certik
Jul 17 2015 19:52
Great. That error "2>C:\Users\dell\projects\csympy\symengine/symengine_rcp.h(42): error C2253: 'Ptr<T>' : pure specifier or abstract override specifier only allowed on virtual function" is the same as for Intel, see my workaround in #536.
@isuruf if you can figure out appveyor.yml that actually starts compiling symengine, just send a PR, so that we can merge it and then we can send PRs fixing the code to compile.
Isuru Fernando
@isuruf
Jul 17 2015 19:57
Thanks. let me try that
Isuru Fernando
@isuruf
Jul 17 2015 20:04
I'm building mpir using msvc now
Ondřej Čertík
@certik
Jul 17 2015 20:08
Ondřej Čertík
@certik
Jul 17 2015 20:14
got it, it was missing PlatformToolset
Isuru Fernando
@isuruf
Jul 17 2015 20:18
yes
@certik, can you give me privileges to edit in your repo temporarily?
Ah got it. no need
Ondřej Čertík
@certik
Jul 17 2015 20:26
But cmake doesn't pick it up for some reason.
Isuru Fernando
@isuruf
Jul 17 2015 20:28
I'm sending a PR
you need to use back slashes
Isuru Fernando
@isuruf
Jul 17 2015 20:33
Ondřej Čertík
@certik
Jul 17 2015 20:36
I think you need to put .. in front of mpir, since you are in the build directory
Isuru Fernando
@isuruf
Jul 17 2015 20:38
mpir-2.7.0 is already in the build directory.
This works,
https://ci.appveyor.com/project/isuruf/symengine/build/196
Ondřej Čertík
@certik
Jul 17 2015 20:39
nice!!!
Can you send a nice PR with just the appveyor.yml?
Let's merge it to master and then we can go from there.
what should be there?
Ondřej Čertík
@certik
Jul 17 2015 20:42
Start with the appveyor.yml see if it works, if not, add the other changes for now
then we'll go from there.
Ondřej Čertík
@certik
Jul 17 2015 20:59
the changes in cmake should only be made for msvc
Isuru Fernando
@isuruf
Jul 17 2015 21:01
okay
Ondřej Čertík
@certik
Jul 17 2015 21:03
sympy/symengine#544
Something like that is what I had in mind.
Ondřej Čertík
@certik
Jul 17 2015 21:08
@isuruf let me know what you think.
Isuru Fernando
@isuruf
Jul 17 2015 21:09
+1
Ondřej Čertík
@certik
Jul 17 2015 21:14
If you can give it +1 on the PR, that would be great. I am waiting for Travis tests as well.
the cxxabi can be fixed by using a define, I'll do it in subsequent PRs.
Isuru Fernando
@isuruf
Jul 17 2015 21:15
I'm doing that right now
Ondřej Čertík
@certik
Jul 17 2015 21:15
Perfect!
I'll wait.
Thanks for your help with this, I wouldn't be able to get it working myself easily.
Ondřej Čertík
@certik
Jul 17 2015 21:29
Merged.
Isuru Fernando
@isuruf
Jul 17 2015 21:36
No problem.
atomic is not there
Sumith Kulal
@Sumith1896
Jul 17 2015 21:38
Sorry to disturb, but is this report normal: https://travis-ci.org/sympy/symengine/builds/71454641
Isuru Fernando
@isuruf
Jul 17 2015 21:39
Yes, that happens rarely
Ondřej Čertík
@certik
Jul 17 2015 21:41
@Sumith1896 looks like Conda failed to install the stuff.
Sumith Kulal
@Sumith1896
Jul 17 2015 21:42
Yes stopped there
Isuru Fernando
@isuruf
Jul 17 2015 21:44
@certik, std::atomic is not supported in MSVC10
Sumith Kulal
@Sumith1896
Jul 17 2015 21:44
@bluescarni Because that's how containers are passed throughout SymEngine
Add::Add(const RCP<const Number> &coef, umap_basic_num&& dict) for example
Ondřej Čertík
@certik
Jul 17 2015 21:45
@isuruf where do we need atomic?
I thought that's only used if we use thread safe.
Isuru Fernando
@isuruf
Jul 17 2015 21:46
Yes, I'll only import it in thread safe mode
With that I get
1935 Warning(s)
2160 Error(s)
Ondřej Čertík
@certik
Jul 17 2015 21:46
Ah I see, it's the header file that is always imported.
Sumith Kulal
@Sumith1896
Jul 17 2015 21:51
@certik Any insights on that static RCP<const Polynomial> create() ?
Francesco Biscani
@bluescarni
Jul 17 2015 21:52
@Sumith1896 I replied above, I think it's a problem with missing constructors in Poly
see the clang message
Sumith Kulal
@Sumith1896
Jul 17 2015 21:52
@bluescarni I think I missed out some message, let me check again
Isuru Fernando
@isuruf
Jul 17 2015 21:54
VC10 does not support variadic templates
Ondřej Čertík
@certik
Jul 17 2015 21:55
The cmake says "MSVC 18.0.31101.0"
which is Visual Studio 12
Isuru Fernando
@isuruf
Jul 17 2015 21:55
ah. then that's fine. I'm using Visual Studio 10 locally
Sumith Kulal
@Sumith1896
Jul 17 2015 21:56
@bluescarni Is it because create method is there for one constructor not other?
I'm not exactly getting what missing constructor means!
Ondřej Čertík
@certik
Jul 17 2015 21:57
I'll polish it up later, right now I am just curious if MSVC can get most of the things compiled or not.
@isuruf according to this: http://stackoverflow.com/a/7422058/479532, we should be fine
Francesco Biscani
@bluescarni
Jul 17 2015 22:01
@Sumith1896 The message is
Ondřej Čertík
@certik
Jul 17 2015 22:01
according to the second link though, variadic templates are only supported in visual studio 13. We'll see if we can workaround it, we only use variadic templates in make_rcp.
Francesco Biscani
@bluescarni
Jul 17 2015 22:04
In file included from /home/yardbird/temp/csympy/symengine/basic.h:25:
/home/yardbird/temp/csympy/symengine/symengine_rcp.h:205:21: error: no matching constructor for initialization of 'const SymEngine::Polynomial'
    return rcp( new T( std::forward<Args>(args)... ) );
sorry troubles with chrome, just switched to firefox :D
return make_rcp<const Polynomial>(vars, polys_set);
here it seems like it cannot construct a poly from vars and polys_set
at least if I am reading correctly
Sumith Kulal
@Sumith1896
Jul 17 2015 22:06
I followed the lines of UnivariatePolynomial here, which works fine
    UnivariatePolynomial(const RCP<const Symbol> &var, const unsigned int &degree, map_uint_mpz&& dict);
    //! Constructor using a dense vector of mpz_class coefficients
    UnivariatePolynomial(const RCP<const Symbol> &var, const std::vector<mpz_class> &v);

    static RCP<const UnivariatePolynomial> create(const RCP<const Symbol> &var,
            const std::vector<mpz_class> &v) {
        return make_rcp<const UnivariatePolynomial>(var, v);
    }
Ohh wait, that's a different constructor, this one is not building from the map.
Btw, I saw the inputs on pImpl, I think I'll let this class grow a bit, then add that.
Atleast constructors and couple of methods
Ondřej Čertík
@certik
Jul 17 2015 22:12
It's a link error
but we compiled gmp ourselves, so hopefully we can resolve it.
Isuru Fernando
@isuruf
Jul 17 2015 22:13
Yes, I am compiling gmp with VC14 now
VC14 is the version used in appveyor by default
Ondřej Čertík
@certik
Jul 17 2015 22:14
but our cmake reports older VC
It's good news though, because VC14 almost for sure supports everything we need.
@isuruf I am now getting the same link error, but I had to do a lot more modifications to the code: https://github.com/sympy/symengine/compare/sympy:master...certik:msvc?expand=1, how is that possible?
Isuru Fernando
@isuruf
Jul 17 2015 22:16
Maybe I'll see those errors later? :D
Ondřej Čertík
@certik
Jul 17 2015 22:18
No, it's because for some reason your appveyor is using:
The CXX compiler identification is MSVC 19.0.22816.0
but mine is using:
The CXX compiler identification is MSVC 18.0.31101.0

@isuruf I wonder if you somehow selected the latest MSVC by hand in appveyor?
See also this: nlohmann/json#62

We should be using the latest compiler for sure.

@isuruf it looks like the version that you have is VS2015, which has all the C++ features that we need: http://blogs.msdn.com/b/vcblog/archive/2015/04/29/c-11-14-17-features-in-vs-2015-rc.aspx
@isuruf what does your Settings->Environment->Operating system say?
Isuru Fernando
@isuruf
Jul 17 2015 22:23
Windows Server 2012 R2
Ondřej Čertík
@certik
Jul 17 2015 22:23
For me it says Windows Server 2012 R2
Ondřej Čertík
@certik
Jul 17 2015 22:29

I tried setting

environment:
  os: Visual Studio 2015 RC

but it didn't help. It's confusing that appveyor has both settings in appveyor.yml as well as online, so it is not clear what takes precedence. We need to figure out how to reliable use the latest MSVC. Then we should be fine.

Either way, it looks like the whole symengine compiled just fine, and just some tests fail to link.

Isuru Fernando
@isuruf
Jul 17 2015 22:36
In my repo's builds, gmp is compied with visual studio 9.0 and symengine is compiled with visual studio 14.0
Isuru Fernando
@isuruf
Jul 17 2015 22:50

@certik, I'm still getting errors with linking. My work is here, https://github.com/isuruf/symengine/tree/windows2

You can send a pull request to my repo to test with VS 2015.

Going to sleep now.
Sumith Kulal
@Sumith1896
Jul 17 2015 23:22
I'm going to sleep too, I'll investigate this problem tomorrow