Discussion:
Compiling NetSNMP for x64 Windows
(too old to reply)
Bart Van Assche
2011-04-18 10:43:14 UTC
Permalink
I downloaded NetSNMP 5.6.1 and were successful to compile it for 32 bit
platforms. WinExtDLL works also fine. Now I'd like to go for x64
Windows. I've seen packages for older NetSNMP 5.5, so someone must
already have done the effort of compiling it for x64. I just couldn't
find any info in the README.win32 file or in the Makefiles.
(I'm not yet 100% familiar with the build system, I've used build.pl up
to now).
As far as I know there are no 64-bit Net-SNMP binaries available yet.
Net-SNMP should build and run fine in 64-bit mode though.

Bart.
Markus Gaugusch
2011-04-18 10:46:26 UTC
Permalink
Post by Bart Van Assche
I downloaded NetSNMP 5.6.1 and were successful to compile it for 32 bit
platforms. WinExtDLL works also fine. Now I'd like to go for x64
Windows. I've seen packages for older NetSNMP 5.5, so someone must
already have done the effort of compiling it for x64. I just couldn't
find any info in the README.win32 file or in the Makefiles.
(I'm not yet 100% familiar with the build system, I've used build.pl up
to now).
As far as I know there are no 64-bit Net-SNMP binaries available yet.
Net-SNMP should build and run fine in 64-bit mode though.
Hi Bart!

Thanks for your answer. I would like to build it myself anyway, so I don't
have to rely on someone else building. Unfortunately, I don't know how to
force a 64 bit build. My Extension Library uses 64 bits too, so I can't
use a 32bit NetSNMP.
I built on Windows 7 using build.pl. But there is no option for selecting
a 32 or 64 bit build. The Visual Studio project files also don't contain a
64 bit configuration. How are they generated?

thanks,
Markus
--
__________________ /"\
Markus Gaugusch \ / ASCII Ribbon Campaign
markus(at)gaugusch.at X Against HTML Mail
/ \
Xiang Li
2011-04-18 20:40:40 UTC
Permalink
Hi,
We have recently successfully built net-snmp5.6.1 and netsnmp 5.5.1
on windows x64 systems when working on our SNMP API products.

No special things need to be done. You just need to build net-snmp
in a x64 build environment. For example, if you use Microsoft platform
SDK 7, you would do :

Click "Start->Microsoft Windows SDK v7.0->CMD shell"
setenv /x64 /release
and then use build.pl or build.bat like you do normally for 32-bit
Windows.

For a "dynamic" build, if you use openssl, you need to get openssl build
for
x64 windows from slproweb. You need to copy the 64-bit openssl lib version:
from:
C:\OpenSSL-1.0.0.c-Win64\lib\VC\libeay32MT.lib and
C:\OpenSSL-1.0.0.c-Win64\lib\VC\libeay32MD.lib

into

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\amd64,

Also copy the "openssl" header files folder as you would do for 32-bit
builds.
After that the build should work.

For a "static" build, unless you add linking with "Gdi32.lib", the build
will fail with link errors. For a "static" build, NETSNMP-5.5 is
linked with
Gdi32.lib but netsnmp-5.6.1 and 5.5.1 are NOT! This appears to be a bug.

If needed we can share our Windows Net-SNMP binary with the community.
We can post it on our website so anyone can download it freely.

Hope this helps.

Xiang Li
http://www.champnms.com
Post by Markus Gaugusch
Post by Bart Van Assche
I downloaded NetSNMP 5.6.1 and were successful to compile it for 32 bit
platforms. WinExtDLL works also fine. Now I'd like to go for x64
Windows. I've seen packages for older NetSNMP 5.5, so someone must
already have done the effort of compiling it for x64. I just couldn't
find any info in the README.win32 file or in the Makefiles.
(I'm not yet 100% familiar with the build system, I've used build.pl up
to now).
As far as I know there are no 64-bit Net-SNMP binaries available yet.
Net-SNMP should build and run fine in 64-bit mode though.
Hi Bart!
Thanks for your answer. I would like to build it myself anyway, so I don't
have to rely on someone else building. Unfortunately, I don't know how to
force a 64 bit build. My Extension Library uses 64 bits too, so I can't
use a 32bit NetSNMP.
I built on Windows 7 using build.pl. But there is no option for selecting
a 32 or 64 bit build. The Visual Studio project files also don't contain a
64 bit configuration. How are they generated?
thanks,
Markus
Markus Gaugusch
2011-04-21 13:17:20 UTC
Permalink
Post by Xiang Li
Hi,
....
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\amd64,
Also copy the "openssl" header files folder as you would do for 32-bit
builds.
After that the build should work.
Thanks for the feedback - I'll update README.win32. But I'll document to copy the OpenSSL binaries in a separate directory instead of the Visual Studio directories.
 
That would be even better. Copying openssl headers/libs to VC++ directory is just the old
instructions I followed (in netsnmp win32 readme file I believe).
If we do that I suppose the perl configuration scripts will have additional options to tell
where opensssl header files and lib are located?
Hi,
@Xiang Li: THANKS a lot for your instructions, I've got it all working :)

Regarding the headers/libs, I did the following:
set OPENSSLPATH=C:\program Files\OpenSSL-Win64
set INCLUDE=%INCLUDE%;"%OPENSSLPATH%\include"
set LIB=%lib%;"%OPENSSLPATH%\lib\vc\static"
[...]
nmake

Some other questions:
* win32\snmplib\release is not cleared when doing nmake clean. It's the
only dir that keeps its object files!

