PyMultiNest icon indicating copy to clipboard operation
PyMultiNest copied to clipboard

Compilation of MultiNest fails

Open AWehrhahn opened this issue 2 years ago • 6 comments

Hi, I tried to compile the MultiNest library following the instructions here: https://johannesbuchner.github.io/PyMultiNest/install.html

However make fails with the error message: f951: Fatal Error: Reading module ‘xmeans_clstr’ at line 1826 column 4: Unexpected EOF compilation terminated.

System: Ubuntu 20.04

Complete Output: cmake:

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working Fortran compiler: /usr/bin/f95
-- Check for working Fortran compiler: /usr/bin/f95  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 -- yes
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for Fortran dgemm
-- Looking for Fortran dgemm - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so  
-- Looking for Fortran cheev
-- Looking for Fortran cheev - not found
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- A library with LAPACK API found.
-- Detected gfortran, adding -ffree-line-length-none compiler flag.
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found version "3.1") 
-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1") 
-- Found MPI_Fortran: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_usempif08.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Configuring done
-- Generating done

make:

[  1%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/utils.f90.o
[  2%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/utils1.f90.o
[  4%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/kmeans_clstr.f90.o
[  5%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/xmeans_clstr.f90.o
[  7%] Building Fortran object src/CMakeFiles/multinest_mpi_shared.dir/posterior.F90.o
f951: Fatal Error: Reading module ‘xmeans_clstr’ at line 1826 column 4: Unexpected EOF
compilation terminated.
make[2]: *** [src/CMakeFiles/multinest_mpi_shared.dir/build.make:102: src/CMakeFiles/multinest_mpi_shared.dir/posterior.F90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:120: src/CMakeFiles/multinest_mpi_shared.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

AWehrhahn avatar Dec 10 '21 11:12 AWehrhahn

Delete the entire folder and download MultiNest again.

JohannesBuchner avatar Dec 10 '21 11:12 JohannesBuchner

I got the files fresh from github, with git clone, still the same problem.

AWehrhahn avatar Dec 10 '21 11:12 AWehrhahn

There should be more output? For some reason xmeans_clstr is damaged? It's always good to clean the entire build/ folder including cmake cache files, whenever something changed.

You can also try telling cmake to use gfortran instead of f95.

JohannesBuchner avatar Dec 10 '21 11:12 JohannesBuchner

This is all the output I get. I tried manually specifying gfortran, it gives the same error.

AWehrhahn avatar Dec 10 '21 12:12 AWehrhahn

so what is happening in xmeans_clstr at line 1826?

JohannesBuchner avatar Feb 15 '22 10:02 JohannesBuchner

It is an empty line in xmeans_clstr.f90 Although the line doesn't change even if I remove the empty lines here. So I assume it refers to something else.

        !work variables
      	integer i
  	
      !<- This is line 1826
      	!total no. of points in the cluster
      	cwt=sum(wt(1:n))
      
      	if(calcMu) then
      		mean=0.d0
      		do i=1,n

AWehrhahn avatar Feb 15 '22 12:02 AWehrhahn