mutationpp / Mutationpp

The MUlticomponent Thermodynamic And Transport library for IONized gases in C++
GNU Lesser General Public License v3.0
103 stars 58 forks source link

fatal error in Mutationpp/install/include/mutation++/mutationpp.mod #177

Closed anfuso1193 closed 2 years ago

anfuso1193 commented 2 years ago

Hi Ruben, sorry to bother you again. All the info about the procedure in installing Mutationpp has been reported in a past closed issue (#176). The 'mutationpp.mod' file has been generated switching in "ON" the BUILD_FORTRAN_WRAPPER

I am trying to compile a code called CABARET (developed by Anabel del Val) with a 'make General' command line. I have attached the General.f90 and Makefile (the format has been changed in .txt).

The error I get is the following:

f951: Fatal Error: Reading module ‘/Users/enricoanfuso/Documents/Enrico/VKI/Codes/Mutationpp/install/include/mutation++/mutationpp.mod’ at line 1 column 2: Unexpected EOF
compilation terminated.

I think, but I am not an expert, that the problem could be linked to the different compilators used for CABARET and mutationpp.mod

Let me know if you have any idea of the problem and a possible solution. Thanks a lot!!

General.txt

Makefile.txt

rdbisme commented 2 years ago

Hello @anfuso1193, could you please provide the version of your compilers? Normally this is given by the cmake output, but the output you posted in #176 is not the full output from a clean situation.

rdbisme commented 2 years ago

Anyway I think it cannot find the module.

# Change this path to your Mutation++ install path
MUTATIONPP_INSTALL = /Users/enricoanfuso/Documents/Enrico/VKI/Codes/Mutationpp/install
FC       = gfortran
FC_FLAGS = -I$(MUTATIONPP_INSTALL)/include/mutation++ -O3 -g -fdefault-real-8 

# use .dylib for Mac, .so for Unix
FC_LIBS  = $(MUTATIONPP_INSTALL)/lib/libmutation++_fortran.dylib

EXAMPLES  = \
    General

all : $(EXAMPLES)
    $(FC) $(FCFLAGS) -c initial.f90
    $(FC) $(FCFLAGS) -c functions.f90

General : General.o forward.o inverse.o Newton.o functions.o initial.o subroutines.o 
    $(FC) -o $@ $(FC_FLAGS) $^ $(FC_LIBS)

%.o : %.f90
    $(FC) -c $(FC_FLAGS) $<

clean :
    $(RM) *.o $(EXAMPLES) 

The flag to tell to the compiler where to find the modules is -I, not -J. Also be sure that the module is correctly present in the $(MUTATIONPP_INSTALL)/include because right now I'm from mobile and I don't recall where the module file is installed by cmake.

anfuso1193 commented 2 years ago

Hi Ruben,

rdbisme commented 2 years ago

Ok, can you please attach here the entirety of the code you'd like to integrate with Mutation?

anfuso1193 commented 2 years ago

Hi Ruben, here attached the cabaret zip file. Thanks a lot for your help. I appreciate it.

cabaret.zip

rdbisme commented 2 years ago

Applying this patch to your zip folder and wating for #178 to be merged should make the build start. Still things need to be adapted to the new version of mutation since I get:

[ 12%] Building Fortran object src/CMakeFiles/cabaret.dir/functions.f90.o
/var/folders/zl/sy9_75n97ds_v99_8bf6fsc00000gn/T/cabaret/cabaret/src/functions.f90:17:3:

   17 | st=mpp_mixture_s_mass()
      |   1
Error: Function 'mpp_mixture_s_mass' at (1) has no IMPLICIT type; did you mean 'mpp_mixture_e_mass'?

that is the cabaret code probably use an old API of Mutation

0001-Use-CMake-for-building.patch.gz

rdbisme commented 2 years ago

The patch uses cmake to build instead of the hand-crafted Makefile. So you need to follow standard practice for cmake build:

anfuso1193 commented 2 years ago

So I have applied the patch and as soon as #78 is merged I will pull them on my local repository. Then, I will try to build using the CMake and see if I get the same error. Thanks a lot, Ruben !!!

jbscoggi commented 2 years ago

Hey @anfuso1193, is this fixed?

enrico1193 commented 2 years ago

Hi JB, not yet. When I try to run the command "cmake -Dmutation++_DIR=$MUTATIONPP_INSTALL .." I get the following error " CMake Error at /usr/local/Cellar/cmake/3.21.0/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package): By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Eigen3", but CMake did not find one.

Could not find a package configuration file provided by "Eigen3" with any of the following names:

Eigen3Config.cmake
eigen3-config.cmake

Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set "Eigen3_DIR" to a directory containing one of the above files. If "Eigen3" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): /Users/enricoanfuso/Documents/Enrico/VKI/Codes/Mutationpp/install/lib/cmake/mutation++/mutation++Config.cmake:2 (find_dependency) CMakeLists.txt:6 (find_package) "

rdbisme commented 2 years ago

@enrico1193, that command is to compile Mutation++ or cabaret? Can you maybe open a new issue, choose an issue template, fill up the template in all the details you can possibly do? Because the problem you are now mentioning is different from the original one on this issue. That will help so much to understand what's going on and provide efficient help to fix the problem. :)

enrico1193 commented 2 years ago

Hi Ruben, it is to compile cabaret. I will open a new issue.

rdbisme commented 2 years ago

Great thanks! :)