diff --git a/configure.ac b/configure.ac index ccb309d3..69307d4b 100644 --- a/configure.ac +++ b/configure.ac @@ -83,6 +83,7 @@ AC_SUBST([TOGLLIBDIR], ["$togllibfl"]) AC_CHECK_HEADER(pthread.h) AC_CHECK_HEADER([togl.h]) +AC_CHECK_HEADER([GL/gl.h]) AC_CHECK_HEADER([iostream],[OCCFLAGS="$OCCFLAGS -DHAVE_IOSTREAM"]) AC_CHECK_HEADER([iostream.h],[OCC_FLAGS="$OCCFLAGS -DHAVE_IOSTREAM_H"]) @@ -93,6 +94,43 @@ AC_CHECK_LIB(pthread, pthread_create) # AC_SEARCH_LIBS(Tcl_Init, [tcl8.5 tcl8.4]) + +#-------------------------------------------------------------------- +# __CHANGE__ +# Choose OpenGL platform (borrowed from Togl1.7) +#-------------------------------------------------------------------- + +case "${TEA_WINDOWINGSYSTEM}" in + aqua) + AC_SUBST(TOGL_WINDOWINGSYSTEM,TOGL_AGL) + TEA_ADD_LIBS([-framework AGL -framework OpenGL -framework ApplicationServices]) + # libGLU is implicit in OpenGL framework + LIBGLU= + ;; + x11) + AC_SUBST(TOGL_WINDOWINGSYSTEM,TOGL_X11) + TEA_ADD_LIBS([-lGL -lXmu]) + LIBGLU=-lGLU + ;; + win32) + AC_SUBST(TOGL_WINDOWINGSYSTEM,TOGL_WGL) + TEA_ADD_LIBS([opengl32.lib user32.lib gdi32.lib]) + if test "$GCC" = "yes" ; then + LIBGLU=-lglu32 + else + LIBGLU=glu32.lib + fi + ;; + *) + AC_MSG_ERROR([Unsupported windowing system: ${TEA_WINDOWINGSYSTEM}]) + ;; +esac +AC_SUBST(LIBGLU) + + + + + AC_CHECK_FUNCS([pow]) AC_CHECK_FUNCS([floor]) AC_CHECK_HEADERS([limits.h]) diff --git a/libsrc/include/incvis.hpp b/libsrc/include/incvis.hpp index 20178d17..b43e0a3d 100644 --- a/libsrc/include/incvis.hpp +++ b/libsrc/include/incvis.hpp @@ -5,6 +5,9 @@ #include #include +// #include "/opt/tcltk86/include/tcl.h" +// #include "/opt/tcltk86/include/tk.h" + #if TK_MAJOR_VERSION==8 && TK_MINOR_VERSION>=4 #define tcl_const const diff --git a/libsrc/interface/readuser.cpp b/libsrc/interface/readuser.cpp index f5b11f79..847ffb26 100644 --- a/libsrc/interface/readuser.cpp +++ b/libsrc/interface/readuser.cpp @@ -73,7 +73,6 @@ namespace netgen return; } } - /* if (invert) swap (el.PNum(2), el.PNum(3)); diff --git a/libsrc/visualization/mvdraw.cpp b/libsrc/visualization/mvdraw.cpp index 30aac051..0d1fd523 100644 --- a/libsrc/visualization/mvdraw.cpp +++ b/libsrc/visualization/mvdraw.cpp @@ -10,14 +10,14 @@ -#ifndef WIN32 +#ifndef WIN32 #define GLX_GLXEXT_LEGACY #include #include #include /* for XA_RGB_DEFAULT_MAP atom */ -#include +// #include // for parallel GL ??? #endif diff --git a/ng/Makefile.am b/ng/Makefile.am index 834eb300..f64cd01d 100644 --- a/ng/Makefile.am +++ b/ng/Makefile.am @@ -16,9 +16,8 @@ netgen_LDADD = $(top_builddir)/libsrc/visualization/libvisual.a \ $(top_builddir)/libsrc/gprim/libgprim.la \ $(top_builddir)/libsrc/linalg/libla.la \ $(top_builddir)/libsrc/general/libgeneral.la \ - $(OCCLIBS) -L$(TK_BIN_DIR)/Togl1.7 $(TOGLLIBDIR) -lTogl1.7 -lGLU $(TK_LIB_SPEC) $(TCL_LIB_SPEC) $(MPI_LIBS) - - + $(OCCLIBS) -L$(TK_BIN_DIR)/Togl1.7 $(TOGLLIBDIR) -lTogl1.7 $(LIBGLU) $(TK_LIB_SPEC) $(TCL_LIB_SPEC) $(MPI_LIBS) +#-lGLU -lGL dist_bin_SCRIPTS = dialog.tcl menustat.tcl ngicon.tcl ng.tcl \ diff --git a/ng/ng.tcl b/ng/ng.tcl index 5b31c1b8..67e9e0f2 100644 --- a/ng/ng.tcl +++ b/ng/ng.tcl @@ -1,5 +1,4 @@ -puts "found ng.tcl" - +puts "Parsing ng.tcl" if {[catch {package require Tix } result ]} { puts "cannot find package Tix" diff --git a/ng/ngappinit.cpp b/ng/ngappinit.cpp index 97c9e6aa..84d3c9e7 100644 --- a/ng/ngappinit.cpp +++ b/ng/ngappinit.cpp @@ -11,9 +11,11 @@ #include #endif +/* #ifndef WIN32 #include #endif +*/ #ifdef PARALLEL #include @@ -27,7 +29,7 @@ namespace netgen #endif -// #include "../libsrc/parallel/parallel.hpp" + #include "parallelfunc.hpp" @@ -47,13 +49,6 @@ using netgen::Array; using netgen::RegisterUserFormats; -#ifdef NGSOLVE - extern "C" int NGSolve_Init (Tcl_Interp * interp); -#endif - -// void * ngsolve_handle; // dynamic library handle - - /* @@ -103,17 +98,9 @@ int main(int argc, char ** argv) #pragma pomp inst begin(main) #endif - // ngsolve_handle = dlopen ("libngsolves.so", RTLD_LAZY | RTLD_GLOBAL); - // cout << "ngsolve_handle = " << ngsolve_handle << endl; - if ( netgen::id == 0 ) { -#ifdef NGSOLVE - cout << "NETGEN/NGSolve " << PACKAGE_VERSION << endl; -#else cout << "NETGEN-" << PACKAGE_VERSION << endl; -#endif - cout << "Developed at RWTH Aachen University, Germany" << endl << "and Johannes Kepler University Linz, Austria" << endl; @@ -280,12 +267,11 @@ int main(int argc, char ** argv) if (errcode) { cout << "Error in Tcl-Script:" << endl; - cout << "result = " << myinterp->result << endl; - cout << "in line " << myinterp->errorLine << endl; - - if (myinterp->errorLine == 1) - cout << "\nMake sure to set environment variable NETGENDIR" << endl; + // cout << "result = " << myinterp->result << endl; + cout << "result = " << Tcl_GetStringResult (myinterp) << endl; + // cout << "in line " << myinterp->errorLine << endl; + cout << "\nMake sure to set environment variable NETGENDIR to directory containing ng.tcl" << endl; exit (1); } @@ -377,13 +363,15 @@ int Tcl_AppInit(Tcl_Interp * interp) if (Tcl_Init(interp) == TCL_ERROR) { cerr << "Problem in Tcl_Init: " << endl; - cerr << interp->result << endl; + cout << "result = " << Tcl_GetStringResult (interp) << endl; + // cerr << interp->result << endl; // return TCL_ERROR; } if (!nodisplay && Tk_Init(interp) == TCL_ERROR) { cerr << "Problem in Tk_Init: " << endl; - cerr << interp->result << endl; + cout << "result = " << Tcl_GetStringResult (interp) << endl; + // cerr << interp->result << endl; // return TCL_ERROR; } @@ -412,13 +400,15 @@ int Tcl_AppInit(Tcl_Interp * interp) if (Ng_Init(interp) == TCL_ERROR) { cerr << "Problem in Ng_Init: " << endl; - cerr << interp->result << endl; + cout << "result = " << Tcl_GetStringResult (interp) << endl; + // cerr << interp->result << endl; // return TCL_ERROR; } if (!nodisplay && Ng_Vis_Init(interp) == TCL_ERROR) { cerr << "Problem in Ng_Vis_Init: " << endl; - cerr << interp->result << endl; + cout << "result = " << Tcl_GetStringResult (interp) << endl; + // cerr << interp->result << endl; // return TCL_ERROR; } @@ -477,38 +467,6 @@ int Tcl_AppInit(Tcl_Interp * interp) #endif - /* - if (ngsolve_handle) - { - void (*ngs_init)(Tcl_Interp*); - ngs_init = ( void (*)(Tcl_Interp*) ) dlsym (ngsolve_handle, "NGSolve_Init"); - cout << "symbolhandle = " << (void*)ngs_init << endl; - if (ngs_init) (*ngs_init)(interp); - } - */ - - -#ifdef NGSOLVE - if (NGSolve_Init(interp) == TCL_ERROR) - { - cerr << "Problem in NgSolve_Init: " << endl; - cerr << interp->result << endl; - return TCL_ERROR; - } - -#ifdef SOCKETS - extern int NGS_Socket_Init (Tcl_Interp * interp); - if (NGS_Socket_Init(interp) == TCL_ERROR) - { - cerr << "Problem in NGS_Socket_Init: " << endl; - cerr << interp->result << endl; - return TCL_ERROR; - } - -#endif // SOCKETS -#endif // NGSOLVE - - #ifdef SOCKETS extern int Ng_Socket_Init (Tcl_Interp * interp); if ( Ng_Socket_Init(interp) == TCL_ERROR) @@ -521,7 +479,6 @@ int Tcl_AppInit(Tcl_Interp * interp) #endif - #ifdef ZUGSTANGE extern int Zugstange_Init (Tcl_Interp * interp); if (Zugstange_Init(interp) == TCL_ERROR)