mutationpp / Mutationpp

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

link mutation++ to SU2 with meson/ninja - follow-up #152

Closed CatarinaGarbacz closed 3 years ago

CatarinaGarbacz commented 3 years ago

@rubendibattista I was trying to implement your suggestion for this, but I am having a problem.

You are right that when I compiled SU2, mutation++ seems to compile as well, since the terminal prints things like:

$./ninja -C build install ninja: Entering directory `build' [68/426] Compiling C++ object subprojects/Mutationpp/libcm_mutation__.so.p/src_kinetics_Kinetics.cpp.o

However, when I ran the code, this happens:

./SU2_CFD: error while loading shared libraries: libcm_mutation__.so: cannot open shared object file: No such file or directory

I should also mention that after compilation, the usual install/ directory does not show up in the mutation++ folder...

how did you work around this?

if you need to check the branch where I'm doing this, feature_NEMO_streamline_final of SU2. I ran

  1. configure: ./meson.py build --prefix=~/Desktop/PhD/Codes/SU2-streamline -Denable-mpp=true
  2. compile: ./ninja -C build install

any help is appreciated, thanks!

rdbisme commented 3 years ago

Ehi @CatarinaGarbacz, again... Can you maybe list again all the steps you took from start to end? That'll help to try to reproduce your problem

rdbisme commented 3 years ago

Anyway, I checked out your branch.

  1. You're missing the patch on the meson.build file I told you in #146.

    diff --git meson.build meson.build
    index b6ebe9ee3b..7fd3d8e6f4 100644
    --- meson.build
    +++ meson.build
    @@ -158,7 +158,9 @@ endif
    
    # Mutation++
    if get_option('enable-mpp')
    -  subdir('externals/Mutationpp-meson')
    +  cmake = import('cmake')
    +  mpp_subproj = cmake.subproject('Mutationpp')
    +  mpp_dep = mpp_subproj.dependency('mutation++')
    su2_deps     += mpp_dep
    su2_cpp_args += '-DHAVE_MPP'
    endif
  2. I used the latest version of meson.

So here's my procedure.

  1. git clone --recursive https://github.com/su2code/SU2.git
  2. Create a Python virtualenv
  3. Install latest meson pip install meson.
  4. Apply the patch to meson.build if not done in precedence.
  5. meson setup builddir
  6. cd builddir
  7. ninja

This compiles the software and when I run againt the nonequilibrium/invwedge it does not print your same error.

Hope it helps. :)

CatarinaGarbacz commented 3 years ago

Hi @rubendibattista thanks for the quick answer. I think maybe you checked out to the wrong branch, since I do have this patch in the meson.build file: make sure you're looking at the feature_NEMO_streamline_final (lines 168-174).

my procedure followed the steps previously mentioned in #146 :

1.Create a subprojects folder in the repository root

2.Add Mutationpp folder in ${SU2_ROOT}/subprojects (as a git submodule)

  1. Fix the meson.build with this:
if get_option('enable-mpp')
  cmake = import('cmake')
  mpp_subproj = cmake.subproject('Mutationpp')
  mpp_dep = mpp_subproj.dependency('mutation++')
  su2_deps     += mpp_dep
  su2_cpp_args += '-DHAVE_MPP'
endif
  1. run meson that already comes with SU2, there should be no need to install it, since the procedure I am trying to achieve is configure and compile SU2 as usual but simply adding a flag that allows for a link with mutationpp:

./meson.py build --prefix=~/Desktop/PhD/Codes/SU2-streamline -Denable-mpp=true

5.Compile SU2 (it seems to compile Mutationpp)

$./ninja -C build install ninja: Entering directory `build' [68/426] Compiling C++ object subprojects/Mutationpp/libcm_mutation__.so.p/src_kinetics_Kinetics.cpp.o

6.export MPP_DATA_DIRECTORY="${SU2_ROOT}/subprojects/Mutationpp/data"

  1. run the appropriate testcase with MUTATIONPP, error:

