Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is OpenStudio.dll no longer included in the installers? #4931

Closed
chriswmackey opened this issue Jul 16, 2023 · 9 comments · Fixed by #4933
Closed

Why is OpenStudio.dll no longer included in the installers? #4931

chriswmackey opened this issue Jul 16, 2023 · 9 comments · Fixed by #4933

Comments

@chriswmackey
Copy link

chriswmackey commented Jul 16, 2023

Enhancement Request

I'm opening this as an enhancement request but it may be more of a question and I just have not found the right answer yet. Starting from OpenStudio 3.5, it seems that there is no longer an OpenStudio.dll included in the Windows exe installer and the only way that I have currently found to obtain this .dll is from the OpenStudio NuGet package.

This seemed odd to me because all of the other csharp dlls are in the installer but I am missing the critical one that I need in order to be able to make use of the CSharp bindings.
image

So I first wanted to ask if this is the intended setup and I am just not understanding how I am now supposed to be making use of the CSharp bindings (eg. should I be adding a different one of these dlls instead of the OpenStudio.dll that I have historically used?) If it is the intended setup, could you instruct me on which dll should be added to enable me to import OpenStudio SDK in .NET. Or do I need to add all of them?

If this is not the intended setup, it would be really nice if future OpenStudio installers could put back the OpenStudio.dll somewhere in the installation folder. I have verified that the latest OpenStudio 3.6.1 installer also lacks the OpenStudio.dll

Thanks, as always.
CC: @jmarrec , @MingboPeng

@chriswmackey chriswmackey added Enhancement Request Triage Issue needs to be assessed and labeled, further information on reported might be needed labels Jul 16, 2023
@jmarrec
Copy link
Collaborator

jmarrec commented Jul 17, 2023

@chriswmackey I think you may be reporting the same issue as

The openstudiolib.dll isn't installed if the C++ API is unchecked during installation of 3.6.0 and 3.6.1, which means the CLI can't be used. Not sure if this is the intended behavior now but it's different than previous versions.

Is this what you are reporting? (Basically I'm asking if you can try with the C++ API component selected). If so, can close this issue, fixed in:

@chriswmackey
Copy link
Author

chriswmackey commented Jul 17, 2023

Thanks @jmarrec ,

I believe that my issue is different because I see the openstuidolib.dll in the installation folder and this is fine.

My issue is that this is what I get with the OpenStudio NuGet package:
image

But this is what I get from the OpenStudio installer released here through GitHub whenever I check the boxes for all of the options.

Here's the bin folder:
image
Here's the CSharp folder:
image

Neither of those folders has the OpenStudio.dll that comes with the NuGet package. Am I correct that there's no way to get the OpenStudio.dll that's distributed on NuGet with the installer that is distributed here on GitHub?

@jmarrec
Copy link
Collaborator

jmarrec commented Jul 19, 2023

Got it. Thanks.

I do see OpenStudio.dll being built correctly on CI. But indeed it's not installed. 99% sure this is due to the CONFIGURATIONS DEBUG part of this line, apparently it's @MingboPeng that last touched it. Do you happen to recall why you added "CONFIGURATIONS DEBUG" here?

install(FILES "${OPENSTUDIO_CSHARP_DLL}" DESTINATION CSharp/openstudio/ CONFIGURATIONS DEBUG COMPONENT "CSharpAPI")

git blame: https://github.com/NREL/OpenStudio/blame/82304dcc76303e8a4c49c87500dc64ffe65248f5/csharp/CMakeLists.txt#L68

@jmarrec
Copy link
Collaborator

jmarrec commented Jul 19, 2023

Actually I'm pretty sure I see why that has happened. This is a left over from refactoring: 84f36ac#diff-eb198a8407cb15ec84351a8a476aa8b60112377c0b12be331baa2874ea20c786L79

@MingboPeng
Copy link
Contributor

Ops, I thought there was a post-process to copy all files into the installer folder.

I didn't realize this CMakeLists also creates the installer. @jmarrec thanks for helping.
Let me add the new OpenStudio.dll to the installer.
"${CSHARP_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/netstandard2.0/OpenStudio.dll"

jmarrec added a commit that referenced this issue Jul 19, 2023
CONFIGURATION genex is deprecated since cmake 3.0 and replaced with CONFIG
@jmarrec
Copy link
Collaborator

jmarrec commented Jul 19, 2023

I'm fixing it right now @MingboPeng

@MingboPeng
Copy link
Contributor

Thanks!

@jmarrec
Copy link
Collaborator

jmarrec commented Jul 19, 2023

#4933 (review)

I replaced the CMAKE_BUILD_TYPE with a genex too. This was working on CI because we do pass explicitly cmake -DCMAKE_BUILD_TYPE:STRING=Release when building on MSVC. But MSVC by default is Multi-configuration and CMAKE_BUILD_TYPE is empty if used like this.

@jmarrec jmarrec added severity - Normal Bug component - C# and removed Enhancement Request Triage Issue needs to be assessed and labeled, further information on reported might be needed labels Jul 19, 2023
@jmarrec jmarrec self-assigned this Jul 19, 2023
@chriswmackey
Copy link
Author

Thanks for getting to the bottom of this, @jmarrec and @MingboPeng . I'm looking forward to having this back in the next installer release.

jmarrec added a commit that referenced this issue Aug 24, 2023
CONFIGURATION genex is deprecated since cmake 3.0 and replaced with CONFIG
jmarrec added a commit that referenced this issue Aug 24, 2023
Fix #4931 - Install C# OpenStudio.dll properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants