Discussion:
[Gmsh] Can Gmsh be compiled as .lib file?
rakesh patil
2011-12-17 05:37:58 UTC
Permalink
Hello,

Can gmsh be compiled as static library (.lib) and dynamic library(.dll)
file? If so what is the procedure? I want to test it with both 32bit and
64bit mode on windows 7 64bit OS, with visual studio 2008 and CMAKE.

Thanks in advance

Regards
Rakesh Patil
Laurent Van Miegroet
2011-12-17 10:03:05 UTC
Permalink
Hello Rakesh,

Gmsh can be built as a .lib for sure under MSVC 2008. Generate your
project with cmake, uncheck FLTK in cmake and build the lib project to
obtain a library. (.lib)
The ENABLE_MSVC_STATIC_RUNTIME is used to switch between /MD and /MT.
To obtain a dll file you may change the output configuration type of the
gmsh project to dll instead of exe (not the lib project).

Laurent

PS: up to date svn version does not built on msvc 2008, some fixes are
needed. Download an older version.
Post by rakesh patil
Hello,
Can gmsh be compiled as static library (.lib) and dynamic
library(.dll) file? If so what is the procedure? I want to test it
with both 32bit and 64bit mode on windows 7 64bit OS, with visual
studio 2008 and CMAKE.
Thanks in advance
Regards
Rakesh Patil
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
Laurent Van Miegroet
2011-12-17 12:48:48 UTC
Permalink
Rakesh,

I corrected the source for msvc. It compile if you uncheck blossom and
fltk. There is also a project shared for the dll version.
Download nightly source tomorrow.

Laurent
Post by Laurent Van Miegroet
Hello Rakesh,
Gmsh can be built as a .lib for sure under MSVC 2008. Generate your
project with cmake, uncheck FLTK in cmake and build the lib project to
obtain a library. (.lib)
The ENABLE_MSVC_STATIC_RUNTIME is used to switch between /MD and /MT.
To obtain a dll file you may change the output configuration type of
the gmsh project to dll instead of exe (not the lib project).
Laurent
PS: up to date svn version does not built on msvc 2008, some fixes are
needed. Download an older version.
Post by rakesh patil
Hello,
Can gmsh be compiled as static library (.lib) and dynamic
library(.dll) file? If so what is the procedure? I want to test it
with both 32bit and 64bit mode on windows 7 64bit OS, with visual
studio 2008 and CMAKE.
Thanks in advance
Regards
Rakesh Patil
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
rakesh patil
2011-12-19 11:26:58 UTC
Permalink
Hey Laurent,

Thanks for your reply. Just before compiling the nightly build, I wanted to
know the minimum supporting libraries required to compile gmsh as a .lib
file. (such as blas, lapack etc). What other libraries I need to have
before compiling it as a static library?

Thanks in advance

Regards
Rakesh Patil

On Sat, Dec 17, 2011 at 6:18 PM, Laurent Van Miegroet <
Post by Laurent Van Miegroet
Rakesh,
I corrected the source for msvc. It compile if you uncheck blossom and
fltk. There is also a project shared for the dll version.
Download nightly source tomorrow.
Laurent
Hello Rakesh,
Gmsh can be built as a .lib for sure under MSVC 2008. Generate your
project with cmake, uncheck FLTK in cmake and build the lib project to
obtain a library. (.lib)
The ENABLE_MSVC_STATIC_RUNTIME is used to switch between /MD and /MT.
To obtain a dll file you may change the output configuration type of the
gmsh project to dll instead of exe (not the lib project).
Laurent
PS: up to date svn version does not built on msvc 2008, some fixes are
needed. Download an older version.
Hello,
Can gmsh be compiled as static library (.lib) and dynamic library(.dll)
file? If so what is the procedure? I want to test it with both 32bit and
64bit mode on windows 7 64bit OS, with visual studio 2008 and CMAKE.
Thanks in advance
Regards
Rakesh Patil
_______________________________________________
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
Laurent Van Miegroet
2011-12-19 16:56:46 UTC
Permalink
Hi Rakesh,

You can compile gmsh without any external lib. But Blas/Lapack is
mandatory for 3D meshing if i'm not wrong and opencascade for CAD geo files.
Laurent
Post by rakesh patil
Hey Laurent,
Thanks for your reply. Just before compiling the nightly build, I
wanted to know the minimum supporting libraries required to compile
gmsh as a .lib file. (such as blas, lapack etc). What other libraries
I need to have before compiling it as a static library?
Thanks in advance
Regards
Rakesh Patil
On Sat, Dec 17, 2011 at 6:18 PM, Laurent Van Miegroet
Rakesh,
I corrected the source for msvc. It compile if you uncheck blossom
and fltk. There is also a project shared for the dll version.
Download nightly source tomorrow.
Laurent
Post by Laurent Van Miegroet
Hello Rakesh,
Gmsh can be built as a .lib for sure under MSVC 2008. Generate
your project with cmake, uncheck FLTK in cmake and build the lib
project to obtain a library. (.lib)
The ENABLE_MSVC_STATIC_RUNTIME is used to switch between /MD and /MT.
To obtain a dll file you may change the output configuration type
of the gmsh project to dll instead of exe (not the lib project).
Laurent
PS: up to date svn version does not built on msvc 2008, some
fixes are needed. Download an older version.
Post by rakesh patil
Hello,
Can gmsh be compiled as static library (.lib) and dynamic
library(.dll) file? If so what is the procedure? I want to test
it with both 32bit and 64bit mode on windows 7 64bit OS, with
visual studio 2008 and CMAKE.
Thanks in advance
Regards
Rakesh Patil
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
rakesh patil
2011-12-20 04:13:35 UTC
Permalink
Hi Laurent,

