|
[Sponsors] |
wmake problems during custom utility compilation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 25, 2013, 16:59 |
wmake problems during custom utility compilation
|
#1 | |
New Member
Karol Kamiński
Join Date: Dec 2012
Posts: 9
Rep Power: 13 |
Hello everyone
I'm new OF user, just yesterday I succesfully installed 12.3Suse and 2.2.1 OpenFoam on my computer. I followed by this instructions: http://www.openfoam.org/download/suse.php And everything looked great, tutorial cases worked, but... when I tried to create my own utility called "wallHeatFluxIncompressibleNu", I got some strange errors. Because I was afraid, that the problem is caused because of code errors, I just copied good, working utility "wallHeatFlux" from OF2.2.1 and then I renamed it to "wallHeatFluxTest" and tried compiled... but I again got the same errors... so I suppose that I don't have some library or sth similar. Maybe someone can help me? Below you can find list of errors: Quote:
|
||
July 26, 2013, 07:25 |
|
#2 |
New Member
Karol Kamiński
Join Date: Dec 2012
Posts: 9
Rep Power: 13 |
Hi all! It's me again.
If the thread is not in a good place and you reccomend me to put it in another sub-forum (i.e. 'OF installation') just write to me. I just think that 'wallHeatFlux' utility is used in postprocessing and that's why I put this thread here. But if I am wrong, please correct me, because I really need fast solution for this problem without it I can't start work for my master thesis. Hope anyone can help |
|
July 26, 2013, 08:28 |
|
#3 |
Senior Member
|
wmake output you've provided is not enough to determine the problem you have. From one point of view you have a problem with environment variables (i.e. forgot to source bashrc), but in this case you should have compilation problems earlier.
So for further help, please, provide at least files and options files from Make directory. Ideally you can post utility source code as well. |
|
July 26, 2013, 15:55 |
|
#4 | ||
New Member
Karol Kamiński
Join Date: Dec 2012
Posts: 9
Rep Power: 13 |
Thanks for answer.
Quote:
So what do you mean by writing: "i.e. forgot to source bashrc"? Do you mean adding this code line at the end of bashrc? I did it as it was recommended here: http://www.openfoam.org/download/suse.php When it comes about utility, as I said it's just standard "wallHeatFlux" utility. I didn't change anything in code. The only change which I did is the name of utility (now "wallHeatFluxTest". Maybe the problem is, that I put this new utility in another folder (not in folder where I can find all standard utilities)? I created special folder "extend" where I want to create new solvers/utilities. Is it problem for OpenFoam? [EDITED] Ok, so now I read this presentation: http://cfd.iut.ac.ir/files/Tutorial,...20Diego%20.pdf and on page 13 there is written: Quote:
And next question, I found this page: http://www.csc.fi/english/research/s...penfoam/modsol And author said, that before compiling your own solver, utility etc, first initialize OpenFOAM environment (more infos on this page): http://www.csc.fi/english/research/s.../openfoam/init but in my case command "module add openfoam" doesn't work. Terminal doesn't recognise command "module". What this command should gives me as a result? |
|||
July 26, 2013, 18:10 |
|
#5 |
Senior Member
|
This can basically mean that actually your shell does not execute bashrc at all. I don't know the state of desktop environment in OpenSUSE (is it KDE or GNOME?) but you need to tell it to execute login shell it is somewhere in settings (I can not make screenshots/describe a path to the settings right now but you can search for "konsole login shell" or "gnome terminal login shell").
Alternatively you can just do "source /path/to/openfoam/bashrc" after launching your shell and then compile utility. files and options seems to be OK so the problem should be indeed in environment variables, i.e. OpenFAOM's bashrc is not executed after your launch shell. And finally about module command, this is usually configured by system administrators (for example if you'd like to use openmpi you do module load openmpi, on my cluster you execute module load openfoam and all environment variables are set up). This is the way of RedHat based distributions, don't know whether it is right for OpenSUSE. |
|
July 31, 2013, 02:54 |
|
#6 |
New Member
Karol Kamiński
Join Date: Dec 2012
Posts: 9
Rep Power: 13 |
I can do it only if I'm logged as a "su". As a normal user I can't do that... Anyway, even if I will log as a su, now compilation works, but only for this window in terminal and this time. After exiting from "su" (became normal user), and again log as a su, I have to compile once again utility. It looks like linux is really old guy, who doesn't remember what he compiled last minute...
Anyway many thanks for your help |
|
May 25, 2016, 13:07 |
|
#7 |
New Member
chubb87
Join Date: May 2011
Posts: 21
Rep Power: 15 |
Hi all,
I had the same symptoms (solver runs without problems, but library does not compile with the mentioned error message). I don't know whether your problem had another origin, but for me it was simply that I had used "wmake" instead of "wmake libso" to compile an object. |
|
September 15, 2017, 12:39 |
gcc version error
|
#8 |
New Member
Eric Bringley
Join Date: Nov 2016
Posts: 14
Rep Power: 10 |
Hi All,
My google searches led me here, so I'm placing this piece of information here. For anyone who stumbled here from getting undefined references from compiled libraries to openfoam functions, check that you are using the correct version of your compiler that matches the compiler during installation. Recompile your user libraries with wmake libso before compiling your executable. This could likely happen if you have multiple versions of openfoam installed. It's a silly/stupid mistake, but one that could be infuriating to figure out. To hopefully better help web searches, I was chasing these linking errors: Code:
libconversion.so: undefined reference to `Foam::OSstream::writeQuoted(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)' ... libOpenFOAM.so: undefined reference to `Foam::dlSym(void*, std::string const&)' libOpenFOAM.so: undefined reference to `Foam::regExp::regExp(std::string const&, bool)' libOpenFOAM.so: undefined reference to `Foam::regExp::operator=(std::string const&)' ... libUserLibrary.so: undefined reference to `Foam::UOPstream::writeQuoted(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)' |
|
March 16, 2018, 09:34 |
linking errors
|
#9 |
New Member
Join Date: Nov 2014
Posts: 6
Rep Power: 11 |
Hi,
Could you please elaborate on the solution? I am having the undefined reference to `Foam::UOPstream::writeQuoted(std::string const&, bool)' error. I have OF4, 5 and -dev installed on Ubuntu 16.04. |
|
April 11, 2018, 11:53 |
|
#10 | |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34 |
Quote:
I also recently had this problem. I was trying to compile a custom utility with a system install of OF50 on Ubuntu 16.04. The problem was that I had changed my default gcc/g++ compiler to gcc-4.9 (I was using this with my foam-extend-4.0 install) and this caused the error. To fix, I had to change the default gcc/g++ compiler back to gcc-5 (I guess this was the one used by the OF-5.0 install). After that, the custom utility compilation went fine. By the way, I obviously need to switch back to gcc/g++ 4.9 when I am using my foam-extend-4.0 installation; the command "update-alternatives" is convenient for switching program versions on Ubuntu, e.g. see here: https://askubuntu.com/questions/2649...-and-g-version. Philip |
||
April 11, 2018, 15:11 |
|
#11 |
New Member
Join Date: Nov 2014
Posts: 6
Rep Power: 11 |
Thanks for the reply.
It seems that some incompatibility issues between the precompiled OF and Ubuntu 16.04 caused my problems. I compiled from source and it started working fine. |
|
August 13, 2018, 21:52 |
|
#12 |
Member
Jack
Join Date: May 2015
Posts: 98
Rep Power: 11 |
Hi all,
How can I check which compiler was used to install my sources (I am using foam-extend-4.0) and which compiler I am using when running wmake? When I execute wmake for my new solver.C I get Code:
Making dependency list for source file solver.C SOURCE=solver.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-200 https://openfoamwiki.net/index.php/I...end-4.0/Ubuntu |
|
Tags |
wmake error |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] wmake problem | vville | OpenFOAM Installation | 1 | October 8, 2015 06:01 |
Problems with wmake | ivan_cozza | OpenFOAM Programming & Development | 14 | June 30, 2013 08:34 |
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 | flakid | OpenFOAM Installation | 16 | December 28, 2010 09:48 |
Problems in personal library compilation | shrina | OpenFOAM | 3 | February 23, 2009 12:12 |
[Commercial meshers] Several problems with the mesh conversion utility when converting the meshes from Gridgen | su_junwei | OpenFOAM Meshing & Mesh Conversion | 2 | July 27, 2008 00:58 |