Symmetryextension build failure with Visual Studio

Hello

I tried to build the latest version Avogadro Win32 binaries from github
master sources which downloaded on September 15 with Visual Studio 2013
(Visual C++ 12) on Windows 10 as follows.

I rewrited cmake generater specification from “NMake Makefiles” to “Visual
Studio 12 2013” in the script/cmake-msvc2008.bat script,
and then generated Visual Studio solution file “avogadro.sln” with targets
project files (vcxproj files).

Since msym were written by using VLA, I switched the platform toolset
specification of msym.vcxproj property dialog from “Visual Studio
2013(v120)”(default) to “LLVM-vs2013” (using clang 3.7 for Windows).

Compilation of avogadro projects progressed smoothly,
but the build of target symmmetryextension.dll was failed.

The failure was this dll link error with msym.lib in which some codes called
unknown _snprintf function.
(error LNK2001: unresolved external symbol"_snprintf":
msym.lib(point_group.obj), msym.lib(symop.obj)
msym.lib(msym_error.obj), msym.lib(orbital.obj),
msym.lib(elements.obj),msym.lib(context.obj) )

I think this is due to the discordance between that msym calls C functions
and that symmetryextension calls C++ functions.
I am wondering if is there the way to build…

Thanks in advance.

iwao

Unfortunately I can’t have a look at this right now since I’m in Canada,
and I don’t have any computer.

I’d suggest testing putting this at the top of msym.h

#ifdef WIN32

#define snprintf _snprintf

#endif

You might need to encapsulate that in an #ifndef __cplusplus

The extern “C” really should take care of this, but I suspect it’s linking
the msym objects to the c++ libraries even though it shouldn’t, but windows
also has some weird behaviour when it comes to some posix functions.

/M
On Sep 29, 2015 12:33, “iwao aoyama” iwao.aoyama@gmail.com wrote:

Hello

I tried to build the latest version Avogadro Win32 binaries from github
master sources which downloaded on September 15 with Visual Studio 2013
(Visual C++ 12) on Windows 10 as follows.

I rewrited cmake generater specification from “NMake Makefiles” to “Visual
Studio 12 2013” in the script/cmake-msvc2008.bat script,
and then generated Visual Studio solution file “avogadro.sln” with targets
project files (vcxproj files).

Since msym were written by using VLA, I switched the platform toolset
specification of msym.vcxproj property dialog from “Visual Studio
2013(v120)”(default) to “LLVM-vs2013” (using clang 3.7 for Windows).

Compilation of avogadro projects progressed smoothly,
but the build of target symmmetryextension.dll was failed.

The failure was this dll link error with msym.lib in which some codes
called
unknown _snprintf function.
(error LNK2001: unresolved external symbol"_snprintf":
msym.lib(point_group.obj), msym.lib(symop.obj)
msym.lib(msym_error.obj), msym.lib(orbital.obj),
msym.lib(elements.obj),msym.lib(context.obj) )

I think this is due to the discordance between that msym calls C functions
and that symmetryextension calls C++ functions.
I am wondering if is there the way to build…

Thanks in advance.

iwao



Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
avogadro-devel List Signup and Options

Hi Marcus

Thank you for quick reply.

I added the suggested code:

#ifdef WIN32
#define snprintf _snprintf
#endif

at the top of msym.h and msym_error.h.

The previous link error has been resolved!

Thank you so much!

iwao

Hi

A new version of libmsym is available, which can generate SALCs for point groups Ci, Cs, Cnv, Dn, Dnh, Dnd, Td, O and Oh
We’re using avagadro v1 to visualise them by converting them to an fchk file right now.

Once there is VTK surface rendering of orbitals and atom selection in avogadro v2 I’ll try to integrate the SALC generation into the symmetry plugin.
That way students can select a basis (like 4f-orbitals) for an element, visualise the SALCs they would produce and see their irreps and partner functions.

(also has types python 3 bindings)

cheers,
/M