CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Problems compiling OF 141 on Edubuntu 71 (http://www.cfd-online.com/Forums/openfoam-installation/57449-problems-compiling-141-edubuntu-71-a.html)

david_flo1 January 11, 2008 02:41

Hello all! I am fairly new
 
Hello all!

I am fairly new to Linux and to OpenFOAM (started using Linux because of OF)

I managed to install OF ok and whilst running through the tutorials, realized that DamnBreak required a patch and thus recompiling.

Got into the recompiling task also because at some point will need to do some programming I guess, to put together some solvers.

Anyway, by following the wiki I managed to compile paraview-2.4.4 but got some errors when trying to compile OF.

This is the compile log showing only the points of interest (I hope I did not miss any I was watching the compilation process and copying and pasting to a text file when found errors or warnings)

./Allwmake

-o Make/linuxGccDPOpt/gzstream.o
In file included from db/IOstreams/gzstream/gzstream.C:29:
lnInclude/gzstream.h:35:18: error: zlib.h: No such file or directory
In file included from db/IOstreams/gzstream/gzstream.C:29:
lnInclude/gzstream.h:50: error: 'gzFile' does not name a type
db/IOstreams/gzstream/gzstream.C: In member function 'gzstreambuf* gzstreambuf::open(const char*, int)':
db/IOstreams/gzstream/gzstream.C:61: error: 'file' was not declared in this scope
db/IOstreams/gzstream/gzstream.C:61: error: 'gzopen' was not declared in this scope
db/IOstreams/gzstream/gzstream.C: In member function 'gzstreambuf* gzstreambuf::close()':
db/IOstreams/gzstream/gzstream.C:72: error: 'file' was not declared in this scope
db/IOstreams/gzstream/gzstream.C:72: error: 'gzclose' was not declared in this scope
db/IOstreams/gzstream/gzstream.C:72: error: 'Z_OK' was not declared in this scope
db/IOstreams/gzstream/gzstream.C: In member function 'virtual int gzstreambuf::underflow()':
db/IOstreams/gzstream/gzstream.C:90: error: 'file' was not declared in this scope
db/IOstreams/gzstream/gzstream.C:90: error: 'gzread' was not declared in this scope
db/IOstreams/gzstream/gzstream.C: In member function 'int gzstreambuf::flush_buffer()':
db/IOstreams/gzstream/gzstream.C:107: error: 'file' was not declared in this scope
db/IOstreams/gzstream/gzstream.C:107: error: 'gzwrite' was not declared in this scope
make: *** [Make/linuxGccDPOpt/gzstream.o] Error 1


In file included from triSurface/interfaces/STL/readSTLBINARY.C:33:
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/gzstream.h:35:18: error: zlib.h: No such file or directory
In file included from triSurface/interfaces/STL/readSTLBINARY.C:33:
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/gzstream.h:50: error: 'gzFile' does not name a type
make: *** [Make/linuxGccDPOpt/readSTLBINARY.o] Error 1


ls.H: In function 'int main(int, char**)':
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readPISOContro ls.H:3: warning: unused variable 'nCorr'

ls.H: In function 'int main(int, char**)':
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readPISOContro ls.H:3: warning: unused variable 'nCorr'

createFields.H: In function 'int main(int, char**)':
createFields.H:30: warning: unused variable 'T'
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readPISOContro ls.H:3: warning: unused variable 'nCorr'

/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readPISOContro ls.H: In function 'int main(int, char**)':
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readPISOContro ls.H:3: warning: unused variable 'nCorr'

/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readPISOContro ls.H: In function 'int main(int, char**)':
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readPISOContro ls.H:3: warning: unused variable 'nCorr'
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readTimeContro ls.H:40: warning: unused variable 'maxCo'

/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readPISOContro ls.H: In function 'int main(int, char**)':
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readPISOContro ls.H:3: warning: unused variable 'nCorr'
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/readTimeContro ls.H:40: warning: unused variable 'maxCo'

+ [ 0 = 1 -a = doc ]
(what is the meaning of this last line? how do I identify that compilation process was completed ok , i.e., despite some warnings?)

then if I try to run FoamX after this recompilation I get the following:
Starting NameServer with inet:PaMa:1234 ...
Starting FoamX Host Browser with inet:PaMa:1234 ...
/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/bin/runFoamXHB: 139: FoamXHostBrowser: not found
runFoamXHB : cleanup
runFoamXHB: Killing name server nsd(pid 5690)

and terminal windows hangs there forever

Note that before recompiling it worked fine.


I have been struggling with this for over a week, this is driving me crazy.
Thanks in advance

Bernardo

mattijs January 11, 2008 05:21

zlib.h is a system include fil
 
zlib.h is a system include file (/usr/include/zlib.h). Maybe there are some development packages you need to install?

The '[ 0 = 1 -a = doc ]' is just output from the script.

If you restart compilation when everything is compiled successfully you'll see messages like 'nothing needs to be done for XXX' lots of times.

With gzstream not compiled the libOpenFOAM will not have been created and nothing will work.

luca January 11, 2008 06:12

Hi Bernardo, just install t
 
Hi Bernardo,

just install the build-essential package:

sudo apt-get install build-essential

enjoy

Luca

david_flo1 January 11, 2008 11:29

Thanks for your reply Mattijs
 
Thanks for your reply Mattijs and Luca

Knowing that zlib is a system file I was able to find it on synaptic package manager under zlibg1-dev package. Related errors are gone, I wonder why I needed to install it separately and the wiki does not mention it at all.

Notice I was able to compile Paraview, thus I had gcc and g++ installed (v4.2). Now I get the following errors with or without build-essentials:

vtkFoam.H:53: error: forward declaration of 'struct vtkFoamReader'
vtkFoam.C:628: error: invalid use of undefined type 'struct vtkFoamReader'
vtkFoam.H:53: error: forward declaration of 'struct vtkFoamReader'
make[3]: *** [Make/linuxGccDPOpt/vtkFoam.o] Error 1
make[3]: Leaving directory `/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/postProcessing/gr aphics/PVFoamReader/vtkFoam'

vtkFoam.H:56: error: forward declaration of 'struct vtkDataArraySelection'
vtkFoamConvertFields.H: In member function 'void Foam::vtkFoam::convertPointFields(const Foam::fvMesh&, const Foam::IOobjectList&, vtkDataArraySelection*)':
vtkFoamConvertFields.H:173: error: invalid use of undefined type 'struct vtkDataArraySelection'
vtkFoam.H:56: error: forward declaration of 'struct vtkDataArraySelection'
vtkFoamConvertFields.H:177: error: invalid use of undefined type 'struct vtkDataArraySelection'
vtkFoam.H:56: error: forward declaration of 'struct vtkDataArraySelection'
vtkFoamConvertFields.H:179: error: invalid use of undefined type 'struct vtkDataArraySelection'
vtkFoam.H:56: error: forward declaration of 'struct vtkDataArraySelection'
vtkFoam.C: In member function 'void Foam::vtkFoam::SetName(vtkUnstructuredGrid*, const char*)':
vtkFoam.C:60: error: 'vtkCharArray' was not declared in this scope
vtkFoam.C:60: error: 'nmArray' was not declared in this scope
vtkFoam.C:60: error: 'vtkCharArray' is not a class or namespace
vtkFoam.C:63: error: expected type-specifier before 'vtkIdType'
vtkFoam.C:63: error: expected `>' before 'vtkIdType'


HEEELP http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif

david_flo1 January 11, 2008 12:35

I have just found out that I h
 
I have just found out that I have more errors, but the output on the terminal goes quite fast to notice them.

make[2]: Entering directory `/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/preProcessing/Foa mX/C++/FoamXLib'
/usr/bin/ld: cannot find -lssl

lcrypto -ldl -lpthread -lOpenFOAM -ldl -lm -o /home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/FoamXHostB rowser
/usr/bin/ld: cannot find -lFoamX
collect2: ld returned 1 exit status
make[2]: *** [/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/FoamXHost Browser] Error 1
make[2]: Leaving directory `/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/preProcessing/Foa mX/C++/FoamXHostBrowser'


PatchTool/PatchTool.java:579: as of release 5, 'enum' is a keyword, and may not be used as an identifier
(use -source 1.4 or lower to use 'enum' as an identifier)
InteractiveNode shape = (InteractiveNode)enum.nextElement();
^
3 errors
jar cfm ../lib/PatchTool.jar META-INF/MANIFEST.MF -C Make/classes .
`../lib/PatchTool.jar' is up to date.
make[3]: Leaving directory `/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/mesh/manipulation /patchTool/Java'


FoamX/Modules/CaseEditor/CaseEditorModule.java:1786: warning: [deprecation] show() in java.awt.Dialog has been deprecated
caseChooser.show();
This comes up loads of times on different methods

david_flo1 January 14, 2008 13:57

Some help please!!
 
Some help please!!

mike_jaworski January 14, 2008 14:48

Bernardo, Did you install
 
Bernardo,
Did you install bin-utils prior to building gcc? It sounds like you're having linker errors performing the full install of bin-utils as written in the Openfoamwiki page should help. You'll have to rebuild gcc off of the new linker as well, I think.

Good luck,
Mike Jaworski

hjasak January 14, 2008 14:58

Have a look at: http://open
 
Have a look at:

http://openfoam-extend.svn.sourceforge.net/viewvc/openfoam-extend/trunk/Core/Ope nFOAM-1.4.1-dev/buildInstructions.txt?view=markup

Here I list DETAILED INSTRUCTIONS on how to compile everything yourself. The part relevant to paraview is below - pay particular attention to copied files:

d ~/OpenFOAM/linuxSrc
69 tar xvzf paraview-2.4.4.tgz
70 mkdir paraview-2.4.4-obj
71 cmake -i ../paraview-2.4.4
72
73 Change options:
74
75 enable shared library: YES
76 prefix: ~/OpenFOAM/linux/paraview-2.4.4
77
78 gmake
79 gmake install
80
81
82 cd ~/OpenFOAM/linuxSrc
83
84 mkdir ~/OpenFOAM/linux/paraview-2.4.4/include
85 cp ./paraview-2.4.4/VTK/Common/vtk* ~/OpenFOAM/linux/paraview-2.4.4/include/
86 cp ./paraview-2.4.4/VTK/Filtering/vtk* ~/OpenFOAM/linux/paraview-2.4.4/include/
87 cp ./paraview-2.4.4-obj/VTK/vtk* ~/OpenFOAM/linux/paraview-2.4.4/include/
88 cp ./paraview-2.4.4-obj/ParaViewConfig.cmake ~/OpenFOAM/linux/paraview-2.4.4/lib/paraview-2.4/

david_flo1 January 15, 2008 23:55

Thanks for the replies guys
 
Thanks for the replies guys

Michael,
I did install binutils before the new versions of gcc g++. As a matter of fact, on my second attempt I unistalled binutils, gcc g++, then reinstalled binutils, restarted and installed gcc g++ 4.2
No different output was produced.

By the way, I installed using the synaptic package manager so I did not compile gcc. I want to suppose that synaptic knows how to do it properly.

What do you reckon? should I go 100% manual? the thing is I am a windows user http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif


Hrvoje,
I am kinda confused about your set of instructions. A number of things I do not understand. Such as the fact of using several directories as opposed to the guidelines on the wiki, or manually copying VTK files to OpenFOAM. I tried your approach anyway but it lead me to a point where I did not know (wasn't sure) what to do.

call me idiot but when you say "change options: enable shared library" I don't know where is that, then gmake instead of make http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif



I do not understand why paraview would finish compiling (some warnings along the way) and I can't make it right with a single ./Allwmake !!! ???


Any help is much appreciated

mike_jaworski January 16, 2008 00:35

I'm not 100% sure on this, but
 
I'm not 100% sure on this, but I don't think using the package manager will do the trick. As I recall, the rpms and such are built against the overall distribution version, not the items you may or may not have installed to a specific location. I would suggest doing it 100% manual.

Regards,
Mike J.

david_flo1 January 16, 2008 20:52

Hi Michael, I refused to be
 
Hi Michael,

I refused to believe that could be the problem but I did as you suggested, a manual install of binutils then gcc and I compiled paraview and Foam is compiling now, been on it for almost two hours. Never been this far before so I suppose that the manual install did the trick. I'll let you know.

If this was the case, I would love to contact the author of the wiki and suggest to add this finding as a warning. Specially for lazy windows users like myself. Any idea how to contact him/her?

Regards

david_flo1 January 16, 2008 21:27

How frustrating http://www.cf
 
How frustrating http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif It did not succeed.
Please some assistance

The errors I can see are:



Xstream/Xstream.C: In member function 'void Foam::Xstream::openSesame(const Foam::colour&, const Foam::colour&)':
Xstream/Xstream.C:68: warning: use of old-style cast
Xstream/Xstream.C:79: warning: deprecated conversion from string constant to 'char*'

GLwindow.o
GLstream/XGLwindow.C: In function 'GLenum Foam::XGLopenWindow(Display**, char*, int, int, int, int)':
GLstream/XGLwindow.C:429: warning: use of old-style cast

Making dependency list for source file fbsdmalloc.c
could not open file libc_private.h for source file fbsdmalloc.c
could not open file spinlock.h for source file fbsdmalloc.c
Segmentation fault (core dumped)
SOURCE=fbsdmalloc.c ; gcc -m32 -Dlinux -DDP -Wall -O3 -IlnInclude -I. -I/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/fbsdmalloc.o


+ cd /home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/mico-2.3.12
+ gmake distclean
./Allwmake: 1: gmake: not found
+ ./configure --prefix=/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/src/mico-2.3.12/platforms/linuxG ccDPOpt --disable-shared --without-x


checking for javac... /usr/bin/javac
checking for JDK 1.1... yes
checking for JavaCUP... no
configure: warning: you have not installed JDK 1.1 and JavaCUP. java parts disabled.

creating include/mico/config.idl
+ gmake
./Allwmake: 1: gmake: not found
+ gmake install
./Allwmake: 1: gmake: not found
+ gmake distclean


collect2: ld returned 1 exit status
make[2]: *** [/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/rhoSimple Foam] Error 1


/home/bernardo/OpenFOAM/linux/binutils-2.18/bin/ld: warning: libPstream.so, needed by /home/bernardo/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so, not found (try using -rpath or -rpath-link)

collect2: ld returned 1 exit status
make[3]: *** [/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/moveDynam icMesh] Error 1

make[1]: Leaving directory `/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/mesh'
make: *** [mesh] Error 2

mike_jaworski January 16, 2008 23:03

Bernardo, I have not seen
 
Bernardo,
I have not seen this error before so I'm a little at a loss as to what caused it. It's good, however, that the manual install is helping.

Keep in mind, though, that warnings are not really that big of a deal. It's the errors that are. The deprecated string constant warning is something that happened with gcc 4.2 I believe, where they cleaned up some syntax or some-such and now code written in a certain way before gives the warning, but should still compile.

If Pstream didn't compile, there could be some setup items you need to take care of related to MPI implementation. There's a wiki article on it and you can look into that material unless someone has a better idea.

Regards,
Mike J.

david_flo1 January 16, 2008 23:49

Cheers Michael. Ok, let's conc
 
Cheers Michael. Ok, let's concentrate on a couple of things first then.

I tried compiling again whilst looking at the fast moving outputs. The first error is

config.status: executing libtool commands
+ gmake
./Allwmake: 1: gmake: not found

Why, what?.. I do not understand the meaning of that

The next is related to MPI,
OPwrite.C:30:17: error: mpi.h: No such file or directory

I guess a number of errors then derive and depend on that. But, why the compiling OpenFOAM wiki would not mention anything at all about it

And then this error later on, which does not give me a clue of what could be wrong
collect2: ld returned 1 exit status
make[2]: *** [/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/rhoSimple Foam] Error 1

Thanks for your patience

mike_jaworski January 17, 2008 00:17

Bernardo, Here is somethin
 
Bernardo,
Here is something to check:

each time you compile, are you sourcing the OpenFOAM bashrc file? This should happen automatically if you put it in your $HOME/.bashrc file like the installation instructions tell you to do.

The next thing to do is make sure that all the version numbers and such in the OpenFOAM bashrc and .bashrc files is correct. You can find them in:

$HOME/OpenFOAM/OpenFOAM-1.4.1/.OpenFOAM-1.4.1/bashrc
and
$HOME/OpenFOAM/OpenFOAM-1.4.1/.bashrc

Inspect both of those files and make sure all the appropriate folder names are there. Also, there are several "optional" steps which are listed in the compiling wiki: do them.

before your next compiling run, type:
which gcc

and

which ld

they should both point to the versions you compiled yourself, not to something in /usr/bin

Also, I recall needing to install the termcap package for some reason. Use your package handler and make sure you have it and try again.

Finally, since I don't recall seeing these errors, google can be your friend. Try typing the error message into the search and see what comes up. it's amazing how many people have come across similar errors before.

Good luck!

Mike J.

david_flo1 January 21, 2008 22:58

Well, finally I managed to com
 
Well, finally I managed to compile.

I installed OpenMPI, did the trick for a link for gmake of make (stupidly I had skipped that from the wiki) and only left one error that propagated in caused the compilation to fail

+ wmake libso OpenFOAM
/home/bernardo/OpenFOAM/linux/binutils-2.18/bin/ld: cannot find -lfoamUser
collect2: ld returned 1 exit status

It came to my mind that it could be related to the wiki apparently telling you to modify one line of the file $HOME/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/Make/options "for the compilation of the library libOpenFOAM" or perhaps there is a difference between that file on version 1.3 and 1.4.1, thus the line on the wiki

LIB_LIBS = -L$(FOAM_LIBBIN)/dummy -lPstream -lfoamUser -lz

should actually be left alone as (default)

LIB_LIBS = -L$(FOAM_LIBBIN)/dummy -lPstream -lz


This fixed the problem for the compiler trying to find and link a library yet to be created.

HOWEVER
after everything finished, and trying to run FoamX, I get:

/home/bernardo/OpenFOAM/OpenFOAM-1.4.1/bin/runFoamXHB: 139: FoamXHostBrowser: not found
runFoamXHB : cleanup
runFoamXHB: Killing name server nsd(pid 27947).

Since this is a new type of problem, I guess, I will open a new thread


Mike, thanks a lot for the patience and help.

Regards
the ld

mike_jaworski January 22, 2008 00:16

Bernardo, Glad things seem
 
Bernardo,
Glad things seem to be working. I will admit that I never got FoamX to compile correctly. I don't plan to not use it, though, so I don't consider it worth the effort to chase down.

Good luck again,
Mike J.


All times are GMT -4. The time now is 11:49.