MathGL with Mingw on Windows 7 - trying to run first program

1,098 views
Skip to first unread message

_neil_

unread,
Feb 15, 2014, 2:04:10 AM2/15/14
to mat...@googlegroups.com
Alexey,

Just to get MathGL up and running on Windows 7 using Mingw and the Netbeans IDE, i'm trying to run your simplest program, the simple graph on page 3 of your manual.

I've downloaded the MathGL and GSL sources, and these compile fine, and for a successful link in need to include *.dll files from MathGL.

However, the program will not run; I get the following error message:

-----------------------------------------------------------------------------------------------------------------------------
The application failed with exit code -1073741515 (0xc0000135).
This could indicate that no required .dll was found in the PATH.
Please try to start the following command from the command shell (cmd.exe).
This may give some additional information.

C:\Users\Neil\Documents\NetBeansProjects\Cpp_MathGL_simple_plot\dist\Debug\MinGW-Windows\cpp_mathgl_simple_plot.exe

RUN FAILED (exit value -1,073,741,515, total time: 70ms)
---------------------------------------------------------------------------------------------------------------------------------

Would you have any suggestions?

many thanks,
neil

_neil_

unread,
Feb 15, 2014, 3:13:25 AM2/15/14
to mat...@googlegroups.com
BTW, when i run cpp_mathgl_simple_plot.exe it says libmgl-fltk.dll is missing from my computer, which is strange, as i do have it in the computer, and i link this in.
neil 

_neil_

unread,
Feb 24, 2014, 8:01:22 AM2/24/14
to mat...@googlegroups.com
In addition, when i put from the Mathgl bin directory the .dll files:

libmgl
libmgl-fltk
libmgl-qt,
libmgl-qt4
libmgl-wnd

the program compiles and links without errors, but does will not run. The above error message about the .dll no longer appears, so that does indeed represent small progress. But frustratingly, it still does not run.

any help much appreciated, thanks.
Neil

_neil_

unread,
Feb 26, 2014, 4:42:09 AM2/26/14
to mat...@googlegroups.com
So the project, complies and links in the Netbeans IDE without problems. Bin files and include files are linked in. So running gdb.exe debugger in Netbeans to get more diagnostic information in the running the simplest MathGL program (that on page 3 of the mathgl 2.2.1 manual) when running the program halts in the data.f routine at the line:
 

inline mglData(long xx=1,long yy=1,long zz=1) {   a=0; Create(xx,yy,zz);   }

with a message from Windows 7 saying: "Signal received: SIGSEGV (Segmentation fault)"

pressing the "Forward and continue" button on the debugger then just results in Windows stopping the executable file for this program.

Suggestions welcome, thank you,

Neil



_neil_

unread,
Mar 5, 2014, 1:08:55 PM3/5/14
to mat...@googlegroups.com
Further diagnostics - when i add the *.dll libraries, namely:
libmgl.dll
libmgl-fltk.dll
libmgl-qt.dll
libmgl-qt4.dll
libmgl-wnd.dll
downloaded from Sourceforge for the most recent version of MathGL (2.2.1) into the directory where the IDE has created the executable for my program, I get the error message:
" The procedure entry point _Z5qFreePv could not be located in the dynamic link library QtCore4.dll ", in a window with " Entry Point Not Found " in the title bar.

Googling indicates perhaps the precompiled libraries i've downloaded are perhaps not suitable for my 64-bit Windows 7 operating system.

Suggestions welcome. Thank you.
Neil

mathgl....@gmail.com

unread,
Mar 8, 2014, 3:07:08 PM3/8/14
to mat...@googlegroups.com
Dear _neil_

As you may know, windows 32bit and 64bit libraries (and executables) are incompatible. I provide binaries for win32 only, and they definitely cannot be used in 64bit applications. You need to found 64bit MathGL libraries or created yours own ones.



--
You received this message because you are subscribed to the Google Groups "MathGL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathgl+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Kind regards,
Prof. Alexey Balakin

_neil_

unread,
Mar 8, 2014, 6:50:04 PM3/8/14
to mat...@googlegroups.com
Dear Alexey,

So operating under a Windows 7 64bit operating system, can i use Cmake to create the 64bit MathGL libraries?

