nupic.core-legacy icon indicating copy to clipboard operation
nupic.core-legacy copied to clipboard

nupic.core can be built as shared lib

Open oxtopus opened this issue 10 years ago • 8 comments

Ideally, nupic.core build optionally accepts -DBUILD_SHARED_LIBS=true CLI option to build libnupic_core.so (on linux systems, for example) as a shared object.

oxtopus avatar Aug 21 '14 21:08 oxtopus

See discussion about Windows DLL building at https://github.com/numenta/nupic.core/pull/184#issuecomment-57468663.

rhyolight avatar Oct 02 '14 00:10 rhyolight

Ahmed and I was discussing this in a Gitter room last night. He's made an initial stab at this and got it built as a DLL and linked to the helloregion example. All looking good on windows.

DLL Feature branch https://github.com/kandeel/nupic.core/tree/dll Build histories https://ci.appveyor.com/project/kandeel/nupic-core/history Packaging https://ci.appveyor.com/project/kandeel/nupic-core-393/build/artifacts

One blocking question is how we handle labeling of exportable Classes and functions. Our discussion revolved around class Visibility http://gcc.gnu.org/wiki/Visibility By placing -fvisibility=hidden on all GCC compiles to make everything hidden from export by default. A pre-processor definition can then decorate at the class declaration level to export an entire class or drill down and specify individually class functions to export. All that came from reading http://stackoverflow.com/questions/2839504/is-there-a-def-file-equivalent-on-linux-for-controlling-exported-function-names?rq=1

Definitely available as a GCC option in 4.3.3, Travis is using 4.6.3 at the moment. Clang and OSX look like it can handle that option too https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html

For the time being Ahmed has chosen NUPIC_EXPORTS for the pre-processor definition e.g. https://github.com/kandeel/nupic.core/commit/c4dcafef747acdb6bdc12756da0cf5a178815108

Is this ok to use, or rather something else?

rcrowder avatar Oct 02 '14 09:10 rcrowder

@rcrowder said:

For the time being Ahmed has chosen NUPIC_EXPORTS for the pre-processor definition e.g. kandeel@c4dcafe

Is this ok to use, or rather something else?

Any comments, @scottpurdy / @breznak / @oxtopus ?

rhyolight avatar Oct 03 '14 14:10 rhyolight

There is an export macro NTA_EXPORT defined in src/main/types/Types.h

scottpurdy avatar Oct 03 '14 18:10 scottpurdy

Excellent, thank you Scott. I believe Ahmed has already made the change in the windows branch to use this define now.

rcrowder avatar Oct 04 '14 10:10 rcrowder

@oxtopus You tagged this as "in progress"... still true?

rhyolight avatar Mar 30 '15 19:03 rhyolight

Please review this issue

This issue needs to be reviewed by the original author or another contributor for applicability to the current codebase. The issue might be obsolete or need updating to match current standards and practices. If the issue is out of date, please close. Otherwise please leave a comment to justify its continuing existence. It may be closed in the future if no further activity is noted.

rhyolight avatar May 18 '16 02:05 rhyolight

still valid, only static .a lib is generated.

breznak avatar May 18 '16 11:05 breznak