CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[Other] Problem with compiling a third party code that relies on OF1606+

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2019, 19:08
Default Problem with compiling a third party code that relies on OF1606+
  #1
New Member
 
Artur
Join Date: Sep 2019
Posts: 3
Rep Power: 6
Artshap is on a distinguished road
Hi everyone,

I'm new to both openfoam and ubuntu, I am trying to compile a code that relies on openfoam 1606+, but it's giving me an error. To be honest as far as I can see this might not even be an OF related issue, but I hope that maybe some here can help me anyway even if it is not.



Full log from running Allmake for that package twice:
Quote:
surfaceRoughness
wmake
make[1]: Entering directory '/home/artur/works/apps/contactAngle/surfaceRoughness'
make[1]: '/home/artur/works/bin-v16/bin/surfaceRoughness' is up to date.
make[1]: Leaving directory '/home/artur/works/apps/contactAngle/surfaceRoughness'
surfaceAddLayerToCL
wmake
make[1]: Entering directory '/home/artur/works/apps/contactAngle/surfaceAddLayerToCL'
make[1]: '/home/artur/works/bin-v16/bin/surfaceAddLayerToCL' is up to date.
make[1]: Leaving directory '/home/artur/works/apps/contactAngle/surfaceAddLayerToCL'
surfaceSmoothVP
wmake
make[1]: Entering directory '/home/artur/works/apps/contactAngle/surfaceSmoothVP'
make[1]: '/home/artur/works/bin-v16/bin/surfaceSmoothVP' is up to date.
make[1]: Leaving directory '/home/artur/works/apps/contactAngle/surfaceSmoothVP'
voxelImage
g++ -std=c++0x -c sphereToRaw.cpp
g++ -o /home/artur/works/bin-v16/bin/sphereToRaw sphereToRaw.o
g++ -c -fPIC imageReader.cpp -o imageReader.o
g++ -c -fPIC voxelMesh.cpp -o voxelMesh.o
g++ -shared voxelMesh.o imageReader.o -o /home/artur/works/bin-v16/bin/libvoxelMesh.so
g++ -c imageFileConvert.cpp
g++ -fPIC -L/home/artur/works/bin-v16/bin/ imageFileConvert.o -lvoxelMesh -o /home/artur/works/bin-v16/bin/imageFileConvert
g++ -fPIC -c rawToFoam.cpp
g++ -fPIC -o /home/artur/works/bin-v16/bin/rawToFoam -L/home/artur/works/bin-v16/bin rawToFoam.o -lvoxelMesh
rm -f *.o
voxelImageNew
g++ -O3 -Wall writeRaCLInds.o -o /home/artur/works/bin-v16/bin/writeRaCLInds
/usr/bin/ld: writeRaCLInds.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:66: recipe for target 'writeRaCLInds' failed
make: *** [writeRaCLInds] Error 1
voxelToSurfaceML
wmake
make[1]: Entering directory '/home/artur/works/apps/contactAngle/voxelToSurfaceML'
make[1]: '/home/artur/works/bin-v16/bin/voxelToSurfaceML' is up to date.
make[1]: Leaving directory '/home/artur/works/apps/contactAngle/voxelToSurfaceML'
Specifically the error seems to be here:


Quote:
voxelImage
g++ -std=c++0x -c sphereToRaw.cpp
g++ -o /home/artur/works/bin-v16/bin/sphereToRaw sphereToRaw.o
g++ -c -fPIC imageReader.cpp -o imageReader.o
g++ -c -fPIC voxelMesh.cpp -o voxelMesh.o
g++ -shared voxelMesh.o imageReader.o -o /home/artur/works/bin-v16/bin/libvoxelMesh.so
g++ -c imageFileConvert.cpp
g++ -fPIC -L/home/artur/works/bin-v16/bin/ imageFileConvert.o -lvoxelMesh -o /home/artur/works/bin-v16/bin/imageFileConvert
g++ -fPIC -c rawToFoam.cpp
g++ -fPIC -o /home/artur/works/bin-v16/bin/rawToFoam -L/home/artur/works/bin-v16/bin rawToFoam.o -lvoxelMesh
rm -f *.o
voxelImageNew
g++ -O3 -Wall writeRaCLInds.o -o /home/artur/works/bin-v16/bin/writeRaCLInds
/usr/bin/ld: writeRaCLInds.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:66: recipe for target 'writeRaCLInds' failed
make: *** [writeRaCLInds] Error 1
Can anyone direct me on how to fix this?
Artshap is offline   Reply With Quote

Old   September 23, 2019, 20:11
Default
  #2
New Member
 
Artur
Join Date: Sep 2019
Posts: 3
Rep Power: 6
Artshap is on a distinguished road
I seem to have solved this problem by adding -no-pie in the relevant section of the make file, in case it will help someone. The following stackoverflow question didn't pop up on my goggle search for some reason:


https://stackoverflow.com/questions/...-object-recomp

I still have another problem, where I am following a guide for the code, where I have to use the commands:

Quote:
voxelToSurfaceML && surfaceAddLayerToCL && surfaceSmoothVP && more contactAngles.txt
but my terminal says that there is no such command. Does it mean there were still errors during the compilation that I do not see?

log.make is below:

Quote:
surfaceRoughness
wmake
make[1]: Entering directory '/home/artur/works/apps/contactAngle/surfaceRoughness'
make[1]: '/home/artur/works/bin-v16/bin/surfaceRoughness' is up to date.
make[1]: Leaving directory '/home/artur/works/apps/contactAngle/surfaceRoughness'
surfaceAddLayerToCL
wmake
make[1]: Entering directory '/home/artur/works/apps/contactAngle/surfaceAddLayerToCL'
make[1]: '/home/artur/works/bin-v16/bin/surfaceAddLayerToCL' is up to date.
make[1]: Leaving directory '/home/artur/works/apps/contactAngle/surfaceAddLayerToCL'
surfaceSmoothVP
wmake
make[1]: Entering directory '/home/artur/works/apps/contactAngle/surfaceSmoothVP'
make[1]: '/home/artur/works/bin-v16/bin/surfaceSmoothVP' is up to date.
make[1]: Leaving directory '/home/artur/works/apps/contactAngle/surfaceSmoothVP'
voxelImage
g++ -std=c++0x -c sphereToRaw.cpp
g++ -o /home/artur/works/bin-v16/bin/sphereToRaw sphereToRaw.o
g++ -c -fPIC imageReader.cpp -o imageReader.o
g++ -c -fPIC voxelMesh.cpp -o voxelMesh.o
g++ -shared voxelMesh.o imageReader.o -o /home/artur/works/bin-v16/bin/libvoxelMesh.so
g++ -c imageFileConvert.cpp
g++ -fPIC -L/home/artur/works/bin-v16/bin/ imageFileConvert.o -lvoxelMesh -o /home/artur/works/bin-v16/bin/imageFileConvert
g++ -fPIC -c rawToFoam.cpp
g++ -fPIC -o /home/artur/works/bin-v16/bin/rawToFoam -L/home/artur/works/bin-v16/bin rawToFoam.o -lvoxelMesh
rm -f *.o
voxelImageNew
g++ -O3 -Wall -no-pie writeRaCLInds.o -o /home/artur/works/bin-v16/bin/writeRaCLInds
ln -f -s /home/artur/works/bin-v16/bin/writeRaCLInds /home/artur/works/bin-v16/bin/imageFileConvert
g++ -O3 -Wall -no-pie writeRaPoreInds.o -o /home/artur/works/bin-v16/bin/writeRaPoreInds
ln -f -s /home/artur/works/bin-v16/bin/writeRaPoreInds /home/artur/works/bin-v16/bin/imageFileConvert
g++ -O3 -Wall -no-pie writepAreaPoreInds.o -o /home/artur/works/bin-v16/bin/writepAreaPoreInds
ln -f -s /home/artur/works/bin-v16/bin/writepAreaPoreInds /home/artur/works/bin-v16/bin/imageFileConvert
g++ -O3 -Wall -no-pie writeCAThroatInds.o -o /home/artur/works/bin-v16/bin/writeCAThroatInds
ln -f -s /home/artur/works/bin-v16/bin/writeCAThroatInds /home/artur/works/bin-v16/bin/imageFileConvert
g++ -O3 -Wall -no-pie writeRcThroatInds.o -o /home/artur/works/bin-v16/bin/writeRcThroatInds
ln -f -s /home/artur/works/bin-v16/bin/writeRcThroatInds /home/artur/works/bin-v16/bin/imageFileConvert
g++ -O3 -Wall -no-pie writeCAPoreInds.o -o /home/artur/works/bin-v16/bin/writeCAPoreInds
ln -f -s /home/artur/works/bin-v16/bin/writeCAPoreInds /home/artur/works/bin-v16/bin/imageFileConvert
g++ -O3 -Wall -no-pie writeRcPoreInds.o -o /home/artur/works/bin-v16/bin/writeRcPoreInds
ln -f -s /home/artur/works/bin-v16/bin/writeRcPoreInds /home/artur/works/bin-v16/bin/imageFileConvert
g++ -O3 -Wall -no-pie writeCACornerInds.o -o /home/artur/works/bin-v16/bin/writeCACornerInds
ln -f -s /home/artur/works/bin-v16/bin/writeCACornerInds /home/artur/works/bin-v16/bin/imageFileConvert
g++ -O3 -Wall -no-pie writeRcCornerInds.o -o /home/artur/works/bin-v16/bin/writeRcCornerInds
ln -f -s /home/artur/works/bin-v16/bin/writeRcCornerInds /home/artur/works/bin-v16/bin/imageFileConvert
g++ -O3 -Wall -no-pie Ufraw2Ucdat.o -o /home/artur/works/bin-v16/bin/Ufraw2Ucdat
g++ -no-pie -O3 -Wall -std=c++0x -o /home/artur/works/bin-v16/bin/rawToFoamPar rawToFoamPar.o
g++ -no-pie -std=c++0x -o /home/artur/works/bin-v16/bin/rawToFoam rawToFoam.o
g++ -O3 -Wall -no-pie voxelImageConvert.o -o /home/artur/works/bin-v16/bin/voxelImageConvert
ln -f -s /home/artur/works/bin-v16/bin/voxelImageConvert /home/artur/works/bin-v16/bin/imageFileConvert
voxelToSurfaceML
wmake
make[1]: Entering directory '/home/artur/works/apps/contactAngle/voxelToSurfaceML'
make[1]: '/home/artur/works/bin-v16/bin/voxelToSurfaceML' is up to date.
make[1]: Leaving directory '/home/artur/works/apps/contactAngle/voxelToSurfaceML'
Artshap is offline   Reply With Quote

Old   September 23, 2019, 21:26
Default
  #3
New Member
 
Artur
Join Date: Sep 2019
Posts: 3
Rep Power: 6
Artshap is on a distinguished road
Managed to fix this one as well by adding the proper source into bashrc manually. Sorry for spamming!
Artshap is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculation restart problem OF1606 ziemowitzima OpenFOAM Running, Solving & CFD 2 December 7, 2016 03:57
Help compiling code (newbie) thsb20 OpenFOAM Programming & Development 56 August 24, 2016 04:24
problem compiling spalart allmaras model bababanamzdaalma OpenFOAM 0 April 4, 2012 20:13
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 14:34
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 10:20


All times are GMT -4. The time now is 00:41.