numenta / nupic.core-legacy

Implementation of core NuPIC algorithms in C++ (under construction)
http://numenta.org
GNU Affero General Public License v3.0
272 stars 276 forks source link

Replace apr #1441

Closed dkeeney closed 6 years ago

dkeeney commented 6 years ago

Replace APR libraries with std:: library to reduce dependencies.

dkeeney commented 6 years ago

I am going to need some help getting this to link. None of the CI's seem to like anything.

Status: I implemented this PR with the C++17 flag on. There are a few boost routines still around that could be replaced but I will get those later.

I implemented the os::Path and os::Directory modules using #if __has_include ( < filesystem > ). See os::Directory.hpp line 45. It will attempt to #include< filesystem > but if that is not found it includes <experimental/filesystem> and if that is not found, fall back to <boost/filesystem.hpp>. The boost solution of course will require boost system and filesystem libraries which we do not have in the build.

I am developing with Ubuntu using cpp-8. I know that the latest cpp-8 does have < filesystem > but I think it still requires library -lstdc++fs. It seems to find that library but lots of things are not resolved. I have no idea what more it needs to link. Google search is not much help so far.

cpp-7 has <experimental/filesystem> but links with the experimental library. From what I have read, the latest versions of most compilers will now support < filesystem > but some of them still require the -lstdc++fs library. MinGW does not seem to support filesystem at all so boost is the only alternative.

Visual Studio 17 (latest) does have < filesystem > and it builds and runs just fine but of course this version of my code already has SWIG removed because I don't think it will build SWIG. I did verify that if I forced it to use boost::filesystem rather that std::filesystem it will also build and run successfully under windows.

So the main sticking point at the moment is getting Ubuntu cpp-8 to link with the filesystem.

dkeeney commented 6 years ago

The secret to getting it to link was placing -lstdc++fs after the objects...because its a static library. But CI is still very broken. I will have to work on that next.

dkeeney commented 6 years ago

CircleCI says: error: invalid value 'c++17' in '-std=c++17' It is asking for clang 9.0.1 compiler but it cannot verify that the compiler works. the Clang 10 has filesystem but apple's Xcode version of Clang is a little behind. Xcode 10.1 Beta ships with libc++ that has experimental/filesystem. must link with -lcexperimental see http://antonmenshov.com/2017/09/09/clang-openmp-setup-in-xcode/ and http://clang.llvm.org/cxx_status.html But apple's version will not be entirely C++17 complaint... whatever that means.

Hmmm, are we are trying to go too far too soon. We could allow the OS-X version to use boost until they catch up. Well, I guess I need to fire up my Mac and find a way to make it work there.

rhyolight commented 6 years ago

Hey @dkeeney I think you opened this on the wrong repo.

rhyolight commented 6 years ago

Maybe you opened this PR just to see if builds would pass? Anyway, Luiz is working on an issue with our windows builds that is affecting all PRs right now. If you guys want CI you can set it up using free services like I did for Nupic.

dkeeney commented 6 years ago

Oh, that is what happened to it. I thought I was in the htm-community repro.

Very sorry to bother you with this.

Dave

On Wed, Sep 26, 2018 at 2:28 PM Matthew Taylor notifications@github.com wrote:

Maybe you opened this PR just to see if builds would pass? Anyway, Luiz is working on an issue with our windows builds that is affecting all PRs right now. If you guys want CI you can set it up using free services like I did for Nupic.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/numenta/nupic.core/pull/1441#issuecomment-424875775, or mute the thread https://github.com/notifications/unsubscribe-auth/AFBa_9xaoF6hRCKBJlTG5JSoia-lSNeEks5ue_FlgaJpZM4WwlwF .