This is what I did. As mentioned by you, I configured gmsh in CMAKE with
visual studio 2008 (win 64) compiler. I disabled BLOSSOM and FLTK and gave
the appropriate paths for BLAS and LAPACK libraries (I am using BLAS and
LAPACK libraries which comes along with Intel Compiler). I was able to
build static and dynamic libraries both. But when I linked them with my
application, I got following run time error:

Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol send
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
WSAStartup
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
WSACleanup
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
closesocket
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol connect
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol htons
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
gethostbyname
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol socket
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol recv
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol select
Gmsh.lib(OS.obj): error LNK2001: unresolved external symbol gethostname

Well, I observed that these functions are available in the code, but still
wondering why my application is not able to link them. Is there any
pre-processor to be defined before compiling? Or is it because I'm trying
to build gmsh for 64-bit windows machine?

Thanks

On Mon, Dec 19, 2011 at 10:26 PM, Laurent Van Miegroet <
Post by Laurent Van Miegroet
Hi Rakesh,
You can compile gmsh without any external lib. But Blas/Lapack is
mandatory for 3D meshing if i'm not wrong and opencascade for CAD geo files.
Laurent
Hey Laurent,
Thanks for your reply. Just before compiling the nightly build, I wanted
to know the minimum supporting libraries required to compile gmsh as a .lib
file. (such as blas, lapack etc). What other libraries I need to have
before compiling it as a static library?
Thanks in advance
Regards
Rakesh Patil
On Sat, Dec 17, 2011 at 6:18 PM, Laurent Van Miegroet <
Post by Laurent Van Miegroet
Rakesh,
I corrected the source for msvc. It compile if you uncheck blossom and
fltk. There is also a project shared for the dll version.
Download nightly source tomorrow.
Laurent
Hello Rakesh,
Gmsh can be built as a .lib for sure under MSVC 2008. Generate your
project with cmake, uncheck FLTK in cmake and build the lib project to
obtain a library. (.lib)
The ENABLE_MSVC_STATIC_RUNTIME is used to switch between /MD and /MT.
To obtain a dll file you may change the output configuration type of the
gmsh project to dll instead of exe (not the lib project).
Laurent
PS: up to date svn version does not built on msvc 2008, some fixes are
needed. Download an older version.
Hello,
Can gmsh be compiled as static library (.lib) and dynamic library(.dll)
file? If so what is the procedure? I want to test it with both 32bit and
64bit mode on windows 7 64bit OS, with visual studio 2008 and CMAKE.
Thanks in advance
Regards
Rakesh Patil
_______________________________________________
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
Laurent Van Miegroet
2011-12-20 08:33:12 UTC
Permalink
Rakesh,

I compiled this morning the version gmsh-2.5.1-svn-20111220-source with
no problem. I compile in 32 bit MSVC 2008 with blas (Intel) /Open Cascade.
Do you use cl compiler or Intel Compiler within Visual studio ?
Can you try to compile in 32 bit ? WSAStartup seems to be defined only
in WIN32.

