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

Monte Carlo inverse code fixes #173

Closed
hayakawa16 opened this issue Sep 19, 2024 · 3 comments · Fixed by #174
Closed

Monte Carlo inverse code fixes #173

hayakawa16 opened this issue Sep 19, 2024 · 3 comments · Fixed by #174

Comments

@hayakawa16
Copy link
Member

A bug was found in mc_inverse_Win.m. Correct bug and add more comments to clarify what code is doing.

@hayakawa16
Copy link
Member Author

All works well on Windows with latest updates to this branch.
On Linux, I try to run this line 51:
system('./mc infile=infile_pMC_db_gen.txt');
and get:
Failed to load /usr/lib/dotnet/host/fxr/8.0.8/libhostfxr.so, error: /usr/local/MATLAB/R2023b/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dotnet/host/fxr/8.0.8/libhostfxr.so)
The library libhostfxr.so was found, but loading it from /usr/lib/dotnet/host/fxr/8.0.8/libhostfxr.so failed

I went to https://go.microsoft.com/fwlink/?linkid=2063370 and made sure all dependencies were indeed installed.

I can run this line outside of MATLAB, just not inside MATLAB.

@hayakawa16
Copy link
Member Author

I found the answer! I don't know why this link didn't come up this weekend:
https://www.mathworks.com/matlabcentral/answers/1907290-how-to-manually-select-the-libstdc-library-to-use-to-resolve-a-version-glibcxx_-not-found
I added:
export LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6
to my .bashrc

@hayakawa16
Copy link
Member Author

I cleaned up and debugged the mc_inverse_Win.m and mc_inverse.m code. When I first coded this software, I did a comparison between the results that lsqcurvefit provided and fminsearch (back in 2021). Since then the SpectralDictionary.xlsx has been expanded, my MATLAB version is now 2023b (used to be 2021b?) which means lsqcurvefit methods may have been modified. I show the plots of the prior study and the plots of the current study. Errors are comparable. Linux version produces exactly the same results.
notes_monte_carlo_inverse.pdf

@hayakawa16 hayakawa16 linked a pull request Sep 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant