|
[Sponsors] |
Compiling OpenFoam from git : problem with ld |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 9, 2012, 07:23 |
|
#21 |
New Member
Matthieu Borgraeve
Join Date: Aug 2012
Posts: 17
Rep Power: 14 |
Hi,
Some news i did'nt caught before : there is some errors when Allwmaking Thirdparty (attached, at the begging of the file). I am trying to compile OpenFoam. |
|
August 9, 2012, 07:26 |
|
#22 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Not much of a problem here... Open-MPI can build without these:
Quote:
__________________
|
||
August 9, 2012, 09:49 |
|
#23 |
New Member
Matthieu Borgraeve
Join Date: Aug 2012
Posts: 17
Rep Power: 14 |
after a few hours compiling, it does finish, linking the elements which were missing after cuda installation.
I am following the rest of the tutorial, and it works, i manage to run the cavity test. I just notice that before installing cudad, they ask me for installing binutils-gold, which i think is the probleming ld util. I will look at the link ld before and after, and/or try to locate cuda/nvidia conf file for redirecting to ld-gold, and replace lthe original link in every other case. I keep you informed ;-) EDIT1 : Effectively, the link /usr/bin/ld point to /usr/bin/ld.bfd without binutils-gold, but it points to /usr/bin/ld.gold after installing it... I look for a way to alias it or to edit nvidia conf files to solve it. EDIT2 It really seems to be the problem, for now i'm testing compiling C Cuda application with the gold, and then i wxill recompile OpenFoam. Cuda C compilation fails with ld.bfd, which the standard version, but OpenCL does not complain, and the tests applications runned. I think i will have to edit the ld link each time i want to use cuda c compilation : i made an alias alias cuda ='alias ld=/usr/bin/ld.gold', the modification is apparent in a batch, but the make fails anyway. Aliases doesn't seem to interact with make... Have you any idea about how to make it quasi-automatic ? Last edited by mborgraeve; August 9, 2012 at 10:51. Reason: Reason ;-) |
|
August 9, 2012, 11:14 |
|
#24 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
alias won't work. You'll have to either use a wrapper script or switch OpenFOAM's build method to the old way.
Wrapper - I haven't tested this so I'm not certain it will work as intended:
The other possibility and possibly the more sane one is to disable the current operational method (edit: this apparently doesn't work ):
__________________
Last edited by wyldckat; August 15, 2012 at 11:09. Reason: updated instructions and indicated that the "other possibility" doesn't work :( |
|
August 10, 2012, 04:57 |
|
#25 |
New Member
Matthieu Borgraeve
Join Date: Aug 2012
Posts: 17
Rep Power: 14 |
The second options give me an error, but i'm not sure it concerns OpenFoam :
Code:
make[2]: « /home/matthieu/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccSPOpt/bin/expandDictionary » est à jour. g++ -m64 -Dlinux64 -DWM_SP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -IlnInclude -I. -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccSPOpt/foamDebugSwitches.o -L/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccSPOpt/lib \ -lautoMesh -lbarotropicCompressibilityModel -lbasicSolidThermo -lbasicThermophysicalModels -lblockMesh -lchemistryModel -lcoalCombustion -lcompressibleLESModels -lcompressibleRASModels -lcompressibleTurbulenceModel -lconversion -ldecompositionMethods -ldistributed -ldistributionModels -ldsmc -ldynamicFvMesh -ldynamicMesh -ledgeMesh -lengine -lfieldFunctionObjects -lfileFormats -lfiniteVolume -lfoamCalcFunctions -lforces -lfvMotionSolvers -lgenericPatchFields -lincompressibleLESModels -lincompressibleRASModels -lincompressibleTransportModels -lincompressibleTurbulenceModel -linterfaceProperties -lIOFunctionObjects -ljobControl -llagrangian -llagrangianIntermediate -llaminarFlameSpeedModels -lLESdeltas -lLESfilters -lliquidMixtureProperties -lliquidProperties -lmeshTools -lmolecularMeasurements -lmolecule -lODE -lOpenFOAM -lpotential -lradiationModels -lrandomProcesses -lreactionThermophysicalModels -lreconstruct -lsampling -lSLGThermo -lsolidMixtureProperties -lsolidParticle -lsolidProperties -lsolid -lspecie -lsurfaceFilmModels -lsurfMesh -lsystemCall -lthermalPorousZone -lthermophysicalFunctions -ltopoChangerFvMesh -ltriSurface -ltwoPhaseInterfaceProperties -lutilityFunctionObjects -lOpenFOAM -ldl -lm -o /home/matthieu/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccSPOpt/bin/foamDebugSwitches g++ -m64 -Dlinux64 -DWM_SP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/meshTools/lnInclude -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/dynamicMesh/lnInclude -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccSPOpt/PDRMesh.o -L/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccSPOpt/lib \ -lmeshTools -ldynamicMesh -lfiniteVolume -lcompressibleRASModels -lOpenFOAM -ldl -lm -o /home/matthieu/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccSPOpt/bin/PDRMesh Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function void Foam::Pstream::gather<int, Foam::minOp<int> >(Foam::List<Foam::UPstream::commsStruct> const&, int&, Foam::minOp<int> const&, int) [clone .constprop.902]: error: undefined reference to 'Foam::UIPstream::read(Foam::UPstream::commsTypes, int, char*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function void Foam::Pstream::gather<int, Foam::minOp<int> >(Foam::List<Foam::UPstream::commsStruct> const&, int&, Foam::minOp<int> const&, int) [clone .constprop.902]: error: undefined reference to 'Foam::UOPstream::write(Foam::UPstream::commsTypes, int, char const*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function findPatch(Foam::polyBoundaryMesh const&, Foam::word const&): error: undefined reference to 'Foam::UIPstream::read(Foam::UPstream::commsTypes, int, char*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function findPatch(Foam::polyBoundaryMesh const&, Foam::word const&): error: undefined reference to 'Foam::UOPstream::write(Foam::UPstream::commsTypes, int, char const*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function findPatch(Foam::polyBoundaryMesh const&, Foam::word const&): error: undefined reference to 'Foam::UIPstream::read(Foam::UPstream::commsTypes, int, char*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function findPatch(Foam::polyBoundaryMesh const&, Foam::word const&): error: undefined reference to 'Foam::UOPstream::write(Foam::UPstream::commsTypes, int, char const*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function void Foam::syncTools::syncBoundaryFaceList<int, Foam::maxEqOp<int>, Foam::mapDistribute::transform>(Foam::polyMesh const&, Foam::UList<int>&, Foam::maxEqOp<int> const&, Foam::mapDistribute::transform const&): error: undefined reference to 'Foam::UIPstream::UIPstream(int, Foam::PstreamBuffers&)' collect2: ld a retourné 1 code d'état d'exécution make[3]: *** [/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccSPOpt/bin/PDRMesh] Erreur 1 make[2]: *** [PDRMesh] Erreur 2 I think it will be safer to manually chane the link when compiling Cuda stuff, and then rechange it at the end to retreive the original state |
|
August 10, 2012, 06:51 |
|
#26 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Try keeping:
Code:
-Xlinker --no-as-needed
__________________
|
|
August 13, 2012, 04:24 |
|
#27 |
New Member
Matthieu Borgraeve
Join Date: Aug 2012
Posts: 17
Rep Power: 14 |
Hi,
Even with keeping this, i got references errors : Code:
g++ -m64 -Dlinux64 -DWM_SP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/meshTools/lnInclude -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/dynamicMesh/lnInclude -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --no-as-needed Make/linux64GccSPOpt/PDRMesh.o -L/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccSPOpt/lib \ -lmeshTools -ldynamicMesh -lfiniteVolume -lcompressibleRASModels -lOpenFOAM -ldl -lm -o /home/matthieu/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccSPOpt/bin/PDRMesh Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function void Foam::Pstream::gather<int, Foam::minOp<int> >(Foam::List<Foam::UPstream::commsStruct> const&, int&, Foam::minOp<int> const&, int) [clone .constprop.902]: error: undefined reference to 'Foam::UIPstream::read(Foam::UPstream::commsTypes, int, char*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function void Foam::Pstream::gather<int, Foam::minOp<int> >(Foam::List<Foam::UPstream::commsStruct> const&, int&, Foam::minOp<int> const&, int) [clone .constprop.902]: error: undefined reference to 'Foam::UOPstream::write(Foam::UPstream::commsTypes, int, char const*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function findPatch(Foam::polyBoundaryMesh const&, Foam::word const&): error: undefined reference to 'Foam::UIPstream::read(Foam::UPstream::commsTypes, int, char*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function findPatch(Foam::polyBoundaryMesh const&, Foam::word const&): error: undefined reference to 'Foam::UOPstream::write(Foam::UPstream::commsTypes, int, char const*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function findPatch(Foam::polyBoundaryMesh const&, Foam::word const&): error: undefined reference to 'Foam::UIPstream::read(Foam::UPstream::commsTypes, int, char*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function findPatch(Foam::polyBoundaryMesh const&, Foam::word const&): error: undefined reference to 'Foam::UOPstream::write(Foam::UPstream::commsTypes, int, char const*, long, int)' Make/linux64GccSPOpt/PDRMesh.o:PDRMesh.C:function void Foam::syncTools::syncBoundaryFaceList<int, Foam::maxEqOp<int>, Foam::mapDistribute::transform>(Foam::polyMesh const&, Foam::UList<int>&, Foam::maxEqOp<int> const&, Foam::mapDistribute::transform const&): error: undefined reference to 'Foam::UIPstream::UIPstream(int, Foam::PstreamBuffers&)' collect2: ld a retourné 1 code d'état d'exécution make[3]: *** [/home/matthieu/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccSPOpt/bin/PDRMesh] Erreur 1 make[2]: *** [PDRMesh] Erreur 2 |
|
August 13, 2012, 17:00 |
|
#28 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Matthieu,
Strange... very strange... I'll try to test this in the next couple of days... In the mean time, there is a somewhat quick way of switching between ld versions... something like this should get you in the right path: Code:
sudo update-alternatives --config ld Best regards, Bruno
__________________
|
|
August 15, 2012, 11:18 |
|
#29 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Matthieu,
I've updated the instructions about creating a wrapper script for ld on post #24: http://www.cfd-online.com/Forums/ope...tml#post376235 As for this command: Code:
sudo update-alternatives --config ld I think the main difference when using the gold one is that all of the library dependencies have to be explicitly declared. This is why tweaking around with "no-as-needed" won't do the trick (although I could be wrong...). This is can be very complicated with OpenFOAM, because it relies on the feature of automatically figuring out certain library dependencies. It would require to edit most of the "Make/options" files and define in them all of the necessary library dependencies. Best regards, Bruno
__________________
|
|
November 19, 2012, 16:11 |
|
#31 |
Senior Member
Daniel WEI (老魏)
Join Date: Mar 2009
Location: Beijing, China
Posts: 689
Blog Entries: 9
Rep Power: 21 |
The error might be because of the GNU gold. It seems GNU gold is still in beta. So use GNU ld instead.
__________________
~ Daniel WEI ------------- Boeing Research & Technology - China Beijing, China |
|
November 19, 2012, 18:33 |
|
#32 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
I noticed you reported this here: http://www.openfoam.org/mantisbt/view.php?id=685 It's not as much of a beta issue, it's more of a decision issue... I think this could have been fixed in OpenFOAM a long time ago, but they kept taking the quickest route, or so it seemed (as seen in post #20): In the comments of bug reports you'll find these two other important links: It basically leads all down to a single paradoxal premise:
Bruno
__________________
|
|||
November 19, 2012, 18:46 |
|
#33 |
Senior Member
Daniel WEI (老魏)
Join Date: Mar 2009
Location: Beijing, China
Posts: 689
Blog Entries: 9
Rep Power: 21 |
Thanks, Bruno.
By saying beta, I was hoping that gnu-gold would someday add a option to tolerate the "--add-needed" option with only a warning. Maybe they are still open to the users' voices in "beta" stage? But anyway, I'm okay with their new philosophy. Is it too troublesome to add twenty to thirty lines in options file for each app? Could the core libs linkage be added in wmake/Makefile (not just -lOpenFOAM)? Thanks again, Bruno, you are so active/energetic everyday.
__________________
~ Daniel WEI ------------- Boeing Research & Technology - China Beijing, China |
|
November 19, 2012, 19:08 |
|
#34 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quote:
Quote:
Actually this isn't much of a headache, because this work has already been done in the (unofficial) modifications made to OpenFOAM for it to work on Windows, both by Symscape and blueCAPE, because ironically Windows requires explicit indication of which libraries the applications reaaally need for working. Although in Windows it gets even trickier, because in Linux one can tell the linker to add a few libraries into the mix, even if they're not explicitly necessary... But from what I've seen so far, the reasoning is part of OpenFOAM's own coding elegance:
I'm half asleep already... so I'm not so sure that "active/energetic" is the key reason Probably I'm simply trying to prove something to myself ...
__________________
|
|||
Tags |
--add-needed, /usr/bin/ld, openfoam 2.1.x |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiling OpenFOAM on hpc-fe.gbar.dtu.dk | kaergaard | OpenFOAM Installation | 1 | June 16, 2011 02:33 |
OpenFOAM 1.7.x git problem | olauer | OpenFOAM Installation | 18 | July 29, 2010 07:36 |
Problem with mpirun with OpenFOAM | jiejie | OpenFOAM | 3 | July 7, 2010 20:30 |
Problem compiling OpenFOAM 1.6.x | deji | OpenFOAM Installation | 1 | October 8, 2009 00:00 |
LiftDrag compiling problem | vdb | OpenFOAM Pre-Processing | 2 | June 16, 2008 10:45 |