many thanks for your help.

best wishes,
Neil

 

mathgl....@gmail.com

unread,
Mar 8, 2014, 11:42:42 PM3/8/14
to mat...@googlegroups.com

Yes, you can.

09 Мар 2014 г. 3:50 пользователь "_neil_" <neil.a...@gmail.com> написал:
--
You received this message because you are subscribed to the Google Groups "MathGL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathgl+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

_neil_

unread,
Mar 10, 2014, 7:11:56 AM3/10/14
to mat...@googlegroups.com

Dear Alexey,

Again thanks for help.

On running Cmake on my 64-bit Windows 7 operating system, when i press the "Configure button" quite a bit of text is generated, then there are a couple of error message, which halt the process:
______________________________________________________________________________
Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR)

CMake Error at CMakeLists.txt:268 (message):
Couldn't find ZLib library.

Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR)

Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)

CMake Error at CMakeLists.txt:281 (message):
Couldn't find PNG library.
__________________________________________________________________________________


I'm running MinGW and in these files there are some zlib files (namely zlib.pm and zlib.dll) whether these are the necessary ones, or whether Cmake just cannot find them i don't know. However, Cmake finds the gcc compiler ok.


Also i do have do not have libpng installed.


Could you suggest what i might go next to get MathGL binaries made up for my machine?


if i should install libpng and zlib, where should i install these to Cmake can find them?


Many thanks for you help,

Neil


(ps. i've downloaded and working with the latest MathGL source files, version: 2.2.2)


mathgl....@gmail.com

unread,
Mar 10, 2014, 9:52:03 PM3/10/14
to mat...@googlegroups.com
Hi,
you can just clear selection (switch off) of enable-zlib and enable-png at configuring in cmake. Basically, you can switch off all of external dependencies.


--
You received this message because you are subscribed to the Google Groups "MathGL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathgl+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cizarr...@gmail.com

unread,
Mar 11, 2014, 12:01:47 AM3/11/14
to mat...@googlegroups.com
Hi _Neil_

I have compiled mathgl ok using msys2 and mingw64. Certainly you need to use cmake-gui and manually locate the needed libraries. First, I had to compile zlib, libpng, libhpdf and gsl. It took me a while to understand it, since i am not an expert on it. At the end ot proved not that difficult. I will be happy to share with you or any other user interested my compiled version for windows 64. I am not sure if it will work for you or anyone else, though.

Hi Alexey,

Thanks for all this great effort in making available mathgl. I am a fan of your library. I am now fighting to compile it with gsl_option on. There is a concurrent message that gsl\gsl_vector.h is not found. Not sure why, but in any case if that switch is off, all compiles ok.

I will try to make the time to put a simple instruction to compile mathgl in windows 64 using mingw64 and msys64.

I am using gfortran and mathgl. Some simple tests work ok. if I progress further, I can also share my experience with any other user. Although, I am not a experienced programmer!!...

Regards

Carlos

Sent from my “contract free” BlackBerry® smartphone on the WIND network.

Date: Tue, 11 Mar 2014 05:52:03 +0400
Subject: Re: [ MathGL ] Re: MathGL with Mingw on Windows 7 - trying to run first program

mathgl....@gmail.com

unread,
Mar 11, 2014, 12:59:58 AM3/11/14
to mat...@googlegroups.com
Dear Carlos,


2014-03-11 8:01 GMT+04:00 <cizarr...@gmail.com>:
Hi _Neil_

I have compiled mathgl ok using msys2 and mingw64. Certainly you need to use cmake-gui and manually locate the needed libraries. First, I had to compile zlib, libpng, libhpdf and gsl. It took me a while to understand it, since i am not an expert on it. At the end ot proved not that difficult. I will be happy to share with you or any other user interested my compiled version for windows 64. I am not sure if it will work for you or anyone else, though.

Hi Alexey,

Thanks for all this great effort in making available mathgl. I am a fan of your library. I am now fighting to compile it with gsl_option on. There is a concurrent message that gsl\gsl_vector.h is not found. Not sure why, but in any case if that switch is off, all compiles ok.

Most probably, you don't resolve all paths at configuring (still present red lines in cmake-gui) or, less probably, you try to use 32bit GSL library with 64bit compiler or yours GSL header is located in unusual place (i.e. not in subfolder "gsl" of folder "include").

 
I will try to make the time to put a simple instruction to compile mathgl in windows 64 using mingw64 and msys64.

Good. In fact I'm too lazy (and busy) to search 64bit windows, setup mingw64 and rebuild all libraries for 64bit, and finally compile 64bit MathGL. Probably I should but later.

_neil_

unread,
Mar 11, 2014, 6:21:00 AM3/11/14
to mat...@googlegroups.com
Dear Alexey & Carlos,

the bitness issues here confuses me a little. On my 64-bit Windows operating system, Cmake and the IDE (Netbeans) are working fine and are installed as 32bit programs, in the standard directory for such programs (Program Files (x86)). So there's no question about whether 32-bit programs work on Windows 64-bit operating systems, they certainly seem to run fine.

To get the GNU capability, i've installed the most popular MinGW version from Sourceforge, and Soureforge says it will work fine on both 32 and 64-bit Windows operating systems. The MinGW compiler works fine for my C programs under the IDE, creating executables that run with no problems. Is there a fork in this MinGW software, which if it detects a 64-bit OS, it just works as a 64-bit compiler?

I ask this question as on the Sourceforge website there is MinGW-w64, which it quotes will run on both 32 and 64-bit OS's. So how is this different from the standard MinGW?

For the time being, as programs run under MinGW, perhaps the best option is to get MathGL working by addressing the issues that Cmake brings up, ie ZLIB and PNG not currently being available.

When running Cmake (using the GUI in Windows) i did uncheck the boxes "enable-png" and "enable-zlib", and both the "Configure" and "Generate" processes did run to completion. (This partial success does indicate that Cmake is compiling MathGL with the standard MinGW compiler (32 or 64 bit or whatever it is) - you have to be grateful for small mercies.) It created the Makefile file in the directories for the binaries. However, what am I suppose to do with the Makefile? (I was really looking for Cmake to create dynamic and/or static libraries for MathGL so i could link these into the IDE and start plotting using MathGL.)

In running the Cmake GUI for MathGL, there are these various checkboxes, so how do these work? Cmake asks for the source code, so if you consider that for zlib, png, pdf, gsl and the rest, that's quite a bit of code. So how does this in work in Cmake, do you:
1) Get the source code for png, gsl etc and put this into this single input directory, then run Cmake and it figures the rest for you and creates MathGL libraries?
2) You compile sources outside of Cmake to make the libraries, then put this as the input to Cmake, then Cmake creates the MathGL libraries?
3) Install libpng and others, as a standard Windows program (if possible), then let Cmake find these libraries as inputs, and then it creates the MathGL libraries?

