GMLC-TDC / HELICS

Hierarchical Engine for Large-scale Infrastructure Co-Simulation (HELICS)
https://docs.helics.org/en/latest/
BSD 3-Clause "New" or "Revised" License
127 stars 41 forks source link

Update HELICSConfig CMake files #322

Closed nightlark closed 6 years ago

nightlark commented 6 years ago

Blocks creating standalone CMake projects for #247

phlptp commented 6 years ago

Do we know what is missing from the existing *Config.cmake? There is a few other things in helicsImport.cmake. we may want to merge those two files and just use Config so find_package(HELICS) works well.

nightlark commented 6 years ago

The main thing keeping it from working seems to be the exported targets, but I want to make sure that other variables are set to match whatever the convention is for CMake packages, and that the exported targets handles include paths for dependencies.

phlptp commented 6 years ago

I was going to switch GridDyn over to using find_package, I guess I will try to get it working with that first then hopefully it will be resolved in the examples, or at least a ways down that path.

phlptp commented 6 years ago

if you want to try in the broker_app branch. I got it generate with find_package(HELICS) for Griddyn

phlptp commented 6 years ago

still doing some work on that branch before I would get to a pull request

phlptp commented 6 years ago

I got GridDyn to work with it? but when I tried with HELICS-FMI, the issue I run into is the libzmq when building from an installed location on Windows. This will probably be an issue with the package as well.

There would be some license issues with including libzmq binaries with the package, so I can't really do that. So I am considering other options, (any suggestions)

nightlark commented 6 years ago

What are the licensing issues?

phlptp commented 6 years ago

libzmq is GPL, it has a specific exclusion for linking with executables and independent modules. Which means the shared library and executables are covered. However, what is a little unclear would be distributing the static libraries of libzmq along with the other static modules of HELICS. That situation is not explicitly covered by the modified GPL terms of libzmq. Which would imply that a HELICS Executable would have to covered under a GPL. which we don't want to do. We deal with this at build by autobuilding from source ZMQ. if it is just an install it shouldn't be an issue since that is contained to a single machine. On Linux ZMQ is normally available so isn't much of an issue, but an executable installer, poses some complexity as far as what to do with ZMQ on windows.

nightlark commented 6 years ago

So its a problem for anyone using HELICS that is also directly using libzmq? Is distributing a copy as a shared library okay based on the license?

phlptp commented 6 years ago

libzmq license

As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library.

So according to that since we are not modifying libzmq we can include it in the executables and as a shared library, and distribute the resulting libzmq.dll/so under the terms of the LGPL.

The issue comes from potentially including the static helics libraries in the installer, I think the stub .lib are ok since they link to the DLL, but I don't think we could include the static libs for instance for libzmq.

Either way we need to figure out how to deal with libzmq in the HELICSConfig.cmake so it finds stuff correctly on windows.