Giter Site home page Giter Site logo

Shared by default about marl HOT 3 CLOSED

google avatar google commented on July 22, 2024
Shared by default

from marl.

Comments (3)

ben-clayton avatar ben-clayton commented on July 22, 2024 1

#152 has landed. If you still have issues building DLLs, please comment on here and I'll reopen.
Cheers!

from marl.

ben-clayton avatar ben-clayton commented on July 22, 2024

Hi @aschrein,

Thank you for alerting me to this. I tried to reproduce using Microsoft Visual Studio Community 2019 Version 16.4.5, and I cannot.

In CMakeCache.txt, I have MARL_BUILD_SHARED:BOOL=False. BUILD_SHARED_LIBS is undefined.

I cleaned the output directories, and rebuilt:

c:\src\marl\out\build\x64-Release>dir marl.*
 Volume in drive C is Windows
 Volume Serial Number is BA92-FD6B

 Directory of c:\src\marl\out\build\x64-Release

15/06/2020  10:18 AM         3,877,600 marl.lib

Setting MARL_BUILD_SHARED:BOOL=True, will attempt to build marl as a dll, but you may notice that with a clean build, the tests, benchmarks and samples fail to link. This is because we're not currently exporting any public dll symbols, and the marl.lib import library is not being produced (presumably because it is empty) which is needed to link the applications.

Looking a CMake's documentation:

add_library

STATIC, SHARED, or MODULE may be given to specify the type of library to be created. STATIC libraries are archives of object files for use when linking other targets. SHARED libraries are linked dynamically and loaded at runtime. MODULE libraries are plugins that are not linked into other targets but may be loaded dynamically at runtime using dlopen-like functionality. If no type is given explicitly the type is STATIC or SHARED based on whether the current value of the variable BUILD_SHARED_LIBS is ON.

BUILD_SHARED_LIBS

Global flag to cause add_library() to create shared libraries if on.

If present and true, this will cause all libraries to be built shared unless the library was explicitly added as a static library. This variable is often added to projects as an option() so that each user of a project can decide if they want to build the project using shared or static libraries

(bold emphasis mine)

So the docs also suggest that we shouldn't be getting dlls built by default, unless you're using BUILD_SHARED_LIBS.

This did highlight to me that attempting to use MARL_BUILD_SHARED / BUILD_SHARED_LIBS on Windows will fail miserably, so I've created #152 to actually export the dll symbols, allowing use of marl as a dll.


If at all possible, can you confirm that you are indeed statically building without #152? If you're somehow building and linking marl as a dll, I'd like to figure out why and how :)

from marl.

aschrein avatar aschrein commented on July 22, 2024

Thanks for your answer.
I can't verify right now but I guess you're correct that something was wrong rather on my side. I'll let you know once I have a chance whether it was BUILD_SHARED_LIBS or not.

from marl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.