There's always so many combinations for trial and error here, so if anyone can shine a light on this, it just minimizes the time to start using MathGL 

many thanks,
neil



   

.

Carlos Izarra

unread,
Mar 11, 2014, 1:44:16 PM3/11/14
to mat...@googlegroups.com
Hi Alexey and _Neil_

Attached is a pdf with screenshots of CMAKE configured for mathgl and mingw64.
For your use - in case there is any - I also have a XZ file with mathgl library for windows 64. I have added all required libraries (e.g. zlib, libpnd, libhpdf) to make it work (I think!). I tried to send it before, but I do not think it went ok - the size is about 5.66 MB. If you need it, pls let me know.

Hope it helps.

Cheers

Carlos


--
Building_MATHGL.pdf

_neil_

unread,
Mar 12, 2014, 6:32:24 AM3/12/14
to mat...@googlegroups.com
Carlos & Alexey, - many thanks for this. It'll take me a while to digest this and test my own version, but i'll return with results either way,
Best wishes, Neil

mathgl....@gmail.com

unread,
Mar 12, 2014, 2:01:59 PM3/12/14
to mat...@googlegroups.com
Dear Carlos,


2014-03-11 21:44 GMT+04:00 Carlos Izarra <cizarr...@gmail.com>:
Hi Alexey and _Neil_

Attached is a pdf with screenshots of CMAKE configured for mathgl and mingw64.
For your use - in case there is any - I also have a XZ file with mathgl library for windows 64. I have added all required libraries (e.g. zlib, libpnd, libhpdf) to make it work (I think!). I tried to send it before, but I do not think it went ok - the size is about 5.66 MB. If you need it, pls let me know.

