View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000015 | OpenFOAM | Bug | public | 2010-08-28 10:40 | 2010-08-31 16:08 |
Reporter | Assigned To | ||||
Priority | low | Severity | tweak | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Platform | Linux | OS | Fedora | OS Version | fc13.x86_64 |
Summary | 0000015: DSO Link Issues | ||||
Description | It appears that there is a lot of implicit linking with the Pstream library for many of the applications. In Fedora 13 this is no longer allowed: http://fedoraproject.org/wiki/UnderstandingDSOLinkChange Running Allwmake results in most of the applications failing to be built. | ||||
Steps To Reproduce | Running wmake on (as an example) potentialFoam leads to: SOURCE=potentialFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/OpenFOAM/lnInclude -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/potentialFoam.o /home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude/readSIMPLEControls.H: In function ‘int main(int, char**)’: /home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude/readSIMPLEControls.H:6: warning: unused variable ‘momentumPredictor’ /home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude/readSIMPLEControls.H:9: warning: unused variable ‘transonic’ g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/OpenFOAM/lnInclude -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/potentialFoam.o -L/home/lrm29/github/OpenFOAM-1.7.x.f13/lib/linux64GccDPOpt \ -/home/lrm29/github/OpenFOAM-1.7.x.f13/lib/linux64GccDPOpt/openmpi-1.4.1/lPstream -lfiniteVolume -lOpenFOAM -liberty -ldl -lm -o /home/lrm29/github/OpenFOAM-1.7.x.f13/applications/bin/linux64GccDPOpt/potentialFoam g++: unrecognized option '-/home/lrm29/github/OpenFOAM-1.7.x.f13/lib/linux64GccDPOpt/openmpi-1.4.1/lPstream' /usr/bin/ld: Make/linux64GccDPOpt/potentialFoam.o: undefined reference to symbol 'Foam::OPstream::write(Foam::Pstream::commsTypes, int, char const*, long)' /usr/bin/ld: note: 'Foam::OPstream::write(Foam::Pstream::commsTypes, int, char const*, long)' is defined in DSO /home/lrm29/github/OpenFOAM-1.7.x.f13/lib/linux64GccDPOpt/openmpi-1.4.1/libPstream.so so try adding it to the linker command line /home/lrm29/github/OpenFOAM-1.7.x.f13/lib/linux64GccDPOpt/openmpi-1.4.1/libPstream.so: could not read symbols: Invalid operation collect2: ld returned 1 exit status make: *** [/home/lrm29/github/OpenFOAM-1.7.x.f13/applications/bin/linux64GccDPOpt/potentialFoam] Error 1 A possible fix would be to change Make/options for (as an example) potentialFoam from EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = -lfiniteVolume to EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = -L$(FOAM_MPI_LIBBIN) \ -lPstream \ -lfiniteVolume Alternatively the wmake rules could be altered, although I'm not sure how to prevent unnecessary linking to libraries that don't require Pstream. | ||||
Additional Information | I wasn't sure whether to report this, but I suppose it's possible that this may become more widespread in other OS's in the future. | ||||
Tags | Installation | ||||
|
Woops, the error message should be: SOURCE=potentialFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/OpenFOAM/lnInclude -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/potentialFoam.o /home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude/readSIMPLEControls.H: In function ‘int main(int, char**)’: /home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude/readSIMPLEControls.H:6: warning: unused variable ‘momentumPredictor’ /home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude/readSIMPLEControls.H:9: warning: unused variable ‘transonic’ g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/OpenFOAM/lnInclude -I/home/lrm29/github/OpenFOAM-1.7.x.f13/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/potentialFoam.o -L/home/lrm29/github/OpenFOAM-1.7.x.f13/lib/linux64GccDPOpt \ -lfiniteVolume -lOpenFOAM -liberty -ldl -lm -o /home/lrm29/github/OpenFOAM-1.7.x.f13/applications/bin/linux64GccDPOpt/potentialFoam /usr/bin/ld: Make/linux64GccDPOpt/potentialFoam.o: undefined reference to symbol 'Foam::OPstream::write(Foam::Pstream::commsTypes, int, char const*, long)' /usr/bin/ld: note: 'Foam::OPstream::write(Foam::Pstream::commsTypes, int, char const*, long)' is defined in DSO /home/lrm29/github/OpenFOAM-1.7.x.f13/lib/linux64GccDPOpt/openmpi-1.4.1/libPstream.so so try adding it to the linker command line /home/lrm29/github/OpenFOAM-1.7.x.f13/lib/linux64GccDPOpt/openmpi-1.4.1/libPstream.so: could not read symbols: Invalid operation collect2: ld returned 1 exit status make: *** [/home/lrm29/github/OpenFOAM-1.7.x.f13/applications/bin/linux64GccDPOpt/potentialFoam] Error 1 |
|
Thanks for the reference. What a strange behaviour to make default. Can you try adding -Xlinker --add-needed to the link line? So in $WM_DIR/rules/linux64Gcc/c++ change LINKLIBSO to: LINKLIBSO = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed Can you let us know if this works? |
|
I see, the Fedora GCC now has the default option --no-add-needed! Well spotted. I can see why they made the change, although in this case it's just annoying rather than helpful. This worked, as it was the applications that had the problem: LINKEXE = $(CC) $(c++FLAGS) -Xlinker --add-needed |
|
I've pushed that into 17x. commit 2a888da4797b5e6b203f7fa4c3f64468c3973429 Thanks. |
|
commit 2a888da4797b5e6b203f7fa4c3f64468c3973429 |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-08-28 10:40 |
|
New Issue | |
2010-08-28 10:44 |
|
Note Added: 0000008 | |
2010-08-30 17:42 |
|
Note Added: 0000009 | |
2010-08-31 09:40 |
|
Assigned To | => user4 |
2010-08-31 09:40 |
|
Status | new => assigned |
2010-08-31 10:23 |
|
Note Added: 0000013 | |
2010-08-31 10:36 |
|
Tag Attached: Installation | |
2010-08-31 16:05 |
|
Note Added: 0000014 | |
2010-08-31 16:08 |
|
Note Added: 0000015 | |
2010-08-31 16:08 |
|
Status | assigned => resolved |
2010-08-31 16:08 |
|
Fixed in Version | => 1.7.x |
2010-08-31 16:08 |
|
Resolution | open => fixed |