microsoft / FHIR-Converter

Conversion utility to translate legacy data formats into FHIR
MIT License
399 stars 175 forks source link

CLI for mac m2 #565

Closed MaazBinMusa closed 4 months ago

MaazBinMusa commented 4 months ago

Hi I am having trouble using the CLI for the tool.

1- I cloned the repo 2- I installed dotnet 3- I built from the root of the repo using "dotnet build ." 4- I cd'ed into bin/Debug/netcore and located the exe 5- try running the executable -- Getting Error

(base) ➜  netcoreapp3.1 git:(v5.1.0) ./Microsoft.Health.Fhir.Liquid.Converter.Tool --help
A fatal error occurred. The required library libhostfxr.dylib could not be found.
If this is a self-contained application, that library should exist in [/Users/maazmusa/Desktop/Intern/fhir-converter/FHIR-Converter/src/Microsoft.Health.Fhir.Liquid.Converter.Tool/bin/Debug/netcoreapp3.1/].
If this is a framework-dependent application, install the runtime in the global location [/usr/local/share/dotnet/x64] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet/install_location].

The .NET Core runtime can be found at:
  - https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=osx.10.19-x64

P.s I am using an older checked out branch as directed to by the main branchs' README

kyclai commented 4 months ago

Hi @MaazBinMusa, thanks for your question. The error message suggests that there is an issue with the .NET runtime on your system. I see that you're using .NET Core 3.1, but the project targets .NET 6.0, meaning it's meant to be built and run using .NET 6.0.

To resolve this error, try the following:

  1. Install .NET 6.0 at https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=osx.10.19-x64 (i.e. the link given in the error message).
  2. Confirm that .NET 6.0 is installed by running dotnet --list-runtimes and ensuring that Microsoft.NETCore.App 6.0.x is included in the output.
  3. Restore the project by running dotnet restore.
  4. Rebuild the project by running dotnet build.

Regarding your comment:

P.s I am using an older checked out branch as directed to by the main branchs' README

Could you please share where the reference to the older branch is in the README? I'd like to check if there's a documentation update that we should make.

MaazBinMusa commented 4 months ago

Thankyou @kyclai ! I was about to post this solution myself. Although I ended up deleting everything and just manually changing the csproj files and didn't use dotnet restore.

This is the link: https://github.com/microsoft/FHIR-Converter/tree/e49b56f165e5607726063c681e90a28e68e39133 to the commit that is provided in the main doc.

I would also suggest some changes in the documentation about how to build the project and where to find the exe etc. For someone new to C#, I was completely lost and had to spend 2 days figuring out which folder i had to build and where the exe was and how to execute the exe. Not to mention the .NET version was not compatible but you seem to have figured that out yourself :D I really appreciate it.

I can add the documentation and make a pull request if you want.

kyclai commented 4 months ago

Glad you got it working, @MaazBinMusa!

Thanks for your suggestion to improve our documentation; I have added a backlog item for my team to add prerequisites like .NET 6.0 to the documentation. This repository does assume a basic familiarity with C# and .NET, so I recommend checking out resources such as the official C# and .NET documentation for "get started" guides and other tutorials. Copilot is another useful tool that can help you get started and troubleshoot issues you encounter, such as the .NET error you asked about.

Regarding the link to the older branch https://github.com/microsoft/FHIR-Converter/tree/e49b56f165e5607726063c681e90a28e68e39133 - this link is given in the section "Previous Versions" because the section is intended to just record previous iterations of FHIR-Converter. I encourage you to work off the main branch to get the latest changes.

MaazBinMusa commented 4 months ago

Hi Carrie,

I agree you are right. As for the previous version, I am using it to gain CLI functionality. So I had to go back to an older version.

Maaz

Get Outlook for iOShttps://aka.ms/o0ukef


From: Carrie Lai @.> Sent: Thursday, June 6, 2024 12:11:58 PM To: microsoft/FHIR-Converter @.> Cc: Maaz Musa @.>; Mention @.> Subject: Re: [microsoft/FHIR-Converter] CLI for mac m2 (Issue #565)

Glad you got it working, @MaazBinMusahttps://github.com/MaazBinMusa!

Thanks for your suggestion to improve our documentation; I have added a backlog item for my team to add prerequisites like .NET 6.0 to the documentation. This repository does assume a basic familiarity with C# and .NET, so I recommend checking out resources such as the official C#https://learn.microsoft.com/dotnet/csharp and .NEThttps://learn.microsoft.com/dotnet documentation for "get started" guides and other tutorials. Copilothttps://github.com/features/copilot is another useful tool that can help you get started and troubleshoot issues you encounter, such as the .NET error you asked about.

Regarding the link to the older branch https://github.com/microsoft/FHIR-Converter/tree/e49b56f165e5607726063c681e90a28e68e39133 - this link is given in the section "Previous Versions" because the section is intended to just record previous iterations of FHIR-Converter. I encourage you to work off the main branch to get the latest changes.

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/FHIR-Converter/issues/565#issuecomment-2153234509, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEVLZCTXMI7O27SEDYXKHN3ZGCX75AVCNFSM6AAAAABIZUP6YGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJTGIZTINJQHE. You are receiving this because you were mentioned.Message ID: @.***>

kyclai commented 4 months ago

Hi Maaz,

Just wanted to point out that the previous versions are intended as references for existing users who are maintaining older projects.

Since your original question has been resolved, I'm going to close this issue. Please feel free to open a new issue if you encounter another one.

MaazBinMusa commented 4 months ago

Sounds good. I believe you successfully did resolve everything. Really appreciate the help.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Carrie Lai @.> Sent: Thursday, June 6, 2024 1:47:58 PM To: microsoft/FHIR-Converter @.> Cc: Maaz Musa @.>; Mention @.> Subject: Re: [microsoft/FHIR-Converter] CLI for mac m2 (Issue #565)

Hi Maaz,

Just wanted to point out that the previous versions are intended as references for existing users who are maintaining older projects.

Since your original question has been resolved, I'm going to close this issue. Please feel free to open a new issue if you encounter another one.

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/FHIR-Converter/issues/565#issuecomment-2153382113, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEVLZCV7BJWM4P5ZRLX4C6LZGDDH5AVCNFSM6AAAAABIZUP6YGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJTGM4DEMJRGM. You are receiving this because you were mentioned.Message ID: @.***>