Yes, it would be nice -- I can put it on the download section. Also, can I ask you to prepare similar files in future?

Concerning the size -- you can put it on GoogleDrive, open public access and send the link here.

cizarr...@gmail.com

unread,
Mar 13, 2014, 4:32:22 PM3/13/14
to mat...@googlegroups.com
Dear Alexey

"Yes, it would be nice -- I can put it on the download section. Also, can I ask you to prepare similar files in future?..."

Thanks and I can do it.


Carlos

Sent from my “contract free” BlackBerry® smartphone on the WIND network.

Date: Wed, 12 Mar 2014 22:01:59 +0400
Subject: Re: [ MathGL ] Re: MathGL with Mingw on Windows 7 - trying to run first program

_neil_

unread,
Mar 19, 2014, 9:54:25 AM3/19/14
to mat...@googlegroups.com, cizarr...@gmail.com
Alexey, Carlos, or any helpful soul,

Well upon running Cmake GUI under Windows for MathGL CMakeList.txt i managed to get no errors in the "Configure" and "Generate" stages. I followed the scheme above from Carlos, but using the MinGW library.

However, when i went to the directory where the binaries are written by Cmake, under a Windows command window with administrator privileges, and typed "make" then i got the following:

Creating library file: libmgl.dll.aCMakeFiles/mgl.dir/objects.a(addon.cpp.obj):addon.cpp:(.text+0xf): undefined reference to `omp_get_num_threads'
CMakeFiles/mgl.dir/objects.a(addon.cpp.obj):addon.cpp:(.text+0x16): undefined reference to `omp_get_thread_num'
CMakeFiles/mgl.dir/objects.a(addon.cpp.obj):addon.cpp:(.text+0x780): undefined reference to `GOMP_parallel_start'
CMakeFiles/mgl.dir/objects.a(addon.cpp.obj):addon.cpp:(.text+0x78d): undefined reference to `GOMP_parallel_end'

This continuing on for about 2500 lines referring to various other undefined references, ending with:

CMakeFiles/mgl.dir/objects.a(volume.cpp.obj):volume.cpp:(.text+0x69e): undefined reference to `GOMP_atomic_end'
collect2: ld returned 1 exit status
make[2]: *** [src/libmgl.dll] Error 1
make[2]: Leaving directory `/c/mathgl'
make[1]: *** [src/CMakeFiles/mgl.dir/all] Error 2
make[1]: Leaving directory `/c/mathgl'
make: *** [all] Error 2

Certain something is not working properly, if you have any clues, i'd be glad to learn about them.

many thanks,
Neil

Carlos Izarra

unread,
Mar 19, 2014, 10:03:01 AM3/19/14
to _neil_, mat...@googlegroups.com
Hi _Neil_

have you already done this:
"There is known bug for building in MinGW – you need to manually add linker option
-fopenmp (i.e. CMAKE_EXE_LINKER_FLAGS:STRING=’-fopenmp’ and CMAKE_SHARED_
LINKER_FLAGS:STRING=’-fopenmp’) if you enable OpenMP support (i.e. if enableopenmp=
ON)."

Cheers


Carlos

_neil_

unread,
Mar 19, 2014, 12:54:44 PM3/19/14
to mat...@googlegroups.com, _neil_
Carlos,

well yes, spot on, adding -fopwnmp in the CMake as you suggest, generates a new makefile. In the command window, with admin privileges, when you type "make", followed by "make install" no errors are generated, and files are written into C:/Program Files (x86).

However, when when in the Netbeans IDE i link the static and dynamic libraries from C/Program File (x86)/mathgl then try to compile a graphic program i get:

make.exe[2]: *** No rule to make target `../../../../../Program Files \(x86\)/MathGL/lib/libmgl.a', needed by `dist/Debug/MinGW-Windows/cpp_mathgl_simple_plot.exe'.  Stop.

Then if in the Netbeans IDE, i have the libraries in a directory C:/Mathgl and link to them, it compiles and links ok, but when i run from Netbeans it just says RUN FAILED.