./SU2_CFD: error while loading shared libraries: libcm_mutation__.so: cannot open shared object file: No such file or directory

sorry I didn't mention all the steps before. but maybe could you try to check out the feature_NEMO_streamline_final, check if this is ok, and configure and compile with meson/ninja as a user would, in this manner?

It seems that I'm almost there, I just don't understand why the compilation doesn't give me the usual Mutationpp/install/ directory that would probably avoid the error in question.

Many thanks!!

rdbisme commented 3 years ago

Sorry, my fault. For some reason it lost the enable-mpp=true option.

I checked out again, built it correctly and launched:

Input File ``` %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % % Case description: Mach 5 inviscid flow over a 10deg wedge % % Author: C. Garbacz % % Institution: Strathclyde University % % Date: 2012.10.07 % % File Version 5.0.0 "Raven" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) SOLVER= NEMO_EULER % GAS_MODEL= AIR-5 % GAS_COMPOSITION= (0.77, 0.23, 0.0, 0.0, 0.0) % % Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO WRT_BINARY_RESTART= NO READ_BINARY_RESTART=NO % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % % Mach number (non-dimensional, based on the free-stream values) MACH_NUMBER= 5 % % Angle of attack (degrees) AOA= 0.0 % % Side-slip angle (degrees) SIDESLIP_ANGLE= 0.0 % % Free-stream pressure (101325.0 N/m^2 by default, only Euler flows) FREESTREAM_PRESSURE= 101325.0 % % Free-stream temperature (288.15 K by default) FREESTREAM_TEMPERATURE= 288.15 FREESTREAM_TEMPERATURE_VE= 288.15 % % Reynolds number (non-dimensional, based on the free-stream values) %REYNOLDS_NUMBER= 1 %KIND_TURB_MODEL= NONE % % % ---- NONEQUILIBRIUM GAS, IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% % % Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, % CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY, MUTATIONPP, USER_DEFINED_NONEQ) FLUID_MODEL= MUTATIONPP % % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % % Euler wall boundary marker(s) (NONE = no marker) MARKER_EULER= ( Euler, Wall ) MARKER_OUTLET= ( Exit, 10 ) MARKER_FAR = ( Farfield, Inlet ) % % Marker(s) of the surface to be plotted or designed %MARKER_PLOTTING= (Euler, Wall ) % % Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated MARKER_MONITORING= ( Wall ) % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % % Numerical method for spatial gradients (GREEN_GAUSS, LEAST_SQUARES, % WEIGHTED_LEAST_SQUARES) NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES % % Courant-Friedrichs-Lewy condition of the finest grid CFL_NUMBER= 0.5 % % Adaptive CFL number (NO, YES) CFL_ADAPT= NO % % Parameters of the adaptive CFL number (factor down, factor up, CFL min value, % CFL max value ) CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Runge-Kutta alpha coefficients RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations ITER= 11 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB % % Min error of the linear solver for the implicit formulation LINEAR_SOLVER_ERROR= 1E-6 % % Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 5 % % -----------------------------------------------------------------------% % % Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, % TURKEL_PREC, MSW) CONV_NUM_METHOD_FLOW= AUSM % % Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER) % MUSCL_FLOW= YES % % Slope limiter (VENKATAKRISHNAN, MINMOD) SLOPE_LIMITER_FLOW= VENKATAKRISHNAN % % Coefficient for the limiter (smooth regions) %LIMITER_COEFF= 0.3 % % 1st, 2nd and 4th order artificial dissipation coefficients %AD_COEFF_FLOW= ( 0.15, 0.5, 0.02 ) % % Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_EXPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % % Min value of the residual (log10 of the residual) CONV_RESIDUAL_MINVAL= -50 % % Start convergence criteria at iteration number CONV_STARTITER= 10 % % Number of elements to apply the criteria CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence CONV_CAUCHY_EPS= 1E-10 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % % Mesh input file MESH_FILENAME= mesh_wedge_inv.cgns % % Mesh input file format (SU2, CGNS, NETCDF_ASCII) MESH_FORMAT= CGNS % % Mesh output file MESH_OUT_FILENAME= swedge_out.su2 % % Restart flow input file SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT) TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= convergence % % Output file restart flow RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables VOLUME_FILENAME= soln_volume % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint % % Output objective function gradient (using continuous adjoint) GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) SURFACE_FILENAME= soln_surface % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint % % Writing solution file frequency WRT_SOL_FREQ= 100 % % Writing convergence history frequency WRT_CON_FREQ= 1 OUTPUT_WRT_FREQ= 100 OUTPUT_FILES= (RESTART_ASCII, PARAVIEW_ASCII) ```
Output ``` ../../../build/SU2_CFD/src/SU2_CFD invwedge.cfg HELLO ------------------------------------------------------------------------- | ___ _ _ ___ | | / __| | | |_ ) Release 7.0.7 "Blackbird" | | \__ \ |_| |/ / | | |___/\___//___| Suite (Computational Fluid Dynamics Code) | | | ------------------------------------------------------------------------- | SU2 Project Website: https://su2code.github.io | | | | The SU2 Project is maintained by the SU2 Foundation | | (http://su2foundation.org) | ------------------------------------------------------------------------- | Copyright 2012-2020, SU2 Contributors | | | | SU2 is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | | License as published by the Free Software Foundation; either | | version 2.1 of the License, or (at your option) any later version. | | | | SU2 is distributed in the hope that it will be useful, | | but WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | Lesser General Public License for more details. | | | | You should have received a copy of the GNU Lesser General Public | | License along with SU2. If not, see . | ------------------------------------------------------------------------- Parsing config file for zone 0 ----------------- Physical Case Definition ( Zone 0 ) ------------------- Compressible two-temperature thermochemical non-equilibrium Euler equations. Mach number: 5. Angle of attack (AoA): 0 deg, and angle of sideslip (AoS): 0 deg. No restart solution, use the values at infinity (freestream). Dimensional simulation. The reference area is 1 m^2. The semi-span will be computed using the max y(3D) value. The reference length is 1 m. Reference origin for moment evaluation is (0, 0, 0). Surface(s) where the force coefficients are evaluated: Wall. Input mesh file name: mesh_wedge_inv.cgns --------------- Space Numerical Integration ( Zone 0 ) ------------------ AUSM solver for the flow inviscid terms. Second order integration in space, with slope limiter. Venkatakrishnan slope-limiting method, with constant: 0.05. The reference element size is: 1. Gradient for upwind reconstruction: inverse-distance weighted Least-Squares. Gradient for viscous and source terms: inverse-distance weighted Least-Squares. --------------- Time Numerical Integration ( Zone 0 ) ------------------ Local time stepping (steady state simulation). Euler explicit method for the flow equations. No CFL adaptation. Courant-Friedrichs-Lewy number: 0.5 ------------------ Convergence Criteria ( Zone 0 ) --------------------- Maximum number of solver subiterations: 11. Begin convergence monitoring at iteration 10. Residual minimum value: 1e-50. Cauchy series min. value: 1e-10. Number of Cauchy elements: 100. Begin windowed time average at iteration 0. -------------------- Output Information ( Zone 0 ) ---------------------- Writing solution files every 100 iterations. Writing the convergence history file every 1 inner iterations. Writing the screen convergence history every 1 inner iterations. The tabular file format is Tecplot (.dat). Convergence history file name: convergence. Forces breakdown file name: forces_breakdown.dat. Surface file name: soln_surface. Volume file name: soln_volume. Restart file name: restart_flow.dat. ------------- Config File Boundary Information ( Zone 0 ) --------------- +-----------------------------------------------------------------------+ | Marker Type| Marker Name| +-----------------------------------------------------------------------+ | Euler wall| Euler| | | Wall| +-----------------------------------------------------------------------+ | Far-field| Farfield| | | Inlet| +-----------------------------------------------------------------------+ | Outlet boundary| Exit| +-----------------------------------------------------------------------+ -------------------- Output Preprocessing ( Zone 0 ) -------------------- Screen output fields: INNER_ITER, RMS_DENSITY_0, RMS_DENSITY_1, RMS_DENSITY_2, RMS_DENSITY_3, RMS_DENSITY_4, RMS_MOMENTUM-X, RMS_MOMENTUM-Y, RMS_ENERGY, RMS_ENERGY_VE History output group(s): ITER, RMS_RES Ignoring Convergence Field(s): RMS_DENSITY Warning: No (valid) fields chosen for convergence monitoring. Convergence monitoring inactive. Warning: No (valid) fields chosen for time convergence monitoring. Time convergence monitoring inactive. Volume output fields: COORDINATES, SOLUTION, PRIMITIVE, AUXILIARY ------------------- Geometry Preprocessing ( Zone 0 ) ------------------- Reading the CGNS file: mesh_wedge_inv.cgns. CGNS file contains 1 database(s). Database 1, Base: cell dimension of 2, physical dimension of 3. 1 total zone(s). Zone 1, dom-1: 3750 total vertices, 3626 total elements. Loading CoordinateX values. Loading CoordinateY values. Number of connectivity sections is 5. Section QuadElements contains 3626 elements of type Quadrilateral. Section inlet contains 49 elements of type Line. Section lower contains 74 elements of type Line. Section outlet contains 49 elements of type Line. Section upper contains 74 elements of type Line. Loading volume section QuadElements from file. Loading surface section inlet from file. Loading surface section lower from file. Loading surface section outlet from file. Loading surface section upper from file. Two dimensional problem. 3750 grid points. 3626 volume elements. 4 surface markers. 49 boundary elements in index 0 (Marker = inlet). Error in "short unsigned int CConfig::GetMarker_CfgFile_TagBound(std::string) const": ------------------------------------------------------------------------- The configuration file doesn't have any definition for marker inlet ------------------------------ Error Exit ------------------------------- -------------------------------------------------------------------------- MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD with errorcode 1. NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes. You may or may not see output from other processes, depending on exactly when Open MPI kills them. -------------------------------------------------------------------------- ```

It seems to work, right? Apart from the fact that I cannot find the invwedge.su2 file anymore, can you maybe attach it here?. I think you have a problem with your environment. Can you please provide the output of the env command? Are you using Anaconda?

CatarinaGarbacz commented 3 years ago

sorry, what do you mean by input file and output file?

I still get the same outcome as before.

  1. $env
MPP_DIRECTORY=/home/catarina/Desktop/PhD/Codes/SU2-streamline/subprojects/Mutationpp
CLUTTER_IM_MODULE=xim
LD_LIBRARY_PATH=/home/catarina/Desktop/PhD/Codes/SU2-streamline/subprojects/Mutationpp/install/lib
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
LC_MEASUREMENT=pt_PT.UTF-8
LESSCLOSE=/usr/bin/lesspipe %s %s
LC_PAPER=pt_PT.UTF-8
LC_MONETARY=pt_PT.UTF-8
XDG_MENU_PREFIX=gnome-
LANG=en_US.UTF-8
DISPLAY=:0
OLDPWD=/home/catarina/Desktop/PhD/Codes
MPP_DATA_DIRECTORY=/home/catarina/Desktop/PhD/Codes/SU2-streamline/subprojects/Mutationpp/data
GNOME_SHELL_SESSION_MODE=ubuntu
COLORTERM=truecolor
USERNAME=catarina
XDG_VTNR=2
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
LC_NAME=pt_PT.UTF-8
XDG_SESSION_ID=2
USER=catarina
DESKTOP_SESSION=ubuntu
QT4_IM_MODULE=xim
TEXTDOMAINDIR=/usr/share/locale/
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/b29ba5ea_f450_471c_8285_2891b95e87b0
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
PWD=/home/catarina/Desktop/PhD/Codes/NEMO-tests/ramp/coarse/euler
HOME=/home/catarina
SU2_HOME=/home/catarina/Desktop/PhD/Codes/SU2-streamline
LC_CTYPE=pt_PT.UTF-8
TEXTDOMAIN=im-config
SSH_AGENT_PID=2182
QT_ACCESSIBILITY=1
XDG_SESSION_TYPE=x11
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_SESSION_DESKTOP=ubuntu
LC_ADDRESS=pt_PT.UTF-8
GJS_DEBUG_OUTPUT=stderr
LC_NUMERIC=pt_PT.UTF-8
SU2_RUN=/home/catarina/Desktop/PhD/Codes/SU2-streamline/bin
GTK_MODULES=gail:atk-bridge
WINDOWPATH=2
VTE_VERSION=5202
TERM=xterm-256color
SHELL=/bin/bash
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus
IM_CONFIG_PHASE=2
XDG_CURRENT_DESKTOP=ubuntu:GNOME
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GNOME_TERMINAL_SERVICE=:1.73
XDG_SEAT=seat0
SHLVL=1
PYTHONPATH=:/home/catarina/Desktop/PhD/Codes/SU2/bin:/home/catarina/Desktop/PhD/Codes/SU2-streamline/bin
LC_TELEPHONE=pt_PT.UTF-8
GDMSESSION=ubuntu
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=catarina
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/run/user/1000/gdm/Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
PATH=/home/catarina/Desktop/PhD/Codes/SU2-streamline/subprojects/Mutationpp/install/bin:/home/catarina/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/catarina/Desktop/PhD/Codes/SU2/bin:/home/catarina/Desktop/PhD/Codes/SU2-streamline/bin
LC_IDENTIFICATION=pt_PT.UTF-8
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
SESSION_MANAGER=local/catarina-VivoBook-ASUSLaptop-X580GD-N580GD:@/tmp/.ICE-unix/2086,unix/catarina-VivoBook-ASUSLaptop-X580GD-N580GD:/tmp/.ICE-unix/2086
LESSOPEN=| /usr/bin/lesspipe %s
GTK_IM_MODULE=ibus
LC_TIME=pt_PT.UTF-8
_=/usr/bin/env
  1. I don't think I am using anaconda:
$python
Python 2.7.17 (default, Sep 30 2020, 13:38:04) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
rdbisme commented 3 years ago

Those are folded outputs. Click on the arrow to get the content.

https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d

CatarinaGarbacz commented 3 years ago

Ah right! yeah it seems to work with you.

Do you have any implicit reference to libmutation.so ? maybe in subprojects/Mutationpp/install/lib?

I think that's why I am missing, which I believe to be the outcome of correctly building mutation?

rdbisme commented 3 years ago

I don't have any explicit reference to anything. meson should take care of all the linking magic. Your environment looks polluted by the way, you have PYTHONPATH and LD_LIBRARY_PATH set.

Maybe try to unset them. It's general a very bad idea to use LD_LIBRARY_PATH and stuff. If you need to link to something out of standard paths, you should use the rpath flag for the linker. Instead of PYTHONPATH you should use a virtualenv.

rdbisme commented 3 years ago

In addition, you are using Python 2.7 that is obsolete, you should use Python 3.6+. Check also that you're installing a recent meson version in your virtualenv. Maybe the last version compatible with Python 2 is not good enough.

CatarinaGarbacz commented 3 years ago

ok thank you. Yes as you probably can tell, I don't have much experience with this side of things. I will explore the things you suggested and see if I can make some progress. Very grateful for the support. Will update here !

