CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Netgen] Installation of Netgen in SuSE Linux 92 (https://www.cfd-online.com/Forums/openfoam-meshing/61943-installation-netgen-suse-linux-92-a.html)

edvardsenpriv October 22, 2005 11:04

Installation of Netgen in SuSE Linux 92
 
Hope it is OK to ask a question about installing Netgen on this OpenFOAM forum.

I have been using Netgen in Windows and OpenFOAM in SuSE 9,2 for a while. Obviously it's not ideal to reboot to switch program, so I have tried to install Netgen in SuSE Linux 9.2, but have run into some problems:

In the README.INSTALL it is described to hack the makefile by adding:
setenv MACHINE LINUX

when running "make", I get the following errormessage:
Makefile:4: *** missing separator. Stop.
Anyone?
Needless to say I'm not very experienced in Linux.
Best Regards
lars Edvardsen

mattijs October 24, 2005 04:41

Sounds like your makefile got
 
Sounds like your makefile got 'corrupted'. Did you edit or copy/paste your Makefile under Windows or copy it from Windows? This might cause problems. Just unpack the original sources.

This is what I get:

Unix> setenv MACHINE LINUX
Unix> make
cd libsrc; make
make[1]: Entering directory `/home/pinky2/mattijs/pub/ngs44/libsrc'
make[2]: Entering directory `/home/pinky2/mattijs/pub/ngs44/libsrc/linalg'
..

edvardsenpriv October 25, 2005 12:33

Thanks for reply, Mattijs I
 
Thanks for reply, Mattijs

I found out that the first problem was that despite I had bash on my computer (SuSE 9,2), I had to use the command "export MACHINE=LINUX" instead of "setenv....

Anyway, I still get error messages.

What I have tried to so far according to tips in the REDME.INTALL file is:

- Problems with Tcl.init:
export TCL_LIBRARY=/usr/lib/tcl8.4
export TK_LIBRARY=/usr/lib/tk8.4
export TIX_LIBRARY=/usr/lib/tix8.1
-which is the versions and location according to my installation.

This is what I get:

lars@linux:~/ngs44> make
gcc -c -I./libsrc/include -I/opt/OpenCASCADE5.2/ros/inc -I./ngsolve/include -Ilibsrc/interface -DOPENGL -O2 -I/usr/include/GL3.5 -DLINUX -DOPENGL -ftemplate-depth-99 -finline-limit=20000 -funroll-loops -DNGSOLVE ngtcltk/ngappinit.cpp -o ngtcltk/ngappinit.o
In file included from ngtcltk/ngappinit.cpp:7:
./libsrc/include/incvis.hpp:15:17: error: tcl.h: No such file or directory
./libsrc/include/incvis.hpp:16:16: error: tk.h: No such file or directory
./libsrc/include/incvis.hpp:26:19: error: GL/gl.h: No such file or directory
./libsrc/include/incvis.hpp:27:20: error: GL/glu.h: No such file or directory
./libsrc/include/../../togl/togl.h:160: warning: 'Togl_Init' initialized and declared 'extern'
./libsrc/include/../../togl/togl.h:160: error: 'Tcl_Interp' was not declared inthis scope
./libsrc/include/../../togl/togl.h:160: error: 'interp' was not declared in this scope
./libsrc/include/../../togl/togl.h:198: warning: 'Togl_Configure' initialized and declared 'extern'
./libsrc/include/../../togl/togl.h:198: error: 'Tcl_Interp' was not declared inthis scope
./libsrc/include/../../togl/togl.h:198: error: 'interp' was not declared in this scope
./libsrc/include/../../togl/togl.h:198: error: expected primary-expression before 'struct'
./libsrc/include/../../togl/togl.h:199: error: expected primary-expression before 'int'
./libsrc/include/../../togl/togl.h:199: error: expected primary-expression before 'const'
./libsrc/include/../../togl/togl.h:199: error: expected primary-expression before 'int'
./libsrc/include/../../togl/togl.h:199: error: initializer expression list treated as compound expression
./libsrc/include/../../togl/togl.h:221: error: expected initializer before '*' token
./libsrc/include/../../togl/togl.h:223: error: 'Tk_Window' does not name a type
./libsrc/include/../../togl/togl.h:243: error: 'GLuint' does not name a type
./libsrc/include/../../togl/togl.h:246: error: 'GLuint' has not been declared
./libsrc/include/../../togl/togl.h:280: warning: 'Togl_ClientData' initialized and declared 'extern'
./libsrc/include/../../togl/togl.h:280: error: variable or field 'Togl_ClientData' declared void
./libsrc/include/../../togl/togl.h:280: error: 'ClientData' was not declared inthis scope
./libsrc/include/../../togl/togl.h:282: error: 'ClientData' does not name a type
./libsrc/include/../../togl/togl.h:284: error: 'ClientData' has not been declared
./libsrc/include/../meshing/meshtype.hpp:965: error: ISO C++ forbids declaration of 'Mesh' with no type
./libsrc/include/../meshing/meshtype.hpp:965: error: expected ';' before '&' token
./libsrc/include/../meshing/meshtype.hpp:975: error: expected `)' before '&' token
ngtcltk/ngappinit.cpp: In function 'int main(int, char**)':
ngtcltk/ngappinit.cpp:100: error: 'Tcl_Interp' was not declared in this scope
ngtcltk/ngappinit.cpp:100: error: 'myinterp' was not declared in this scope
ngtcltk/ngappinit.cpp:100: error: 'Tcl_CreateInterp' was not declared in this scope
ngtcltk/ngappinit.cpp:101: error: 'Tcl_AppInit' was not declared in this scope
ngtcltk/ngappinit.cpp:101: error: 'TCL_ERROR' was not declared in this scope
ngtcltk/ngappinit.cpp:115: error: 'TCL_PATCH_LEVEL' was not declared in this scope
ngtcltk/ngappinit.cpp:148: error: 'Tcl_Eval' was not declared in this scope
ngtcltk/ngappinit.cpp:160: error: 'Tcl_EvalFile' was not declared in this scope
ngtcltk/ngappinit.cpp:188: error: 'Tcl_Eval' was not declared in this scope
ngtcltk/ngappinit.cpp:189: error: 'Tcl_SetVar' was not declared in this scope
ngtcltk/ngappinit.cpp:206: error: 'Tk_MainLoop' was not declared in this scope
ngtcltk/ngappinit.cpp:207: error: 'Tcl_DeleteInterp' was not declared in this scope
ngtcltk/ngappinit.cpp: At global scope:
ngtcltk/ngappinit.cpp:215: warning: 'Tix_Init' initialized and declared 'extern'
ngtcltk/ngappinit.cpp:215: error: 'Tcl_Interp' was not declared in this scope
ngtcltk/ngappinit.cpp:215: error: 'interp' was not declared in this scope
ngtcltk/ngappinit.cpp:216: warning: 'Itcl_Init' initialized and declared 'extern'
ngtcltk/ngappinit.cpp:216: error: 'Tcl_Interp' was not declared in this scope
ngtcltk/ngappinit.cpp:216: error: 'interp' was not declared in this scope
ngtcltk/ngappinit.cpp:217: warning: 'Itk_Init' initialized and declared 'extern'
ngtcltk/ngappinit.cpp:217: error: 'Tcl_Interp' was not declared in this scope
ngtcltk/ngappinit.cpp:217: error: 'interp' was not declared in this scope
ngtcltk/ngappinit.cpp:218: warning: 'Ng_Init' initialized and declared 'extern'
ngtcltk/ngappinit.cpp:218: error: 'Tcl_Interp' was not declared in this scope
ngtcltk/ngappinit.cpp:218: error: 'interp' was not declared in this scope
ngtcltk/ngappinit.cpp:219: warning: 'Ng_Vis_Init' initialized and declared 'extern'
ngtcltk/ngappinit.cpp:219: error: 'Tcl_Interp' was not declared in this scope
ngtcltk/ngappinit.cpp:219: error: 'interp' was not declared in this scope
ngtcltk/ngappinit.cpp:230: error: 'Tcl_Interp' was not declared in this scope
ngtcltk/ngappinit.cpp:230: error: 'interp' was not declared in this scope
ngtcltk/ngappinit.cpp:231: error: expected ',' or ';' before '{' token
make: *** [ngtcltk/ngappinit.o] Error 1

Anyone seeing the solution?
Lars

mattijs October 25, 2005 14:36

You'missing some files (GL/, t
 
You'missing some files (GL/, tcl.h etc.) in /usr/include.

Your can install them from your suse9.2 cd. Just install all of the development libraries and sources .

edvardsenpriv October 25, 2005 18:29

Sorry to keep nagging, Mattijs
 
Sorry to keep nagging, Mattijs, but I think I'm almost there. Installing development packages helped. The error messages has been narrowed down to:


lars@linux:~/ngs44> make
gcc -c -I./libsrc/include -I/opt/OpenCASCADE5.2/ros/inc -I./ngsolve/include -Ilibsrc/interface -DOPENGL -O2 -I/usr/include/GL3.5 -DLINUX -DOPENGL -ftemplate-depth-99 -finline-limit=20000 -funroll-loops -DNGSOLVE ngtcltk/ngappinit.cpp -o ngtcltk/ngappinit.o
./libsrc/include/../meshing/meshtype.hpp:965: error: ISO C++ forbids declarationof 'Mesh' with no type
./libsrc/include/../meshing/meshtype.hpp:965: error: expected ';' before '&' token
./libsrc/include/../meshing/meshtype.hpp:975: error: expected `)' before '&' token
make: *** [ngtcltk/ngappinit.o] Error 1
lars@linux:~/ngs44>


