Closed CatarinaGarbacz closed 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
Anyway, I checked out your branch.
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
So here's my procedure.
git clone --recursive https://github.com/su2code/SU2.git
pip install meson
. meson.build
if not done in precedence. meson setup builddir
cd builddir
ninja
This compiles the software and when I run againt the nonequilibrium/invwedge
it does not print your same error.
Hope it helps. :)
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)
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
./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"
./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!!
Sorry, my fault. For some reason it lost the enable-mpp=true
option.
I checked out again, built it correctly and launched:
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?
sorry, what do you mean by input file and output file?
I still get the same outcome as before.
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
$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.
>>>
Those are folded outputs. Click on the arrow to get the content.
https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d
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?
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
.
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.
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 !
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 .
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
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 .
true. I will do that!
some (good) news. So I re-started to process, trying to follow this conversation, my steps were:
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
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
edit meson_options.txt: option('enable-pp', type : 'boolean', value : true, description: 'enable Mutation++ support')
./meson.py build --prefix=~/Desktop/PhD/Codes/SU2-streamline -Denable-mpp=true
7 ./ninja -C build install
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
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?
Ehi @CatarinaGarbacz, few notes:
In my experience, It's a very bad idea to change the system python interpreter (as you do with the symlink) and to install python packages systemwise using pip
, because this will likely conflict with the ones packaged by your distribution package manager. Rule of thumb: never use root! :) This will likely cause lots of problems. The correct way to do this is to use a virtualenv. Here you find the official documentation. So, another rule of thumb, for each project that requires Python, create an independent virtualenv.
In the step 6, you are using meson.py
from the local repository of SU2. I did not. I used meson
directly from command line. Maybe it's related to that meson.py
?
First, I'll fix your modifications that will likely cause problems in the future:
python
and remove the symlink on python 3
pip3 uninstall
meson`.Then, let's do it correctly
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
Activate the virtualenv (a parenthesis should appear next to your command prompt)
source ~/.virtualenvs/su2-venv/bin/activate
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
Enter the SU2 root folder and prepare the build (always having the virtualenv active)
# Not meson.py!!
meson setup build -Denable-mpp=true
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
.
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 ?
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
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.
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!
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 :)
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)
that's fine :) again, many thanks! your help was essential
@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
any help is appreciated, thanks!