rdbisme commented 3 years ago

There's absolutely no problem. 😉

Let me know if unsetting the environment variables you manage to solve.

On Sun, 10 Jan 2021, 00:23 CatarinaGarbacz, notifications@github.com wrote:

ok thank you. Yes as you probably can tell, I don't have much experience with this side of things. I will explore the things you suggested and see if I can make some progress. Very grateful for the support. Will update here !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mutationpp/Mutationpp/issues/152#issuecomment-757383065, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5UANESOSWTP4ARVKHMCRLSZDQQPANCNFSM4V3FRLQQ .

CatarinaGarbacz commented 3 years ago

it didn't solve it. But I will start the process again step by step on a clean branch and in a fresh day, since I'm at the stage of going around in circles. I'll update on any developments

rdbisme commented 3 years ago

I know the feeling. Generally is always something very easy that we can't see.

If you start again, please record exactly all the steps you're doing with the output of the commands such that I can try to understand better.

On Sun, 10 Jan 2021, 02:14 CatarinaGarbacz, notifications@github.com wrote:

it didn't solve it. But I will start the process again step by step on a clean branch and in a fresh day, since I'm at the stage of going around in circles. I'll update on any developments

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mutationpp/Mutationpp/issues/152#issuecomment-757394243, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5UAND5VXIJIRNEHL5UPZTSZD5ODANCNFSM4V3FRLQQ .

