JohannesBuchner / PyMultiNest

Pythonic Bayesian inference and visualization for the MultiNest Nested Sampling Algorithm and PyCuba's cubature algorithms.
http://johannesbuchner.github.io/PyMultiNest/
Other
194 stars 88 forks source link

Fortran Runtime Error #223

Open Berfin9704 opened 1 year ago

Berfin9704 commented 1 year ago

Hi. I'm trying to use PyMultinest through petitRADTRANS by Paul Mollière (Mollière et al., A&A, 627, A67, 2019). However, I face an error message saying "Fortran runtime error: Unexpeccted element 'i' in format (a,i4)" at line 222 of Multinest/src/nested.F90 file. I use Ubuntu 20.04. This error occurs either using the shell or a conda environment. I'd be glad if you could help me. Thank you!

JohannesBuchner commented 1 year ago

show the full output of make VERBOSE=1 and which Fortran compiler + version used. Maybe you can switch the compiler?

Berfin9704 commented 1 year ago

Before I got to the "make VERBOSE=1" step, I noticed that I got an error message saying "Could NOT find MPI_Fortran (missing: MPI_Fortran_WORKS)". I tried to find it by find_package(MPI) and "cmake .. -DCMAKE_PREFIX_PATH=/home/berfin7miniconda3/envs/exoplanet/bin/mpiexec" but both failed. So cmake built only the non-MPI Multinest libraries. Is it be the problem?

Also, I set the compiler as gfortran.

JohannesBuchner commented 1 year ago

Try cleaning completely the build directory (see instructions file there) and rebuild with cmake and make. you may have conflicting fortran versions. I think CMAKE_PREFIX_PATH is not the right parameter for the fortran compiler. https://mixable.blog/how-to-set-c-c-or-fortran-compiler-for-cmake/

Berfin9704 commented 1 year ago

I tried "SET(CMAKE_FC_COMPILER /usr/bin/gfortran)", but it didn't work. During "cmake .." process, it finds libmpi.so for MPI_C and libmpicxx.so for MPI_CXX. However, it can't find libmpifort.so for MPI_Fortran for some reason. It exists on the same path with libmpi.so and libmpicxx.so.