I can find and open the C++ Header File "meshtype.hpp" and read line 965 to 975, but can't figure what the problem is. Anyway the code here says:

XXXXXXXX line 962 XXXXXXXXX
{
private:
Mesh & mesh;

/// identify points (thin layers, periodic b.c.)
INDEX_2_HASHTABLE<int> * identifiedpoints;

/// number of identifications (or, actually used identifications ?)
int maxidentnr;

public:
///
Identifications (Mesh & amesh);
///
~Identifications ();

void Delete ();

/*
Identify points pi1 and pi2, due to
identification nr identnr
*/
void Add (PointIndex pi1, PointIndex pi2, int identnr);


int Get (PointIndex pi1, PointIndex pi2) const;
int GetSymmetric (PointIndex pi1, PointIndex pi2) const;
///
INDEX_2_HASHTABLE<int> & GetIdentifiedPoints ()
{
Thanks, so far.
Lars

niklas October 26, 2005 02:15

What happens if you remove the
 
What happens if you remove the space
between Mesh and &.

Plus i think you should add the -fpermissive flag to the makefile.

N

mattijs October 26, 2005 13:35

In meshtype.hpp line 957 I add
 
In meshtype.hpp line 957 I added

class Mesh;

and that seemed to help with that one.

edvardsenpriv October 27, 2005 18:16

Thanks for all tips, "class m
 
Thanks for all tips,
"class mesh;" solved that problem.
(I'm afraid I don't know enough about C++ to know how to ad a -fpermissive flag, or what it means)

Then it was the thing about right version of the tkInt.h file in the togl directory, wich was fixed.

But I still keep getting errormessages, now its:

lars@linux:~/ngs44> make
gcc -c -I./libsrc/include -I/opt/OpenCASCADE5.2/ros/inc -I./ngsolve/include -Ilibsrc/interface -DOPENGL -O2 -I/usr/include/GL3.5 -DLINUX -DOPENGL -ftemplate-depth-99 -finline-limit=20000 -funroll-loops -DNGSOLVE ngtcltk/demoview.cpp -o ngtcltk/demoview.o
./libsrc/include/../general/array.hpp: In constructor 'netgen::ARRAY<t,>::ARRAY(int) [with T = netgen::InterpolationPoint<netgen::vec<3> > [3], int BASE = 0]':
ngtcltk/demoview.hpp:116: instantiated from 'netgen::InterpolationSpline<s>::InterpolationSpli ne(S) [with S = netgen::Vec<3>]'
ngtcltk/demoview.cpp:315: instantiated from here
./libsrc/include/../general/array.hpp:155: error: invalid use of undefined type 'class netgen::InterpolationPoint<netgen::vec<3> >'
ngtcltk/demoview.hpp:74: error: declaration of 'class netgen::InterpolationPoint<netgen::vec<3> >'
make: *** [ngtcltk/demoview.o] Error 1
lars@linux:~/ngs44>116

Still hoping,
Lars

unoder October 30, 2005 18:11

Actually I also had problems i
 
Actually I also had problems installing netgen on suse so then I installed it on win xp under cygwin. It works fine... You should try that if everything else fails.

How/where did you install Tcl/Tk + Tix + Mesa? In which directories? Did you follow the installation instructions (readme's) and get no errors?

As I remember it, I once screwed up the Mesa installation and then I got tired of trying... Also, as I remember it, tcl/tk should be in your path but I also think you can install some of these programs with the suse installation (yast?) program.

I think I'll try installing it on suse again later but I agree it's not straightforward. I don't know if it helped you anything but perhaps you should try the cygwin solution.

mattijs October 31, 2005 04:05

Are you compiling with gcc4? Y
 
Are you compiling with gcc4? You could try compiling with an older version of gcc. Gcc4 is more strict.

niklas October 31, 2005 04:34

Hey Mattijs, did u try adding
 
Hey Mattijs,
did u try adding -fpermissive?
I found this flag very useful for the AIX system.

N

mattijs October 31, 2005 04:38

No haven't. For what software
 
No haven't. For what software do you need this? I hope not OpenFOAM?

niklas October 31, 2005 04:40

nope, but paraview for instanc
 
nope, but paraview for instance will not compile without it.

N

edvardsenpriv October 31, 2005 17:19

I installed Tcl/Tk + Tix with
 
I installed Tcl/Tk + Tix with YaST under /usr/lib/, but used export TCL_LIBRARY=/usr/lib/tcl8.4 etc. to set the variables.

I am compiling with gcc 3.3.4...

Hey Niklas, I understand (now) -fpermissive allows for non-conformant code. But what exactly do you write, and where in the makefile?
Any risks?

LE

unoder November 1, 2005 18:00

Hello, Lars. I don't know w
 
Hello, Lars.

I don't know what's wrong with you installation, but today I got netgen running on my home computer after I saw it being installed on another computer by a more experienced linux user. Both systems ran suse 9.3, and I can see that you're almost there since the last problem I had also was with the togl/ directory (the first problems was correctly as Mattijs writes about missing files in /usr/include).

Once you get to this problem below which I've now seen 2 times today on 2 different linux pc's:

togl/togl.cpp:144: error: ISO C++ forbids declaration of `Sorry' with no type
togl/togl.cpp:144: error: ISO C++ forbids declaration of `you' with no type
togl/togl.cpp:144: error: syntax error before `have'

Then you'll have to follow the instructions from the netgen homepage section trouble shooting:

Quote:

I have compilation problems with "togl/togl.cc"

Togl by Brian Paul and Ben Bederson provides the link between Tcl/Tk and OpenGl rendering. It requires internal tk-header files, which are included for several tk-distributions (like tkInt8.0.h). If you use newer Tcl/Tk versions, please copy the file "tkInt.h" (from the Tk-source directories) to the togl directory (e.g. to tkInt8.2p2.h), and adapt togl.cc (about line nr 120).
In my case, I then changed the togl.cpp around line 120 like this:

#elif TK_MAJOR_VERSION==8 && TK_MINOR_VERSION==4 && TK_RELEASE_SERIAL==9
# include "tkInt.h"
#else
Sorry, you will have to edit togl.c to include the right tkInt.h file
#endif

Since my version of tk was 8.4.9-9, the program would jump to the "Sorry, you.." and this explains the error since the code has problems with newer versions! The tkInt.h was copied from /usr/include/tkInt.h to current togl-directory and when you then do a "make" again, compilation will take about 15 minutes and you're done.

Compiler was gcc (GCC) 4.0.1, no need for -fpermissive or anything else mentioned in this thread. Since I also used:

export TCL_LIBRARY=/usr/lib/tcl8.4
export TK_LIBRARY=/usr/lib/tk8.4
export TIX_LIBRARY=/usr/lib/tix8.1

Then our systems must be much alike.

Good luck, I think you should start completely from scratch again and don't edit anything else but togl.cpp! I hope this was good news for you...

You're actually very close to completing the installation. I think your problem is that you changed something in the other source files... Let me know if this helps.

edvardsenpriv November 2, 2005 18:30

Thanks for tips, Martin. I'
 
Thanks for tips, Martin.

I'm happy for you fixing the problem on your computer. The only difference I undertand between the two system is that I run suse 9,2 and gcc 3.3.4 instead of suse 9,3 and gcc 4.0.1. Strangly enough I have done quite the same as you, but keep getting the same errormessage as before.

I have tried to follow the tip about -fpermissive as well by adding this after CPLUSPLUSFLAGS = in Makefile (not all Makefiles).



The errors are still:

lars@linux:~/ngs44> make
gcc -c -I./libsrc/include -I/opt/OpenCASCADE5.2/ros/inc -I./ngsolve/include -Ilibsrc/interface -DOPENGL -O2 -I/usr/include/GL3.5 -DLINUX -DOPENGL -ftemplate-depth-99 -finline-limit=20000 -funroll-loops -DNGSOLVE ngtcltk/demoview.cpp -o ngtcltk/demoview.o

./libsrc/include/../general/array.hpp: In constructor 'netgen::ARRAY<t,>::ARRAY(int) [with T = netgen::InterpolationPoint<netgen::vec<3> > [3], int BASE = 0]':

ngtcltk/demoview.hpp:116: instantiated from 'netgen::InterpolationSpline<s>::InterpolationSpli ne(S) [with S = netgen::Vec<3>]'

ngtcltk/demoview.cpp:315: instantiated from here

./libsrc/include/../general/array.hpp:155: error: invalid use of undefined type 'class netgen::InterpolationPoint<netgen::vec<3> >'

ngtcltk/demoview.hpp:74: error: declaration of 'class netgen::InterpolationPoint<netgen::vec<3> >'

make: *** [ngtcltk/demoview.o] Error 1
lars@linux:~/ngs44>116


Something with 'class netgen' ? Could I still be missing some development libraries?

Lars

edvardsenpriv November 3, 2005 02:57

By the way, Martin. Where did
 
By the way, Martin. Where did you install netgen, in /home/username/ngs44 or /usr/local... and how does the structure look like?

A general question; I understand that when building from sources, it is usually three commands that has to be used:
./configure
make
make install
Have I understood it right as for programs like netgen, where there already exists Makefile, the ./configure command is skipped?

unoder November 3, 2005 08:17

Hi, I installed it in /home
 
Hi,

I installed it in /home/martin/ngs44 since I'm the only linux user on both machines, but I guess on a multiuser system it would be better to place it in /usr/local? Not so important, though (still compiled as root).

Actually as I remember it I think I only did "make" and used yast to install the necessary development stuff.

I think you need to open yast and install some more devel libraries and don't worry about classes + flags etc. Do you have something named ?-x11-?-devel installed (can't remember the exact name), and also development libraries for tcl/tk + tix? NOTICE: Look for the files in /usr/include if in doubt. Then you'll know whether you need more devel libraries or not.

I didn't install mesa this time and only used yast for installing what was missing (didn't grab the files from the netgen download page).

I still think you shouldn't change anything but the togl.cpp so I would start all over if I were you.

----- BTW:

Anyone got any hints on how to get STEP/IGES import functionality working with netgen?

I tried to install OpenCASCADE with java -jar setup.jar (don't remember the exact filename, but the installer just exited). Binary files should be in /opt/? but I can't even start the program...... I then did a "make" in the netgen installation directory again and this time compilation took more than 1 hour, but still I can't import IGES/STEP files on suse 9.3.

Anyone, perhaps Mattijs got any hints?

edvardsenpriv November 3, 2005 17:09

Fantastic, I finally made it!
 
Fantastic, I finally made it! The only difference now (as far as I have registered) was that I compiled as root. Thanks for help so far.

...anyway when trying to build the IGES/STEP OpenCascade module, I get the errormessage:

/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lTKIGES
collect2: ld returned 1 exit status
make: *** [ng] Error 1
linux:/home/Lars/ngs44 #

...but then again its stated on the Netgen website that:
"At present, only the NETGEN version downloaded via CVS access supports the installation of the OpenCascade kernel."
(Anyhow it does work in the windows version)

L

colinss May 13, 2006 00:12

Any one succeeded in compiling
 
Any one succeeded in compiling negen on linux with OpenCascade kernel?

I can compile it without the kernel but have difficulties with it.

Any suggestion will be appreciated.

Colinss

baldios1972 May 24, 2006 03:42

HI, I dowloaded cvs version w
 
HI,
I dowloaded cvs version with instructions fro netgen web site, i modified the root makefile, makefile.MACHINE and makefile.inc as suggested in the netgen website, i downloaded the opencascade module from netgen website, I compiled with gcc 3.3.2 all works fine but the iges/step importing still does not work!!!!

bwolfe July 26, 2006 08:49

Hi-- I ran into the same so
 
Hi--

I ran into the same sorts of problems. The fix was twofold:

1) add the lines 'class Mesh;' and 'class mesh;' to meshtype.hpp.
2) remove the entire tk include mess from 'togl.cpp'. Move the files 'tk.h' from /usr/include and 'tkInt.h', 'tkIntDecls.h' from /usr/include/tk-private/generic. Then add '#include "tkInt.h"' to 'togl.cpp'.

This of course assumes you have tk: in FC just type 'yum list | grep tk' to see what's available/installed and 'yum install tk', 'yum install tk-devel' to install them. Do the same for tcl and tix.

bwolfe July 26, 2006 08:55

I should add that users with p
 
I should add that users with powerful computers and/or access to a DVD-R burner can now get netgen and a whole bunch of other powerful cae tools with CAELinux. This is a live DVD/virtual machine distro that has all these awkward installations already done. Plus you can pop it in to any windows box and laugh at your neighbor who paid thousands for codes he can't adapt.

psosnows January 16, 2009 06:12

hello, I see that the thread
 
hello,
I see that the thread was dead for years, but just recently I got stuck with netgen compilation...

I think that the OS is not a big problem, but to give full info: I use Ubuntu 8.04- the Hardy Heron

I tried to compile netgen for some time...
The tips presented above were very helpfull (got through the Tcl/Tk and othe features)
but after running "make" I get such output:

:~/ngs44$ make
gcc -c -I./libsrc/include -I/opt/OpenCASCADE5.2/ros/inc -I./ngsolve/include -Ilibsrc/interface -DOPENGL -O2 -I/usr/include/GL3.5 -DLINUX -DOPENGL -ftemplate-depth-99 -finline-limit=20000 -funroll-loops -DNGSOLVE -fpermissive ngtcltk/ngappinit.cpp -o ngtcltk/ngappinit.o
In file included from ./libsrc/include/../general/myadt.hpp:31,
from ./libsrc/include/myadt.hpp:1,
from ./libsrc/include/../meshing/meshing.hpp:4,
from ./libsrc/include/meshing.hpp:1,
from ngtcltk/ngappinit.cpp:8:
./libsrc/include/../general/symbolta.hpp: In member function 'void netgen::SYMBOLTABLE<t>::Set(const char*, const T&)':
./libsrc/include/../general/symbolta.hpp:138: warning: there are no arguments to 'strlen' that depend on a template parameter, so a declaration of 'strlen' must be available
./libsrc/include/../general/symbolta.hpp:139: warning: there are no arguments to 'strcpy' that depend on a template parameter, so a declaration of 'strcpy' must be available
In file included from ./libsrc/include/../general/myadt.hpp:40,
from ./libsrc/include/myadt.hpp:1,
from ./libsrc/include/../meshing/meshing.hpp:4,
from ./libsrc/include/meshing.hpp:1,
from ngtcltk/ngappinit.cpp:8:
./libsrc/include/../general/mystring.hpp: In member function 'int netgen::MyStr::Find(char)':
./libsrc/include/../general/mystring.hpp:125: error: 'strchr' was not declared in this scope
./libsrc/include/../general/mystring.hpp: In member function 'int netgen::MyStr::Find(const netgen::MyStr&)':
./libsrc/include/../general/mystring.hpp:131: error: 'strstr' was not declared in this scope
./libsrc/include/../general/mystring.hpp: In member function 'int netgen::MyStr::Find(const char*)':

(after that, there are like 20 or 30 similar messages )

I think that the problem is that some includes are not made (like #include <stdio.h> )
but to be honest, I have no idea where to put them...

looking foreward for some tips

Pawel Sosnowski


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