* The prefix is hard-coded into the binaries, so I can't offer the user to
install them to another directory. Is anything planned to improve that?

* win32\Makefile uses spaces instead of tabs, my GVIM marks those with
red color. Probably nmake ignores that, but should be fixed?

* Why is there an install-net-snmp.bat AND an install target in Makefile?
They look identical and thus only one should survive. I'd prefer the
makefile solution because I can give another PREFIX_DOS on cmdline and
copy the files to my staging dir for MSI creation.

* Finally, how do you build your installers? I could offer a wix script
for inclusion with netsnmp code (would take some time though, because my
current style doesn't fit netsnmp build infrastructure at all).

br,
Markus
Dave Shield
2011-04-21 13:37:11 UTC
Permalink
Post by Markus Gaugusch
* Finally, how do you build your installers?
The Windows binary releases use the Nullsoft Scriptable Install System
(http://nsis.sourceforge.net/home/) driven by a .nsi script (in win32/dist).
I'm currently in the process of constructing windows binary releases for
5.5.1 and 5.6.1 - except that paid work keeps getting in the way!


Dave
Xiang Li
2011-04-21 14:36:45 UTC
Permalink
Post by Markus Gaugusch
Post by Xiang Li
Hi,
....
C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\lib\amd64,
Also copy the "openssl" header files folder as you would
do for 32-bit
builds.
After that the build should work.
Thanks for the feedback - I'll update README.win32. But I'll
document to copy the OpenSSL binaries in a separate directory instead
of the Visual Studio directories.
That would be even better. Copying openssl headers/libs to VC++
directory is just the old
instructions I followed (in netsnmp win32 readme file I believe).
If we do that I suppose the perl configuration scripts will have
additional options to tell
where opensssl header files and lib are located?
Hi,
@Xiang Li: THANKS a lot for your instructions, I've got it all working :)
set OPENSSLPATH=C:\program Files\OpenSSL-Win64
set INCLUDE=%INCLUDE%;"%OPENSSLPATH%\include"
set LIB=%lib%;"%OPENSSLPATH%\lib\vc\static"
[...]
nmake
I did not know we can do that. Looks it is undocumented environment
variables...
Thanks for the info.
Post by Markus Gaugusch
* win32\snmplib\release is not cleared when doing nmake clean. It's the
only dir that keeps its object files!
I suspect this might have something to with a problem I am facing:
For 5.6.1 I could not build x86 and x64 from within the same source
directory.
I ended up building x86 and x64 in separate source directories.
For NET-SNMP 5.5.1 and 5.5 I can switch Windows SDK 32 bit and 64 bit build
environment and build 32 bit and 64 bit net-snmp binary successfully,
but NOT with 5.6.1.
Post by Markus Gaugusch
* The prefix is hard-coded into the binaries, so I can't offer the
user to
install them to another directory. Is anything planned to improve that?
You can always use --prefix= your-dir to install your build in a
different directory.
Maybe that 's not what you meant here...
Post by Markus Gaugusch
* win32\Makefile uses spaces instead of tabs, my GVIM marks those with
red color. Probably nmake ignores that, but should be fixed?
Yes looks like "tab" does stop nmake. I use notepad++ in general on Windows
so not a problem for me:)

BR,
--
Xiang Li
http://www.champnms.com
Xiang Li
2011-04-21 15:10:53 UTC
Permalink
Hi Dave,
There is another issue with the “openssl” in Net-snmp windows 5.6.1 and
5.5.1 builds I thought I should bring it up to your attention: It seems
Net-snmp 5.6.1 (and 5.5.1) windows build depend on the Openssl
distribution from slproweb.

However in net-snmp readme.win32 it says:

===============================================================
OpenSSL is required to support the encryption capabilities in SNMPv3
(or SHA authentication). The win32 version of OpenSSL can be built
from the sources or you can download a pre-compiled version.

Building from source: … (instructions skipped...)
===============================================================


With NETSNMP 5.5 and older releases we can either use slproweb's openssl
or our own openssl build.

NetSNMP 5.6.1 and 5.5.1 require libeay32MT.lib and libeay32MD.lib in
their build processes. However it seems these files are only available
from the openssl1.0.0x binary packages distributed by "slproweb". If we
build Openssl 1.0.x from source, it does NOT produce those files, but
only “libeay32.lib” as with its older openssl 0.9.x releases. In the
Openssl's nmake file from its source release, it uses “/MD” compiler
option if you build “DLL”; If you build a “static” library then it uses
“MT” compiler option. It seems to me Slproweb made their changes without
giving any real good reasons/explanations. However this does create a
new problem for our net-snmp Windows build. That is --by using
libeay32MT etc. we did make Net-snmp 5.6.1 (and 5.5.1) windows build
DEPEND on the Openssl distribution from slproweb. In our case we don't
use slproweb's openssl build so I actually have to change NOT to use
libeay32MT.lib and libeay32MD.lib, etc.

At least I think the readme.win32 needs to be updated.

BR,
Post by Dave Shield
Post by Markus Gaugusch
* Finally, how do you build your installers?
The Windows binary releases use the Nullsoft Scriptable Install System
(http://nsis.sourceforge.net/home/) driven by a .nsi script (in win32/dist).
I'm currently in the process of constructing windows binary releases for
5.5.1 and 5.6.1 - except that paid work keeps getting in the way!
Dave
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Net-snmp-users mailing list
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
--
Xiang Li
http://www.champnms.com
Loading...