So i then come out of the Netbeans IDE and go to the directory where the executable from the previous compile and link is generated and run the executable from the command window. Then i get the message: "The program cant't start because libmgl.dll is missing from your computer. Try reinstalling the program to fix this problem."

So then i copy the libmgl.dll file into the MinGW/bin directory and run the executable from the command window i just get the result: "The application was unable to start correctly (0xc000007b). Click OK to close the application.

It seem that perhaps all is not well with libmgl.dll. Would you have any suggestions?

many thanks,
Neil

_neil_

unread,
Mar 28, 2014, 7:19:07 PM3/28/14
to mat...@googlegroups.com, _neil_
I eventually got MathGL working on 64-bit Windows OS under Netbeans, using the win32 downloaded binaries from Sourceforge and MinGW.

I'll now investigate capabilities of MathGL and if i need it, use Cmake to build win64 binaries using files from Carlos using MinGW-w64.

thank you,
Neil

cizarr...@gmail.com

unread,
Mar 28, 2014, 7:43:30 PM3/28/14
to mat...@googlegroups.com, _neil_
Hi _Neil_

Glad to hear that..hope you find it useful.

Cheers


Carlos
Sent from my “contract free” BlackBerry® smartphone on the WIND network.

From: _neil_ <neil.a...@gmail.com>
Date: Fri, 28 Mar 2014 16:19:07 -0700 (PDT)
Subject: Re: [ MathGL ] Re: MathGL with Mingw on Windows 7 - trying to run first program

_neil_

unread,
Apr 1, 2014, 6:07:36 PM4/1/14
to mat...@googlegroups.com, _neil_, cizarr...@gmail.com
help, anyone?

well when i said i got it working, that was just the compiling and linking. When it comes to running a program i can get a qt window and rotate the box - progress nevertheless!

However, if i try to calculate anything by using arrays like mglData the program just crashes without warnings. Putting on the debugger indicates it crashes when i try to popular mglData arrays.

The fact that it just crashes without any error message makes me think the problem lies with the dynamic or static library files.

I've included the *.h files from mgl and gsl include directories.

I've linked in the dynamic and static libraries from MGL win32 downloaded from sourceforge, namely:
QtCore4.dll
QtGui4.dll
hdf5dll.dll
libgcc_s_dw2-1.dll
libgomp-1.dll
libmgl-fltk.dll
libmgl-qt.dll
libmgl-qt4.dll
libmgl-wnd.dll
libmgl.dll
libzlib.dll
pthreadGC2.dll
libmgl-fltk.a
libmgl-fltk.dll.a
libmgl-qt.a
libmgl-qt.dll.a
libmgl-qt4.a
libmgl-qt4.dll.a
libmgl-wnd.a
libmgl-wnd.dll.a
libmgl.a
libmgl.dll.a

Then i've linked in the win32 dynamic and static libraries from gnuwin32 at Sourceforge, namely:
jpeg62.dll
libgsl.dll
libgslcblas.dll
libpng12.dll
libtiff3.dll
zlib1.dll
libgsl.a
libgsl.dll.a
libgslcblas.a
libgslcblas.dll.a

and of course linked in the Mingw libraries.

So is there anything obviously missing from this list of libraries, or in error in any way?

thank you for any help.
_neil_

_neil_

unread,
Apr 3, 2014, 3:00:19 AM4/3/14
to mat...@googlegroups.com, _neil_, cizarr...@gmail.com
a little more diagnostics on this problem, when i switch on the debugger i get a segmentation fault when the program reaches the line:

     /// Allocate the memory for data array and initialize it zero

    inline mglData(long xx=1,long yy=1,long zz=1)    {    a=0;    Create(xx,yy,zz);    }

this occuring in the data.h header of the .\\include\mgl2 directory.

many thanks,
neil

_neil_

unread,
Apr 4, 2014, 6:47:17 AM4/4/14
to mat...@googlegroups.com, _neil_, cizarr...@gmail.com
I'm just stating to get some MathGl plots out now, but only if i set the Netbeans program run Configuration to Release. If if put the run Configuration to Debug, i still get the segmentation fault.(anyone have any idea which this is?) It's not perfect, but at least things are starting to work.
thank you,
neil
Reply all
Reply to author
Forward
0 new messages