CatarinaGarbacz commented 3 years ago

true. I will do that!

CatarinaGarbacz commented 3 years ago

some (good) news. So I re-started to process, trying to follow this conversation, my steps were:

  1. sudo ln -s /usr/bin/python3 /usr/bin/python (to have python3 as default when python is called, I confirmed it works)

2.pip3 install meson Collecting meson Installing collected packages: meson Successfully installed meson-0.56.2

3.mkdir subprojects cd subprojects git submodule add https://github.com/mutationpp/Mutationpp.git

  1. edit meson.build:

if get_option('enable-mpp') cmake = import('cmake') mpp_subproj = cmake.subproject('Mutationpp') mpp_dep = mpp_subproj.dependency('mutation++') su2_deps += mpp_dep su2_cpp_args += '-DHAVE_MPP' endif

  1. edit meson_options.txt: option('enable-pp', type : 'boolean', value : true, description: 'enable Mutation++ support')

  2. ./meson.py build --prefix=~/Desktop/PhD/Codes/SU2-streamline -Denable-mpp=true

7 ./ninja -C build install

  1. export MPP_DATA_DIRECTORY=/home/catarina/Desktop/PhD/Codes/SU2-streamline/subprojects/Mutationpp/data

I was having the same error. but in the middle of digging and exploring, I found this guy: ~/Desktop/PhD/Codes/SU2-streamline/build/subprojects/Mutationpp/libcm_mutation__.so so I simply did

  1. export LD_LIBRARY_PATH=/home/catarina/Desktop/PhD/Codes/SU2-streamline/build/subprojects/Mutationpp

and it worked! probably it was there all along.

now... this works and I'm obviously happy with it after lots of failed attempts, but you told me before exporting LD_LIBRARY_PATH might not be the best approach. Should I leave it like this since it seems to fulfill the purpose, or do you have any additional suggestion?

rdbisme commented 3 years ago

Ehi @CatarinaGarbacz, few notes:

First, I'll fix your modifications that will likely cause problems in the future:

  1. Restore your system python and remove the symlink on python 3
  2. pip3 uninstallmeson`.

Then, let's do it correctly

  1. Let's create a virtualenv to be used with SU2 called su2-venv. I generally create them in ~/.virtualenv or ~/.envs, you choose.

    python3 -m venv ~/.virtualenvs/su2-venv
  2. Activate the virtualenv (a parenthesis should appear next to your command prompt)

    source ~/.virtualenvs/su2-venv/bin/activate
  3. Git clone (recursively in order to checkout also all the submodules):

    git clone --recursive https://github.com/su2code/SU2.git --branch=feature_NEMO_streamline_final
  4. Enter the SU2 root folder and prepare the build (always having the virtualenv active)

    # Not meson.py!!
    meson setup build -Denable-mpp=true
  5. Go in the build directory and compile SU2

    cd build
    ninja

This, in my case, compiles SU2 as expected without the need of tweaking LD_LIBRARY_PATH.

CatarinaGarbacz commented 3 years ago

Hi @rubendibattista your patience is truly admirable, thank you so much. I will correct the things you're saying, after this last post I understand better how to use virtualenv, whereas before I was getting a bit lost, that's why I ended up doing other things.

about the meson/ninja part, I can give it a try (tomorrow), to see what happens. but, in the end, I don't think this is something I want to do... cause the point is that a user would download SU2 and follow the SU2-build instructions on their website, which say to use the meson.py script. I'm afraid that if I don't set all this up accordingly, the users will not know how to do it. My aim is to interfere the least possible in the current SU2 build method. what do you think, knowing this ?

CatarinaGarbacz commented 3 years ago

in any case, I was looking at meson.py to see if there's anything obvious causing this. And I noticed these lines:

 if os.path.exists(sys.path[0] + os.path.sep + 'externals' + os.path.sep + 'meson' + os.path.sep + 'mesonbuild'):
    sys.path.insert(0, str(sys.path[0] + os.path.sep + 'externals' +os.path.sep + 'meson'))

maybe it wouldn't hurt to add here a reference to the subprojects/ directory ? (externals/ is the typical directory where SU2 has all the other external libraries, not dependent on cmake. initially this is where I wanted to have mpp, but I guess the conclusion was that to have meson with cmake, we had to pretend mpp was a subproject. wondering if this is something we could still change to externals/). let me know if you have any thoughts

rdbisme commented 3 years ago

Ehi @CatarinaGarbacz, I don't know. I just followed the instructions on the Meson website. I'm not familiar with SU2 things, but apparently using that non-standard script meson.py causes linking problems as you witness. I did not check it tho.

Personally, I'll use the standard way of doing in Meson and, if possible, I'll remove the meson.py script since, as you can see, the hardcoding of path gets easily out of sync and moreover you need to take care of meson.py also in terms of compatibility with Python versions and such.

in any case, I was looking at meson.py to see if there's anything obvious causing this. And I noticed these lines:

  if os.path.exists(sys.path[0] + os.path.sep + 'externals' + os.path.sep + 'meson' + os.path.sep + 'mesonbuild'):
    sys.path.insert(0, str(sys.path[0] + os.path.sep + 'externals' +os.path.sep + 'meson'))

 maybe it wouldn't hurt to add here a reference to the subprojects/directory ? (externals/ is the typical directory where SU2 has all the other external libraries, not dependent on cmake. initially this is where I wanted to have mpp, but I guess the conclusion was that to have meson with cmake, we had to pretend mpp was a subproject. wondering if this is something we could still change to externals/). let me know if you have any thoughts

I don't know. Maybe? That looks quite non-standard, tho. Personally I like things done as standalone as possible. If it's applicable for SU2, I would push to standardize the build system workflow: Meson is already a build system that has a niche community of users, i.e. finding the same problem as yours on the internet is quite hard (wrt CMake, for example). Avoiding the need of debugging a hand-made build script is incredibly valuable, also for external packagers.

rdbisme commented 3 years ago

Then again, it's possible I'm completely overseeing the real reason why there's that meson.py. So, take my words with a grain of salt!

CatarinaGarbacz commented 3 years ago

ok I see. It makes sense, I will check with other developers to see if this goes in line with their work introducing meson to SU2.

about the subprojects, do you know by heart if this folder is allowed to have a different name ? I'm searching about it, but if you know, let me know pls :)

rdbisme commented 3 years ago

If I remember well, apparently not. I did not investigate further tho. 🤷‍♂️

(I'll close this issue, if there's something more feel free to post here below and if needed we will reopen it, even if, all things considered, this seems not to be an issue related to Mutation, but more to SU2)

CatarinaGarbacz commented 3 years ago

that's fine :) again, many thanks! your help was essential