Laurent.
Post by rakesh patil
Hi Laurent,
This is what I did. As mentioned by you, I configured gmsh in CMAKE
with visual studio 2008 (win 64) compiler. I disabled BLOSSOM and FLTK
and gave the appropriate paths for BLAS and LAPACK libraries (I am
using BLAS and LAPACK libraries which comes along with Intel
Compiler). I was able to build static and dynamic libraries both. But
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol send
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
WSAStartup
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
WSACleanup
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
closesocket
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol connect
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol htons
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
gethostbyname
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol socket
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol recv
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol select
Gmsh.lib(OS.obj): error LNK2001: unresolved external symbol gethostname
Well, I observed that these functions are available in the code, but
still wondering why my application is not able to link them. Is there
any pre-processor to be defined before compiling? Or is it because I'm
trying to build gmsh for 64-bit windows machine?
Thanks
On Mon, Dec 19, 2011 at 10:26 PM, Laurent Van Miegroet
Hi Rakesh,
You can compile gmsh without any external lib. But Blas/Lapack is
mandatory for 3D meshing if i'm not wrong and opencascade for CAD geo files.
Laurent
Post by rakesh patil
Hey Laurent,
Thanks for your reply. Just before compiling the nightly build, I
wanted to know the minimum supporting libraries required to
compile gmsh as a .lib file. (such as blas, lapack etc). What
other libraries I need to have before compiling it as a static
library?
Thanks in advance
Regards
Rakesh Patil
On Sat, Dec 17, 2011 at 6:18 PM, Laurent Van Miegroet
Rakesh,
I corrected the source for msvc. It compile if you uncheck
blossom and fltk. There is also a project shared for the dll
version.
Download nightly source tomorrow.
Laurent
Post by Laurent Van Miegroet
Hello Rakesh,
Gmsh can be built as a .lib for sure under MSVC 2008.
Generate your project with cmake, uncheck FLTK in cmake and
build the lib project to obtain a library. (.lib)
The ENABLE_MSVC_STATIC_RUNTIME is used to switch between /MD and /MT.
To obtain a dll file you may change the output configuration
type of the gmsh project to dll instead of exe (not the lib
project).
Laurent
PS: up to date svn version does not built on msvc 2008, some
fixes are needed. Download an older version.
Post by rakesh patil
Hello,
Can gmsh be compiled as static library (.lib) and dynamic
library(.dll) file? If so what is the procedure? I want to
test it with both 32bit and 64bit mode on windows 7 64bit
OS, with visual studio 2008 and CMAKE.
Thanks in advance
Regards
Rakesh Patil
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
rakesh patil
2011-12-20 17:21:01 UTC
Permalink
Hey,

Its my mistake... I am really sorry.. I had forgot to include
winsock32.lib.. :) once that was included, its working fine..

Thanks a lot

Cheers
Rakesh Patil

On Tue, Dec 20, 2011 at 2:03 PM, Laurent Van Miegroet <
Post by Laurent Van Miegroet
Rakesh,
I compiled this morning the version gmsh-2.5.1-svn-20111220-source with no
problem. I compile in 32 bit MSVC 2008 with blas (Intel) /Open Cascade.
Do you use cl compiler or Intel Compiler within Visual studio ?
Can you try to compile in 32 bit ? WSAStartup seems to be defined only in
WIN32.
Laurent.
Hi Laurent,
This is what I did. As mentioned by you, I configured gmsh in CMAKE with
visual studio 2008 (win 64) compiler. I disabled BLOSSOM and FLTK and gave
the appropriate paths for BLAS and LAPACK libraries (I am using BLAS and
LAPACK libraries which comes along with Intel Compiler). I was able to
build static and dynamic libraries both. But when I linked them with my
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol send
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
WSAStartup
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
WSACleanup
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
closesocket
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol connect
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol htons
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol
gethostbyname
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol socket
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol recv
Gmsh.lib(GmshMessage.obj): error LNK2001: unresolved external symbol select
Gmsh.lib(OS.obj): error LNK2001: unresolved external symbol gethostname
Well, I observed that these functions are available in the code, but still
wondering why my application is not able to link them. Is there any
pre-processor to be defined before compiling? Or is it because I'm trying
to build gmsh for 64-bit windows machine?
Thanks
On Mon, Dec 19, 2011 at 10:26 PM, Laurent Van Miegroet <
Post by Laurent Van Miegroet
Hi Rakesh,
You can compile gmsh without any external lib. But Blas/Lapack is
mandatory for 3D meshing if i'm not wrong and opencascade for CAD geo files.
Laurent
Hey Laurent,
Thanks for your reply. Just before compiling the nightly build, I wanted
to know the minimum supporting libraries required to compile gmsh as a .lib
file. (such as blas, lapack etc). What other libraries I need to have
before compiling it as a static library?
Thanks in advance
Regards
Rakesh Patil
On Sat, Dec 17, 2011 at 6:18 PM, Laurent Van Miegroet <
Post by Laurent Van Miegroet
Rakesh,
I corrected the source for msvc. It compile if you uncheck blossom and
fltk. There is also a project shared for the dll version.
Download nightly source tomorrow.
Laurent
Hello Rakesh,
Gmsh can be built as a .lib for sure under MSVC 2008. Generate your
project with cmake, uncheck FLTK in cmake and build the lib project to
obtain a library. (.lib)
The ENABLE_MSVC_STATIC_RUNTIME is used to switch between /MD and /MT.
To obtain a dll file you may change the output configuration type of the
gmsh project to dll instead of exe (not the lib project).
Laurent
PS: up to date svn version does not built on msvc 2008, some fixes are
needed. Download an older version.
Hello,
Can gmsh be compiled as static library (.lib) and dynamic library(.dll)
file? If so what is the procedure? I want to test it with both 32bit and
64bit mode on windows 7 64bit OS, with visual studio 2008 and CMAKE.
Thanks in advance
Regards
Rakesh Patil
_______________________________________________
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
--
Laurent Van Miegroet
Research Engineer
Department of Aerospace & Mechanical Engineering
University of Liege - Belgium
Phone : +32.4.366.92.70
Fax: +32.4.366.91.59
Loading...