Closed ggange closed 4 years ago
Hello @ggange.
Like this it's kinda hard to troubleshoot why you're getting this. Let's try to gain more informations.
mutation++
? cmake
command you used to compile mutation++
?CMakeLists.txt
of your solver in which you're integrating mutation++
? (Or equivalent, if you're not using cmake
)uname -a
on both machines? env
on both machines, just after you compiled mutation++
? Thank you for the reply!
First of all, let's try to use the "right" way of integrating mutation++
into a code. Informations are here.
So can you try with this CMakeListst.txt
?
cmake_minimum_required(VERSION 2.8.12)
project(muffin)
add_subdirectory(pybind11)
set(CPPFLAGS "-O3 -Wall -shared -std=c++11 -undefined dynamic_lookup" )
file(GLOB_RECURSE Muffin_SOURCES "src/*.cpp")
file(GLOB_RECURSE Muffin_HEADERS "src/*.h")
set (Muffin_INCLUDE_DIRS "")
foreach (_headerFile ${Muffin_HEADERS})
get_filename_component(_dir ${_headerFile} PATH)
list (APPEND Muffin_INCLUDE_DIRS ${_dir})
endforeach()
list(REMOVE_DUPLICATES Muffin_INCLUDE_DIRS)
# Include the PETSC library
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules")
FIND_PACKAGE(MPI REQUIRED)
set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_LINK_FLAGS})
include_directories(MPI_INCLUDE_PATH)
FIND_PACKAGE(PETSc REQUIRED)
INCLUDE_DIRECTORIES(${PETSC_INCLUDES})
ADD_DEFINITIONS(${PETSC_DEFINITIONS})
find_package(mutation++ REQUIRED)
pybind11_add_module(muffin ${Muffin_SOURCES})
target_link_libraries(muffin PRIVATE mutation++ ${PETSC_LIBRARIES} ${MPI_LIBRARIES})
target_include_directories(muffin PRIVATE ${Muffin_INCLUDE_DIRS} )
You might need to provide mutation++_DIR
on the cmake
command line or add the mutation++
cmake files install folder to CMAKE_PREFIX_PATH
.
PS: Is your code available somewhere? Such that I can test it maybe on my machine?
Hello, I am performing a coupling in C++ of M++ to my solver. I linked the .so to the program with cmake (without any alert rising) both on my workstation and a public one (VKI). The source files (and mixture/mechanisms .xml) are the same (transfered through git) but calling a forward reaction rate gives different results.
Debugging I discovered that, with the same procedure, on my pc I'm unable to set the number density of the single species (with setState) and obtain -nan when recalled; on the other hand on the public machine the setting works fine. In both cases the temperature (with the flag "1" in ChemNonEqTTv) is set fine.
Are you aware of some issues that may arise with some compilers versions or similar? I am working on Ubuntu 18.04 on my pc and I haven't touched the predefined compilers (while the other machine is on Fedora ). I couldn't find other explanations yet...
Thank you in advance for your help! Giuseppe Gangemi